sas_ata: satisfy libata qc function locking requirements
Subsystems (2)
PATCH 1/1 sas_ata: satisfy libata qc function locking requirements
ata_qc_complete and ata_sas_queuecmd require that the port lock be held when they are called. sas_ata doesn't do this, leading to BUG messages about qc tags newly allocated qc tags already being in use. This patch fixes the locking, which should clean up the rest of those messages.
So far I've tested this against an IBM x206m with two SATA disks with no BUG messages and no other signs of things going wrong, and the machine finally passed the pounder stress test. The patch is against jejb's aic94xx-sas tree.
--
drivers/scsi/libsas/sas_ata.c +4 -0
@@ -92,6 +92,7 @@ static void sas_ata_task_done(struct sasstruct task_status_struct *stat = &task->task_status;struct ata_task_resp *resp = (struct ata_task_resp *)stat->buf;enum ata_completion_errors ac; +unsigned long flags;if (stat->stat ==SAS_PROTO_RESPONSE ) {ata_tf_from_fis (resp->ending_fis, &dev->sata_dev.tf);
@@ -112,7 +113,10 @@ static void sas_ata_task_done(struct sas } } +spin_lock_irqsave (dev->sata_dev.ap->lock, flags);ata_qc_complete (qc); +spin_unlock_irqrestore (dev->sata_dev.ap->lock, flags); +list_del_init (&task->list);sas_free_task (task); }
drivers/scsi/libsas/sas_scsi_host.c +4 -0
@@ -212,8 +212,12 @@ int sas_queuecommand(struct scsi_cmnd *cstruct sas_task *task;if (dev_is_sata (dev)) { +unsigned long flags; + +spin_lock_irqsave (dev->sata_dev.ap->lock, flags); res =ata_sas_queuecmd (cmd, scsi_done, dev->sata_dev.ap); +spin_unlock_irqrestore (dev->sata_dev.ap->lock, flags); goto out; }
Quoted 5 lines · Darrick J. Wong
ata_qc_completeandata_sas_queuecmdrequire that the port lock be held when they are called.sas_atadoesn't do this, leading to BUG messages about qc tags newly allocated qc tags already being in use. This patch fixes the locking, which should clean up the rest of those messages.
Quoted 8 lines
So far I've tested this against an IBM x206m with two SATA disks with no BUG messages and no other signs of things going wrong, and the machine finally passed the pounder stress test. The patch is against jejb's aic94xx-sas tree.
--
Signed-off-by Darrick J. Wong <[email protected]>
heh, yeah, proper locking helps :)
Glad to hear the progress. Adaptec just sent me a cable that will allow me to use my Razor card as a SATA controller, so I can finally start testing that.
Jeff