From nobody Tue Oct 20 23:24:24 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 4j8T5T2nMgz6wZln for ; Tue, 20 Oct 2026 23:24:29 +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 4j8T5T2G8xz4Ysg for ; Tue, 20 Oct 2026 23:24:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792538669; 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=tmw70Ogt+Y3JUQseXUqSqfUUY1uJWMq8buIhnfgx7ntzQbJ9MhkKLkFeF7sgahj1sg2t1Q Klm62skWvndQxKCUX6nSgb1ZUZMljQl6Cbnx1E09nSOkxlVDYI+vpuRZWVW88EKjM3YHZb mJd7IEx7FHts3upJMxoPsbN3ffG6oYN1n1fs+kPSX3NElhExtpCaoibv86XO3kKT3KOI31 bQD+rUo2TYITwXj41UXNpC2x2JnOTBOBoOp6BXSou4MlDRNJZDFUnekJO3//yckaksWSMO g3Kky1dZUozLzxstX0jJh1IazSUEBJ42a7mDQxeu524w1wPQzWz6MCxk6OI7Nw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792538669; b=sSotEz0XrzyBmN+sTqNR9RymYUSL3z5gpVnhFh1UtPClwom/Vd8ZD8T8U4+vIMK0cNyp2E kf3cPFergplNHQ99kqNSuOf1zG6xIkOBUhQ9GyR5BWXKKqMBCz+xpEwIvkKy+tuXkCuCJd GMVbob8WzBdiYuyJsyOaPgcpngIdb//3E0pR2MUJQIU2AM5cs9mxcwHAcisAbNF461HdhE GNam9t21Z3wJksEz+177cMhlzML7ZxJLE1hPqWl5/Ns75Kilh0l9iC9MWjNhehH5rKsVjb xPD3lzJlv4jzcqwFQoptitke7SVQHWXB94Ke2mNX3Mh5Q9ZsOUalhX+G0+npag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792538669; 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=qaEWsune+12lGQw8Io5dY00sIt7fUzIskZQeRaj4VeYxyasURK8SYd6kIptVKTDAiQbgnX xM+OBh1TOcpb7LfGRTFHAx6MBpRMV/iAeixiJ13U0UPPHrt3f/3110fwJs14iziyT+xkWM fYddPG3UtYEGum/2SUB1AB7mFnVtfy7TmCo5wufCe7WSUKpl4ziIC9fmWDp5DKQVuVbiDZ aXvXoVsT6DAUIFPv7NfYW6r6vYjcpriIhgj3cUhFHzRzhxo7wtFSSiL66QeqY06X7djs9D M53JmSZ8vPJJVBDO9v8DzIBypsuSKZNkMdrFiG8oEjJNsmFRlf1I6VPRjwx89A== 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 4j8T5T1f9gzSBX for ; Tue, 20 Oct 2026 23:24:29 +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-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: 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_ */