commit 25b5ee122b79553798f0d1abfefcc2d4e4b4e6cc Author: Manish Pandey Date: Fri Apr 11 17:43:45 2025 +0530 scsi: ufs: ufs-qcom: Add support to dump testbus registers Add support to dump testbus registers to enhance debugging capabilities for the Qualcomm UFS Host Controller. Signed-off-by: Manish Pandey Link: https://lore.kernel.org/r/20250411121345.16859-4-quic_mapa@quicinc.com Signed-off-by: Martin K. Petersen commit 82edd868888a780c9c1e335d9f9c2258aaf20b8b Author: Manish Pandey Date: Fri Apr 11 17:43:44 2025 +0530 scsi: ufs: ufs-qcom: Add support to dump MCQ registers Add support to dump UFS MCQ registers to enhance debugging capabilities for the Qualcomm UFS Host Controller. Signed-off-by: Manish Pandey Link: https://lore.kernel.org/r/20250411121345.16859-3-quic_mapa@quicinc.com Signed-off-by: Martin K. Petersen commit fe016bb54dd1ec8218dd1c831178158052c9a0c6 Author: Manish Pandey Date: Fri Apr 11 17:43:43 2025 +0530 scsi: ufs: ufs-qcom: Add support to dump HW and SW hibern8 count Add support to dump HW and SW hibern8 enter and exit counts to enhance the debugging of hibern8 state transitions. Signed-off-by: Manish Pandey Link: https://lore.kernel.org/r/20250411121345.16859-2-quic_mapa@quicinc.com Signed-off-by: Martin K. Petersen commit 04f79c113ae77732e7e6674bd814e76c7a3453cf Author: Ranjan Kumar Date: Wed Apr 23 14:51:39 2025 +0530 scsi: mpi3mr: Event processing debug improvement Improve event process debugging. Implement more verbose event logging throughout the driver. Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20250423092139.110206-1-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 268975a87c7b6f6b0ceb62df236c1e1b08b89379 Author: Mike Christie Date: Wed Apr 23 22:26:33 2025 -0500 scsi: target: Move delayed/ordered tracking to per CPU The atomic use from the delayed/ordered tracking is causing perf issues when using higher perf backend devices and multiple queues. This moves the values to a per CPU counter. Combined with the per CPU stats patch, this improves IOPS by up to 33% for 8K IOS when using 4 or more queues from the initiator. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20250424032741.16216-3-michael.christie@oracle.com Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 9cf2317b795d6cde0fccb8744b5a080a9586020e Author: Mike Christie Date: Wed Apr 23 22:26:32 2025 -0500 scsi: target: Move I/O path stats to per CPU The atomic use in the main I/O path is causing perf issues when using higher performance backend devices and multiple queues. This moves the stats to per CPU. Combined with the next patch that moves the non_ordered/delayed_cmd_count to per CPU, IOPS by up to 33% for 8K IOS when using 4 or more queues. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20250424032741.16216-2-michael.christie@oracle.com Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 6e6d9e85bad21635c95700f2d3094f1976442bf2 Author: Don Brace Date: Wed Apr 23 13:32:29 2025 -0500 scsi: smartpqi: Update driver version to 2.1.34-035 Update driver version to 2.1.34-035. Reviewed-by: Gerry Morong Reviewed-by: Scott Teel Reviewed-by: Scott Benesh Reviewed-by: Mike McGowen Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20250423183229.538572-6-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 42d033cf4b517e91c187ad2fbd7b30fdc6d2d62c Author: Yi Zhang Date: Wed Apr 23 13:32:28 2025 -0500 scsi: smartpqi: Fix smp_processor_id() call trace for preemptible kernels Correct kernel call trace when calling smp_processor_id() when called in preemptible kernels by using raw_smp_processor_id(). smp_processor_id() checks to see if preemption is disabled and if not, issue an error message followed by a call to dump_stack(). Brief example of call trace: kernel: check_preemption_disabled: 436 callbacks suppressed kernel: BUG: using smp_processor_id() in preemptible [00000000] code: kworker/u1025:0/2354 kernel: caller is pqi_scsi_queue_command+0x183/0x310 [smartpqi] kernel: CPU: 129 PID: 2354 Comm: kworker/u1025:0 kernel: ... kernel: Workqueue: writeback wb_workfn (flush-253:0) kernel: Call Trace: kernel: kernel: dump_stack_lvl+0x34/0x48 kernel: check_preemption_disabled+0xdd/0xe0 kernel: pqi_scsi_queue_command+0x183/0x310 [smartpqi] kernel: ... Fixes: 283dcc1b142e ("scsi: smartpqi: add counter for parity write stream requests") Reviewed-by: Scott Benesh Reviewed-by: Mike McGowen Tested-by: Don Brace Signed-off-by: Yi Zhang Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20250423183229.538572-5-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 001164fc3082cd8c53f65eb87a0f490e9780fd67 Author: Venkatesh Emparala Date: Wed Apr 23 13:32:27 2025 -0500 scsi: smartpqi: Enhance WWID logging logic Log the extended WWID for NVMe devices and for devices that have the firmware feature bit "PQI_FIRMWARE_FEATURE_RPL_EXTENDED_FORMAT_4_5" enabled. Log 8-bytes otherwise. Reviewed-by: Scott Teel Reviewed-by: Scott Benesh Reviewed-by: Mike McGowen Signed-off-by: Venkatesh Emparala Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20250423183229.538572-4-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 01b8bdddcfab035cf70fd9981cb20593564cd15d Author: David Strahan Date: Wed Apr 23 13:32:26 2025 -0500 scsi: smartpqi: Add new PCI IDs Add in support for more PCI devices. All PCI ID entries in Hex. Add PCI IDs for Ramaxel controllers: VID / DID / SVID / SDID ---- ---- ---- ---- Ramaxel SmartHBA RX8238-16i 9005 028f 1018 8238 Ramaxel SSSRAID card 9005 028f 1f3f 0610 Add PCI ID for Alibaba controller: VID / DID / SVID / SDID ---- ---- ---- ---- HBA AS1340 9005 028f 1ded 3301 Add PCI IDs for Inspur controller: VID / DID / SVID / SDID ---- ---- ---- ---- RT0800M6E2i 9005 028f 1bd4 00a3 Add PCI IDs for Delta controllers: VID / DID / SVID / SDID ---- ---- ---- ---- ThinkSystem 4450-8i SAS/SATA/NVMe PCIe Gen4 9005 028f 1d49 0222 24Gb HBA ThinkSystem 4450-16i SAS/SATA/NVMe PCIe Gen4 9005 028f 1d49 0223 24Gb HBA ThinkSystem 4450-8e SAS/SATA PCIe Gen4 9005 028f 1d49 0224 24Gb HBA ThinkSystem RAID 4450-16e PCIe Gen4 24Gb 9005 028f 1d49 0225 Adapter HBA ThinkSystem RAID 5450-16i PCIe Gen4 24Gb Adapter 9005 028f 1d49 0521 ThinkSystem RAID 9450-8i 4GB Flash PCIe Gen4 9005 028f 1d49 0624 24Gb Adapter ThinkSystem RAID 9450-16i 4GB Flash PCIe Gen4 9005 028f 1d49 0625 24Gb Adapter ThinkSystem RAID 9450-16i 4GB Flash PCIe Gen4 9005 028f 1d49 0626 24Gb Adapter ThinkSystem RAID 9450-32i 8GB Flash PCIe Gen4 9005 028f 1d49 0627 24Gb Adapter ThinkSystem RAID 9450-16e 4GB Flash PCIe Gen4 9005 028f 1d49 0628 24Gb Adapter Add PCI ID for Cloudnine Controller: VID / DID / SVID / SDID ---- ---- ---- ---- SmartHBA P6600-24i 9005 028f 1f51 100b Add PCI IDs for Hurraydata Controllers: VID / DID / SVID / SDID ---- ---- ---- ---- HRDT TrustHBA H4100-8i 9005 028f 207d 4044 HRDT TrustHBA H4100-8e 9005 028f 207d 4054 HRDT TrustHBA H4100-16i 9005 028f 207d 4084 HRDT TrustHBA H4100-16e 9005 028f 207d 4094 HRDT TrustRAID D3152s-8i 9005 028f 207d 4140 HRDT TrustRAID D3154s-8i 9005 028f 207d 4240 Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Signed-off-by: David Strahan Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20250423183229.538572-3-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit 32c79c268078daf5713d3b07b23077591b245d55 Author: David Strahan Date: Wed Apr 23 13:32:25 2025 -0500 scsi: smartpqi: Take drives offline when controller is offline During a controller lockup, the physical and logical drives under the locked up controller are still listed at the OS level. I.e. the controller is offline but the status of each drive is 'running'. When the controller is unexpectedly taken offline, show its drives as offline. Reviewed-by: Scott Benesh Reviewed-by: Mike McGowen Signed-off-by: David Strahan Co-developed-by: Don Brace Signed-off-by: Don Brace Link: https://lore.kernel.org/r/20250423183229.538572-2-don.brace@microchip.com Signed-off-by: Martin K. Petersen commit f65c7b81796e026bd21cf462505b3d8932a0de3c Author: Justin Tee Date: Fri Apr 25 12:48:06 2025 -0700 scsi: lpfc: Copyright updates for 14.4.0.9 patches Update copyrights to 2025 for files modified in the 14.4.0.9 patch set. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20250425194806.3585-9-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 773a136fc8286811401f1548ace3b60cfdc9c042 Author: Justin Tee Date: Fri Apr 25 12:48:05 2025 -0700 scsi: lpfc: Update lpfc version to 14.4.0.9 Update lpfc version to 14.4.0.9 Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20250425194806.3585-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 327b110fdea1ee6ea805d7ba620ceb8f76918f4f Author: Justin Tee Date: Fri Apr 25 12:48:04 2025 -0700 scsi: lpfc: Create lpfc_vmid_info sysfs entry A vmid_info sysfs entry is created as a convenience designed for users to obtain VMID information without having to log into fabrics for similar info. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20250425194806.3585-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit b5162bb6aa1ec04dff4509b025883524b6d7e7ca Author: Justin Tee Date: Fri Apr 25 12:48:03 2025 -0700 scsi: lpfc: Avoid potential ndlp use-after-free in dev_loss_tmo_callbk Smatch detected a potential use-after-free of an ndlp oject in dev_loss_tmo_callbk during driver unload or fatal error handling. Fix by reordering code to avoid potential use-after-free if initial nodelist reference has been previously removed. Fixes: 4281f44ea8bf ("scsi: lpfc: Prevent NDLP reference count underflow in dev_loss_tmo callback") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/linux-scsi/41c1d855-9eb5-416f-ac12-8b61929201a3@stanley.mountain/ Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20250425194806.3585-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit df117c93f58ab93c71413496491fdf543dbd7eca Author: Justin Tee Date: Fri Apr 25 12:48:02 2025 -0700 scsi: lpfc: Prevent failure to reregister with NVMe transport after PRLI retry A failure to unregister with the NVMe transport may occur when a PRLI is retried. Remove duplicate testing of NLP_NVME_TARGET flag. Add a secondary check of the registered state based on the nrport information. Further qualify the ndlp reference count modification when nvme_fc_register_remoteport() returns an error. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20250425194806.3585-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 19d768dca549d492fcf222f50067752e80062bc0 Author: Justin Tee Date: Fri Apr 25 12:48:01 2025 -0700 scsi: lpfc: Restart eratt_poll timer if HBA_SETUP flag still unset Reschedule the eratt_poll timer if the HBA_SETUP flag isn’t set yet. The eratt_poll timer should only be cancelled if FC_UNLOADING flag is set or if lpfc_stop_hba_timers() is called as part of error, reset, or offline handling. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20250425194806.3585-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 8808c36b48a66ff24032e56538ab2d8df3b09e20 Author: Justin Tee Date: Fri Apr 25 12:48:00 2025 -0700 scsi: lpfc: Notify FC transport of rport disappearance during PCI fcn reset A PCI function reset implies a temporary disappearance of a fc_rport. So, call lpfc_scsi_dev_block(), which sets all mapped fc_rports into the temporary FC_PORTSTATE_BLOCKED state. Once PCI function reset completes and link reinitialized, the fc_rport is rediscovered and FC_PORTSTATE_BLOCKED state is removed. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20250425194806.3585-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 05ae6c9c7315d844fbc15afe393f5ba5e5771126 Author: Justin Tee Date: Fri Apr 25 12:47:59 2025 -0700 scsi: lpfc: Fix lpfc_check_sli_ndlp() handling for GEN_REQUEST64 commands In lpfc_check_sli_ndlp(), the get_job_els_rsp64_did remote_id assignment does not apply for GEN_REQUEST64 commands as it only has meaning for a ELS_REQUEST64 command. So, if (iocb->ndlp == ndlp) is false, we could erroneously return the wrong value. Fix by replacing the fallthrough statement with a break statement before the remote_id check. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20250425194806.3585-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 3d030e2feb8a3545959d80362dd91fb769868c54 Author: Kees Cook Date: Fri Apr 25 23:20:11 2025 -0700 scsi: qla4xxx: Remove duplicate struct crb_addr_pair In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "struct crb_addr_pair *" and the returned type will be a _different_ "struct crb_addr_pair *", causing a warning. This really stumped me for a bit. :) Drop the redundant declaration. Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20250426062010.work.878-kees@kernel.org Signed-off-by: Martin K. Petersen commit 386e014202f8380bc034678f157140db2d4dc25a Author: Kees Cook Date: Fri Apr 25 23:19:52 2025 -0700 scsi: qla2xxx: Remove duplicate struct crb_addr_pair In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "struct crb_addr_pair *" and the returned type will be a _different_ "struct crb_addr_pair *", causing a warning. This really stumped me for a bit. :) Drop the redundant declaration. Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20250426061951.work.272-kees@kernel.org Signed-off-by: Martin K. Petersen commit edf147e215c6952a9300388372febe24213c83d0 Author: Thorsten Blum Date: Mon Apr 28 19:16:26 2025 +0200 scsi: lpfc: Use secs_to_jiffies() instead of msecs_to_jiffies() Use secs_to_jiffies() instead of msecs_to_jiffies() and avoid scaling the timeouts to milliseconds. No functional changes intended. Signed-off-by: Thorsten Blum Link: https://lore.kernel.org/r/20250428171625.2499-2-thorsten.blum@linux.dev Reviewed-by: Justin Tee Signed-off-by: Martin K. Petersen commit 62b434b0db2cdc21d6fe978d24d8f84e473cb5e7 Author: Oliver Neukum Date: Mon Apr 28 14:43:45 2025 +0200 scsi: dc395x: Remove DEBUG conditional compilation Building dc395x with debugging enabled has been broken for ages. This driver needs to be converted to dynamic debugging. Remove the crud. Fixes: a862ea31655a ("[SCSI] dc395x: convert to use the data buffer accessors") Signed-off-by: Oliver Neukum Link: https://lore.kernel.org/r/20250428124345.520137-1-oneukum@suse.com Reviewed-by: Colin Ian King Signed-off-by: Martin K. Petersen commit a84a12d34f824fdff06d8191990a94cdb1c17dae Author: Huan Tang Date: Wed Apr 23 17:29:17 2025 +0800 scsi: ufs: core: Fix WB resize using wrong offset Commit 500d4b742e0c ("scsi: ufs: core: Add WB buffer resize support") incorrectly reads the value of offset DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP to determine whether WB resize is supported. Fix the issue by reading the value of DEVICE_DESC_PARAM_EXT_WB_SUP to determine whether the device supports WB resize. Fixes: 500d4b742e0c ("scsi: ufs: core: Add WB buffer resize support") Reported-by: Peter Wang Closes: https://lore.kernel.org/all/7ce05b28f5d4b4b4973244310010c1487 Signed-off-by: Huan Tang Link: https://lore.kernel.org/r/20250423092917.1031-1-tanghuan@vivo.com Reviewed-by: Peter Wang Signed-off-by: Martin K. Petersen commit 0d16b70cdbfcdffe7d4bf6ccc6f23372d71bcfeb Author: Dr. David Alan Gilbert Date: Wed Apr 16 01:22:35 2025 +0100 scsi: qedi: Remove unused qedi_get_proto_itt() qedi_get_proto_itt() last use was removed in 2021 by commit ed1b86ba0fba ("scsi: qedi: Wake up if cmd_cleanup_req is set") Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250416002235.299347-3-linux@treblig.org Signed-off-by: Martin K. Petersen commit 918eb068215775d27d8b6e37d9f623eb296f76ee Author: Dr. David Alan Gilbert Date: Wed Apr 16 01:22:34 2025 +0100 scsi: qedi: Remove unused sysfs functions qedi_remove_sysfs_attr() and qedi_create_sysfs_attr() were added in 2016 by commit ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") but have remained unused. Remove them. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250416002235.299347-2-linux@treblig.org Signed-off-by: Martin K. Petersen commit 3a37ab0827fd36a670c5db8a13b3703e4b30c7e1 Author: Dr. David Alan Gilbert Date: Tue Apr 15 01:28:03 2025 +0100 scsi: qla2xxx: Remove unused module parameters ql2xetsenable last use was removed in 2020 by commit 37efd51f75f3 ("scsi: qla2xxx: Use FC generic update firmware options routine for ISP27xx") ql2xiidmaenable last use was removed in 2017 by commit 726b85487067 ("qla2xxx: Add framework for async fabric discovery") Remove them. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250415002803.135909-9-linux@treblig.org Signed-off-by: Martin K. Petersen commit 45838d3db7500b1ff8393a195ee6efec56b8d2b8 Author: Dr. David Alan Gilbert Date: Tue Apr 15 01:28:02 2025 +0100 scsi: qla2xxx: Remove unused qla2x00_gpsc() qla2x00_gpsc() was added in 2017 as part of commit 726b85487067 ("qla2xxx: Add framework for async fabric discovery") but has remained unused. Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250415002803.135909-8-linux@treblig.org Signed-off-by: Martin K. Petersen commit 33f44a50ca61f03db1d251ddd301b0c11058e59b Author: Dr. David Alan Gilbert Date: Tue Apr 15 01:28:01 2025 +0100 scsi: qla2xxx: Remove unused ql_log_qp ql_log_qp() was added in 2017 as part of commit 22d84726e3b8 ("scsi: qla2xxx: Add debug logging routine for qpair") but has remained unused. Remove it. (That patch also added ql_dbg_qp but that is still used so is left in). Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250415002803.135909-7-linux@treblig.org Signed-off-by: Martin K. Petersen commit 2a2f3168c510c7031bbe720452365c00626bacdf Author: Dr. David Alan Gilbert Date: Tue Apr 15 01:28:00 2025 +0100 scsi: qla2xxx: Remove unused qla82xx_wait_for_state_change() qla82xx_wait_for_state_change() was added in 2010 as part of commit 579d12b58abb ("[SCSI] qla2xxx: Added support for quiescence mode for ISP82xx.") but has remained unused. Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250415002803.135909-6-linux@treblig.org Signed-off-by: Martin K. Petersen commit 89981b47f6fc942e6ffd73c8811fe73812519fbe Author: Dr. David Alan Gilbert Date: Tue Apr 15 01:27:59 2025 +0100 scsi: qla2xxx: Remove unused qla82xx_pci_region_offset() qla82xx_pci_region_offset() has been unused since the last use was removed by 2010's commit 3711333dfbee ("[SCSI] qla2xxx: Updates for ISP82xx.") Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250415002803.135909-5-linux@treblig.org Signed-off-by: Martin K. Petersen commit 91453ebecccce91e6e7604b9c8828bdab499007b Author: Dr. David Alan Gilbert Date: Tue Apr 15 01:27:58 2025 +0100 scsi: qla2xxx: Remove unused qlt_83xx_iospace_config() qlt_83xx_iospace_config() has been unused since the last use was removed by 2017's commit f54f2cb540b5 ("scsi: qla2xxx: Cleaned up queue configuration code.") Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250415002803.135909-4-linux@treblig.org Signed-off-by: Martin K. Petersen commit cbb2a2ef58019409e5fc775ccd024ea21d58f17b Author: Dr. David Alan Gilbert Date: Tue Apr 15 01:27:57 2025 +0100 scsi: qla2xxx: Remove unused qlt_fc_port_deleted() qlt_fc_port_deleted() has been unused since the last use was removed by 2017's commit 726b85487067 ("qla2xxx: Add framework for async fabric discovery") Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250415002803.135909-3-linux@treblig.org Signed-off-by: Martin K. Petersen commit ae7a08bee82b808081536be373f7d922180518a2 Author: Dr. David Alan Gilbert Date: Tue Apr 15 01:27:56 2025 +0100 scsi: qla2xxx: Remove unused qlt_free_qfull_cmds() qlt_free_qfull_cmds() was added in 2014 as part of commit 33e799775593 ("qla2xxx: Add support for QFull throttling and Term Exchange retry") but has remained unused. Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20250415002803.135909-2-linux@treblig.org Signed-off-by: Martin K. Petersen commit 1ca57644e2e935b39a260ead5e0ec5ac0319148e Author: Yihang Li Date: Mon Apr 14 16:08:45 2025 +0800 scsi: hisi_sas: Wait until error handling is complete SATA devices are lost when FLR is performed while the controller and disks are in suspended state. This is because the libata layer is called to initialize the SATA device during controller resume. If FLR is executed at this time, the IDENTIFY command fails. As a result, the revalidate fails, and the SATA device is disabled by the libata layer. Wait until error handling completes. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20250414080845.1220997-5-liyihang9@huawei.com Signed-off-by: Martin K. Petersen commit e4d953ca557e02edd3aed7390043e1b8ad1c9723 Author: Yihang Li Date: Mon Apr 14 16:08:44 2025 +0800 scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk In commit 21c7e972475e ("scsi: hisi_sas: Disable SATA disk phy for severe I_T nexus reset failure"), if the softreset fails upon certain conditions, the PHY connected to the disk is disabled directly. Manual recovery is required, which is inconvenient for users in actual use. In addition, SATA disks do not support simultaneous connection of multiple hosts. Therefore, when multiple controllers are connected to a SATA disk at the same time, the controller which is connected later failed to issue an ATA softreset to the SATA disk. As a result, the PHY associated with the disk is disabled and cannot be automatically recovered. Now that, we will not focus on the execution result of softreset. No matter whether the execution is successful or not, we will directly carry out I_T_nexus_reset. Fixes: 21c7e972475e ("scsi: hisi_sas: Disable SATA disk phy for severe I_T nexus reset failure") Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20250414080845.1220997-4-liyihang9@huawei.com Signed-off-by: Martin K. Petersen commit 92c8fe15241587363983d45b63210cc214535146 Author: Yihang Li Date: Mon Apr 14 16:08:43 2025 +0800 scsi: hisi_sas: Coding style cleanup Remove superfluous blank lines and symbols. Add spaces around operators. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20250414080845.1220997-3-liyihang9@huawei.com Signed-off-by: Martin K. Petersen commit 4ca7fe99fc8485fcd04b367f37dc7a48f1355419 Author: Yihang Li Date: Mon Apr 14 16:08:42 2025 +0800 scsi: hisi_sas: Use macro instead of magic number The hisi_sas driver has a large number of magic numbers which makes for unfriendly code reading. Use macro definitions instead. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20250414080845.1220997-2-liyihang9@huawei.com Signed-off-by: Martin K. Petersen commit 7a497d1649a9d2af1b9d184eeef4c7e63efb022c Author: Chelsy Ratnawat Date: Sat Apr 19 15:59:06 2025 -0700 scsi: mpi3mr: Fix typo and grammar Corrected grammar, spelling, and formatting in the kernel-doc comment for mpi3mr_os_handle_events() to follow kernel-doc style and improve clarity. Signed-off-by: Chelsy Ratnawat Link: https://lore.kernel.org/r/20250419225906.31437-1-chelsyratnawat2001@gmail.com Signed-off-by: Martin K. Petersen commit b0b7ee3b574a72283399b9232f6190be07f220c0 Author: Ranjan Kumar Date: Tue Apr 15 15:45:46 2025 +0530 scsi: mpi3mr: Add level check to control event logging Ensure event logs are only generated when the debug logging level MPI3_DEBUG_EVENT is enabled. This prevents unnecessary logging. Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20250415101546.204018-1-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit c8c70ff3a766a077e5b3a717e91722638d50e2a6 Author: WangYuli Date: Mon Apr 14 12:26:27 2025 +0800 scsi: scsi_transport_fc: Rename del_timer() in comment Commit 8fa7292fee5c ("treewide: Switch/rename to timer_delete[_sync]()") switched del_timer() to timer_delete(), but did not modify the comment for fc_remote_port_rolechg(). Fix it. Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: SCSI SUBSYSTEM Cc: linux-kernel@vger.kernel.org Signed-off-by: WangYuli Link: https://lore.kernel.org/r/084BD6AB1C4759DA+20250414042629.63019-3-wangyuli@uniontech.com Signed-off-by: Martin K. Petersen commit 08a966a917fe3d92150fa3cc15793ad5e57051eb Author: Chenyuan Yang Date: Sat Apr 12 14:59:09 2025 -0500 scsi: ufs: core: Add NULL check in ufshcd_mcq_compl_pending_transfer() Add a NULL check for the returned hwq pointer by ufshcd_mcq_req_to_hwq(). This is similar to the fix in commit 74736103fb41 ("scsi: ufs: core: Fix ufshcd_abort_one racing issue"). Signed-off-by: Chenyuan Yang Link: https://lore.kernel.org/r/20250412195909.315418-1-chenyuan0y@gmail.com Fixes: ab248643d3d6 ("scsi: ufs: core: Add error handling for MCQ mode") Reviewed-by: Peter Wang Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 54bebe46871d4e56e05fcf55c1a37e7efa24e0a8 Author: Anastasia Kovaleva Date: Mon Mar 24 11:49:33 2025 +0300 scsi: core: Clear flags for scsi_cmnd that did not complete Commands that have not been completed with scsi_done() do not clear the SCMD_INITIALIZED flag and therefore will not be properly reinitialized. Thus, the next time the scsi_cmnd structure is used, the command may fail in scsi_cmd_runtime_exceeded() due to the old jiffies_at_alloc value: kernel: sd 16:0:1:84: [sdts] tag#405 timing out command, waited 720s kernel: sd 16:0:1:84: [sdts] tag#405 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=66636s Clear flags for commands that have not been completed by SCSI. Fixes: 4abafdc4360d ("block: remove the initialize_rq_fn blk_mq_ops method") Signed-off-by: Anastasia Kovaleva Link: https://lore.kernel.org/r/20250324084933.15932-2-a.kovaleva@yadro.com Signed-off-by: Martin K. Petersen commit 569330a34a31a52c904239439984a59972c11d28 Author: Manish Pandey Date: Fri Apr 11 17:46:30 2025 +0530 scsi: ufs: Introduce quirk to extend PA_HIBERN8TIME for UFS devices Samsung UFS devices require additional time in hibern8 mode before exiting, beyond the negotiated handshaking phase between the host and device. Introduce a quirk to increase the PA_HIBERN8TIME parameter by 100 µs, a value derived from experiments, to ensure a proper hibernation process. Signed-off-by: Manish Pandey Link: https://lore.kernel.org/r/20250411121630.21330-3-quic_mapa@quicinc.com Reviewed-by: Bean Huo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit f8cba9a700cf38b181df7c1d809cd73c6e1b2df9 Author: Manish Pandey Date: Fri Apr 11 17:46:29 2025 +0530 scsi: ufs: qcom: Add quirks for Samsung UFS devices Introduce quirks for Samsung UFS devices to adjust PA TX HSG1 sync length and TX_HS_EQUALIZER settings on the Qualcomm UFS Host controller. This ensures proper functionality of Samsung UFS devices with the Qualcomm UFS Host controller. Signed-off-by: Manish Pandey Link: https://lore.kernel.org/r/20250411121630.21330-2-quic_mapa@quicinc.com Reviewed-by: Bean Huo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit 7f533cc5ee4c4436cee51dc58e81dfd9c3384418 Author: Dmitry Bogdanov Date: Tue Dec 24 13:17:57 2024 +0300 scsi: target: iscsi: Fix timeout on deleted connection NOPIN response timer may expire on a deleted connection and crash with such logs: Did not receive response to NOPIN on CID: 0, failing connection for I_T Nexus (null),i,0x00023d000125,iqn.2017-01.com.iscsi.target,t,0x3d BUG: Kernel NULL pointer dereference on read at 0x00000000 NIP strlcpy+0x8/0xb0 LR iscsit_fill_cxn_timeout_err_stats+0x5c/0xc0 [iscsi_target_mod] Call Trace: iscsit_handle_nopin_response_timeout+0xfc/0x120 [iscsi_target_mod] call_timer_fn+0x58/0x1f0 run_timer_softirq+0x740/0x860 __do_softirq+0x16c/0x420 irq_exit+0x188/0x1c0 timer_interrupt+0x184/0x410 That is because nopin response timer may be re-started on nopin timer expiration. Stop nopin timer before stopping the nopin response timer to be sure that no one of them will be re-started. Signed-off-by: Dmitry Bogdanov Link: https://lore.kernel.org/r/20241224101757.32300-1-d.bogdanov@yadro.com Reviewed-by: Maurizio Lombardi Signed-off-by: Martin K. Petersen commit 1f8eb295790001e0f498e62c186130055d3d496f Author: Thorsten Blum Date: Tue Mar 4 19:14:00 2025 +0100 scsi: target: Remove size arguments when calling strscpy() The size parameter of strscpy() is optional because strscpy() uses sizeof() to determine the length of the destination buffer if it is not provided as an argument. Remove it to simplify the code. Remove some unnecessary curly braces. No functional changes intended. Signed-off-by: Thorsten Blum Link: https://lore.kernel.org/r/20250304181400.78325-1-thorsten.blum@linux.dev Signed-off-by: Martin K. Petersen commit fc8a5ee50743516700d10a83c598b6adb3c2dbef Author: Kees Cook Date: Mon Mar 10 15:25:54 2025 -0700 scsi: pm80xx: Add __nonstring annotations for unterminated strings When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initialization will only warn if the array lacks the "nonstring" attribute[1]. Mark the arrays with __nonstring to and correctly identify the char array as "not a C string" and thereby eliminate the warning. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178 [1] Cc: Jack Wang Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20250310222553.work.437-kees@kernel.org Signed-off-by: Martin K. Petersen commit 3b5091fee49ffcee512901318ca2425bb1e31a5c Author: Ranjan Kumar Date: Fri Apr 11 16:44:19 2025 +0530 scsi: mpi3mr: Reset the pending interrupt flag If an admin interrupt is missed, admin_pend_isr may stay set and trigger admin reply processing even when no admin I/Os are pending. Clearing/Resetting it in the admin completion path prevents this. Fixes: ca41929b2ed5 ("scsi: mpi3mr: Check admin reply queue from Watchdog") Cc: stable@vger.kernel.org Co-developed-by: Sathya Prakash Signed-off-by: Sathya Prakash Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20250411111419.135485-3-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit cdd445258db9919e9dde497a6d5c3477ea7faf4d Author: Ranjan Kumar Date: Fri Apr 11 16:44:18 2025 +0530 scsi: mpi3mr: Fix pending I/O counter Commit 199510e33dea ("scsi: mpi3mr: Update consumer index of reply queues after every 100 replies") introduced a regression with the per-reply queue pending I/O counter which was erroneously decremented, leading to the counter going negative. Drop the incorrect atomic decrement for the pending I/O counter. Fixes: 199510e33dea ("scsi: mpi3mr: Update consumer index of reply queues after every 100 replies") Cc: stable@vger.kernel.org Co-developed-by: Sathya Prakash Signed-off-by: Sathya Prakash Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20250411111419.135485-2-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 500d4b742e0cc712160054413e129a568467a7de Author: Huan Tang Date: Fri Apr 11 17:29:24 2025 +0800 scsi: ufs: core: Add WB buffer resize support Follow JESD220G, support a WB buffer resize function through sysfs. The host can obtain resize hint and resize status, and enable the resize operation. Add three sysfs nodes: 1. wb_resize_enable 2. wb_resize_hint 3. wb_resize_status The detailed definition of the three nodes can be found in the sysfs documentation. Signed-off-by: Huan Tang Signed-off-by: Lu Hongfei Link: https://lore.kernel.org/r/20250411092924.1116-1-tanghuan@vivo.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4c324085062919d4e21c69e5e78456dcec0052fe Author: Chenyuan Yang Date: Wed Apr 9 19:13:20 2025 -0500 scsi: ufs: mcq: Add NULL check in ufshcd_mcq_abort() A race can occur between the MCQ completion path and the abort handler: once a request completes, __blk_mq_free_request() sets rq->mq_hctx to NULL, meaning the subsequent ufshcd_mcq_req_to_hwq() call in ufshcd_mcq_abort() can return a NULL pointer. If this NULL pointer is dereferenced, the kernel will crash. Add a NULL check for the returned hwq pointer. If hwq is NULL, log an error and return FAILED, preventing a potential NULL-pointer dereference. As suggested by Bart, the ufshcd_cmd_inflight() check is removed. This is similar to the fix in commit 74736103fb41 ("scsi: ufs: core: Fix ufshcd_abort_one racing issue"). This is found by our static analysis tool KNighter. Signed-off-by: Chenyuan Yang Link: https://lore.kernel.org/r/20250410001320.2219341-1-chenyuan0y@gmail.com Fixes: f1304d442077 ("scsi: ufs: mcq: Added ufshcd_mcq_abort()") Reviewed-by: Bart Van Assche Reviewed-by: Peter Wang Signed-off-by: Martin K. Petersen commit ae82eaf4aeea060bb736c3e20c0568b67c701d7d Author: Daniel Wagner Date: Wed Apr 9 13:34:22 2025 +0200 scsi: lpfc: Use memcpy() for BIOS version The strlcat() with FORTIFY support is triggering a panic because it thinks the target buffer will overflow although the correct target buffer size is passed in. Anyway, instead of memset() with 0 followed by a strlcat(), just use memcpy() and ensure that the resulting buffer is NULL terminated. BIOSVersion is only used for the lpfc_printf_log() which expects a properly terminated string. Signed-off-by: Daniel Wagner Link: https://lore.kernel.org/r/20250409-fix-lpfc-bios-str-v1-1-05dac9e51e13@kernel.org Reviewed-by: Justin Tee Signed-off-by: Martin K. Petersen commit cdcb08d5710bc9b543551a85ad551f44d6a4bfc0 Author: Thorsten Blum Date: Tue Apr 8 12:28:40 2025 +0200 scsi: elx: sli4: Replace deprecated strncpy() with strscpy() strncpy() is deprecated for NUL-terminated destination buffers; use strscpy() instead. Since sli_config_cmd_init() already zeroes out the destination buffers, the potential NUL-padding by strncpy() is unnecessary. strscpy() copies only the required characters and guarantees NUL-termination. And since all three destination buffers have a fixed length, strscpy() automatically determines their size using sizeof() when the argument is omitted. This makes any explicit sizeof() calls unnecessary. The source strings are also NUL-terminated and meet the __must_be_cstr() requirement of strscpy(). No functional changes intended. Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Thorsten Blum Link: https://lore.kernel.org/r/20250408102843.804083-2-thorsten.blum@linux.dev Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 3c7ac40d732232fec0ba31d0a5e3cc9c112fc2e7 Author: Neil Armstrong Date: Mon Apr 7 12:17:05 2025 +0200 scsi: ufs: core: Delegate the interrupt service routine to a threaded IRQ handler On systems with a large number request slots and unavailable MCQ ESI, the current design of the interrupt handler can delay handling of other subsystems interrupts causing display artifacts, GPU stalls or system firmware requests timeouts. Since the interrupt routine can take quite some time, it's preferable to move it to a threaded handler and leave the hard interrupt handler wake up the threaded interrupt routine, the interrupt line would be masked until the processing is finished in the thread thanks to the IRQS_ONESHOT flag. When MCQ & ESI interrupts are enabled the I/O completions are now directly handled in the "hard" interrupt routine to keep IOPs high since queues handling is done in separate per-queue interrupt routines. This fixes all encountered issued when running FIO tests on the Qualcomm SM8650 platform. Example of errors reported on a loaded system: [drm:dpu_encoder_frame_done_timeout:2706] [dpu error]enc32 frame done timeout msm_dpu ae01000.display-controller: [drm:hangcheck_handler [msm]] *ERROR* 67.5.20.1: hangcheck detected gpu lockup rb 2! msm_dpu ae01000.display-controller: [drm:hangcheck_handler [msm]] *ERROR* 67.5.20.1: completed fence: 74285 msm_dpu ae01000.display-controller: [drm:hangcheck_handler [msm]] *ERROR* 67.5.20.1: submitted fence: 74286 Error sending AMC RPMH requests (-110) Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20250407-topic-ufs-use-threaded-irq-v3-3-08bee980f71e@linaro.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2d6c7bcc6cca63238fce0a95874b053500a1112e Author: Neil Armstrong Date: Mon Apr 7 12:17:04 2025 +0200 scsi: ufs: core: Track when MCQ ESI is enabled In preparation of adding a threaded interrupt handler, track when the MCQ ESI interrupt handlers were installed so we can optimize the MCQ interrupt handling to avoid walking the threaded handler in the case ESI handlers are enabled. Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20250407-topic-ufs-use-threaded-irq-v3-2-08bee980f71e@linaro.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 56f4beffc9a056f70e56f53d01451441106bd4ff Author: Neil Armstrong Date: Mon Apr 7 12:17:03 2025 +0200 scsi: ufs: core: Drop last_intr_status/ts stats In order to prepare introduction of a threaded interrupt handler, drop last_intr_status & last_intr_ts drop the ufs_stats struct, and the associated debug code. Suggested-by: Bart Van Assche Reviewed-by: Bart Van Assche Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20250407-topic-ufs-use-threaded-irq-v3-1-08bee980f71e@linaro.org Signed-off-by: Martin K. Petersen commit 50dda49835073433840fdffe8c4d7624daf6d9ba Author: Eric Biggers Date: Fri Apr 4 16:15:32 2025 -0700 scsi: ufs: qcom: Add support for wrapped keys Wire up the wrapped key support for ufs-qcom by implementing the needed methods in struct blk_crypto_ll_ops and setting the appropriate flag in blk_crypto_profile::key_types_supported. For more information about this feature and how to use it, refer to the sections about hardware-wrapped keys in Documentation/block/inline-encryption.rst and Documentation/filesystems/fscrypt.rst. Based on patches by Gaurav Kashyap . Reworked to use the custom crypto profile support. Acked-by: Manivannan Sadhasivam Tested-by: Bartosz Golaszewski # sm8650 Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20250404231533.174419-4-ebiggers@kernel.org Acked-by: Ulf Hansson # For MMC Signed-off-by: Martin K. Petersen commit 7cc6e0c34b21b6e981afde695132f38e174c7aa5 Author: Gaurav Kashyap Date: Fri Apr 4 16:15:31 2025 -0700 scsi: soc: qcom: ice: Add HWKM support to the ICE driver Qualcomm's Inline Crypto Engine (ICE) version 3.2 and later includes a key management hardware block called the Hardware Key Manager (HWKM). Add support for HWKM to the ICE driver. HWKM provides hardware-wrapped key support where the ICE (storage) keys are not exposed to software and instead are protected in hardware. Later patches will wire up this feature to ufs-qcom and sdhci-msm using the support added in this patch. HWKM and legacy mode are currently mutually exclusive. The selection of which mode to use has to be made before the storage driver(s) registers any inline encryption capable disk(s) with the block layer (i.e., generally at boot time) so that the appropriate crypto capabilities can be advertised to upper layers. Therefore, make the ICE driver select HWKM mode when the all of the following are true: - The new module parameter qcom_ice.use_wrapped_keys=1 is specified. - HWKM is present and is at least v2, i.e. ICE is v3.2.1 or later. - The SCM calls needed to fully use HWKM are supported by TrustZone. [EB: merged related patches; fixed the module parameter to work correctly; dropped unnecessary support for HWKM v1; fixed error handling; improved log messages, comments, and commit message; fixed naming; merged enable and init functions; and other cleanups] Signed-off-by: Gaurav Kashyap Signed-off-by: Bartosz Golaszewski Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20250404231533.174419-3-ebiggers@kernel.org Acked-by: Ulf Hansson # For MMC Signed-off-by: Martin K. Petersen commit 11d4c388a38ab6e95a7be82a44a55ecc32cd6a14 Author: Eric Biggers Date: Fri Apr 4 16:15:30 2025 -0700 scsi: soc: qcom: ice: Make qcom_ice_program_key() take struct blk_crypto_key qcom_ice_program_key() currently accepts the key as an array of bytes, algorithm ID, key size enum, and data unit size. However both callers have a struct blk_crypto_key which contains all that information. Thus they both have similar code that converts the blk_crypto_key into the form that qcom_ice_program_key() wants. Once wrapped key support is added, the key type would need to be added to the arguments too. Therefore, this patch changes qcom_ice_program_key() to take in all this information as a struct blk_crypto_key directly. The calling code is updated accordingly. This ends up being much simpler, and it makes the key type be passed down automatically once wrapped key support is added. Based on a patch by Gaurav Kashyap that replaced the byte array argument only. This patch makes the blk_crypto_key replace other arguments like the algorithm ID too, ensuring that there remains only one source of truth. Acked-by: Manivannan Sadhasivam Tested-by: Bartosz Golaszewski # sm8650 Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20250404231533.174419-2-ebiggers@kernel.org Acked-by: Konrad Dybcio Acked-by: Ulf Hansson # For MMC Signed-off-by: Martin K. Petersen commit d19dc8d4dfca33f5957422d4a23963ee8fac12f5 Author: Kai Mäkisara Date: Mon Mar 10 17:55:57 2025 +0200 scsi: scsi_debug: Add ERASE for tapes The command ERASE(6) for tape devices is added. Signed-off-by: Kai Mäkisara Link: https://lore.kernel.org/r/20250310155557.2872-6-Kai.Makisara@kolumbus.fi Signed-off-by: Martin K. Petersen commit 34252036774b19f66eb9241e4b0b5a07f3461dbe Author: Kai Mäkisara Date: Mon Mar 10 17:55:56 2025 +0200 scsi: scsi_debug: Use scsi_device->type instead os sdebug_ptype where possible Devices of several types can be created for a single host. The module device type should be used only when the devices are created. Scsi_scan sets the device type initially to 0xff and sets the correct type based in Inquiry results. This means that Inquiry must report sdebug_ptype as long as scsi_device->type is not set (the limit 32 comes from the 5-bit length of the Peripheral Device Type in Inquiry). Signed-off-by: Kai Mäkisara Link: https://lore.kernel.org/r/20250310155557.2872-5-Kai.Makisara@kolumbus.fi Signed-off-by: Martin K. Petersen commit 5b0cb8c984bf68dc98aa02ab534e7ddb47157693 Author: Kai Mäkisara Date: Mon Mar 10 17:55:55 2025 +0200 scsi: scsi_debug: Move some tape-specific commands to separate definitions New definitions (struct opcode_info_t) are created for READ(6), WRITE(6), READ POSITION(10) for tape devices. Signed-off-by: Kai Mäkisara Link: https://lore.kernel.org/r/20250310155557.2872-4-Kai.Makisara@kolumbus.fi Signed-off-by: Martin K. Petersen commit eaa326f5a8e8996711c0cb6d0aa70fa9b2ea38ea Author: Kai Mäkisara Date: Mon Mar 10 17:55:54 2025 +0200 scsi: scsi_debug: Enable different command definitions for different device types Add mask field devsel to the struct opcode_info_t to enable different definitions for different device types. Add checking of device mask to command queuing and reporting of supported opcodes. Signed-off-by: Kai Mäkisara Link: https://lore.kernel.org/r/20250310155557.2872-3-Kai.Makisara@kolumbus.fi Signed-off-by: Martin K. Petersen commit a040adb78005cc35de61318975768c3d82138232 Author: Kai Mäkisara Date: Mon Mar 10 17:55:53 2025 +0200 scsi: scsi_debug: Fix two typos in command definitions Fix two command definitions: - Flags and service action reversed in SEND DIAGNOSTIC - ATOMIC WRITE missing opcode Signed-off-by: Kai Mäkisara Link: https://lore.kernel.org/r/20250310155557.2872-2-Kai.Makisara@kolumbus.fi Signed-off-by: Martin K. Petersen commit 1b4902f0a4f20aaea14d51a378368fa697467901 Author: Chandrakanth Patil Date: Thu Apr 3 01:07:35 2025 +0530 scsi: megaraid_sas: Driver version update to 07.734.00.00-rc1 Signed-off-by: Chandrakanth Patil Link: https://lore.kernel.org/r/20250402193735.5098-2-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen commit aad9945623ab4029ae7789609fb6166c97976c62 Author: Chandrakanth Patil Date: Thu Apr 3 01:07:34 2025 +0530 scsi: megaraid_sas: Block zero-length ATA VPD inquiry A firmware bug was observed where ATA VPD inquiry commands with a zero-length data payload were not handled and failed with a non-standard status code of 0xf0. Avoid sending ATA VPD inquiry commands without data payload by setting the device no_vpd_size flag to 1. In addition, if the firmware returns a status code of 0xf0, set scsi_cmnd->result to CHECK_CONDITION to facilitate proper error handling. Suggested-by: Martin K. Petersen Signed-off-by: Chandrakanth Patil Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250402193735.5098-1-chandrakanth.patil@broadcom.com Tested-by: Ryan Lahfa Signed-off-by: Martin K. Petersen commit a63b69f05f999acae91b0b50d7c5fe4fb241dbaf Author: Li Haoran Date: Mon Mar 31 15:55:11 2025 +0800 scsi: scsi_transport_srp: Replace min/max nesting with clamp() This patch replaces min(a, max(b, c)) by clamp(val, lo, hi) in the SRP transport layer. The clamp() macro explicitly expresses the intent of constraining a value within bounds, improving code readability. Signed-off-by: Li Haoran Signed-off-by: Shao Mingyin Link: https://lore.kernel.org/r/202503311555115618U8Md16mKpRYOIy2TOmB6@zte.com.cn Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1fd2e77b889761d9bde0c580518689d1d8e83117 Author: Bao D. Nguyen Date: Fri Mar 28 14:46:13 2025 -0700 scsi: ufs: core: Add device level exception support The ufs device JEDEC specification version 4.1 adds support for the device level exception events. To support this new device level exception feature, expose two new sysfs nodes below to provide the user space access to the device level exception information. /sys/bus/platform/drivers/ufshcd/*/device_lvl_exception_count /sys/bus/platform/drivers/ufshcd/*/device_lvl_exception_id The device_lvl_exception_count sysfs node reports the number of device level exceptions that have occurred since the last time this variable is reset. Writing a value of 0 will reset it. The device_lvl_exception_id reports the exception ID which is the qDeviceLevelExceptionID attribute of the device JEDEC specifications version 4.1 and later. The user space application can query these sysfs nodes to get more information about the device level exception. Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/6278d7c125b2f0cf5056f4a647a4b9c1fdd24fc7.1743198325.git.quic_nguyenb@quicinc.com Reviewed-by: Peter Wang Reviewed-by: Bart Van Assche Reviewed-by: Arthur Simchaev Signed-off-by: Martin K. Petersen commit bdab40480b146e2f37f4c7164cb47f526e77ee6d Author: Bao D. Nguyen Date: Fri Mar 28 13:17:11 2025 -0700 scsi: ufs: core: Rename ufshcd_wb_presrv_usrspc_keep_vcc_on() The ufshcd_wb_presrv_usrspc_keep_vcc_on() function has deviated from its original implementation. The "_keep_vcc_on" part of the function name is misleading. Rename the function to ufshcd_wb_curr_buff_threshold_check() to improve the readability. Also, updated the comments in the function. There is no change to the functionality. Signed-off-by: Bao D. Nguyen Link: https://lore.kernel.org/r/02ae5e133f6ebf23b54d943e6d1d9de2544eb80e.1743192926.git.quic_nguyenb@quicinc.com Reviewed-by: Avri Altman Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a2d5a0072235a69749ceb04c1a26dc75df66a31a Author: Martin Wilck Date: Fri Mar 21 23:33:19 2025 +0100 scsi: smartpqi: Use is_kdump_kernel() to check for kdump The smartpqi driver checks the reset_devices variable to determine whether special adjustments need to be made for kdump. This has the effect that after a regular kexec reboot, some driver parameters such as max_transfer_size are much lower than usual. More importantly, kexec reboot tests have revealed memory corruption caused by the driver log being written to system memory after a kexec. Fix this by testing is_kdump_kernel() rather than reset_devices where appropriate. Fixes: 058311b72f54 ("scsi: smartpqi: Add fw log to kdump") Signed-off-by: Martin Wilck Link: https://lore.kernel.org/r/20250321223319.109250-1-mwilck@suse.com Cc: Randy Wright Acked-by: Don Brace Tested-by: Don Brace Reviewed-by: Lee Duncan Signed-off-by: Martin K. Petersen commit f7b705c238d1483f0a766e2b20010f176e5c0fb7 Author: Igor Pylypiv Date: Wed Mar 19 23:03:05 2025 +0000 scsi: pm80xx: Set phy_attached to zero when device is gone When a fatal error occurs, a phy down event may not be received to set phy->phy_attached to zero. Signed-off-by: Igor Pylypiv Signed-off-by: Salomon Dushimirimana Link: https://lore.kernel.org/r/20250319230305.3172920-1-salomondush@google.com Signed-off-by: Martin K. Petersen commit cd4c0025069f16fc666c6ffc56c49c9b1154841f Author: Peter Griffin Date: Wed Mar 19 15:30:24 2025 +0000 scsi: ufs: exynos: gs101: Put UFS device in reset on .suspend() GPIO_OUT[0] is connected to the reset pin of embedded UFS device. Before powering off the phy assert the reset signal. This is added as a gs101 specific suspend hook so as not to have any unintended consequences for other SoCs supported by this driver. Signed-off-by: Peter Griffin Link: https://lore.kernel.org/r/20250319-exynos-ufs-stability-fixes-v2-7-96722cc2ba1b@linaro.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 67e4085015c33bf2fb552af1f171c58b81ef0616 Author: Peter Griffin Date: Wed Mar 19 15:30:23 2025 +0000 scsi: ufs: exynos: Move phy calls to .exit() callback ufshcd_pltfrm_remove() calls ufshcd_remove(hba) which in turn calls ufshcd_hba_exit(). By moving the phy_power_off() and phy_exit() calls to the newly created .exit callback they get called by ufshcd_variant_hba_exit() before ufshcd_hba_exit() turns off the regulators. This is also similar flow to the ufs-qcom driver. Signed-off-by: Peter Griffin Link: https://lore.kernel.org/r/20250319-exynos-ufs-stability-fixes-v2-6-96722cc2ba1b@linaro.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit deac9ad496ec17e1ec06848964ecc635bdaca703 Author: Peter Griffin Date: Wed Mar 19 15:30:22 2025 +0000 scsi: ufs: exynos: Enable PRDT pre-fetching with UFSHCD_CAP_CRYPTO PRDT_PREFETCH_ENABLE[31] bit should be set when desctype field of fmpsecurity0 register is type2 (double file encryption) or type3 (support for file and disk encryption). Setting this bit enables PRDT pre-fetching on both TXPRDT and RXPRDT. Signed-off-by: Peter Griffin Link: https://lore.kernel.org/r/20250319-exynos-ufs-stability-fixes-v2-5-96722cc2ba1b@linaro.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 7f05fd9a3b6fb3a9abc5a748307d11831c03175f Author: Peter Griffin Date: Wed Mar 19 15:30:21 2025 +0000 scsi: ufs: exynos: Ensure consistent phy reference counts ufshcd_link_startup() can call ufshcd_vops_link_startup_notify() multiple times when retrying. This causes the phy reference count to keep increasing and the phy to not properly re-initialize. If the phy has already been previously powered on, first issue a phy_power_off() and phy_exit(), before re-initializing and powering on again. Signed-off-by: Peter Griffin Link: https://lore.kernel.org/r/20250319-exynos-ufs-stability-fixes-v2-4-96722cc2ba1b@linaro.org Fixes: 3d73b200f989 ("scsi: ufs: ufs-exynos: Change ufs phy control sequence") Cc: stable@vger.kernel.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit f92bb7436802f8eb7ee72dc911a33c8897fde366 Author: Peter Griffin Date: Wed Mar 19 15:30:20 2025 +0000 scsi: ufs: exynos: Disable iocc if dma-coherent property isn't set If dma-coherent property isn't set then descriptors are non-cacheable and the iocc shareability bits should be disabled. Without this UFS can end up in an incompatible configuration and suffer from random cache related stability issues. Suggested-by: Bart Van Assche Fixes: cc52e15397cc ("scsi: ufs: ufs-exynos: Support ExynosAuto v9 UFS") Signed-off-by: Peter Griffin Link: https://lore.kernel.org/r/20250319-exynos-ufs-stability-fixes-v2-3-96722cc2ba1b@linaro.org Cc: Chanho Park Cc: stable@vger.kernel.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 68f5ef7eebf0f41df4d38ea55a54c2462af1e3d6 Author: Peter Griffin Date: Wed Mar 19 15:30:19 2025 +0000 scsi: ufs: exynos: Move UFS shareability value to drvdata gs101 I/O coherency shareability bits differ from exynosauto SoC. To support both SoCs move this info the SoC drvdata. Currently both the value and mask are the same for both gs101 and exynosauto, thus we use the same value. Signed-off-by: Peter Griffin Link: https://lore.kernel.org/r/20250319-exynos-ufs-stability-fixes-v2-2-96722cc2ba1b@linaro.org Fixes: d11e0a318df8 ("scsi: ufs: exynos: Add support for Tensor gs101 SoC") Cc: stable@vger.kernel.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3d101165e72316775947d71321d97194f03dfef3 Author: Peter Griffin Date: Wed Mar 19 15:30:18 2025 +0000 scsi: ufs: exynos: Ensure pre_link() executes before exynos_ufs_phy_init() Ensure clocks are enabled before configuring unipro. Additionally move the pre_link() hook before the exynos_ufs_phy_init() calls. This means the register write sequence more closely resembles the ordering of the downstream driver. Signed-off-by: Peter Griffin Link: https://lore.kernel.org/r/20250319-exynos-ufs-stability-fixes-v2-1-96722cc2ba1b@linaro.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 72eea84a1092b50a10eeecfeba4b28ac9f1312ab Author: Miaoqian Lin Date: Tue Mar 18 17:43:43 2025 +0800 scsi: iscsi: Fix missing scsi_host_put() in error path Add goto to ensure scsi_host_put() is called in all error paths of iscsi_set_host_param() function. This fixes a potential memory leak when strlen() check fails. Fixes: ce51c8170084 ("scsi: iscsi: Add strlen() check in iscsi_if_set{_host}_param()") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20250318094344.91776-1-linmq006@gmail.com Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 20b97acc4cafa2be8ac91a777de135110e58a90b Author: Bart Van Assche Date: Fri Mar 14 15:51:50 2025 -0700 scsi: ufs: core: Fix a race condition related to device commands There is a TOCTOU race in ufshcd_compl_one_cqe(): hba->dev_cmd.complete may be cleared from another thread after it has been checked and before it is used. Fix this race by moving the device command completion from the stack of the device command submitter into struct ufs_hba. This patch fixes the following kernel crash: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 Call trace: _raw_spin_lock_irqsave+0x34/0x80 complete+0x24/0xb8 ufshcd_compl_one_cqe+0x13c/0x4f0 ufshcd_mcq_poll_cqe_lock+0xb4/0x108 ufshcd_intr+0x2f4/0x444 __handle_irq_event_percpu+0xbc/0x250 handle_irq_event+0x48/0xb0 Fixes: 5a0b0cb9bee7 ("[SCSI] ufs: Add support for sending NOP OUT UPIU") Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20250314225206.1487838-1-bvanassche@acm.org Reviewed-by: Peter Wang Signed-off-by: Martin K. Petersen commit daff37f00c7506ca322ccfce95d342022f06ec58 Author: Xingui Yang Date: Wed Mar 12 17:51:35 2025 +0800 scsi: hisi_sas: Fix I/O errors caused by hardware port ID changes The hw port ID of phy may change when inserting disks in batches, causing the port ID in hisi_sas_port and itct to be inconsistent with the hardware, resulting in I/O errors. The solution is to set the device state to gone to intercept I/O sent to the device, and then execute linkreset to discard and find the disk to re-update its information. Signed-off-by: Xingui Yang Link: https://lore.kernel.org/r/20250312095135.3048379-3-yangxingui@huawei.com Signed-off-by: Martin K. Petersen commit 8aa580cd92843b60d4d6331f3b0a9e8409bb70eb Author: Xingui Yang Date: Wed Mar 12 17:51:34 2025 +0800 scsi: hisi_sas: Enable force phy when SATA disk directly connected when a SATA disk is directly connected the SAS controller determines the disk to which I/Os are delivered based on the port ID in the DQ entry. When many phys are disconnected and reconnect, the port ID of phys were changed and used by other link, resulting in I/O being sent to incorrect disk. Data inconsistency on the SATA disk may occur during I/O retries using the old port ID. So enable force phy, then force the command to be executed in a certain phy, and if the actual phy ID of the port does not match the phy configured in the command, the chip will stop delivering the I/O to disk. Fixes: ce60689e12dd ("scsi: hisi_sas: add v3 code to send ATA frame") Signed-off-by: Xingui Yang Link: https://lore.kernel.org/r/20250312095135.3048379-2-yangxingui@huawei.com Reviewed-by: Yihang Li Signed-off-by: Martin K. Petersen