commit 9020be114a47bf7ff33e179b3bb0016b91a098e6 Author: Dan Carpenter Date: Tue Dec 14 10:05:27 2021 +0300 scsi: lpfc: Terminate string in lpfc_debugfs_nvmeio_trc_write() The "mybuf" string comes from the user, so we need to ensure that it is NUL terminated. Link: https://lore.kernel.org/r/20211214070527.GA27934@kili Fixes: bd2cdd5e400f ("scsi: lpfc: NVME Initiator: Add debugfs support") Reviewed-by: James Smart Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 8c2d04551545d3722c1e6891ecce46f44c5406ec Author: Christophe JAILLET Date: Thu Dec 9 22:11:56 2021 +0100 scsi: hpsa: Remove an unused variable in hpsa_update_scsi_devices() 'lunzerobits' is unused. Remove it. This a left over of commit 2d62a33e05d4 ("hpsa: eliminate fake lun0 enclosures") Link: https://lore.kernel.org/r/9f80ea569867b5f7ae1e0f99d656e5a8bacad34e.1639084205.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit c167dd0b2a7afcf2c25e44b9b6168cba3a51d27d Author: Kees Cook Date: Fri Dec 3 14:33:51 2021 -0800 scsi: lpfc: Use struct_group to isolate cast to larger object When building under -Warray-bounds, a warning is generated when casting a u32 into MAILBOX_t (which is larger). This warning is conservative, but it's not an unreasonable change to make to improve future robustness. Use a tagged struct_group that can refer to either the specific fields or the first u32 separately, silencing this warning: drivers/scsi/lpfc/lpfc_sli.c: In function 'lpfc_reset_barrier': drivers/scsi/lpfc/lpfc_sli.c:4787:29: error: array subscript 'MAILBOX_t[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds] 4787 | ((MAILBOX_t *)&mbox)->mbxCommand = MBX_KILL_BOARD; | ^~ drivers/scsi/lpfc/lpfc_sli.c:4752:27: note: while referencing 'mbox' 4752 | volatile uint32_t mbox; | ^~~~ There is no change to the resulting executable instruction code. Link: https://lore.kernel.org/r/20211203223351.107323-1-keescook@chromium.org Reviewed-by: James Smart Signed-off-by: Kees Cook Signed-off-by: Martin K. Petersen commit 532adda9f405d69ef1837f59e60512313fdf0f63 Author: Kees Cook Date: Wed Dec 8 11:59:57 2021 -0800 scsi: lpfc: Use struct_group() to initialize struct lpfc_cgn_info In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark "stat" region of struct lpfc_cgn_info that should be initialized to zero, and refactor the "data" region memset() to wipe everything up to the cgn_stats region. Link: https://lore.kernel.org/r/20211208195957.1603092-1-keescook@chromium.org Reviewed-by: James Smart Signed-off-by: Kees Cook Signed-off-by: Martin K. Petersen commit 4437503bfbec2f02b41b2492520fe627715889a7 Author: James Smart Date: Fri Dec 3 16:26:44 2021 -0800 scsi: lpfc: Update lpfc version to 14.0.0.4 Update lpfc version to 14.0.0.4. Link: https://lore.kernel.org/r/20211204002644.116455-10-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 6014a2468f0e49194f612b1f09f99eacee0a409a Author: James Smart Date: Fri Dec 3 16:26:43 2021 -0800 scsi: lpfc: Add additional debugfs support for CMF Dump raw CMF parameter information in debugfs cgn_buffer. Link: https://lore.kernel.org/r/20211204002644.116455-9-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 05116ef9c4b444f7fdbb56f9e13c2ec941726639 Author: James Smart Date: Fri Dec 3 16:26:42 2021 -0800 scsi: lpfc: Cap CMF read bytes to MBPI Ensure read bytes data does not go over MBPI for CMF timer intervals that are purposely shortened. Link: https://lore.kernel.org/r/20211204002644.116455-8-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit a6269f837045acb02904f31f05acde847ec8f8a7 Author: James Smart Date: Fri Dec 3 16:26:41 2021 -0800 scsi: lpfc: Adjust CMF total bytes and rxmonitor Calculate any extra bytes needed to account for timer accuracy. If we are less than LPFC_CMF_INTERVAL, then calculate the adjustment needed for total to reflect a full LPFC_CMF_INTERVAL. Add additional info to rxmonitor, and adjust some log formatting. Link: https://lore.kernel.org/r/20211204002644.116455-7-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 7dd2e2a923173d637c272e483966be8e96a72b64 Author: James Smart Date: Fri Dec 3 16:26:40 2021 -0800 scsi: lpfc: Trigger SLI4 firmware dump before doing driver cleanup Extraneous teardown routines are present in the firmware dump path causing altered states in firmware captures. When a firmware dump is requested via sysfs, trigger the dump immediately without tearing down structures and changing adapter state. The driver shall rely on pre-existing firmware error state clean up handlers to restore the adapter. Link: https://lore.kernel.org/r/20211204002644.116455-6-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 8ed190a91950564775cbaae9e8e8083a69a8da23 Author: James Smart Date: Fri Dec 3 16:26:39 2021 -0800 scsi: lpfc: Fix NPIV port deletion crash The driver is calling schedule_timeout after the DA_ID nameserver request and LOGO commands are issued to the fabric by the initiator virtual endport. These fixed delay functions are causing long delays in the driver's worker thread when processing discovery I/Os in a serialized fashion, which is then triggering mailbox timeout errors artificially. To fix this, don't wait on the DA_ID request to complete and call wait_event_timeout to allow the vport delete thread to make progress on an event driven basis rather than fixing the wait time. Link: https://lore.kernel.org/r/20211204002644.116455-5-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 7576d48c64f36f6fea9df2882f710a474fa35f40 Author: James Smart Date: Fri Dec 3 16:26:38 2021 -0800 scsi: lpfc: Fix lpfc_force_rscn ndlp kref imbalance Issuing lpfc_force_rscn twice results in an ndlp kref use-after-free call trace. A prior patch reworked the get/put handling by ensuring nlp_get was done before WQE submission and a put was done in the completion path. Unfortunately, the issue_els_rscn path had a piece of legacy code that did a nlp_put, causing an imbalance on the ref counts. Fixed by removing the unnecessary legacy code snippet. Link: https://lore.kernel.org/r/20211204002644.116455-4-jsmart2021@gmail.com Fixes: 4430f7fd09ec ("scsi: lpfc: Rework locations of ndlp reference taking") Cc: # v5.11+ Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 2e81b1a374da5d6024208c16c4a5224a70cafa64 Author: James Smart Date: Fri Dec 3 16:26:37 2021 -0800 scsi: lpfc: Change return code on I/Os received during link bounce During heavy I/O testing with issue_lip to bounce the link, occasionally I/O is terminated with status 3 result 9, which means the RPI is suspended. The I/O is completed and this type of error will result in immediate retry by the SCSI layer. The retry count expires and the I/O fails and returns error to the application. To avoid these quick retry/retries exhausted scenarios change the return code given to the midlayer to DID_REQUEUE rather than DID_ERROR. This gets them retried, and eventually succeed when the link recovers. Link: https://lore.kernel.org/r/20211204002644.116455-3-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit f0d3919697492950f57a26a1093aee53880d669d Author: James Smart Date: Fri Dec 3 16:26:36 2021 -0800 scsi: lpfc: Fix leaked lpfc_dmabuf mbox allocations with NPIV During rmmod testing, messages appeared indicating lpfc_mbuf_pool entries were still busy. This situation was only seen doing rmmod after at least 1 vport (NPIV) instance was created and destroyed. The number of messages scaled with the number of vports created. When a vport is created, it can receive a PLOGI from another initiator Nport. When this happens, the driver prepares to ack the PLOGI and prepares an RPI for registration (via mbx cmd) which includes an mbuf allocation. During the unsolicited PLOGI processing and after the RPI preparation, the driver recognizes it is one of the vport instances and decides to reject the PLOGI. During the LS_RJT preparation for the PLOGI, the mailbox struct allocated for RPI registration is freed, but the mbuf that was also allocated is not released. Fix by freeing the mbuf with the mailbox struct in the LS_RJT path. As part of the code review to figure the issue out a couple of other areas where found that also would not have released the mbuf. Those are cleaned up as well. Link: https://lore.kernel.org/r/20211204002644.116455-2-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit eaab9b57305496067e225155ca86bf77c9a982f7 Author: Bart Van Assche Date: Fri Dec 3 15:19:50 2021 -0800 scsi: ufs: Implement polling support The time spent in io_schedule() and also the interrupt latency are significant when submitting direct I/O to a UFS device. Hence this patch that implements polling support. User space software can enable polling by passing the RWF_HIPRI flag to the preadv2() system call or the IORING_SETUP_IOPOLL flag to the io_uring interface. Although the block layer supports to partition the tag space for interrupt-based completions (HCTX_TYPE_DEFAULT) purposes and polling (HCTX_TYPE_POLL), the choice has been made to use the same hardware queue for both hctx types because partitioning the tag space would negatively affect performance. On my test setup this patch increases IOPS from 2736 to 22000 (8x) for the following test: for hipri in 0 1; do fio --ioengine=io_uring --iodepth=1 --rw=randread \ --runtime=60 --time_based=1 --direct=1 --name=qd1 \ --filename=/dev/block/sda --ioscheduler=none --gtod_reduce=1 \ --norandommap --hipri=$hipri done Link: https://lore.kernel.org/r/20211203231950.193369-18-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 8d077ede48c1532d791c027467d152ae137c54ab Author: Bart Van Assche Date: Fri Dec 3 15:19:49 2021 -0800 scsi: ufs: Optimize the command queueing code Remove the clock scaling lock from ufshcd_queuecommand() since it is a performance bottleneck. Instead check the SCSI device budget bitmaps in the code that waits for ongoing ufshcd_queuecommand() calls. A bit is set in sdev->budget_map just before scsi_queue_rq() is called and a bit is cleared from that bitmap if scsi_queue_rq() does not submit the request or after the request has finished. See also the blk_mq_{get,put}_dispatch_budget() calls in the block layer. There is no risk for a livelock since the block layer delays queue reruns if queueing a request fails because the SCSI host has been blocked. Link: https://lore.kernel.org/r/20211203231950.193369-17-bvanassche@acm.org Cc: Asutosh Das (asd) Reviewed-by: Asutosh Das Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 5675c381ea51360b4968b78f23aefda73e3de90d Author: Bart Van Assche Date: Fri Dec 3 15:19:48 2021 -0800 scsi: ufs: Stop using the clock scaling lock in the error handler Instead of locking and unlocking the clock scaling lock, surround the command queueing code with an RCU reader lock and call synchronize_rcu(). This patch prepares for removal of the clock scaling lock. Link: https://lore.kernel.org/r/20211203231950.193369-16-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3489c34bd02b73a72646037d673a122a53cee174 Author: Bart Van Assche Date: Fri Dec 3 15:19:47 2021 -0800 scsi: ufs: Fix a kernel crash during shutdown Fix the following kernel crash: Unable to handle kernel paging request at virtual address ffffffc91e735000 Call trace: __queue_work+0x26c/0x624 queue_work_on+0x6c/0xf0 ufshcd_hold+0x12c/0x210 __ufshcd_wl_suspend+0xc0/0x400 ufshcd_wl_shutdown+0xb8/0xcc device_shutdown+0x184/0x224 kernel_restart+0x4c/0x124 __arm64_sys_reboot+0x194/0x264 el0_svc_common+0xc8/0x1d4 do_el0_svc+0x30/0x8c el0_svc+0x20/0x30 el0_sync_handler+0x84/0xe4 el0_sync+0x1bc/0x1c0 Fix this crash by ungating the clock before destroying the work queue on which clock gating work is queued. Link: https://lore.kernel.org/r/20211203231950.193369-15-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1fbaa02dfd05229312404aaef8bc9317b4ff8750 Author: Bart Van Assche Date: Fri Dec 3 15:19:46 2021 -0800 scsi: ufs: Improve SCSI abort handling further Release resources when aborting a command. Make sure that aborted commands are completed once by clearing the corresponding tag bit from hba->outstanding_reqs. This patch is an improved version of commit 3ff1f6b6ba6f ("scsi: ufs: core: Improve SCSI abort handling"). Link: https://lore.kernel.org/r/20211203231950.193369-14-bvanassche@acm.org Fixes: 7a3e97b0dc4b ("[SCSI] ufshcd: UFS Host controller driver") Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 6f8dafdee6ae836763e753a9df288d10b35e9679 Author: Bart Van Assche Date: Fri Dec 3 15:19:45 2021 -0800 scsi: ufs: Introduce ufshcd_release_scsi_cmd() The only functional change in this patch is that scsi_done() is now called after ufshcd_release() and ufshcd_clk_scaling_update_busy() instead of before. The next patch in this series will introduce a call to ufshcd_release_scsi_cmd() in the abort handler. Link: https://lore.kernel.org/r/20211203231950.193369-13-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3eb9dcc027e2b2bbd8f377d3ef9271b7abfe103d Author: Bart Van Assche Date: Fri Dec 3 15:19:44 2021 -0800 scsi: ufs: Remove the 'update_scaling' local variable This patch does not change any functionality but makes the next patch in this series easier to read. Link: https://lore.kernel.org/r/20211203231950.193369-12-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 511a083b8b6bf63f5609a4e4e3db748ab3719451 Author: Bart Van Assche Date: Fri Dec 3 15:19:43 2021 -0800 scsi: ufs: Remove hba->cmd_queue The previous patch removed all code that uses hba->cmd_queue. Hence also remove hba->cmd_queue itself. Link: https://lore.kernel.org/r/20211203231950.193369-11-bvanassche@acm.org Suggested-by: Adrian Hunter Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 945c3cca05d78351bba29fa65d93834cb7934c7b Author: Bart Van Assche Date: Fri Dec 3 15:19:42 2021 -0800 scsi: ufs: Fix a deadlock in the error handler The following deadlock has been observed on a test setup: - All tags allocated - The SCSI error handler calls ufshcd_eh_host_reset_handler() - ufshcd_eh_host_reset_handler() queues work that calls ufshcd_err_handler() - ufshcd_err_handler() locks up as follows: Workqueue: ufs_eh_wq_0 ufshcd_err_handler.cfi_jt Call trace: __switch_to+0x298/0x5d8 __schedule+0x6cc/0xa94 schedule+0x12c/0x298 blk_mq_get_tag+0x210/0x480 __blk_mq_alloc_request+0x1c8/0x284 blk_get_request+0x74/0x134 ufshcd_exec_dev_cmd+0x68/0x640 ufshcd_verify_dev_init+0x68/0x35c ufshcd_probe_hba+0x12c/0x1cb8 ufshcd_host_reset_and_restore+0x88/0x254 ufshcd_reset_and_restore+0xd0/0x354 ufshcd_err_handler+0x408/0xc58 process_one_work+0x24c/0x66c worker_thread+0x3e8/0xa4c kthread+0x150/0x1b4 ret_from_fork+0x10/0x30 Fix this lockup by making ufshcd_exec_dev_cmd() allocate a reserved request. Link: https://lore.kernel.org/r/20211203231950.193369-10-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit fc21da8a840a93fd3512e5d779cbb0996cc1b4f1 Author: Bart Van Assche Date: Fri Dec 3 15:19:41 2021 -0800 scsi: ufs: Rework ufshcd_change_queue_depth() Prepare for making sdev->host->can_queue less than hba->nutrs. This patch does not change any functionality. Link: https://lore.kernel.org/r/20211203231950.193369-9-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit bd0b35383193d0d31a0cce3d7c7f7e4be1cc7905 Author: Bart Van Assche Date: Fri Dec 3 15:19:40 2021 -0800 scsi: ufs: Remove ufshcd_any_tag_in_use() Use hba->outstanding_reqs instead of ufshcd_any_tag_in_use(). This patch prepares for removal of the blk_mq_start_request() call from ufshcd_wait_for_dev_cmd(). blk_mq_tagset_busy_iter() only iterates over started requests. Link: https://lore.kernel.org/r/20211203231950.193369-8-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 21ad0e49085deb22c094f91f9da57319a97188e4 Author: Bart Van Assche Date: Fri Dec 3 15:19:39 2021 -0800 scsi: ufs: Fix race conditions related to driver data The driver data pointer must be set before any callbacks are registered that use that pointer. Hence move the initialization of that pointer from after the ufshcd_init() call to inside ufshcd_init(). Link: https://lore.kernel.org/r/20211203231950.193369-7-bvanassche@acm.org Fixes: 3b1d05807a9a ("[SCSI] ufs: Segregate PCI Specific Code") Reported-by: Alexey Dobriyan Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d77ea8226b3be23b0b45aa42851243b62a27bda1 Author: Bart Van Assche Date: Fri Dec 3 15:19:38 2021 -0800 scsi: ufs: Remove dead code Commit 7252a3603015 ("scsi: ufs: Avoid busy-waiting by eliminating tag conflicts") guarantees that 'tag' is not in use by any SCSI command. Remove the check that returns early if a conflict occurs. Link: https://lore.kernel.org/r/20211203231950.193369-6-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Acked-by: Avri Altman Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 59830c095cf01978d71a25ba1f8660f23f8312c7 Author: Bart Van Assche Date: Fri Dec 3 15:19:37 2021 -0800 scsi: ufs: Remove the sdev_rpmb member Since the sdev_rpmb member of struct ufs_hba is only used inside ufshcd_scsi_add_wlus(), convert it into a local variable. Link: https://lore.kernel.org/r/20211203231950.193369-5-bvanassche@acm.org Suggested-by: Jaegeuk Kim Tested-by: Bean Huo Reviewed-by: Asutosh Das Reviewed-by: Alim Akhtar Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d656dc9b0b79e868e46ff78b6ca7a6a70df23566 Author: Bart Van Assche Date: Fri Dec 3 15:19:36 2021 -0800 scsi: ufs: Remove is_rpmb_wlun() Commit edc0596cc04b ("scsi: ufs: core: Stop clearing UNIT ATTENTIONS") removed all callers of is_rpmb_wlun(). Hence also remove the function itself. Link: https://lore.kernel.org/r/20211203231950.193369-4-bvanassche@acm.org Reported-by: kernel test robot Tested-by: Bean Huo Reviewed-by: Asutosh Das Reviewed-by: Alim Akhtar Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b427609e11ee98b88e745f9fe17aae437b2e2d80 Author: Bart Van Assche Date: Fri Dec 3 15:19:35 2021 -0800 scsi: ufs: Rename a function argument The new name makes it clear what the meaning of the function argument is. Link: https://lore.kernel.org/r/20211203231950.193369-3-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Chanho Park Reviewed-by: Keoseong Park Reviewed-by: Bean Huo Acked-by: Alim Akhtar Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4bc3bffc1a885eb5cb259e4a25146a4c7b1034e3 Author: Bart Van Assche Date: Fri Dec 3 15:19:34 2021 -0800 scsi: core: Fix scsi_device_max_queue_depth() The comment above scsi_device_max_queue_depth() and also the description of commit ca4453213951 ("scsi: core: Make sure sdev->queue_depth is <= max(shost->can_queue, 1024)") contradict the implementation of the function scsi_device_max_queue_depth(). Additionally, the maximum queue depth of a SCSI LUN never exceeds host->can_queue. Fix scsi_device_max_queue_depth() by changing max_t() into min_t(). Link: https://lore.kernel.org/r/20211203231950.193369-2-bvanassche@acm.org Fixes: ca4453213951 ("scsi: core: Make sure sdev->queue_depth is <= max(shost->can_queue, 1024)") Cc: Hannes Reinecke Cc: Sumanesh Samanta Tested-by: Bean Huo Reviewed-by: Ming Lei Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c27fd25db39b8f16aeda8563d4be6f33e59d07d1 Author: Colin Ian King Date: Sun Dec 5 22:59:01 2021 +0000 scsi: mptfusion: Remove redundant variable r Variable r is being assigned a value that is never read. The assignment is redundant and so is the variable, so remove these. Remove unnecessary the {} braces in the if statement too. Link: https://lore.kernel.org/r/20211205225901.54362-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 4c3e3f8cfc05116d1adf83d95322090f335d2091 Author: Sebastian Andrzej Siewior Date: Thu Dec 2 21:11:41 2021 +0100 scsi: be2iscsi: Remove maintainers The email addresses of Subbu Seetharaman Jitendra Bhivare are no longer working. Remove Subbu and Jitendra as maintainers. Link: https://lore.kernel.org/r/20211202201141.cytqe73ish6oa356@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Martin K. Petersen commit 74d80152538535e7acf3d56863876a18a218261a Author: Florian Fainelli Date: Tue Nov 30 12:38:13 2021 -0800 scsi: qla4xxx: Format SYSFS_FLAG_FW_SEL_BOOT as byte qedi formats SYSFS_FLAG_FW_SEL_BOOT as a byte and the qla4xxx driver does exactly the same thing. Align them for consistency. Link: https://lore.kernel.org/r/20211130203813.12138-3-f.fainelli@gmail.com Suggested-by: Martin K. Petersen Acked-by: Manish Rangankar Signed-off-by: Florian Fainelli Signed-off-by: Martin K. Petersen commit 9f9b7fa946beaa36681a7011a286da7cbb953816 Author: Florian Fainelli Date: Tue Nov 30 12:38:12 2021 -0800 scsi: qedi: Fix SYSFS_FLAG_FW_SEL_BOOT formatting The format used for formatting SYSFS_FLAG_FW_SEL_BOOT creates the following warning: drivers/scsi/qedi/qedi_main.c:2259:35: warning: format specifies type 'char' but the argument has type 'int' [-Wformat] rc = snprintf(buf, 3, "%hhd\n", SYSFS_FLAG_FW_SEL_BOOT); Fix this to cast the constant as a char since the intention is to print it via sysfs as a byte. Link: https://lore.kernel.org/r/20211130203813.12138-2-f.fainelli@gmail.com Reported-by: kernel test robot Acked-by: Manish Rangankar Signed-off-by: Florian Fainelli Signed-off-by: Martin K. Petersen commit 4d6942e2666efb3a415213ed12ba72b7700620f3 Author: Christophe JAILLET Date: Fri Nov 26 22:18:26 2021 +0100 scsi: hisi_sas: Use non-atomic bitmap functions when possible All uses of the 'hisi_hba->slot_index_tags' bitmap are protected with the 'hisi_hba->lock' spinlock. Prefer the non-atomic '__[set|clear]_bit()' functions to save a few cycles. Link: https://lore.kernel.org/r/8ee33e463523db080e6a2c06f332e47abb69359b.1637961191.git.christophe.jaillet@wanadoo.fr Acked-by: John Garry Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit d43efddf6271a185d13895c5a38c889791e96bff Author: Christophe JAILLET Date: Fri Nov 26 22:18:25 2021 +0100 scsi: hisi_sas: Remove some useless code in hisi_sas_alloc() The 'hisi_hba->slot_index_tags' bitmap is allocated with bitmap_zalloc() so it is already cleared. There is no need to clear it another time, one bit at a time. Remove the corresponding useless code. Link: https://lore.kernel.org/r/41c86e7e3e05a13bd586d8ee1b81296140b7a6eb.1637961191.git.christophe.jaillet@wanadoo.fr Acked-by: John Garry Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 54585ec62fbdbb45d9005bba3f988a11621ef42c Author: Christophe JAILLET Date: Fri Nov 26 22:15:21 2021 +0100 scsi: hisi_sas: Use devm_bitmap_zalloc() when applicable 'hisi_hba->slot_index_tags' is a bitmap. Use 'devm_bitmap_zalloc()' to simplify code, improve the semantic, and avoid some open-coded arithmetic in allocator arguments. Link: https://lore.kernel.org/r/4afa3f71e66c941c660627c7f5b0223b51968ebb.1637961191.git.christophe.jaillet@wanadoo.fr Acked-by: John Garry Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit bf3f120fd61c42c2f4aed8995e5417776d788c37 Author: Niklas Cassel Date: Wed Dec 1 14:28:31 2021 +0000 scsi: sd_zbc: Clean up sd_zbc_parse_report() setting of wp Make sd_zbc_parse_report() use if/else when setting the write pointer, instead of setting it unconditionally and then conditionally updating it. Link: https://lore.kernel.org/r/20211201142821.64650-2-Niklas.Cassel@wdc.com Reviewed-by: Johannes Thumshirn Signed-off-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit 13202ebf5f331ca83f5ab47eb90ca4ef5489ac80 Author: Niklas Cassel Date: Wed Dec 1 14:28:30 2021 +0000 scsi: sd_zbc: Simplify zone full condition check According to the ZBC (and ZAC) specification, a zone that has Zone Type set to Conventional, must also have its Zone Condition set to "Not Write Pointer". Therefore, a conventional zone will never have Zone Condition set to "Full", which means that we can omit the non-conventional prerequisite from the zone full condition check. Link: https://lore.kernel.org/r/20211201142821.64650-1-Niklas.Cassel@wdc.com Suggested-by: Damien Le Moal Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Signed-off-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit db33028647a3eca9e3e6fccf170d75f3b56a466c Author: Bart Van Assche Date: Mon Nov 29 11:46:09 2021 -0800 scsi: Remove superfluous #include directives Remove this include directive from code that does not use any functionality from kernel/async.c. Link: https://lore.kernel.org/r/20211129194609.3466071-13-bvanassche@acm.org Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b558fa11e4b53027776c451553437aeda4463e4d Author: Bart Van Assche Date: Mon Nov 29 11:46:08 2021 -0800 scsi: pmcraid: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/pmcraid.c:3317: warning: Excess function parameter 'done' description in 'pmcraid_queuecommand_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-12-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d6e71a43b11c67cae3f3c595beef020899ec68e9 Author: Bart Van Assche Date: Mon Nov 29 11:46:07 2021 -0800 scsi: pm8001: Fix kernel-doc warnings Fix the following kernel-doc warnings: drivers/scsi/pm8001/pm8001_ctl.c:900: warning: cannot understand function prototype: 'const char *const mpiStateText[] = ' drivers/scsi/pm8001/pm8001_ctl.c:930: warning: Function parameter or member 'attr' not described in 'ctl_hmi_error_show' drivers/scsi/pm8001/pm8001_ctl.c:951: warning: Function parameter or member 'attr' not described in 'ctl_raae_count_show' drivers/scsi/pm8001/pm8001_ctl.c:972: warning: Function parameter or member 'attr' not described in 'ctl_iop0_count_show' drivers/scsi/pm8001/pm8001_ctl.c:993: warning: Function parameter or member 'attr' not described in 'ctl_iop1_count_show' Link: https://lore.kernel.org/r/20211129194609.3466071-11-bvanassche@acm.org Fixes: 4ddbea1b6f51 ("scsi: pm80xx: Add sysfs attribute to check MPI state") Acked-by: Jack Wang Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit acad9c4324992b6fcfe4f714a3b6f3a8cf8af929 Author: Bart Van Assche Date: Mon Nov 29 11:46:06 2021 -0800 scsi: megaraid: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/megaraid/megaraid_mbox.c:1439: warning: Excess function parameter 'done' description in 'megaraid_queue_command_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-10-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 0addfa5877971a123b489caa3b73c860111e96a8 Author: Bart Van Assche Date: Mon Nov 29 11:46:05 2021 -0800 scsi: initio: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/initio.c:2613: warning: Excess function parameter 'done' description in 'i91u_queuecommand_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-9-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 013d14eafd5c3d07f54ff8ff075df3cb0254e1a9 Author: Bart Van Assche Date: Mon Nov 29 11:46:04 2021 -0800 scsi: dc395x: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/dc395x.c:964: warning: Excess function parameter 'done' description in 'dc395x_queue_command_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-8-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 69e623791eb3ff3457c71ef734fdc82f6f3cc3c1 Author: Bart Van Assche Date: Mon Nov 29 11:46:03 2021 -0800 scsi: bfa: Declare 'bfad_im_vport_attrs' static Fix the following kernel-doc warning: 'bfad_im_vport_attrs' is only used in one source file. Hence declare this array static. Link: https://lore.kernel.org/r/20211129194609.3466071-7-bvanassche@acm.org Fixes: e73af234a1a2 ("scsi: bfa: Switch to attribute groups") Reported-by: kernel test robot Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 471d6840559ae8bd1ed7e222d68f15373f6890f9 Author: Bart Van Assche Date: Mon Nov 29 11:46:02 2021 -0800 scsi: atp870u: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/atp870u.c:622: warning: Excess function parameter 'done' description in 'atp870u_queuecommand_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-6-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 332053e87cda4db58fbeb83fcb7144f88936f3ed Author: Bart Van Assche Date: Mon Nov 29 11:46:01 2021 -0800 scsi: a100u2w: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/a100u2w.c:915: warning: Excess function parameter 'done' description in 'inia100_queue_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-5-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3369046e54ca8f82e0cb17740643da2d80d3cfa8 Author: Bart Van Assche Date: Mon Nov 29 11:46:00 2021 -0800 scsi: core: Show SCMD_LAST in text form The SCSI debugfs code supports showing information about pending commands, including translating SCSI command flags from numeric into text format. Also convert the SCMD_LAST flag from numeric into text form. Link: https://lore.kernel.org/r/20211129194609.3466071-4-bvanassche@acm.org Fixes: 8930a6c20791 ("scsi: core: add support for request batching") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 7cc5aad6c98e0b7e9ab744d1ac7e385e886bb869 Author: Bart Van Assche Date: Mon Nov 29 11:45:59 2021 -0800 scsi: core: Declare 'scsi_scan_type' static 'scsi_scan_type' is only used in one source file. Hence declare it static. Link: https://lore.kernel.org/r/20211129194609.3466071-3-bvanassche@acm.org Fixes: a19a93e4c6a9 ("scsi: core: pm: Rely on the device driver core for async power management") Reported-by: kernel test robot Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 776141dda77f153379a2eea0887f76cb3e6c8062 Author: Bart Van Assche Date: Mon Nov 29 11:45:58 2021 -0800 scsi: core: Suppress a kernel-doc warning Suppress the following kernel-doc warning: drivers/scsi/scsi_scan.c:129: warning: Function parameter or member 'dev' not described in 'scsi_enable_async_suspend' Link: https://lore.kernel.org/r/20211129194609.3466071-2-bvanassche@acm.org Fixes: a19a93e4c6a9 ("scsi: core: pm: Rely on the device driver core for async power management") Reported-by: Stephen Rothwell Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 6d8619f034f01c841fb3836d4a1bc682571db995 Author: Florian Fainelli Date: Fri Nov 26 12:17:07 2021 -0800 scsi: qedi: Remove set but unused 'page' variable The variable 'page' is set but never used throughout qedi_alloc_bdq(). Therefore remove it. Link: https://lore.kernel.org/r/20211126201708.27140-2-f.fainelli@gmail.com Reported-by: kernel test robot Acked-by: Manish Rangankar Signed-off-by: Florian Fainelli Signed-off-by: Martin K. Petersen commit ddba1cf7a506b09b3583bcac2d64ec88bd4e3a96 Author: Adrian Hunter Date: Wed Oct 27 16:06:14 2021 +0300 scsi: ufs: Let devices remain runtime suspended during system suspend If the UFS Device WLUN is runtime suspended and is in the same power mode, link state, and b_rpm_dev_flush_capable (BKOP or WB buffer flush etc) state, then it can remain runtime suspended instead of being runtime resumed and then system suspended. The following patch has cleared the way for that to happen: scsi: core: pm: Only runtime resume if necessary So amend the logic accordingly. Note, the ufs-hisi driver uses different RPM and SPM, but it is made explicit by a new parameter to suspend prepare. Link: https://lore.kernel.org/r/20211027130614.406985-2-adrian.hunter@intel.com Reviewed-by: Asutosh Das Reviewed-by: Bean Huo Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit 659109a45c6c5a3c81a8ce35dea59318c44cfa6e Author: Geert Uytterhoeven Date: Sat Nov 6 17:47:41 2021 +0100 scsi: ufs: Fix double space in SCSI_UFS_HWMON description There's no reason to have a double space between "UFS" and "Temperature", hence drop it. Link: https://lore.kernel.org/r/20211106164741.1571206-1-geert@linux-m68k.org Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support") Signed-off-by: Geert Uytterhoeven Signed-off-by: Martin K. Petersen commit d28a78537d1d79f1ba6b9e68f5d44cc869045afe Author: Geert Uytterhoeven Date: Sat Nov 6 17:46:50 2021 +0100 scsi: ufs: Wrap Universal Flash Storage drivers in SCSI_UFSHCD The build only descends into drivers/scsi/ufs/ if SCSI_UFSHCD is enabled. Hence all later config symbols should depend on SCSI_UFSHCD to prevent asking the user about config symbols for driver code that won't be built anyway. Unfortunately not all symbols have that dependency. Fix this by wrapping them all into a big if/endif block. Remove the now superfluous explicit dependencies on SCSI_UFSHCD from all symbols that already had it. Link: https://lore.kernel.org/r/20211106164650.1571068-1-geert@linux-m68k.org Signed-off-by: Geert Uytterhoeven Signed-off-by: Martin K. Petersen commit 0137b129f215fb5d0209c5c91984b2f44f2d98cc Author: Changyuan Lyu Date: Mon Nov 15 13:57:50 2021 -0800 scsi: pm80xx: Add pm80xx_mpi_build_cmd() tracepoint pm8001_mpi_build_cmd() prepares and sends all commands to a controller. Having pm80xx_mpi_build_cmd tracepoint can help us with latency issues. this patch depends on patch "scsi: pm80xx: Add tracepoints". Link: https://lore.kernel.org/r/20211115215750.131696-3-changyuanl@google.com Acked-by: Jack Wang Co-developed-by: Igor Pylypiv Signed-off-by: Igor Pylypiv Signed-off-by: Changyuan Lyu Signed-off-by: Martin K. Petersen commit 8ceddda38d4272683fe0c5d8f310109affae0b63 Author: Changyuan Lyu Date: Mon Nov 15 13:57:49 2021 -0800 scsi: pm80xx: Add tracepoints Tracepoints for tracking controller and ATA commands issued and completed. Link: https://lore.kernel.org/r/20211115215750.131696-2-changyuanl@google.com Acked-by: Jack Wang Co-developed-by: Akshat Jain Signed-off-by: Akshat Jain Signed-off-by: Changyuan Lyu Signed-off-by: Martin K. Petersen commit 853615582d6f99c0a4b4424a63b4f01aa8fcebef Author: Igor Pylypiv Date: Mon Nov 1 16:28:25 2021 -0700 scsi: pm80xx: Use bitmap_zalloc() for tags bitmap allocation We used to allocate X bytes while we only need X bits. Link: https://lore.kernel.org/r/20211101232825.2350233-5-ipylypiv@google.com Reviewed-by: Vishakha Channapattan Acked-by: Jack Wang Signed-off-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit 606c54ae975ad3af540b505b46b55a687501711f Author: Igor Pylypiv Date: Mon Nov 1 16:28:24 2021 -0700 scsi: pm80xx: Update WARN_ON check in pm8001_mpi_build_cmd() Starting from commit 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues") driver initializes only max_q_num queues. Do not use an invalid queue if the WARN_ON condition is true. Link: https://lore.kernel.org/r/20211101232825.2350233-4-ipylypiv@google.com Fixes: 7640e1eb8c5d ("scsi: pm80xx: Make mpi_build_cmd locking consistent") Reviewed-by: Vishakha Channapattan Acked-by: Jack Wang Signed-off-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit 60de1a67d66db11319a82bd95f11c2b12b75dee0 Author: Igor Pylypiv Date: Mon Nov 1 16:28:23 2021 -0700 scsi: pm80xx: Do not check the address-of value for NULL Address-of operator cannot return NULL. Link: https://lore.kernel.org/r/20211101232825.2350233-3-ipylypiv@google.com Reviewed-by: Vishakha Channapattan Acked-by: Jack Wang Signed-off-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit 744798fcd2b31b806ebf09f86989cbf2806fa9ea Author: Igor Pylypiv Date: Mon Nov 1 16:28:22 2021 -0700 scsi: pm80xx: Apply byte mask for phy ID in mpi_phy_start_resp() Phy ID is located in the least significant byte of the 4-byte field. mpi_phy_stop_resp() already applies such mask. Link: https://lore.kernel.org/r/20211101232825.2350233-2-ipylypiv@google.com Reviewed-by: Vishakha Channapattan Acked-by: Jack Wang Signed-off-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit adcc796b4f55c18ee5fca8190a592c84cf8682e0 Author: Chunguang Xu Date: Wed Nov 10 09:23:32 2021 +0800 scsi: core: Use eh_timeout for START STOP UNIT In some scenarios START STOP UNIT may time out. The default recovery time of 30 seconds is relatively large. Modifying rq_timeout to adjust the START STOP UNIT timeout value will affect the regular I/O. Commit 9728c0814ecb ("[SCSI] make scsi_eh_try_stu use block timeout") switched to rq_timeout for the START STOP UNIT command. However commit 0816c9251a71 ("[SCSI] Allow error handling timeout to be specified") introduced an explicit eh_timeout parameter. It makes more sense to use this value as the timeout for START STOP UNIT. Link: https://lore.kernel.org/r/1636507412-21678-1-git-send-email-brookxu.cn@gmail.com Reviewed-by: Christoph Hellwig Reviewed-by: Wu Bo Signed-off-by: Chunguang Xu Signed-off-by: Martin K. Petersen commit 0a84486d6c1da1c2738544d8fc1b07b1d3ce046f Author: Bart Van Assche Date: Tue Nov 16 14:31:15 2021 -0800 scsi: core: Remove Scsi_Host.shost_dev_attr_groups Simplify the scsi_host_alloc() implementation by setting the shost_class .dev_groups member instead of copying all host attribute group pointers into the shost_dev_attr_groups[] array. Link: https://lore.kernel.org/r/20211116223115.2103031-1-bvanassche@acm.org Cc: Steffen Maier Cc: Damien Le Moal Suggested-by: Benjamin Block Reviewed-by: Damien Le Moal Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 54d816d3d36293728ffc8488fae14b002d4b4a64 Author: Ewan D. Milne Date: Fri Oct 29 15:43:11 2021 -0400 scsi: core: Simplify control flow in scmd_eh_abort_handler() Simplify the nested conditionals in the function by using a label for the error path. Introduce local "shost" to avoid repeated "sdev->shost" usage. Also remove scsi_eh_complete_abort() since there is now only one place it would be called. Link: https://lore.kernel.org/r/20211029194311.17504-3-emilne@redhat.com Signed-off-by: Ewan D. Milne Signed-off-by: Martin K. Petersen