aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-scsi.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 45a49be65042..32c1df69091b 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -3005,14 +3005,16 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3005} 3005}
3006 3006
3007/** 3007/**
3008 * ata_scsi_dev_rescan - initiate scsi_rescan_device() 3008 * ata_scsi_dev_rescan - initiate scsi_rescan_device()
3009 * @data: Pointer to ATA port to perform scsi_rescan_device() 3009 * @data: Pointer to ATA port to perform scsi_rescan_device()
3010 * 3010 *
3011 * After ATA pass thru (SAT) commands are executed successfully, 3011 * After ATA pass thru (SAT) commands are executed successfully,
3012 * libata need to propagate the changes to SCSI layer. 3012 * libata need to propagate the changes to SCSI layer. This
3013 * function must be executed from ata_aux_wq such that sdev
3014 * attach/detach don't race with rescan.
3013 * 3015 *
3014 * LOCKING: 3016 * LOCKING:
3015 * Kernel thread context (may sleep). 3017 * Kernel thread context (may sleep).
3016 */ 3018 */
3017void ata_scsi_dev_rescan(void *data) 3019void ata_scsi_dev_rescan(void *data)
3018{ 3020{
@@ -3023,8 +3025,7 @@ void ata_scsi_dev_rescan(void *data)
3023 for (i = 0; i < ATA_MAX_DEVICES; i++) { 3025 for (i = 0; i < ATA_MAX_DEVICES; i++) {
3024 dev = &ap->device[i]; 3026 dev = &ap->device[i];
3025 3027
3026 if (ata_dev_enabled(dev)) 3028 if (ata_dev_enabled(dev) && dev->sdev)
3027 scsi_rescan_device(&(dev->sdev->sdev_gendev)); 3029 scsi_rescan_device(&(dev->sdev->sdev_gendev));
3028 } 3030 }
3029} 3031}
3030