From 25f2541adca2938e1554b126a87677911dd05257 Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Sun, 5 Mar 2017 09:55:17 +0000 Subject: When we're unable to determine which NCQ command failed, fail all active commands rather than proceeding to an assertion failure. This matches how we handle the same condition with non-queued commands, and the behaviour of every other ahci driver I can find. Add a printf there so we might get some idea of how often this condition arises and what happens afterwards. ok dlg@ --- sys/dev/ic/ahci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index d600f3eff3a..699e482d71b 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.28 2016/10/02 18:56:05 patrick Exp $ */ +/* $OpenBSD: ahci.c,v 1.29 2017/03/05 09:55:16 jmatthew Exp $ */ /* * Copyright (c) 2006 David Gwynne @@ -2158,6 +2158,12 @@ ahci_port_intr(struct ahci_port *ap, u_int32_t ci_mask) PORTNAME(ap), err_slot); ccb = &ap->ap_ccbs[err_slot]; + if (ccb->ccb_xa.state != ATA_S_ONCHIP) { + printf("%s: NCQ errored slot %d is idle" + " (%08x active)\n", PORTNAME(ap), err_slot, + ci_saved); + goto failall; + } } else { /* Didn't reset, could gather extended info from log. */ } -- cgit v1.2.3