Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Nov 2019 03:06:03 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354579 - head/sys/arm/broadcom/bcm2835
Message-ID:  <201911100306.xAA363xI036949@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Sun Nov 10 03:06:03 2019
New Revision: 354579
URL: https://svnweb.freebsd.org/changeset/base/354579

Log:
  bcm2835_sdhci: don't panic in DMA interrupt if curcmd went away
  
  This is an exceptional case; generally found during controller errors.
  A panic when we attempt to acess slot->curcmd->data is less ideal than
  warning, and other verbiage will be emitted to indicate the exact error.

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Sun Nov 10 02:31:29 2019	(r354578)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Sun Nov 10 03:06:03 2019	(r354579)
@@ -570,6 +570,13 @@ bcm_sdhci_dma_intr(int ch, void *arg)
 
 	mtx_lock(&slot->mtx);
 
+	if (slot->curcmd == NULL) {
+		mtx_unlock(&slot->mtx);
+		device_printf(sc->sc_dev,
+		    "command aborted in the middle of DMA\n");
+		return;
+	}
+
 	/*
 	 * If there are more segments for the current dma, start the next one.
 	 * Otherwise unload the dma map and decide what to do next based on the



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911100306.xAA363xI036949>