From nobody Sat Feb 17 15:12:32 2024 X-Original-To: dev-commits-src-branches@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 4TcXNK0b9Zz5BFVx; Sat, 17 Feb 2024 15:12:33 +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 4TcXNJ6fd8z4YDZ; Sat, 17 Feb 2024 15:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708182752; 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=bIA0F7cMdEV2Xd1mDadkHu5+DrsKxR+Z8Xq8QZk3mUY=; b=hN0EkqgYIk5m2IpxfHFevLhNID0g85wH8WUY2bkemUiPVluyfi/BnaORUdn70QZcMbo+Ue Kz7DbQ0m7e1l7hKdN8uXpL6wy++EFCSEB2iISZKr5V3Jt2BW4IGZ0jgJQn2oFGDd4HvFEZ mwWSXjLhZGcu16afMPVTAoRfP1zDAUTnJKLBPndn4riV7rVOHx1pGlnyRwiXAYZwq3pZpA WZUOY55cwxBrP1QUMlSvxrlSQI+IFLEiDiD5NipAzO8qbXZFt39tuc6PqQ3juQnJOmWOaT Cb3frbstOYqxKWqs6qE1qADxdT4qHOdtO5i6TPjn+35ln2sJuZAVlt15xMHVMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708182752; 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=bIA0F7cMdEV2Xd1mDadkHu5+DrsKxR+Z8Xq8QZk3mUY=; b=B7A5vw4GXt0sPIEgBrY7N334lbWyUoI4PPtLYUgLE4JNyFYdoOHyouLCF27qq0uOpLil8U E98Fke55xoaWSSHoLnlbn3nUrTH0qDievWgglS0ZMmCHK3qRB4uZ2qmUaDqsW2k5Xtsm0g zrzL4+DFd4ZqYlakOW8EH6EsEURn9RU/YddGHce1gft8FBB9g1lYRuADrnmYYcLBJMxzGl lDOcO+j1/flg0zTbbxOEGLSjupkjnmDzGWd+/+zT56JvXe8/Rx1cv8nGso8XIRm2pr9q/z C7tEnMREFoeb7kV4maKxWNa2af0fVupec94G1L8Em1Qa3U7sN0tvaCm+RHigIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708182752; a=rsa-sha256; cv=none; b=LxBxBEkfv+t0mJboasR1LUNMGa81b2nR4lvtySyCMnL9lczqZZ8vqmjCQDDXo9N5DDk2OQ EAnr9dV8HtRCUgI2oTYokC20bfN/FdO/Wb8EjrpWwOYLD6FrYVYrW9Xi/AqZh7xFQjdyBd 1iJJpiX+vuT7+dO6A+ve+5bVTNMocVCuyWY0GnCNor7T5RrGb9szVE/TTPoGSWNUOCoTSN BU/BQqOtfbgOvhaK25RLCIJVg/wXPsiSBsBk50E93IEgVmrJzBHNdjUdYsSxR7Ocldog9Y 5ZSpxM0J6fouwcxZ8K6e4VeI/sGBeRbolXjn6tVKmt56xmnz+qs1l4s2yrJ1zA== 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 4TcXNJ5mplz1CG6; Sat, 17 Feb 2024 15:12:32 +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 41HFCWlI080948; Sat, 17 Feb 2024 15:12:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41HFCW0q080945; Sat, 17 Feb 2024 15:12:32 GMT (envelope-from git) Date: Sat, 17 Feb 2024 15:12:32 GMT Message-Id: <202402171512.41HFCW0q080945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 4cb348eaf6ac - stable/14 - subr_bus: report DEVICE_SUSPEND failures List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4cb348eaf6ac1326e79bf6c6679dbf1e219574ee Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=4cb348eaf6ac1326e79bf6c6679dbf1e219574ee commit 4cb348eaf6ac1326e79bf6c6679dbf1e219574ee Author: Andriy Gapon AuthorDate: 2023-01-03 08:39:32 +0000 Commit: Andriy Gapon CommitDate: 2024-02-17 14:18:04 +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. (cherry picked from commit 4d1161f094dd90428847f7e5989767e9957055f4) --- 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 d3db7ca5431c..38c646593a85 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); }