diff options
author | Robert Hancock <hancockr@shaw.ca> | 2007-02-22 00:53:03 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-23 05:37:11 -0500 |
commit | 2a54cf76d1066d5aadfac65c8455426df80322f4 (patch) | |
tree | a42e8fa19a774a5853d7e15b6bb1a48327a0698a /drivers | |
parent | 32d90911568f67fad3f73623e106667a37c6e7ed (diff) |
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')
-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) | |||
740 | DPRINTK("Completing qc from tag %d with err_mask %u\n",cpb_num, | 740 | DPRINTK("Completing qc from tag %d with err_mask %u\n",cpb_num, |
741 | qc->err_mask); | 741 | qc->err_mask); |
742 | ata_qc_complete(qc); | 742 | ata_qc_complete(qc); |
743 | } else { | ||
744 | struct ata_eh_info *ehi = &ap->eh_info; | ||
745 | /* Notifier bits set without a command may indicate the drive | ||
746 | is misbehaving. Raise host state machine violation on this | ||
747 | condition. */ | ||
748 | ata_port_printk(ap, KERN_ERR, "notifier for tag %d with no command?\n", | ||
749 | cpb_num); | ||
750 | ehi->err_mask |= AC_ERR_HSM; | ||
751 | ehi->action |= ATA_EH_SOFTRESET; | ||
752 | ata_port_freeze(ap); | ||
753 | return 1; | ||
743 | } | 754 | } |
744 | } | 755 | } |
745 | return 0; | 756 | return 0; |