From nobody Thu Jul 9 18:34:21 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 4gx3XF3fmPz6kf5l for ; Thu, 09 Jul 2026 18:34:21 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gx3XF2Z41z3phc for ; Thu, 09 Jul 2026 18:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783622061; 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=T0D0BQu+/cC+bOl0ORq4IHljJYrS1CMHzuV7m9WWSL4=; b=YzGKobO8rPzCz3nEeVXK71UCw/+FVfmy6a4/6bLAQt4aCBUZtQw67ldU+HaFk9PArnN7oA FncFtzVlJ/aGKgZfDwqE2qUehWuY6qo7NZU9vugsIsIQpm3MtfT7eQH78LxIsCB9ztPRRk 0gjLGzt4gSoHqnqNEeQgrZ6VlYXszyNK/8QAmlMrNhEXkKmPI19v3p6joblb6E4lXDri+K 7yYEgwOxBCcmgH0AIOklxrrmJJFpFycXHIOLPSCeg8Vd8h8rpEnTo+eNHIc2IYuOjmVeDK Cwt1ai9s8LZ6lQdh4LeCLMKDqYmF8QJ+Id7hl+bu6E+JxEypbPM2mOBUFQNa3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783622061; a=rsa-sha256; cv=none; b=wRGsZqy5aNBZK8bmjz4EiVs+616sVRUNh1aQ044CYTvlDA+cJVY7XALtm4YvTKhAc6/kIb csbVHqBPsmdin+mnesaupxym0h2ChL6QYz0i12tdtok8c6p4oeaLEfqdBHvjY6XZjj9XKG iF3WoBAYocvzBNVHx+DtQ8bRcxVtTZTzigL995AR9+UncESyElmXbQQ+6ChMdxcY5iExXb QL25sJ0a2Im+KSx4N2G5iqCBY/ANO0iEkdyIfVMN3HiEWmZJsihXR6s1s3FpsWKnTBbSie k0QVqCy+gD6Y+fborCb8WPmz4cjpBHZk/OshOcIuR9LrDWYdc7snGCjhcqn8jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783622061; 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=T0D0BQu+/cC+bOl0ORq4IHljJYrS1CMHzuV7m9WWSL4=; b=XfU1DBFG+m9dAbMVwjFJu/IboLcw1n/9Pf/TRRfiWu8fCtZlQ/f+4rXrpbbH3prZbvl5Jb cxU00+Kx68AYs74hJen86P1m3hzFJT9MQJZfvnNdVJHRMpLZQ6wbNP0Z3WXoRPU3GiZLfj o3s1sgPdi8nqOiPJDSCGja8VFMaaj2zB9Oq0HOYZWW5xbWNnnfBv6GGMDTdLPatjuie+we 5msRtiJFnIt/COQQPzTAXRCsXqXUeYiM/euO1mZxjPHeetB1jSSACouFdJdk1JU+BSdbn6 DGsMDRQUccwzonUliNl2IHoFiwRc4JWEr/DcOrx1uuZ2jCD5MsQmmiF5qHSCpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gx3XF0zGBz5J8 for ; Thu, 09 Jul 2026 18:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 452a8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 09 Jul 2026 18:34:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: e9f21e4f28ce - main - linuxkpi: Add `usleep_range_state()` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9f21e4f28ce8cf8ca890b86f8c791473976396f Auto-Submitted: auto-generated Date: Thu, 09 Jul 2026 18:34:21 +0000 Message-Id: <6a4fe9ad.452a8.66cd3c35@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=e9f21e4f28ce8cf8ca890b86f8c791473976396f commit e9f21e4f28ce8cf8ca890b86f8c791473976396f Author: Jean-Sébastien Pédron AuthorDate: 2026-06-12 16:00:56 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-07-09 18:33:56 +0000 linuxkpi: Add `usleep_range_state()` It takes a task state as its last argument. We enforce that this state is `TASK_UNINTERRUPTIBLE` for the time being because other states are not interpreted. Change `usleep_range()` to call `usleep_range_state()` with the state set to `TASK_UNINTERRUPTIBLE`, which is what Linux does too. The amdgpu DRM driver starte to use `usleep_range_state()` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57579 --- sys/compat/linuxkpi/common/include/linux/delay.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/delay.h b/sys/compat/linuxkpi/common/include/linux/delay.h index f19d1a759c26..7d29211bf110 100644 --- a/sys/compat/linuxkpi/common/include/linux/delay.h +++ b/sys/compat/linuxkpi/common/include/linux/delay.h @@ -30,7 +30,10 @@ #ifndef _LINUXKPI_LINUX_DELAY_H_ #define _LINUXKPI_LINUX_DELAY_H_ +#include +#include #include + #include static inline void @@ -64,14 +67,23 @@ ndelay(unsigned long x) } static inline void -usleep_range(unsigned long min, unsigned long max) +usleep_range_state(unsigned long min, unsigned long max, unsigned int state) { + KASSERT(state == TASK_UNINTERRUPTIBLE, ("%s: state=%d unsupported\n", + __func__, state)); + /* guard against invalid values */ if (min == 0) min = 1; pause_sbt("lnxsleep", ustosbt(min), 0, C_HARDCLOCK); } +static inline void +usleep_range(unsigned long min, unsigned long max) +{ + usleep_range_state(min, max, TASK_UNINTERRUPTIBLE); +} + extern unsigned int linux_msleep_interruptible(unsigned int ms); static inline void