Skip to contentSkip to conversation

sata_nv: complain on spurious completion notifiers

PATCH Applied Robert Hancock 3 participants 3 messages Feb 22, 2007 – Feb 23, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

drivers/ata/sata_nv.c renamed from drivers/ata/sata_nv.c.prev +0 -0
@@ -740,6 +740,17 @@ static int nv_adma_check_cpb(struct ata_
			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;
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Robert Hancock

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.

Signature · 1 line
tejun
Applied
#2 lore raw
In reply to Robert Hancock
Quoted 7 lines · Robert Hancock

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.

applied