diff options
author | James Bottomley <James.Bottomley@suse.de> | 2011-01-23 09:30:00 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-13 14:16:24 -0500 |
commit | b8784f77455124ceb4746e798f7aaf5b3b8a5406 (patch) | |
tree | 54e2681157bc050d5f3fed9c27b3c6209478d6b7 /drivers/ata | |
parent | 1f723867e650e5e021445eea34fddeffca9c4faa (diff) |
[SCSI] libata: fix locking for sas paths
For historical reasons, libsas uses the scsi host lock as the ata port
lock, and libata always uses the ata host. For the old eh, this was
largely irrelevant since the two locks were never mixed inside the
code. However, the new eh has a case where it nests acquisition of
the host lock inside the port lock (this does look rather deadlock
prone). Obviously this would be an instant deadlock if the port lock
were the host lock, so switch the libsas paths to use the ata host
lock as well.
Cc: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 897066761359..b935f3a2b010 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -3747,7 +3747,7 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host, | |||
3747 | return NULL; | 3747 | return NULL; |
3748 | 3748 | ||
3749 | ap->port_no = 0; | 3749 | ap->port_no = 0; |
3750 | ap->lock = shost->host_lock; | 3750 | ap->lock = &host->lock; |
3751 | ap->pio_mask = port_info->pio_mask; | 3751 | ap->pio_mask = port_info->pio_mask; |
3752 | ap->mwdma_mask = port_info->mwdma_mask; | 3752 | ap->mwdma_mask = port_info->mwdma_mask; |
3753 | ap->udma_mask = port_info->udma_mask; | 3753 | ap->udma_mask = port_info->udma_mask; |