Source-Changes-HG archive

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

[src/jdolecek-ncq]: src/sys/dev/ic fix condition for switching to kernel thre...



details:   https://anonhg.NetBSD.org/src/rev/8613a5466244
branches:  jdolecek-ncq
changeset: 822995:8613a5466244
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Aug 12 09:38:58 2017 +0000

description:
fix condition for switching to kernel thread for ATAPI and bio reset recovery
to match atapi_wdc.c, __wdcwait() postpones to the thread whenever neither
AT_POLL nor AT_WAIT flags are present

fixes spurious 'timeout' for the command on mvsata, followed by 'unexpected'
interrupt

diffstat:

 sys/dev/ic/mvsata.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 6e98c62f2d7c -r 8613a5466244 sys/dev/ic/mvsata.c
--- a/sys/dev/ic/mvsata.c       Fri Aug 11 18:20:13 2017 +0000
+++ b/sys/dev/ic/mvsata.c       Sat Aug 12 09:38:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mvsata.c,v 1.35.6.18 2017/06/28 19:59:36 jdolecek Exp $        */
+/*     $NetBSD: mvsata.c,v 1.35.6.19 2017/08/12 09:38:58 jdolecek Exp $        */
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.35.6.18 2017/06/28 19:59:36 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.35.6.19 2017/08/12 09:38:58 jdolecek Exp $");
 
 #include "opt_mvsata.h"
 
@@ -1222,7 +1222,8 @@
                         * If it's not a polled command, we need the kernel
                         * thread
                         */
-                       if ((xfer->c_flags & C_POLL) == 0 && cpu_intr_p()) {
+                       if ((xfer->c_flags & C_POLL) == 0 &&
+                           (chp->ch_flags & ATACH_TH_RUN) == 0) {
                                ata_channel_freeze(chp);
                                wakeup(&chp->ch_thread);
                                return;
@@ -1910,7 +1911,8 @@
        /* Do control operations specially. */
        if (__predict_false(drvp->state < READY)) {
                /* If it's not a polled command, we need the kernel thread */
-               if ((sc_xfer->xs_control & XS_CTL_POLL) == 0 && cpu_intr_p()) {
+               if ((sc_xfer->xs_control & XS_CTL_POLL) == 0 &&
+                   (chp->ch_flags & ATACH_TH_RUN) == 0) {
                        ata_channel_freeze(chp);
                        wakeup(&chp->ch_thread);
                        return;



Home | Main Index | Thread Index | Old Index