Module Name: src
Committed By: jdolecek
Date: Sat Aug 12 22:12:04 UTC 2017
Modified Files:
src/sys/dev/ata [jdolecek-ncq]: atavar.h wd.c
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c siisata.c
Log Message:
do not reset drive after successful NCQ error recovery
To generate a diff of this commit:
cvs rdiff -u -r1.92.8.23 -r1.92.8.24 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.428.2.31 -r1.428.2.32 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.57.6.25 -r1.57.6.26 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.30.4.34 -r1.30.4.35 src/sys/dev/ic/siisata.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ata/atavar.h
diff -u src/sys/dev/ata/atavar.h:1.92.8.23 src/sys/dev/ata/atavar.h:1.92.8.24
--- src/sys/dev/ata/atavar.h:1.92.8.23 Sat Aug 12 14:41:54 2017
+++ src/sys/dev/ata/atavar.h Sat Aug 12 22:12:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: atavar.h,v 1.92.8.23 2017/08/12 14:41:54 jdolecek Exp $ */
+/* $NetBSD: atavar.h,v 1.92.8.24 2017/08/12 22:12:04 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -184,6 +184,7 @@ struct ata_xfer {
#define C_RECOVERY 0x0200 /* executed as part of recovery */
#define C_WAITTIMO 0x0400 /* race vs. timeout */
#define C_CHAOS 0x0800 /* forced error xfer */
+#define C_RECOVERED 0x1000 /* error recovered, no need for reset */
/* reasons for c_kill_xfer() */
#define KILL_GONE 1 /* device is gone while xfer was active */
Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.428.2.31 src/sys/dev/ata/wd.c:1.428.2.32
--- src/sys/dev/ata/wd.c:1.428.2.31 Sun Jul 30 20:16:29 2017
+++ src/sys/dev/ata/wd.c Sat Aug 12 22:12:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.428.2.31 2017/07/30 20:16:29 jdolecek Exp $ */
+/* $NetBSD: wd.c,v 1.428.2.32 2017/08/12 22:12:04 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.31 2017/07/30 20:16:29 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.32 2017/08/12 22:12:04 jdolecek Exp $");
#include "opt_ata.h"
#include "opt_wd.h"
@@ -819,7 +819,8 @@ wddone(device_t self, struct ata_xfer *x
errmsg = "error";
do_perror = 1;
retry: /* Just reset and retry. Can we do more ? */
- (*wd->atabus->ata_reset_drive)(wd->drvp, AT_POLL, NULL);
+ if ((xfer->c_flags & C_RECOVERED) == 0)
+ (*wd->atabus->ata_reset_drive)(wd->drvp, AT_POLL, NULL);
retry2:
mutex_enter(&wd->sc_lock);
Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.57.6.25 src/sys/dev/ic/ahcisata_core.c:1.57.6.26
--- src/sys/dev/ic/ahcisata_core.c:1.57.6.25 Tue Aug 1 22:02:32 2017
+++ src/sys/dev/ic/ahcisata_core.c Sat Aug 12 22:12:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ahcisata_core.c,v 1.57.6.25 2017/08/01 22:02:32 jdolecek Exp $ */
+/* $NetBSD: ahcisata_core.c,v 1.57.6.26 2017/08/12 22:12:04 jdolecek Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.25 2017/08/01 22:02:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57.6.26 2017/08/12 22:12:04 jdolecek Exp $");
#include <sys/types.h>
#include <sys/malloc.h>
@@ -1592,6 +1592,7 @@ ahci_channel_recover(struct ahci_softc *
/* Error out the particular NCQ xfer, then requeue the others */
if ((achp->ahcic_cmds_active & (1 << eslot)) != 0) {
xfer = ata_queue_hwslot_to_xfer(chp, eslot);
+ xfer->c_flags |= C_RECOVERED;
xfer->c_intr(chp, xfer,
(err << AHCI_P_TFD_ERR_SHIFT) | st);
}
Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.34 src/sys/dev/ic/siisata.c:1.30.4.35
--- src/sys/dev/ic/siisata.c:1.30.4.34 Fri Aug 11 18:20:13 2017
+++ src/sys/dev/ic/siisata.c Sat Aug 12 22:12:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.34 2017/08/11 18:20:13 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.35 2017/08/12 22:12:04 jdolecek Exp $ */
/* from ahcisata_core.c */
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.34 2017/08/11 18:20:13 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.35 2017/08/12 22:12:04 jdolecek Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -653,6 +653,7 @@ siisata_channel_recover(struct ata_chann
/* Error out the particular NCQ xfer, then requeue the others */
if ((schp->sch_active_slots & (1 << eslot)) != 0) {
xfer = ata_queue_hwslot_to_xfer(chp, eslot);
+ xfer->c_flags |= C_RECOVERED;
xfer->c_intr(chp, xfer, ATACH_ERR_ST(err, st));
}
break;