diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-23 05:28:35 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2007-03-23 05:28:35 +0000 |
commit | 0c5f68efcc2fce1d20910e8f67ba9780b48ad212 (patch) | |
tree | 3d5d282a8a45a53dde2dc0190d828354174e16d2 /sys/dev/pci | |
parent | 2ababa6ddad708c439031bd8e213cbe0412414c3 (diff) |
Track the ATA xfer's state more closely - may help us identify why some
are seeing a panic at halt time.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/ahci.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c index b26ff882566..2f1a6f2a308 100644 --- a/sys/dev/pci/ahci.c +++ b/sys/dev/pci/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.96 2007/03/22 05:15:39 pascoe Exp $ */ +/* $OpenBSD: ahci.c,v 1.97 2007/03/23 05:28:34 pascoe Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -895,6 +895,7 @@ nomem: ccb->ccb_xa.ata_put_xfer = ahci_ata_put_xfer; + ccb->ccb_xa.state = ATA_S_COMPLETE; ahci_put_ccb(ccb); } @@ -1174,6 +1175,7 @@ err: ahci_port_stop(ap, 0); } s = splbio(); + ccb->ccb_xa.state = ATA_S_ERROR; ahci_put_ccb(ccb); splx(s); } @@ -1746,6 +1748,16 @@ ahci_put_ccb(struct ahci_ccb *ccb) { struct ahci_port *ap = ccb->ccb_port; +#ifdef DIAGNOSTIC + if (ccb->ccb_xa.state != ATA_S_COMPLETE && + ccb->ccb_xa.state != ATA_S_TIMEOUT && + ccb->ccb_xa.state != ATA_S_ERROR) { + printf("%s: invalid ata_xfer state %02x in ahci_put_ccb, " + "slot %d\n", PORTNAME(ccb->ccb_port), ccb->ccb_xa.state, + ccb->ccb_slot); + } +#endif + ccb->ccb_xa.state = ATA_S_PUT; TAILQ_INSERT_TAIL(&ap->ap_ccb_free, ccb, ccb_entry); } |