From nobody Sun Jan 28 13:21:49 2024 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 4TNBsp1QXGz58ZFQ; Sun, 28 Jan 2024 13:21:50 +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 4TNBsp0dVlz51Mp; Sun, 28 Jan 2024 13:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706448110; 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=U5S1sJ30wG8z+/inRyHV9IQUB1GhJpEU57JV2++Bnuo=; b=WEKppdyfvQkUiw24YIggK664HeWw2f/NNkg6jJFFDtonti06VEH99CWDVTVxb6Hf2cQ0Wi DP4VaWh2d7GdbHrxmWAHc06TfVQiCtvhIoa+DZwXXCQfD3Zh2qHlJF1czwaaS8ogERr97l jF/vS6/PosLdIy27h+OGUwIR4oN5BI9r+FBZhewo+79xnxoMmKaU1LtLPiFw6Sko6dZ76z PlWFAQNkpzppDcC/2bhDNVgHrhtBLzav+nJNCapEVJVJbNY87JtzsZB892V6Zwif+eqoNR n2iEGh3ipHA6o+imxSJQ/Bu+cSYbN7jQJMzL3qCqPuhmURceHThYqSQVzxR6SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706448110; 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=U5S1sJ30wG8z+/inRyHV9IQUB1GhJpEU57JV2++Bnuo=; b=yHMddNug1RkEI/cpfpEJlInYw6PxywJq2W0iZfJ9HzrxZY1OfSvRwvLQIkOYmslu9qWbLS wJDzhh/QNEXh9PYFXJhGkyud0gqXvEOkdDJ15VZiAN0jZJvluUAvaK3YcyirswpxYweTkH Jnll3rvUXUTLZU+U9p9UztVxvW6rGR7Iq8bCpNvKRLzQt4h8P4kI4UPaWRSEILvCLGzJtY 6GzO3uhCgx8vsO7jMvwuk4bZJDg6tgbG6VPo9L17sYjsQyx3B8L84axQz6liMCw+s7TfrE uspEaCjoD42QiE7FbUteN/8qvJhoxIRr5xGVdbRpPDZnP236Jr2n/5dU1pMw8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706448110; a=rsa-sha256; cv=none; b=NWAZDYeGDXmoLbIdLLeW+ThklzKQfVmA05bI7pnf9zF28dESg4MDxdjt7RkjFNazcm73fM cqT/MGBQI4PMR2LjfIxadHejjs5MZYrm83qqgX5h5unks7wd8dlZSJIXRsW9dQL8zyAKgV 926EnTn8Tl39/CPaCKB3sEbYgM304Ei0NzBf1AT4z+FNlmC90WPpAX5vE23JFf9smSGNmx 521060PD3CNsG9vXlWm3wqVRNtJ+SthVqjSuTYqCs3gMj72sppq42kGdxQizYFC+Kll1ny tHdbPNTE3h5byNQTsBWaYfY+ZOjdYhLVCrQ4XL78ex5vZ+LIrAQq1EDrcDqaPg== 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 4TNBsn6qpfz18Yp; Sun, 28 Jan 2024 13:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40SDLnxT052095; Sun, 28 Jan 2024 13:21:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40SDLneL052092; Sun, 28 Jan 2024 13:21:49 GMT (envelope-from git) Date: Sun, 28 Jan 2024 13:21:49 GMT Message-Id: <202401281321.40SDLneL052092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 4d1161f094dd - main - subr_bus: report DEVICE_SUSPEND failures 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d1161f094dd90428847f7e5989767e9957055f4 Auto-Submitted: auto-generated The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=4d1161f094dd90428847f7e5989767e9957055f4 commit 4d1161f094dd90428847f7e5989767e9957055f4 Author: Andriy Gapon AuthorDate: 2023-01-03 08:39:32 +0000 Commit: Andriy Gapon CommitDate: 2024-01-28 13:21:09 +0000 subr_bus: report DEVICE_SUSPEND failures This greatly aids with diagnosing system suspend failures when they are due to a device driver or hardware. --- sys/kern/subr_bus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 21c2835f2ae6..c06f3df0c9c9 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3463,8 +3463,12 @@ bus_generic_suspend_child(device_t dev, device_t child) error = DEVICE_SUSPEND(child); - if (error == 0) + if (error == 0) { child->flags |= DF_SUSPENDED; + } else { + printf("DEVICE_SUSPEND(%s) failed: %d\n", + device_get_nameunit(child), error); + } return (error); }