From d678a7e4d752ebe4563d3aed0fd65ad62ecb8386 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Fri, 3 Jun 2016 10:34:03 +0000 Subject: 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. --- sys/dev/ic/ahcisata_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ic/ahcisata_core.c b/sys/dev/ic/ahcisata_core.c index 96970d6f44b..8c4c8db2df7 100644 --- a/sys/dev/ic/ahcisata_core.c +++ b/sys/dev/ic/ahcisata_core.c @@ -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 -__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 #include @@ -828,7 +828,8 @@ ahci_reset_channel(struct ata_channel *chp, int flags) /* 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 ch_channel)); -- cgit