summaryrefslogtreecommitdiff
path: root/drivers/scsi
AgeCommit message (Collapse)Author
2025-04-28scsi: smartpqi: Fix smp_processor_id() call trace for preemptible kernelsYi Zhang
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: <TASK> 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 <scott.benesh@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Tested-by: Don Brace <don.brace@microchip.com> Signed-off-by: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Don Brace <don.brace@microchip.com> Link: https://lore.kernel.org/r/20250423183229.538572-5-don.brace@microchip.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: smartpqi: Enhance WWID logging logicVenkatesh Emparala
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 <scott.teel@microchip.com> Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Signed-off-by: Venkatesh Emparala <Venkatesh.Emparala@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Link: https://lore.kernel.org/r/20250423183229.538572-4-don.brace@microchip.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: smartpqi: Add new PCI IDsDavid Strahan
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 <scott.benesh@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Signed-off-by: David Strahan <david.strahan@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Link: https://lore.kernel.org/r/20250423183229.538572-3-don.brace@microchip.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: smartpqi: Take drives offline when controller is offlineDavid Strahan
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 <scott.benesh@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Signed-off-by: David Strahan <david.strahan@microchip.com> Co-developed-by: Don Brace <don.brace@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Link: https://lore.kernel.org/r/20250423183229.538572-2-don.brace@microchip.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28Merge patch series "Update lpfc to revision 14.4.0.9"Martin K. Petersen
Justin Tee <justintee8345@gmail.com> says: Update lpfc to revision 14.4.0.9 This patch set contains fixes related to handling of WQE commands, PCI function resets, firmware eratta events, ELS retries, a smatch use-after-free warning, and the creation of a new VMID information entry. The patches were cut against Martin's 6.16/scsi-queue tree. Link: https://lore.kernel.org/r/20250425194806.3585-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Copyright updates for 14.4.0.9 patchesJustin Tee
Update copyrights to 2025 for files modified in the 14.4.0.9 patch set. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250425194806.3585-9-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Update lpfc version to 14.4.0.9Justin Tee
Update lpfc version to 14.4.0.9 Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250425194806.3585-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Create lpfc_vmid_info sysfs entryJustin Tee
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 <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250425194806.3585-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Avoid potential ndlp use-after-free in dev_loss_tmo_callbkJustin Tee
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 <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-scsi/41c1d855-9eb5-416f-ac12-8b61929201a3@stanley.mountain/ Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250425194806.3585-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Prevent failure to reregister with NVMe transport after PRLI retryJustin Tee
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 <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250425194806.3585-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Restart eratt_poll timer if HBA_SETUP flag still unsetJustin Tee
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 <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250425194806.3585-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Notify FC transport of rport disappearance during PCI fcn resetJustin Tee
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 <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250425194806.3585-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Fix lpfc_check_sli_ndlp() handling for GEN_REQUEST64 commandsJustin Tee
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 <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250425194806.3585-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: qla4xxx: Remove duplicate struct crb_addr_pairKees Cook
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 <kees@kernel.org> Link: https://lore.kernel.org/r/20250426062010.work.878-kees@kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: qla2xxx: Remove duplicate struct crb_addr_pairKees Cook
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 <kees@kernel.org> Link: https://lore.kernel.org/r/20250426061951.work.272-kees@kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: lpfc: Use secs_to_jiffies() instead of msecs_to_jiffies()Thorsten Blum
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 <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20250428171625.2499-2-thorsten.blum@linux.dev Reviewed-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: dc395x: Remove DEBUG conditional compilationOliver Neukum
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 <oneukum@suse.com> Link: https://lore.kernel.org/r/20250428124345.520137-1-oneukum@suse.com Reviewed-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28scsi: myrb: Fix spelling mistake "statux" -> "status"Colin Ian King
There is a spelling mistake in a dev_err() message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20250422170347.66792-1-colin.i.king@gmail.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-28Merge branch '6.15/scsi-fixes' into 6.16/scsi-stagingMartin K. Petersen
Pull in fixes from 6.15 and resolve a few conflicts so we can have a clean base for UFS patches. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-25Merge tag 'ata-6.15-rc4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux Pull ata fixes from Damien Le Moal: - Fix the incorrect return type of ata_mselect_control_ata_feature() - Several fixes for the control of the Command Duration Limits feature to avoid unnecessary enable and disable actions. Avoiding the unnecessary enable action also avoids unwanted resets of the CDL statistics log page as that is implied for any enable action. - Fix the translation for sensing the control mode page to correctly return the last enable or disable action performed, as defined in SAT-6. This correct mode sense information is used to fix the behavior of the scsi layer to avoid unnecessary mode select command issuing. * tag 'ata-6.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: scsi: Improve CDL control ata: libata-scsi: Improve CDL control ata: libata-scsi: Fix ata_msense_control_ata_feature() ata: libata-scsi: Fix ata_mselect_control_ata_feature() return type
2025-04-23PCI: Add CONFIG_MMU dependencyArnd Bergmann
It turns out that there are no platforms that have PCI but don't have an MMU, so adding a Kconfig dependency on CONFIG_PCI simplifies build testing kernels for those platforms a lot, and avoids a lot of inadvertent build regressions. Add a dependency for CONFIG_PCI and remove all the ones for PCI specific device drivers that are currently marked not having it. There are a few platforms that have an optional MMU, but they usually cannot have PCI at all. The one exception is Coldfire MCF54xx, but this is mainly for historic reasons, and anyone using those chips should really use the MMU these days. Link: https://lore.kernel.org/lkml/a41f1b20-a76c-43d8-8c36-f12744327a54@app.fastmail.com/ Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> # SCSI Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20250423202215.3315550-1-arnd@kernel.org
2025-04-22scsi: Improve CDL controlDamien Le Moal
With ATA devices supporting the CDL feature, using CDL requires that the feature be enabled with a SET FEATURES command. This command is issued as the translated command for the MODE SELECT command issued by scsi_cdl_enable() when the user enables CDL through the device cdl_enable sysfs attribute. However, the implementation of scsi_cdl_enable() always issues a MODE SELECT command for ATA devices when the enable argument is true, even if CDL is already enabled on the device. While this does not cause any issue with using CDL descriptors with read/write commands (the CDL feature will be enabled on the drive), issuing the MODE SELECT command even when the device CDL feature is already enabled will cause a reset of the ATA device CDL statistics log page (as defined in ACS, any CDL enable action must reset the device statistics). Avoid this needless actions (and the implied statistics log page reset) by modifying scsi_cdl_enable() to issue the MODE SELECT command to enable CDL if and only if CDL is not reported as already enabled on the device. And while at it, simplify the initialization of the is_ata boolean variable and move the declaration of the scsi mode data and sense header variables to within the scope of ATA device handling. Fixes: 1b22cfb14142 ("scsi: core: Allow enabling and disabling command duration limits") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Niklas Cassel <cassel@kernel.org> Reviewed-by: Igor Pylypiv <ipylypiv@google.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21Merge patch series "scsi: qedi deadcoding"Martin K. Petersen
linux@treblig.org says: Hi, A couple of deadcode patches for the qdi driver. Build tested only. Dave Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Link: https://lore.kernel.org/r/20250416002235.299347-1-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21Merge patch series "scsi: qla2xxx deadcoding"Martin K. Petersen
linux@treblig.org says: Hi, This is a batch of deadcoding on the qla2xxx driver. Note the last patch removes two unused module parameters, so I guess if anyone has that in some configs somewhere that might surprise them. Other than that, it's all simple function deletion. Build tested only. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-1-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21Merge patch series "hisi_sas: Misc patches and cleanups"Martin K. Petersen
Yihang Li <liyihang9@huawei.com> says: This series contains some minor bugfix and general tidying: - Ignore the soft reset result by calling I_T_nexus after the SATA disk is soft reset - General minor tidying Link: https://lore.kernel.org/r/20250331123349.99591-1-liyihang9@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qedi: Remove unused qedi_get_proto_itt()Dr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250416002235.299347-3-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qedi: Remove unused sysfs functionsDr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250416002235.299347-2-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qla2xxx: Remove unused module parametersDr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-9-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qla2xxx: Remove unused qla2x00_gpsc()Dr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-8-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qla2xxx: Remove unused ql_log_qpDr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-7-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qla2xxx: Remove unused qla82xx_wait_for_state_change()Dr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-6-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qla2xxx: Remove unused qla82xx_pci_region_offset()Dr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-5-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qla2xxx: Remove unused qlt_83xx_iospace_config()Dr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-4-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qla2xxx: Remove unused qlt_fc_port_deleted()Dr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-3-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: qla2xxx: Remove unused qlt_free_qfull_cmds()Dr. David Alan Gilbert
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 <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-2-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: hisi_sas: Wait until error handling is completeYihang Li
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 <liyihang9@huawei.com> Link: https://lore.kernel.org/r/20250414080845.1220997-5-liyihang9@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: hisi_sas: Call I_T_nexus after soft reset for SATA diskYihang Li
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 <liyihang9@huawei.com> Link: https://lore.kernel.org/r/20250414080845.1220997-4-liyihang9@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: hisi_sas: Coding style cleanupYihang Li
Remove superfluous blank lines and symbols. Add spaces around operators. Signed-off-by: Yihang Li <liyihang9@huawei.com> Link: https://lore.kernel.org/r/20250414080845.1220997-3-liyihang9@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: hisi_sas: Use macro instead of magic numberYihang Li
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 <liyihang9@huawei.com> Link: https://lore.kernel.org/r/20250414080845.1220997-2-liyihang9@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: mpi3mr: Fix typo and grammarChelsy Ratnawat
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 <chelsyratnawat2001@gmail.com> Link: https://lore.kernel.org/r/20250419225906.31437-1-chelsyratnawat2001@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: mpi3mr: Add level check to control event loggingRanjan Kumar
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 <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20250415101546.204018-1-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: scsi_transport_fc: Rename del_timer() in commentWangYuli
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 <James.Bottomley@HansenPartnership.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: SCSI SUBSYSTEM <linux-scsi@vger.kernel.org> Cc: linux-kernel@vger.kernel.org Signed-off-by: WangYuli <wangyuli@uniontech.com> Link: https://lore.kernel.org/r/084BD6AB1C4759DA+20250414042629.63019-3-wangyuli@uniontech.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-21scsi: core: Clear flags for scsi_cmnd that did not completeAnastasia Kovaleva
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 <a.kovaleva@yadro.com> Link: https://lore.kernel.org/r/20250324084933.15932-2-a.kovaleva@yadro.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-11scsi: pm80xx: Add __nonstring annotations for unterminated stringsKees Cook
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 <jinpu.wang@cloud.ionos.com> Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook <kees@kernel.org> Link: https://lore.kernel.org/r/20250310222553.work.437-kees@kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-11scsi: mpi3mr: Reset the pending interrupt flagRanjan Kumar
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 <sathya.prakash@broadcom.com> Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com> Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20250411111419.135485-3-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-11scsi: mpi3mr: Fix pending I/O counterRanjan Kumar
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 <sathya.prakash@broadcom.com> Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com> Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20250411111419.135485-2-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-11scsi: lpfc: Use memcpy() for BIOS versionDaniel Wagner
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 <wagi@kernel.org> Link: https://lore.kernel.org/r/20250409-fix-lpfc-bios-str-v1-1-05dac9e51e13@kernel.org Reviewed-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-11scsi: elx: sli4: Replace deprecated strncpy() with strscpy()Thorsten Blum
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 <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20250408102843.804083-2-thorsten.blum@linux.dev Reviewed-by: Kees Cook <kees@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-11scsi: scsi_debug: Add ERASE for tapesKai Mäkisara
The command ERASE(6) for tape devices is added. Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi> Link: https://lore.kernel.org/r/20250310155557.2872-6-Kai.Makisara@kolumbus.fi Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-04-11scsi: scsi_debug: Use scsi_device->type instead os sdebug_ptype where possibleKai Mäkisara
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 <Kai.Makisara@kolumbus.fi> Link: https://lore.kernel.org/r/20250310155557.2872-5-Kai.Makisara@kolumbus.fi Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>