Module Name:    src
Committed By:   jmcneill
Date:           Fri Jun  3 10:34:03 UTC 2016

Modified Files:
        src/sys/dev/ic: ahcisata_core.c

Log Message:
PR kern/51211: atactl atabus0 reset causes a panic on Tegra K1

Fix an issue where ahci_reset_channel calls ahci_channel_start with clo=1
even if CAP.SCLO=0.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/ic/ahcisata_core.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/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.56 src/sys/dev/ic/ahcisata_core.c:1.57
--- src/sys/dev/ic/ahcisata_core.c:1.56	Mon May  2 19:18:29 2016
+++ src/sys/dev/ic/ahcisata_core.c	Fri Jun  3 10:34:03 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.56 2016/05/02 19:18:29 christos Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.57 2016/06/03 10:34:03 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.56 2016/05/02 19:18:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.57 2016/06/03 10:34:03 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -828,7 +828,8 @@ ahci_reset_channel(struct ata_channel *c
 	/* clear port interrupt register */
 	AHCI_WRITE(sc, AHCI_P_IS(chp->ch_channel), 0xffffffff);
 	/* clear SErrors and start operations */
-	ahci_channel_start(sc, chp, flags, 1);
+	ahci_channel_start(sc, chp, flags,
+	    (sc->sc_ahci_cap & AHCI_CAP_CLO) ? 1 : 0);
 	/* wait 31s for BSY to clear */
 	for (i = 0; i <AHCI_RST_WAIT; i++) {
 		tfd = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel));

Reply via email to