aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index a54273d2c3c6..d75c9c479d1a 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3435,7 +3435,7 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
3435 " switching to async\n"); 3435 " switching to async\n");
3436 } 3436 }
3437 3437
3438 queue_delayed_work(ata_aux_wq, &ap->hotplug_task, 3438 queue_delayed_work(system_long_wq, &ap->hotplug_task,
3439 round_jiffies_relative(HZ)); 3439 round_jiffies_relative(HZ));
3440} 3440}
3441 3441
@@ -3582,6 +3582,7 @@ void ata_scsi_hotplug(struct work_struct *work)
3582 } 3582 }
3583 3583
3584 DPRINTK("ENTER\n"); 3584 DPRINTK("ENTER\n");
3585 mutex_lock(&ap->scsi_scan_mutex);
3585 3586
3586 /* Unplug detached devices. We cannot use link iterator here 3587 /* Unplug detached devices. We cannot use link iterator here
3587 * because PMP links have to be scanned even if PMP is 3588 * because PMP links have to be scanned even if PMP is
@@ -3595,6 +3596,7 @@ void ata_scsi_hotplug(struct work_struct *work)
3595 /* scan for new ones */ 3596 /* scan for new ones */
3596 ata_scsi_scan_host(ap, 0); 3597 ata_scsi_scan_host(ap, 0);
3597 3598
3599 mutex_unlock(&ap->scsi_scan_mutex);
3598 DPRINTK("EXIT\n"); 3600 DPRINTK("EXIT\n");
3599} 3601}
3600 3602
@@ -3673,9 +3675,7 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
3673 * @work: Pointer to ATA port to perform scsi_rescan_device() 3675 * @work: Pointer to ATA port to perform scsi_rescan_device()
3674 * 3676 *
3675 * After ATA pass thru (SAT) commands are executed successfully, 3677 * After ATA pass thru (SAT) commands are executed successfully,
3676 * libata need to propagate the changes to SCSI layer. This 3678 * libata need to propagate the changes to SCSI layer.
3677 * function must be executed from ata_aux_wq such that sdev
3678 * attach/detach don't race with rescan.
3679 * 3679 *
3680 * LOCKING: 3680 * LOCKING:
3681 * Kernel thread context (may sleep). 3681 * Kernel thread context (may sleep).
@@ -3688,6 +3688,7 @@ void ata_scsi_dev_rescan(struct work_struct *work)
3688 struct ata_device *dev; 3688 struct ata_device *dev;
3689 unsigned long flags; 3689 unsigned long flags;
3690 3690
3691 mutex_lock(&ap->scsi_scan_mutex);
3691 spin_lock_irqsave(ap->lock, flags); 3692 spin_lock_irqsave(ap->lock, flags);
3692 3693
3693 ata_for_each_link(link, ap, EDGE) { 3694 ata_for_each_link(link, ap, EDGE) {
@@ -3707,6 +3708,7 @@ void ata_scsi_dev_rescan(struct work_struct *work)
3707 } 3708 }
3708 3709
3709 spin_unlock_irqrestore(ap->lock, flags); 3710 spin_unlock_irqrestore(ap->lock, flags);
3711 mutex_unlock(&ap->scsi_scan_mutex);
3710} 3712}
3711 3713
3712/** 3714/**