diff options
author | Tejun Heo <htejun@gmail.com> | 2007-02-20 09:27:06 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-21 04:58:18 -0500 |
commit | fcf1bf1584647f9fd864c193fee81840c4c5ce41 (patch) | |
tree | 6271f12b805d57edcb4ba908149c02e754c348e0 /drivers | |
parent | 6d1245bf294e9ea65b3717be9fa0338bfb6ff6c9 (diff) |
libata: fix ata_scmd_need_defer()
Fix ata_scmd_need_defer() such that...
* whether NCQ is used or not is exactly determined using the same
criteria as the issue path.
* defer-check is performed in all cases.
This fixes race condition where turning off NCQ on the fly causes
non-NCQ commands sneak into NCQ phase.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-scsi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 7bb782b5ce0c..aa6cb6dcec41 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1496,11 +1496,9 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | |||
1496 | static int ata_scmd_need_defer(struct ata_device *dev, int is_io) | 1496 | static int ata_scmd_need_defer(struct ata_device *dev, int is_io) |
1497 | { | 1497 | { |
1498 | struct ata_port *ap = dev->ap; | 1498 | struct ata_port *ap = dev->ap; |
1499 | int is_ncq = is_io && ata_ncq_enabled(dev); | ||
1499 | 1500 | ||
1500 | if (!(dev->flags & ATA_DFLAG_NCQ)) | 1501 | if (is_ncq) { |
1501 | return 0; | ||
1502 | |||
1503 | if (is_io) { | ||
1504 | if (!ata_tag_valid(ap->active_tag)) | 1502 | if (!ata_tag_valid(ap->active_tag)) |
1505 | return 0; | 1503 | return 0; |
1506 | } else { | 1504 | } else { |