mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
scsi: don't add scsi_device if its already visible
If LLD has added scsi device (by calling scsi_add_device) before scheduling async scsi_scan_host then scsi_finish_async_scan() will end up calling scsi_sysfs_add_sdev for scsi device which was already added by LLD. This patch fixes this issue by skipping the call to scsi_sysfs_add_sdev() if it's already visible to rest of the kernel. Signed-off-by: Subhash Jadavani <[email protected]> Signed-off-by: Dolev Raviv <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
45341ca3fc
commit
693ad5ba13
1 changed files with 3 additions and 0 deletions
|
|
@ -1756,6 +1756,9 @@ static void scsi_sysfs_add_devices(struct Scsi_Host *shost)
|
|||
/* target removed before the device could be added */
|
||||
if (sdev->sdev_state == SDEV_DEL)
|
||||
continue;
|
||||
/* If device is already visible, skip adding it to sysfs */
|
||||
if (sdev->is_visible)
|
||||
continue;
|
||||
if (!scsi_host_scan_allowed(shost) ||
|
||||
scsi_sysfs_add_sdev(sdev) != 0)
|
||||
__scsi_remove_device(sdev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue