aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@suse.de>2011-01-23 09:30:00 -0500
committerJeff Garzik <jgarzik@redhat.com>2011-03-02 02:36:45 -0500
commita29b5dad46ee4168c8fc18e47dabbde49790527b (patch)
tree8d0c2a11487a485ebf719cebb9af9b12423bf439 /drivers/ata/libata-scsi.c
parent238c9cf9ea88bbbb9fd0f60c2cc9511c10b4585c (diff)
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. Signed-off-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index e6ce765534ac..c11675f34b93 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3759,7 +3759,7 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host,
3759 return NULL; 3759 return NULL;
3760 3760
3761 ap->port_no = 0; 3761 ap->port_no = 0;
3762 ap->lock = shost->host_lock; 3762 ap->lock = &host->lock;
3763 ap->pio_mask = port_info->pio_mask; 3763 ap->pio_mask = port_info->pio_mask;
3764 ap->mwdma_mask = port_info->mwdma_mask; 3764 ap->mwdma_mask = port_info->mwdma_mask;
3765 ap->udma_mask = port_info->udma_mask; 3765 ap->udma_mask = port_info->udma_mask;