]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: Fix sas_user_scan() to handle wildcard and multi-channel scans
authorRanjan Kumar <ranjan.kumar@broadcom.com>
Tue, 24 Jun 2025 06:16:49 +0000 (11:46 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Jul 2025 02:00:43 +0000 (22:00 -0400)
commit37c4e72b0651e7697eb338cd1fb09feef472cc1a
tree9dd87ea1f1b409793bfc0eb003067f862d636256
parent6e0f6aa44b68335df404a2df955055f416b5f2aa
scsi: Fix sas_user_scan() to handle wildcard and multi-channel scans

sas_user_scan() did not fully process wildcard channel scans
(SCAN_WILD_CARD) when a transport-specific user_scan() callback was
present. Only channel 0 would be scanned via user_scan(), while the
remaining channels were skipped, potentially missing devices.

user_scan() invokes updated sas_user_scan() for channel 0, and if
successful, iteratively scans remaining channels (1 to
shost->max_channel) via scsi_scan_host_selected().  This ensures complete
wildcard scanning without affecting transport-specific scanning behavior.

Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Link: https://lore.kernel.org/r/20250624061649.17990-1-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_transport_sas.c