From owner-dev-commits-src-main@freebsd.org Tue Sep 21 13:09:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78035672F28; Tue, 21 Sep 2021 13:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HDMGT2yBNz4fms; Tue, 21 Sep 2021 13:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45C88246D4; Tue, 21 Sep 2021 13:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18LD9rOi082710; Tue, 21 Sep 2021 13:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LD9rIR082709; Tue, 21 Sep 2021 13:09:53 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:09:53 GMT Message-Id: <202109211309.18LD9rIR082709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 806ebc9eba2a - main - bcm2835_sdhci: don't use DMA for kernel dumps MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 806ebc9eba2a45638d63ae8a2ed20e6fb44dd06e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2021 13:09:53 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=806ebc9eba2a45638d63ae8a2ed20e6fb44dd06e commit 806ebc9eba2a45638d63ae8a2ed20e6fb44dd06e Author: Mitchell Horne AuthorDate: 2021-09-09 18:07:06 +0000 Commit: Mitchell Horne CommitDate: 2021-09-21 13:08:39 +0000 bcm2835_sdhci: don't use DMA for kernel dumps When handling a data irq, the sdhci driver calls the sdhci_platform_will_handle() method, to determine if it should allow the platform driver to handle the transfer or fall back to programmed I/O. While dumping, the data irq path may be invoked directly (not from an interrupt context), which the bcm2835_sdhci DMA code is not prepared to handle. Return early in this case, to force the fallback to PIO. Otherwise, the KASSERT that follows will be triggered, and the dump will fail. On non-INVARIANTS kernels, the system will hang, waiting for a DMA interrupt that will never arrive. Reviewed by: kevans MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31893 --- sys/arm/broadcom/bcm2835/bcm2835_sdhci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c index 38617dcd38eb..c8725b6067f6 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -762,6 +763,13 @@ bcm_sdhci_will_handle_transfer(device_t dev, struct sdhci_slot *slot) struct bcm_sdhci_softc *sc = device_get_softc(slot->bus); #endif + /* + * We don't want to perform DMA in this context -- interrupts are + * disabled, and a transaction may already be in progress. + */ + if (dumping) + return (0); + /* * This indicates that we somehow let a data interrupt slip by into the * SDHCI framework, when it should not have. This really needs to be