Source-Changes-HG archive

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

[src/jdolecek-ncq]: src/sys/dev/ata explicitly do not try to activate any fur...



details:   https://anonhg.NetBSD.org/src/rev/09e343c49c65
branches:  jdolecek-ncq
changeset: 352756:09e343c49c65
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Aug 15 11:21:32 2017 +0000

description:
explicitly do not try to activate any further commands when running recovery
xfer; it was kind of implied since the code would not queue another non-NCQ
command when non-NCQ command is active, but this is better for readibility

diffstat:

 sys/dev/ata/ata.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r 1f76041dd116 -r 09e343c49c65 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Sun Aug 13 15:12:04 2017 +0000
+++ b/sys/dev/ata/ata.c Tue Aug 15 11:21:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ata.c,v 1.132.8.28 2017/08/12 22:31:50 jdolecek Exp $  */
+/*     $NetBSD: ata.c,v 1.132.8.29 2017/08/15 11:21:32 jdolecek Exp $  */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.28 2017/08/12 22:31:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.29 2017/08/15 11:21:32 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -1249,7 +1249,7 @@
        struct atac_softc *atac = chp->ch_atac;
        struct ata_queue *chq = chp->ch_queue;
        struct ata_xfer *xfer, *axfer;
-       bool immediate;
+       bool recovery;
 
 #ifdef ATA_DEBUG
        int spl1, spl2;
@@ -1276,10 +1276,10 @@
        if ((xfer = TAILQ_FIRST(&chp->ch_queue->queue_xfer)) == NULL)
                goto out;
 
-       immediate = ISSET(xfer->c_flags, C_RECOVERY);
+       recovery = ISSET(xfer->c_flags, C_RECOVERY);
 
        /* is the queue frozen? */
-       if (__predict_false(!immediate && chq->queue_freeze > 0)) {
+       if (__predict_false(!recovery && chq->queue_freeze > 0)) {
                if (chq->queue_flags & QF_IDLE_WAIT) {
                        chq->queue_flags &= ~QF_IDLE_WAIT;
                        wakeup(&chq->queue_flags);
@@ -1298,7 +1298,7 @@
         * Need only check first xfer.
         * XXX FIS-based switching - revisit
         */
-       if (!immediate && (axfer = TAILQ_FIRST(&chp->ch_queue->active_xfers))) {
+       if (!recovery && (axfer = TAILQ_FIRST(&chp->ch_queue->active_xfers))) {
                if (!ISSET(xfer->c_flags, C_NCQ) ||
                    !ISSET(axfer->c_flags, C_NCQ) ||
                    xfer->c_drive != axfer->c_drive)
@@ -1344,8 +1344,8 @@
         */
        xfer->c_start(chp, xfer);
 
-       /* Queue more commands if possible */
-       if (chq->queue_active < chq->queue_openings)
+       /* Queue more commands if possible, but not during recovery */
+       if (!recovery && chq->queue_active < chq->queue_openings)
                goto again;
 
        return;



Home | Main Index | Thread Index | Old Index