From nobody Wed Dec 17 14:17:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dWbTt3T0Zz6LC0W for ; Wed, 17 Dec 2025 14:17:22 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dWbTt18GDz3LxN for ; Wed, 17 Dec 2025 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765981042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KYk7wa0lrtjXHqlevzUPMRzcX+z7a4kJb2XmGcOJQsM=; b=NO71BGntRuqcH5Oot1UMtC5GSwpwpBhqKxUe0CzgMMMFSgXzEvIQzJg5MA/dxJ64yMnmZ2 mv8vJkGVHpTz2GeTbj0Wb1sQ5gXTGghmxHisHvBj2HyRyoohQhyZlVlFyLuX3s5MFx9Cb8 NZNE2v1WiVlU/gUhXp7YFjOdIdYZQnj15n6/PtVCsm7biUG6AmJ3qfMLTvcuuvtfjBXD+L xdKeALFCoOWjne9fCC5ndLBswZiU3qnyxyWv8NHDrmxZb84+9UWZMzrO4kkjdkyHIcuxYL LRzRCMb99eYv60alzvw9HNAjnWAOHjmqCX2L/u46WIKjH5wv1ky00FDQnylScg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765981042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KYk7wa0lrtjXHqlevzUPMRzcX+z7a4kJb2XmGcOJQsM=; b=tidBTT5/sbn3wUf/+BmfOCKI/fM+6B1MIfjDp4nsFhHRwobrVL83MFAc1kPlOC0z1FJN6b 8prrTFfK+vlIUvGys3+60LIRZQvLhB7aatR+hr2ob5PylLlax2NN6knGtxZJw5nkZI1ihQ tsVE+i1apLLz387Sb6BvUO0y7SNdIH+4wuDMBqcyeJQ/OFGVTMjZCHBKLhZYmAZXyQpQou 21HhZucbe8dUEvtK9G8nrA7BRF5mG1fmlx/U757z8enERATV1JqAjEjhfEwXuJU1NawVqf sgr6NRPGc0XQF0OQ9PQ2xZ8YqNHjdKIdUICTTrTFibgnJGxItGDWse5ZPsPq2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765981042; a=rsa-sha256; cv=none; b=lGp52zDcl/dYoBvu6rSrmMj8f81SVh2pRn5RmolIcSbZ1IqKdUCkRjm7QaeP1OY6jziodn CPwbuX0aBZ7vyqqGmqmXIRdnkR9YP08QDdS2AeJuBeNFW0AVX6THqCeCYGnielagOMPLxL cKr/jYAovA9q22PABunhtG7u4+Erms03+osEfk4v/LIqnUuSiiY6k2j0GQuofzotJ3gegO 2BqoDBFJX9rd+UUYbp4IFSYnplBYEASpSxZcmUyTF2g4+XLkOgsQxvY6/HIlmsqLG8lcuW P54DELRPa4cKDPqT5y+dva7cjno7F2pvQ5bvr9UHndilUMBC7WDw9nRqS3G7Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dWbTt0MwYzwB2 for ; Wed, 17 Dec 2025 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39406 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Dec 2025 14:17:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 1fad49baf390 - main - sdhci: Try to complete the last transaction if dumping List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fad49baf390cb52f238e6c352d0bc0893c008c3 Auto-Submitted: auto-generated Date: Wed, 17 Dec 2025 14:17:22 +0000 Message-Id: <6942bb72.39406.4933958a@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=1fad49baf390cb52f238e6c352d0bc0893c008c3 commit 1fad49baf390cb52f238e6c352d0bc0893c008c3 Author: Justin Hibbits AuthorDate: 2025-12-17 14:15:40 +0000 Commit: Justin Hibbits CommitDate: 2025-12-17 14:17:06 +0000 sdhci: Try to complete the last transaction if dumping If the kernel panics while a thread is in the middle of an SDHCI transaction, trying to dump to a dump target on the MMC would result in a hang. Fix this by completing the transaction first. Reviewed by: imp Obtained from: Hewlett Packard Enterprise Differential Revision: https://reviews.freebsd.org/D54255 --- sys/dev/sdhci/sdhci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index b53b85bf44c2..0426d9d27916 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -2183,6 +2183,18 @@ sdhci_generic_acquire_host(device_t brdev __unused, device_t reqdev) int err = 0; SDHCI_LOCK(slot); + /* + * If the bus is busy at dump time, it may have stopped in the middle of + * a transaction. Try to complete that transaction before continuing. + */ + if (slot->bus_busy && dumping) { + SDHCI_UNLOCK(slot); + while (slot->req != NULL) { + sdhci_generic_intr(slot); + DELAY(10); + } + return (0); + } while (slot->bus_busy) msleep(slot, &slot->mtx, 0, "sdhciah", 0); slot->bus_busy++;