Commit dc318958 authored by Jeff Garzik's avatar Jeff Garzik

[libata] use scsi host lock

In 2.4 we release io_request_lock and take our own per-host lock,
in the ->queuecommand() hook.  In 2.6, the SCSI layer provides a
useful to simply use the lock we already have, via scsi_assign_lock().
parent 2932b498
...@@ -2864,6 +2864,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, ...@@ -2864,6 +2864,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
host->unique_id = ata_unique_id++; host->unique_id = ata_unique_id++;
host->max_cmd_len = 12; host->max_cmd_len = 12;
scsi_set_device(host, &ent->pdev->dev); scsi_set_device(host, &ent->pdev->dev);
scsi_assign_lock(host, &host_set->lock);
ap->flags = ATA_FLAG_PORT_DISABLED; ap->flags = ATA_FLAG_PORT_DISABLED;
ap->id = host->unique_id; ap->id = host->unique_id;
......
...@@ -970,9 +970,6 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -970,9 +970,6 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
0; 0;
#endif #endif
/* Note: spin_lock_irqsave is held by caller... */
spin_unlock(cmd->device->host->host_lock);
ap = (struct ata_port *) &cmd->device->host->hostdata[0]; ap = (struct ata_port *) &cmd->device->host->hostdata[0];
DPRINTK("CDB (%u:%d,%d,%d) %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", DPRINTK("CDB (%u:%d,%d,%d) %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
...@@ -990,8 +987,6 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -990,8 +987,6 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
goto out; goto out;
} }
spin_lock(&ap->host_set->lock);
dev = &ap->device[cmd->device->id]; dev = &ap->device[cmd->device->id];
if (!ata_dev_present(dev)) { if (!ata_dev_present(dev)) {
...@@ -1105,10 +1100,8 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -1105,10 +1100,8 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
break; break;
} }
out_unlock: out_unlock: /* I will kill this soon... reduces 2.4 diff */
spin_unlock(&ap->host_set->lock);
out: out:
spin_lock(cmd->device->host->host_lock);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment