diff options
author | Robert Hancock <hancockr@shaw.ca> | 2007-02-21 23:53:03 -0600 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-23 05:37:11 -0500 |
commit | 2a54cf76d1066d5aadfac65c8455426df80322f4 (patch) | |
tree | a42e8fa19a774a5853d7e15b6bb1a48327a0698a /drivers/ata | |
parent | 32d90911568f67fad3f73623e106667a37c6e7ed (diff) | |
download | talos-op-linux-2a54cf76d1066d5aadfac65c8455426df80322f4.tar.gz talos-op-linux-2a54cf76d1066d5aadfac65c8455426df80322f4.zip |
sata_nv: complain on spurious completion notifiers
Recently Tejun wrote a patch to ahci.c to make it raise a HSM violation
if the drive attempted to complete a tag that wasn't outstanding. We could
run into the same problem with sata_nv ADMA. This adds code to raise a HSM
violation error if the controller gives us a notifier tag that isn't
outstanding, since the drive may be issuing spurious completions.
Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/sata_nv.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 4d9357caa1ac..783281ec28c6 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c @@ -740,6 +740,17 @@ static int nv_adma_check_cpb(struct ata_port *ap, int cpb_num, int force_err) DPRINTK("Completing qc from tag %d with err_mask %u\n",cpb_num, qc->err_mask); ata_qc_complete(qc); + } else { + struct ata_eh_info *ehi = &ap->eh_info; + /* Notifier bits set without a command may indicate the drive + is misbehaving. Raise host state machine violation on this + condition. */ + ata_port_printk(ap, KERN_ERR, "notifier for tag %d with no command?\n", + cpb_num); + ehi->err_mask |= AC_ERR_HSM; + ehi->action |= ATA_EH_SOFTRESET; + ata_port_freeze(ap); + return 1; } } return 0; |