From nobody Tue Oct 20 23:24:24 2026 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 4j8T5N29kRz6wZlj for ; Tue, 20 Oct 2026 23:24:24 +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 4j8T5N1fl6z4Yv6 for ; Tue, 20 Oct 2026 23:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792538664; 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=5VVs93ho+V1IiF2NZER+aTyNUB8+cAsKf4BPQd0fDAk=; b=BuYdJCxL58/GWT3ozStAw9B81BhaVVwHtXmrhYwTxuB0GBs0QLj+4Uqq4EzH8BN3zzQGnP 068JcG69iK9fWPBCc9jtTfSJsT0521VgtBA9s5gcvzsdBkQbPdAgQyr6wCK1vWVhGezxpb zEgXzz00qERNdeRt84pgnCqkaBCxIlVOno5TwRJAOYwnzOo+h3pWSWSyOfYM4mLwSbvpJa Qo5sLC9x2Kg+LMyavFHk6hyValta5KCsYgMzMME6VVj1yis4jXUq5/OsHUEfM8pX44jYoW ddwin7ZW0r9+kdWR8e3n7qAYZB+CkeZniSvvn2xXwEzTxUCY9JiwKkhvfYiAgw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792538664; b=POz5d6sM7S4CBmmeq9fdtReKXIw05NotxLkIDBuLi+FZp1HpdkRZuZUiGF6dxZrYtjhcWB w36xbwBlvP4SDN5iPYPfvQFDaC3FyafGwIeogx1ZE+sdkYdiaDMbcE3cloh0G47f/oFKiT JjSNotbUizpFKzfMsLs4c0n/LbKjzqFp0SD0EwEOkxxjdYdVCTglQ4Mh7KE7W1uj0Ksyf2 NRz8IBHozlwHRimAi64Ko3Pvg3WRWJdXi4NW1fHBNbPZf2vKnz2v8D5yYk15c9N1nj5qEs pTKS0hFSXwbvyplliqzALk/XaJwGUhNTUeL2AAfi9UwBuxkQ+u0fZsYX5i2YKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792538664; 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=5VVs93ho+V1IiF2NZER+aTyNUB8+cAsKf4BPQd0fDAk=; b=D+aOQzqDgdSVCNqpYc6cL4sYWAOU0bg34Aj/bSBDdWziHahAc961wl/NMye4e6q3GRc8MS P0TnyR2Ff8pw389URrARRXZ4Am7vEcgzmVLx1CIbpWGCzl+y0z47hFjgA6OrCpvYzkTTeY h1iufXeMCqKMHrmQCTfZJivjRk3DtdhnM4NHApW2M6N3ylD5C+1dxjFRoryqF+CQ7zY5yX VysjlCZIr0Fs3YO+uiGpZfZ9IuWrtieBAdV8ZdnLg8QKlZ9TQmZ28ovLxk8+CCyS8zOlrh EQzifXhpXz7b32FtOfR1NSCqw8jukf7GFqXRMks16VK2u8Smi0iizplFJxZOUw== 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 4j8T5N12WczScD for ; Tue, 20 Oct 2026 23:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33e31 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 20 Oct 2026 23:24:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: d2145e9b9644 - main - LinuxKPI: restore several hard coded return values for the CONFIG_PM case List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2145e9b96448da34d3cfede24c509af6d830c92 Auto-Submitted: auto-generated Date: Tue, 20 Oct 2026 23:24:24 +0000 Message-Id: <6ad7f828.33e31.112df230@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d2145e9b96448da34d3cfede24c509af6d830c92 commit d2145e9b96448da34d3cfede24c509af6d830c92 Author: Bjoern A. Zeeb AuthorDate: 2026-10-19 21:30:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-10-20 22:50:14 +0000 LinuxKPI: restore several hard coded return values for the CONFIG_PM case drm-kmod sets CONFIG_PM (unclear if for other parts) but LinuxKPI has no understanding of a dev->power implementation for pm_runtime.h. The return values based on !CONFIG_PM thus cause problems to drm-kmod. Return the previous values under CONFIG_PM but leave the TODO logging as the actual implementation is missing and return values may not be universally correct (beyond the known drm-kmod use cases). The following functions having a return value but none sepcific for CONFIG_PM as (based on drm-kmod master): pm_runtime_resume only caller ignores the return value pm_runtime_set_active two callers ignore the return value pm_runtime_put_autosuspend all callers seem to ignore the return value pm_runtime_autosuspend 2/3 callers ignore the return value; 3rd is #ifdef __linux__ pm_runtime_suspended 3/4 callers ... do check the return value but the logic expects the false, which also matches the previous value. Fixes: 863fe7ae5152 ("LinuxKPI: re-implement pm_runtime.h") Reported by: markj MFC after: 3 days Tested by: markj, Oleg V. Nauman (oleg.nauman gmail.com) Differential Revision: https://reviews.freebsd.org/D60878 --- .../linuxkpi/common/include/linux/pm_runtime.h | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pm_runtime.h b/sys/compat/linuxkpi/common/include/linux/pm_runtime.h index c4fcfad2860d..ba3aaec2d0f7 100644 --- a/sys/compat/linuxkpi/common/include/linux/pm_runtime.h +++ b/sys/compat/linuxkpi/common/include/linux/pm_runtime.h @@ -17,11 +17,11 @@ /* * Return values, where needed, are based on the !CONFIG_PM/!CONFIG_PM_SLEEP * assumption given we currently do not support anything in here. - * We could #error in case CONFIG_PM or CONFIG_PM_SLEEP are set but that - * would likely be too intrusive for now. - * - * We could likely use dev_dbg() in here instead of pr_debug() if the former - * would be mapped to the latter with additional dev information. + * Several values used to be hard coded in the previous implementation + * with the assumption that CONFIG_PM was set for the driver to compile + * and returned appropriate values as needed for drm-kmod. They were restored + * inline leaving the TODO logging available as the implementation itself is + * still missing as are any non-trivial dev->power bits in LinuxKPI. */ static inline void @@ -132,14 +132,22 @@ static inline int pm_runtime_get_sync(struct device *dev __unused) { pr_debug("%s TODO\n", __func__); +#ifdef CONFIG_PM + return (0); +#else return (1); +#endif } static inline int pm_runtime_get_if_in_use(struct device *dev __unused) { pr_debug("%s TODO\n", __func__); +#ifdef CONFIG_PM + return (1); +#else return (-EINVAL); +#endif } #if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION < 60900 @@ -151,14 +159,23 @@ pm_runtime_get_if_active(struct device *dev __unused) #endif { pr_debug("%s TODO\n", __func__); +#ifdef CONFIG_PM + return (1); +#else return (-EINVAL); +#endif + } static inline int pm_runtime_resume_and_get(struct device *dev __unused) { pr_debug("%s TODO\n", __func__); +#ifdef CONFIG_PM + return (0); +#else return (1); +#endif } #endif /* _LINUXKPI_LINUX_PM_RUNTIME_H_ */