From nobody Mon Oct 26 16:42:57 2026 X-Original-To: dev-commits-src-all@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 4jCzvP49spz6xDd5 for ; Mon, 26 Oct 2026 16:42:57 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jCzvP1l3jz3QSJ for ; Mon, 26 Oct 2026 16:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793032977; 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=4gsQPnPQON3z7lDmEjI/RJQ2dy+AqYq4p8UlAMZPG1o=; b=mlsBTsFKKUNqDFGK1sqHGC9KRulI4hAPOP2XNw38f+8h5cHtqTn7wFv5qB34nagfmVbuuJ hDRhD62bKVBR0vOAx6byRn/Rrq9QcluA0ejUEF0sfaXukKOyrRu+AvTq/GfuK5RCFFUYlF K7ql4tnWfW81xk8Utv9ztGb1wBvZ0QEPrPoI7o50BVD4BRP9bpOT2sz9IqE2KD3uCA/Pol 2fNpuKC50/7pu4I9GwA1mgh/TRQBnnoEOOUpFxaiBYl0VQMEO6dqNMWwuK950ccKEBU3wt coZrZKIyRA2u5CH4Yl6uvsuLig9ICJTOwDoX7GyYmYQGa6YNP4HDMLdRv0tN+g== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793032977; b=GhCWkVgKbgXt0yOtPqIa8t+BwKpAkCIY7oUN+7e4oY/sAf7Q6j/2DnZzmoVujIotb/qfDP 1mND2tej8xcocmZQoqrzkGdR8s6avXhb6qAJ3IwAjydLcKm2iXH2jl8DOyzLbnELParUgV 7E5aSJ8yWu8VOZgS2zLLSE/2hl03kyyJO5k2pojJ5zkIlbVDDZPxQTrh7IMy9mugsV5pts 2eLFB0u5/n8tuyy/zh/vSy1+pf3DSmZlMDBzY1j76zNRHOT7oMoBhSSdmEUSi2WL6RkPkx kZr9f8ddQY6N4Px8p5nw3s6uFT7r9YGzPu7bUckejnUwySb4TFayCm0/Yb6drQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793032977; 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=4gsQPnPQON3z7lDmEjI/RJQ2dy+AqYq4p8UlAMZPG1o=; b=GPPz8LLTb6NIulgeSu8NFf3uC6L6vayGfr8bve4WByohsomwoF6XfOmFJsollsfBYvGqFn +Xm39SGAn592NPIX8kUOQ4Ijyu0fsexMXh1relS0qJnzilqwAhRQYQvk6GJHOGI3VsmTas hZ3SKXpn2mKe+K0S1WGR7iMHIKkFiVdQuuVf+MjzxW/M+YBhVrPpCSvdvK2/zbi0d2vHfY 2kOxHief+jvGHpBcvMCmQnEHueESzcq3ghngq18QFeRuwxqTA6PAGc4lbWDduGyNcAEl7J bSKKa2jMb8O6HfxShD5Q+UqsIZOqCiY8I9Ph5zU8Xz+PJEJc+s8YbyANUXIueg== 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 4jCzvP14TQzjgg for ; Mon, 26 Oct 2026 16:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d820 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 26 Oct 2026 16:42:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: 9a4bb77040f0 - main - amdsmu: Use devclass name instead of module name List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a4bb77040f074f6e842a54f8aedf7a24c0eab42 Auto-Submitted: auto-generated Date: Mon, 26 Oct 2026 16:42:57 +0000 Message-Id: <6adf8311.1d820.4c022a48@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=9a4bb77040f074f6e842a54f8aedf7a24c0eab42 commit 9a4bb77040f074f6e842a54f8aedf7a24c0eab42 Author: Aymeric Wibo AuthorDate: 2026-10-24 00:02:52 +0000 Commit: Aymeric Wibo CommitDate: 2026-10-26 16:35:18 +0000 amdsmu: Use devclass name instead of module name The diagnostics array contained expected modules to be loaded but the checking logic checked for if a devclass of that name existed instead. Have the diagnostics array contain the devclass instead as well as the module to load for the hint string. Furthermore, check tha the number of devices is greater than 0 so that leftover devclasses from unloaded modules don't skip the hint. Reported by: emaste Reviewed by: emaste Fixes: 758578370f6b ("amdsmu: Hints on what to do if IP block blocking S0i3") Sponsored by: The FreeBSD Foundation Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/70 --- sys/dev/amdsmu/amdsmu.c | 13 ++++++++----- sys/dev/amdsmu/amdsmu.h | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/sys/dev/amdsmu/amdsmu.c b/sys/dev/amdsmu/amdsmu.c index c37a06e18454..cee7dbec95d7 100644 --- a/sys/dev/amdsmu/amdsmu.c +++ b/sys/dev/amdsmu/amdsmu.c @@ -320,6 +320,7 @@ amdsmu_resume_check(device_t dev, enum power_stype stype) struct amdsmu_metrics *m = &sc->metrics; bool any_blocking = false; const struct amdsmu_diagnostics *d; + devclass_t dc; if (stype != POWER_STYPE_SUSPEND_TO_IDLE) return; @@ -380,11 +381,13 @@ amdsmu_resume_check(device_t dev, enum power_stype stype) if (d == NULL) continue; - if (d->expected_module != NULL && - devclass_find(d->expected_module) == NULL) - device_printf(dev, - " hint: load %s to allow this block to " - "suspend\n", d->expected_module); + if (d->expected_devclass != NULL) { + dc = devclass_find(d->expected_devclass); + if (dc == NULL || devclass_get_count(dc) == 0) + device_printf(dev, + " hint: load %s to allow this block to " + "suspend\n", d->mod_to_load); + } if (d->extra != NULL) device_printf(dev, " hint: %s\n", d->extra); } diff --git a/sys/dev/amdsmu/amdsmu.h b/sys/dev/amdsmu/amdsmu.h index 263adfb1d977..5cfa8d19ccdb 100644 --- a/sys/dev/amdsmu/amdsmu.h +++ b/sys/dev/amdsmu/amdsmu.h @@ -123,26 +123,28 @@ static const struct amdsmu_product { static const struct amdsmu_diagnostics { const char *blocking_ip_block; bool ignore; - const char *expected_module; + const char *expected_devclass; + /* mod_to_load must not be NULL if expected_devclass is not NULL. */ + const char *mod_to_load; const char *extra; } amdsmu_diagnostics[] = { - { "CPU", false, NULL, "this can happen due to other IP blocks or " + { "CPU", false, NULL, NULL, "this can happen due to other IP blocks or " "because the system was on AC power" }, - { "MPM", false, NULL, "this can happen due to other IP blocks or " - "because the system was on AC power" }, - { "GFX", false, "amdgpu", NULL }, - { "DISPLAY", false, "amdgpu", NULL }, + { "MPM", false, NULL, NULL, "this can happen due to other IP blocks or " + "because the CPU didn't properly idle" }, + { "GFX", false, "drmn", "amdgpu", NULL }, + { "DISPLAY", false, "drmn", "amdgpu", NULL }, /* * On Phoenix and Krackan Point, these seem to report USB4, not USB3 as * their names would suggest. */ - { "USB3_0", false, "tb", "see thunderbolt(4)" }, - { "USB3_1", false, "tb", "see thunderbolt(4)" }, + { "USB3_0", false, "nhi", "tb", "see thunderbolt(4)" }, + { "USB3_1", false, "nhi", "tb", "see thunderbolt(4)" }, /* * On Phoenix and Krackan Point, the SMU seems to report garbage for * this IP block. */ - { "USB4_0", true, NULL, NULL }, + { "USB4_0", true, NULL, NULL, NULL }, }; struct amdsmu_softc {