Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/jdolecek-ncq]: src/sys/dev do not reset drive after successful NCQ error...



details:   https://anonhg.NetBSD.org/src/rev/0341f4195098
branches:  jdolecek-ncq
changeset: 823000:0341f4195098
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Aug 12 22:12:04 2017 +0000

description:
do not reset drive after successful NCQ error recovery

diffstat:

 sys/dev/ata/atavar.h       |  3 ++-
 sys/dev/ata/wd.c           |  7 ++++---
 sys/dev/ic/ahcisata_core.c |  5 +++--
 sys/dev/ic/siisata.c       |  5 +++--
 4 files changed, 12 insertions(+), 8 deletions(-)

diffs (97 lines):

diff -r cd23e853a326 -r 0341f4195098 sys/dev/ata/atavar.h
--- a/sys/dev/ata/atavar.h      Sat Aug 12 15:08:38 2017 +0000
+++ b/sys/dev/ata/atavar.h      Sat Aug 12 22:12:04 2017 +0000
@@ -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 @@
 #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 */
diff -r cd23e853a326 -r 0341f4195098 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Sat Aug 12 15:08:38 2017 +0000
+++ b/sys/dev/ata/wd.c  Sat Aug 12 22:12:04 2017 +0000
@@ -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 @@
                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);
 
diff -r cd23e853a326 -r 0341f4195098 sys/dev/ic/ahcisata_core.c
--- a/sys/dev/ic/ahcisata_core.c        Sat Aug 12 15:08:38 2017 +0000
+++ b/sys/dev/ic/ahcisata_core.c        Sat Aug 12 22:12:04 2017 +0000
@@ -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 @@
                /* 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);
                }
diff -r cd23e853a326 -r 0341f4195098 sys/dev/ic/siisata.c
--- a/sys/dev/ic/siisata.c      Sat Aug 12 15:08:38 2017 +0000
+++ b/sys/dev/ic/siisata.c      Sat Aug 12 22:12:04 2017 +0000
@@ -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 @@
                /* 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;



Home | Main Index | Thread Index | Old Index