Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ata Don't assert channel lock in polled mode.



details:   https://anonhg.NetBSD.org/src/rev/7ab5344bceb8
branches:  trunk
changeset: 356687:7ab5344bceb8
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Oct 08 04:52:33 2017 +0000

description:
Don't assert channel lock in polled mode.

ahcisata (and maybe others) use ata_delay during initialization where
lock isn't taken.

diffstat:

 sys/dev/ata/ata.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r e3b52e7589f3 -r 7ab5344bceb8 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Sun Oct 08 03:39:50 2017 +0000
+++ b/sys/dev/ata/ata.c Sun Oct 08 04:52:33 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ata.c,v 1.133 2017/10/07 16:05:32 jdolecek Exp $       */
+/*     $NetBSD: ata.c,v 1.134 2017/10/08 04:52:33 mlelstv 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.133 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.134 2017/10/08 04:52:33 mlelstv Exp $");
 
 #include "opt_ata.h"
 
@@ -2503,7 +2503,6 @@
 void
 ata_delay(struct ata_channel *chp, int ms, const char *msg, int flags)
 {
-       KASSERT(mutex_owned(&chp->ch_lock));
 
        if ((flags & (AT_WAIT | AT_POLL)) == AT_POLL) {
                /*
@@ -2513,6 +2512,8 @@
                delay(ms * 1000);
        } else {
                int pause = mstohz(ms);
+
+               KASSERT(mutex_owned(&chp->ch_lock));
                kpause(msg, false, pause > 0 ? pause : 1, &chp->ch_lock);
        }
 }



Home | Main Index | Thread Index | Old Index