Module Name:    src
Committed By:   mlelstv
Date:           Sun Oct  8 04:52:33 UTC 2017

Modified Files:
        src/sys/dev/ata: ata.c

Log Message:
Don't assert channel lock in polled mode.

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


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/dev/ata/ata.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/ata.c
diff -u src/sys/dev/ata/ata.c:1.133 src/sys/dev/ata/ata.c:1.134
--- src/sys/dev/ata/ata.c:1.133	Sat Oct  7 16:05:32 2017
+++ src/sys/dev/ata/ata.c	Sun Oct  8 04:52:33 2017
@@ -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 @@ atabus_rescan(device_t self, const char 
 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 @@ ata_delay(struct ata_channel *chp, int m
 		delay(ms * 1000);
 	} else {
 		int pause = mstohz(ms);
+
+		KASSERT(mutex_owned(&chp->ch_lock));
 		kpause(msg, false, pause > 0 ? pause : 1, &chp->ch_lock);
 	}
 }

Reply via email to