From nobody Mon Feb 24 15:53:12 2025 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 4Z1ld51YWVz5pNX0; Mon, 24 Feb 2025 15:53:13 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1ld50yJ6z3x78; Mon, 24 Feb 2025 15:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412393; 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=inwscEDRqm69WuvORk/QRUdVNSYSS1xrqgvy9Qu7jeQ=; b=k7Wdj9nmu9K0BmhoZK8cYwFZHVRwbRV0Xs7uVfoUB2VnbphlCiQVqxKl9LN0YEpAzfaSlT FdavHxzPLqTfNFpoOfPQkT39oVVA3Uydk6rsn7TYvqltVBACowQcWSa3UD5fwbyku9MepG 9Z6h/7CFEOsRP9IE9EvDzji8ir+ppvop5kBF3IEQ4K6H01y4Ot2cCpyrXeSuDUXQPCFXUR krA7bUQE8b3Gf+ji6EyezixmruY5es2RDUUWdObyNJT3w5URnNPcBdtyYhR+We0yXUDlS5 iId7cbJE5+ltFQ65Wi8u1f0oF83qPWBlXjNOg8ztwB1VI5r2/g0L3Q5v7EVdbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740412393; a=rsa-sha256; cv=none; b=uVQ3g1s6hW+njcYIK27dWQBnSfmN6Wb8W0K/BKqI/qX/ryrKwLWntOMACWq0ExmegjOdH9 lIMFugHlNVaPkMWa3jf8kzPUjehdYtA+4d+Pj2Z8G5v5s1u56Y/V/+/dSlEZ7D3+aixjFh D7YTvM9KctHnr19KnRwTS35wQDhnWEH3StyuswKB78Wghuc3B18IDYvV4PkfeLlIQcPiY1 U2y0GXjucYUSjrdIoLHeREdolgoNxgwC3OrKTX6z3LxlLsF0Nt414iFBbBcf/VqHe1SKNC 9qzscQOUYMaUfnFh2PS7D8GzTGEoIMoYWmTZoy2LjSnXla74LbjGl0zwfEDqEw== 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=1740412393; 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=inwscEDRqm69WuvORk/QRUdVNSYSS1xrqgvy9Qu7jeQ=; b=pF2OVcSFdRYQNQPdmkg3rE1AKjuWSQ5l6vALYUC8hvZ7oFo6Owi8UPwBMnicaprJFyCnVF T1K9rIMNH5rvK2OzH2hDW7vTAxRw7qdYXbhFFflQ1jKumrPbLMaGqlzm4CII4OtHpdjK2a Ejy6xulDg10YtuYkeiWdwoH7H7Nkn5oKDZn1dwxmiedsL+aZHnquaoI6IycIChQ4GmHrRo OaEEFogLmBm5pUeBBvqcYiCGCI9LmhR0qcJH/o3nkw21Gpi6YuW9wcif41XrlK8Rqk+F/U Tjs61dDaZ5wbG+RY9wh3O0LsUgr5H3Ww/2SYU5MTbIYeuo5FNKr4Vtq/cNawlA== 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 4Z1ld50LTBznNL; Mon, 24 Feb 2025 15:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OFrC0f018918; Mon, 24 Feb 2025 15:53:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OFrCnS018915; Mon, 24 Feb 2025 15:53:12 GMT (envelope-from git) Date: Mon, 24 Feb 2025 15:53:12 GMT Message-Id: <202502241553.51OFrCnS018915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: eb3be1cb9f4c - stable/14 - upgt: Deprecate ancient 802.11b/g driver 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eb3be1cb9f4ced29183c08a6ea4c195d8b9ce268 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=eb3be1cb9f4ced29183c08a6ea4c195d8b9ce268 commit eb3be1cb9f4ced29183c08a6ea4c195d8b9ce268 Author: Ed Maste AuthorDate: 2025-02-18 13:18:56 +0000 Commit: Ed Maste CommitDate: 2025-02-24 15:52:49 +0000 upgt: Deprecate ancient 802.11b/g driver Recently-reported bugs in this driver should be fixed, but also the hardware it supports is obsolete so mark it for deprecation. PR: 284876 Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49045 (cherry picked from commit 7f8a5c5a1585fd9b56adfd8de4f9194ba5cc0785) --- share/man/man4/upgt.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 805d045e61dd..508c87c6a925 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -48,7 +48,7 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 17, 2008 +.Dd February 18, 2025 .Dt UPGT 4 .Os .Sh NAME @@ -74,6 +74,11 @@ module at boot time, place the following line in .Bd -literal -offset indent if_upgt_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed in +.Fx 15.0 . .Sh DESCRIPTION The .Nm From nobody Mon Feb 24 15:54:48 2025 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 4Z1lfx2DYqz5pNJk; Mon, 24 Feb 2025 15:54:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1lfx1TwDz3y1K; Mon, 24 Feb 2025 15:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412489; 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=I0B2bU4ARjtdYuo5j7ViDDBITTF2LZuRuW3KQ0SfEOo=; b=d493ZMyrO+J9zHdB+T1qsCbSBSdcqnOuRXJK5gXwUofdljpOENseCwtz1jAqZttTsXkP1q oln9OOcGp90hT9HZnWk8nslnnemI/E8D0OBRVQ+3r9tHu8FFqBs9XGLCI3dzHOa7XN+B0O TBTW61zZInIIj0UdOjBUBaZvjhTFpq8DBeGY8G4Rxfj9Llazxkiczx+odlrRSRJEO6O9od v90bwLntdWk6hYYUCuwdUqq9HE15WSXPJa/kO9qPk4CLWlulXiGOPASfcuArDAFNRfWtVm 5ALEl7O3G62aRImJr5ZabDs2azSpHO9Wlz3Ou7L5J3wisaiQk/szNu6MXG+47Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740412489; a=rsa-sha256; cv=none; b=QOrQwtjuKj7Dz71x+Hn2z3gqYN7iJpUzxIvIUs+ploySLYU4SaWK+LzroZD4+RP5OU8YT4 WnI8SuMcbYdluMgcrqiEH3f1I/w4tvweWYPvKlVezXia3kacFQFXte2NZ25cMP6dBCVBKh K+bin0+oW4Wn3pNrwiUMv8b3F3hdfZchUvikOFsvvBVp9zjaybzjFJT3fsY6kc8BCyQ+5e slQXmuPCctGGsKCCCs+3XaG3AbK0LcmKL1Dxk8+kPz6vfXcu9jW1Kx9UBe4LG4OBRip6B3 hP7w7bLzKJhHMyuNPaSvlU0O2EQWrl7X9JQXLBH+UP87A3ETnhvKZfckCqLw/w== 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=1740412489; 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=I0B2bU4ARjtdYuo5j7ViDDBITTF2LZuRuW3KQ0SfEOo=; b=GWlLiqa1SGp08tPrhwLHbqOANXxErdZDuJlfQWNs+5IxICZgUnwOlOBajUMVmj5xyyU1Vs vz0H+CdECd7h0gYgX6ok2c5fl85ROuIiyJ8H3uAPz9VEPSvfehqQq7Fi0kbfhyNUxAPOK4 9UN2oCU1J17vgNFjL/psmNSCq/OOSbkwiSw4pMQQTgz3WmyyvFQDHvnDgzWM3APpLmB8ih 94j+XnesfhVLdn5JQUxCsXTCwG9WQpeHwMVQvENjMRAh0lAbV5a6dbt8ew53Boe57yiXdz RCoEAublVdgYwuT4dzrYpKUASQ5CEFi28jWojxjzO3wPRbioj8ll3wIEImTXgA== 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 4Z1lfx0yyhznL9; Mon, 24 Feb 2025 15:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OFsm2N019513; Mon, 24 Feb 2025 15:54:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OFsm7Z019510; Mon, 24 Feb 2025 15:54:48 GMT (envelope-from git) Date: Mon, 24 Feb 2025 15:54:48 GMT Message-Id: <202502241554.51OFsm7Z019510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 96e06df5bcf1 - stable/13 - upgt: Deprecate ancient 802.11b/g driver 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 96e06df5bcf18ca20c3bc6ac76a63cc3a5954158 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=96e06df5bcf18ca20c3bc6ac76a63cc3a5954158 commit 96e06df5bcf18ca20c3bc6ac76a63cc3a5954158 Author: Ed Maste AuthorDate: 2025-02-18 13:18:56 +0000 Commit: Ed Maste CommitDate: 2025-02-24 15:53:42 +0000 upgt: Deprecate ancient 802.11b/g driver Recently-reported bugs in this driver should be fixed, but also the hardware it supports is obsolete so mark it for deprecation. PR: 284876 Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49045 (cherry picked from commit 7f8a5c5a1585fd9b56adfd8de4f9194ba5cc0785) (cherry picked from commit eb3be1cb9f4ced29183c08a6ea4c195d8b9ce268) --- share/man/man4/upgt.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 805d045e61dd..508c87c6a925 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -48,7 +48,7 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 17, 2008 +.Dd February 18, 2025 .Dt UPGT 4 .Os .Sh NAME @@ -74,6 +74,11 @@ module at boot time, place the following line in .Bd -literal -offset indent if_upgt_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed in +.Fx 15.0 . .Sh DESCRIPTION The .Nm From nobody Mon Feb 24 15:54:50 2025 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 4Z1lfy4365z5pNXJ; Mon, 24 Feb 2025 15:54:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1lfy1m0bz3y5b; Mon, 24 Feb 2025 15:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740412490; 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=+VbMr3xgbM+5LjjcXBor0tEH1PZL8kKHwa9HdGcxJtA=; b=ZsrTtcfezMmvoFjZGbkkR5KBk5Twy1jf9CiEGskyvEQtGf2QkUaeRru4LAN8KWGYajUCMg T2gGhS0r/3XKbAIQjFgEDJbLJ8Ec1RnR3iWSYBqbzD74NPhhgCXdXGOFpyw1aEfL6BdpNe rXARv05hUfwQ2yGQKbRPW/0cGDnqCZXX+sHk16DJu/TfCl3xEiX67rvq+gOLNa2UhHSghH LO+pXE2wgvVWpfJXUnxXlwhlwtsfkSbXVz1k4tVIQVGlJXO6KfUeO7I75GSCEzi6B/lOVA w5jorYF+Z+snAvwCyFatrhI4lH3nuBsjja0/rC0BXwxkTiLWwrMnEiqs9iC4Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740412490; a=rsa-sha256; cv=none; b=NX/04Dn/dTGT01bqD5uvXm61ZD4cv+Q7CH+N+nm9WxIZ4QfnbvygcPCWBZY7XOkYehXOES Y/pSFAxbyzHmFtUNwAnvL/0mP/nix/nEN/O9uFpuLvH5Gy+dGcMMUr5IqikcGaTZn5L2bb tiYDfcO+lCOaB2VscD54b1lubRqQ7MZO/slB9qgqSjMAM2RWKwaDNwS473pFYG52LbZVne M28ym/FKCR02CdI0WAaG8dgRTRqd6Gmw0X/U2o/0ekoKdblXAuDza9/cOO6YtAw9D6nYCT o3Yc9aRfYcBOn/6qqt5BgwiRs4JdGvQYjHhasYC1uHIi1WFHlZcOWnGNwTR59A== 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=1740412490; 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=+VbMr3xgbM+5LjjcXBor0tEH1PZL8kKHwa9HdGcxJtA=; b=v+J5Z71Eq7PDkQTdTbDLk+UaW9OYVrRlskJEk8CgpMMT2avvVj42NrdR63AJ+UEhpcfB0u fSnUhZ1XPPTZxJj6gr1or/vGAgpdBHyZ9p74fxNd5ID1wbB3lsBrzQ1IkaCEJ0ROIGoeo0 z94KBijrvmm9wPz7gEaikKKQpWAoxG2MMrTuwLlgfi0sKKTEvf2Rv/u+4NsRDVxTHuoY/u xMhRV9rmzGQn7jYWNv8wnaOFv5QFStnhhjpFIp7NQ0FmwuCYpg53QI9zgBZaksxVuDJ+R5 GzaiZTkk0My9ceKVOK6Dj/t2jMq5IBIFZI5NdjvQ99ED90f8MsyWcbTsWR3pWg== 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 4Z1lfy188jznCJ; Mon, 24 Feb 2025 15:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OFso2L019548; Mon, 24 Feb 2025 15:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OFso1b019545; Mon, 24 Feb 2025 15:54:50 GMT (envelope-from git) Date: Mon, 24 Feb 2025 15:54:50 GMT Message-Id: <202502241554.51OFso1b019545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ab4d246b781c - stable/13 - Deprecate publickey(5) stuff 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ab4d246b781c844b0fc14a3f525e316e4654f087 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ab4d246b781c844b0fc14a3f525e316e4654f087 commit ab4d246b781c844b0fc14a3f525e316e4654f087 Author: Emmanuel Vadot AuthorDate: 2025-01-22 16:56:58 +0000 Commit: Ed Maste CommitDate: 2025-02-24 15:53:42 +0000 Deprecate publickey(5) stuff This uses DES and it's likely that nobody uses that in 2025. If somebody uses this we help them by deprecating and removing this. Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D30682 (cherry picked from commit 723425f837270dd3b22098168ae9464a1ebe38c6) (cherry picked from commit 9197c04a251bc531ee5fca8e11cf7b64237a42f3) --- usr.bin/chkey/chkey.1 | 5 +++++ usr.bin/chkey/chkey.c | 1 + usr.bin/keylogin/keylogin.1 | 5 +++++ usr.bin/keylogin/keylogin.c | 1 + usr.bin/keylogout/keylogout.1 | 5 +++++ usr.bin/keylogout/keylogout.c | 1 + usr.bin/newkey/newkey.8 | 5 +++++ usr.bin/newkey/newkey.c | 1 + usr.sbin/keyserv/keyserv.8 | 5 +++++ usr.sbin/keyserv/keyserv.c | 1 + 10 files changed, 30 insertions(+) diff --git a/usr.bin/chkey/chkey.1 b/usr.bin/chkey/chkey.1 index 508227ba9601..e754d676e5d1 100644 --- a/usr.bin/chkey/chkey.1 +++ b/usr.bin/chkey/chkey.1 @@ -26,3 +26,8 @@ database. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/chkey/chkey.c b/usr.bin/chkey/chkey.c index 3e568b88b9d6..d04f070fb50f 100644 --- a/usr.bin/chkey/chkey.c +++ b/usr.bin/chkey/chkey.c @@ -96,6 +96,7 @@ main(int argc, char **argv) char *cryptpw; #endif + fprintf(stderr, "chkey is deprecated and removed from FreeBSD 15.\n"); while ((ch = getopt(argc, argv, "f")) != -1) switch(ch) { case 'f': diff --git a/usr.bin/keylogin/keylogin.1 b/usr.bin/keylogin/keylogin.1 index 32a3e8e1b5b4..69b59cb68c5e 100644 --- a/usr.bin/keylogin/keylogin.1 +++ b/usr.bin/keylogin/keylogin.1 @@ -31,3 +31,8 @@ to be used by any secure network services, such as NFS. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/keylogin/keylogin.c b/usr.bin/keylogin/keylogin.c index 021935163a1d..c8a4206df3b3 100644 --- a/usr.bin/keylogin/keylogin.c +++ b/usr.bin/keylogin/keylogin.c @@ -54,6 +54,7 @@ main(void) char fullname[MAXNETNAMELEN + 1]; struct key_netstarg netst; + fprintf(stderr, "keylogin is deprecated and removed from FreeBSD 15.\n"); if (!getnetname(fullname)) { fprintf(stderr, "netname lookup failed -- make sure the "); fprintf(stderr, "system domain name is set.\n"); diff --git a/usr.bin/keylogout/keylogout.1 b/usr.bin/keylogout/keylogout.1 index 1480a83aece5..b2d0071416ef 100644 --- a/usr.bin/keylogout/keylogout.1 +++ b/usr.bin/keylogout/keylogout.1 @@ -43,3 +43,8 @@ This will break secure NFS if it is done on a server. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/keylogout/keylogout.c b/usr.bin/keylogout/keylogout.c index 03eeee0f6417..faad41462340 100644 --- a/usr.bin/keylogout/keylogout.c +++ b/usr.bin/keylogout/keylogout.c @@ -47,6 +47,7 @@ main(int argc, char **argv) { static char secret[HEXKEYBYTES + 1]; + fprintf(stderr, "keylogin is deprecated and removed from FreeBSD 15.\n"); if (geteuid() == 0) { if ((argc != 2 ) || (strcmp(argv[1], "-f") != 0)) { fprintf(stderr, diff --git a/usr.bin/newkey/newkey.8 b/usr.bin/newkey/newkey.8 index 51dca6688bd0..294198c50972 100644 --- a/usr.bin/newkey/newkey.8 +++ b/usr.bin/newkey/newkey.8 @@ -53,6 +53,11 @@ password of the given username. .Xr keylogin 1 , .Xr publickey 5 , .Xr keyserv 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . .Sh NOTES The Network Information Service .Pq NIS diff --git a/usr.bin/newkey/newkey.c b/usr.bin/newkey/newkey.c index 20d8302461b8..0371688996fe 100644 --- a/usr.bin/newkey/newkey.c +++ b/usr.bin/newkey/newkey.c @@ -105,6 +105,7 @@ main(int argc, char *argv[]) struct hostent *h; #endif + fprintf(stderr, "newkey is deprecated and removed from FreeBSD 15.\n"); if (argc != 3 || !(strcmp(argv[1], "-u") == 0 || strcmp(argv[1], "-h") == 0)) { usage(); diff --git a/usr.sbin/keyserv/keyserv.8 b/usr.sbin/keyserv/keyserv.8 index 17007c7d8f40..578f548cbe73 100644 --- a/usr.sbin/keyserv/keyserv.8 +++ b/usr.sbin/keyserv/keyserv.8 @@ -81,3 +81,8 @@ Display status of DES support (enabled/disabled). .Xr keylogin 1 , .Xr keylogout 1 , .Xr publickey 5 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.sbin/keyserv/keyserv.c b/usr.sbin/keyserv/keyserv.c index 0a4d084c25dc..7099c6cbe39e 100644 --- a/usr.sbin/keyserv/keyserv.c +++ b/usr.sbin/keyserv/keyserv.c @@ -117,6 +117,7 @@ main(argc, argv) register SVCXPRT *transp; struct netconfig *nconf = NULL; + fprintf(stderr, "keyserv is deprecated and removed from FreeBSD 15.\n"); __key_encryptsession_pk_LOCAL = &key_encrypt_pk_2_svc_prog; __key_decryptsession_pk_LOCAL = &key_decrypt_pk_2_svc_prog; __key_gendes_LOCAL = &key_gen_1_svc_prog; From nobody Mon Feb 24 18:13:44 2025 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 4Z1plF2cjRz5pcKZ; Mon, 24 Feb 2025 18:13:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1plF04jbz3DQ4; Mon, 24 Feb 2025 18:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740420825; 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=x8KUwZZOXOLcPk2VDIRZCmWC/tdkG49YbJtn8+nZQ0I=; b=EXFRTFXTuA+1kNncC2UTzwiEJWHvU/UIus2QhzHgeNAY2Q45ALvHQc/1k3+uthOyGxoGup 2gAZ0ffs9gZvRWLQMp/T9yWHuabIBQKgz2uKlivCtyT+sU77BoUWWjDHhlx9hKg619ZP1P wXkxTJgMp0ZGO7AAvr5jpDfs56ZWbdUePiJbBdn1tiCGJ/a6mZ8gBGBSoz6JTG/CH2wFOF jYx0siiy0Xs3Kp1HB1uHeHJTrsuD7ZVtTqcoGmRH0sWWh2mvzGlXjt72Wawot/AGdDRpvj E7h1+kgwsk+1cLNzJGRi6eyAr2MjObVNTp++6zBb2GOlvbFYrpeEk5AwR/YkNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740420825; a=rsa-sha256; cv=none; b=wzhJA272f3o7YgETomBgcyRP+B42e5mZONqDObPVDaZHeNY6Z+woiJ8IbJnxiQ9MhiotPB mMjOOaYSqUkeVzRzsrcRDuj8U4EWD3u9u7jqbERJZx/8hpKnsM5dp/iegxepfOHkZNVdo/ eBuW4UXw+u6U+eEwAujqpUtHLfzqKF5aGOwvVYwc3PfhhM4N1Upkm/WQfhFYCvKNkPha7g 0H1LnpK+pc86RfnRogrGOaT8TpZn6HpY7q2YkfivGh9PlEsEKxMsBEYhyrQsiybSgPfL/I clBpwuyqaFbKzQkseLyq9STaefLUaNAP7X7WceRIeMYjJNDTJGDF9JQmMgANuA== 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=1740420825; 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=x8KUwZZOXOLcPk2VDIRZCmWC/tdkG49YbJtn8+nZQ0I=; b=C9S7i11z+9VbJjHUNfpvTUM4EB9+/1FpGvXLJDK5iBs7VR+bDYGsHaccIb80MrTj8rnc+5 3+iYhn+DEuFokWPuaDSbS+WNtHBDR55NyPzkXi5P6H2VOJkVQ0ZAu2mvYeDL0wfC1g2K9P GwfzmfSq+PxahuWzV/n21K2XqMxKlC2gTe0ruWQwdw35jReCaZi5bs7htRdq+x2wVZ3m7t MvXyyRc50ENeLvSfeKj/NQOfO7A8wvIzRyU98aZRVwIlhOxR2YAsnPHfQw79k8wQYq3EDh X1Tg5x69estz8gIRPz4GqVyzPA4cqz794+n5+soIkRaoSln6ioXzaGkMjlfdMQ== 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 4Z1plD62fqzrnq; Mon, 24 Feb 2025 18:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OIDi73083596; Mon, 24 Feb 2025 18:13:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OIDi6k083591; Mon, 24 Feb 2025 18:13:44 GMT (envelope-from git) Date: Mon, 24 Feb 2025 18:13:44 GMT Message-Id: <202502241813.51OIDi6k083591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 476f352b5a08 - stable/14 - Use the correct idle routine on recent AMD EPYC servers 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 476f352b5a080d94ea2c375fdb311813feb7e14b Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=476f352b5a080d94ea2c375fdb311813feb7e14b commit 476f352b5a080d94ea2c375fdb311813feb7e14b Author: Andrew Gallatin AuthorDate: 2024-11-08 21:37:32 +0000 Commit: Ed Maste CommitDate: 2025-02-24 18:11:34 +0000 Use the correct idle routine on recent AMD EPYC servers We have been incorrectly choosing the "hlt" idle method on modern AMD EPYC servers for C1 idle. This is because AMD also uses the Functional Fixed Hardware interface. Due to not parsing the table properly for AMD, and due to a weird quirk where the mwait latency for C1 is mis-interpreted as the latency for hlt, we wind up choosing hlt for c1, which has a far higher wake up latency (similar to IO) of roughly 400us on my test system (AMD 7502P). This patch fixes this by: - Looking for AMD in addition to Intel in the FFH (Note the vendor id of "2" for AMD is not publically documented, but AMD has confirmed they are using "2" and has promised to document it.) - Using mwait on AMD when specified in the table, and when CPUid says its supported - Fixing a weird issue where we copy the contents of cx_ptr for C1 and when moving to C2, we do not reinitialize cx_ptr. This leads to mwait being selected, and ignoring the specified i/o halt method unless we clear mwait before looking at the table for C2. Differential Revision: https://reviews.freebsd.org/D47444 Reviewed by: dab, kib, vangyzen Sponsored by: Netflix (cherry picked from commit fd67ff5c7a6cd9a2e82e6a02ea249cec76a4c030) --- sys/dev/acpica/acpi_cpu.c | 9 +++++++-- sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 80855cf168e9..63e17de1ff28 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -131,6 +131,7 @@ struct acpi_cpu_device { #define PIIX4_PCNTRL_BST_EN (1<<10) #define CST_FFH_VENDOR_INTEL 1 +#define CST_FFH_VENDOR_AMD 2 #define CST_FFH_INTEL_CL_C1IO 1 #define CST_FFH_INTEL_CL_MWAIT 2 #define CST_FFH_MWAIT_HW_COORD 0x0001 @@ -855,7 +856,8 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) acpi_cpu_cx_cst_free_plvlx(sc->cpu_dev, cx_ptr); #if defined(__i386__) || defined(__amd64__) if (acpi_PkgFFH_IntelCpu(pkg, 0, &vendor, &class, &address, - &accsize) == 0 && vendor == CST_FFH_VENDOR_INTEL) { + &accsize) == 0 && + (vendor == CST_FFH_VENDOR_INTEL || vendor == CST_FFH_VENDOR_AMD)) { if (class == CST_FFH_INTEL_CL_C1IO) { /* C1 I/O then Halt */ cx_ptr->res_rid = sc->cpu_cx_count; @@ -872,7 +874,9 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) "degrading to C1 Halt", (int)address); } } else if (class == CST_FFH_INTEL_CL_MWAIT) { - acpi_cpu_cx_cst_mwait(cx_ptr, address, accsize); + if (vendor == CST_FFH_VENDOR_INTEL || + (vendor == CST_FFH_VENDOR_AMD && cpu_mon_mwait_edx != 0)) + acpi_cpu_cx_cst_mwait(cx_ptr, address, accsize); } } #endif @@ -922,6 +926,7 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->res_type, &cx_ptr->res_rid, &cx_ptr->p_lvlx, RF_SHAREABLE); if (cx_ptr->p_lvlx) { + cx_ptr->do_mwait = false; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu%d: Got C%d - %d latency\n", device_get_unit(sc->cpu_dev), cx_ptr->type, diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index f19c557e270b..6609871bf89e 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -62,6 +62,7 @@ extern char cpu_vendor[]; extern char cpu_model[]; extern u_int cpu_vendor_id; extern u_int cpu_mon_mwait_flags; +extern u_int cpu_mon_mwait_edx; extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; extern u_int cpu_maxphyaddr; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index d97c9c47e97d..000f99c683e7 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -113,6 +113,7 @@ u_int cpu_stdext_feature3; /* %edx */ uint64_t cpu_ia32_arch_caps; u_int cpu_max_ext_state_size; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ +u_int cpu_mon_mwait_edx; /* MONITOR/MWAIT supported on AMD (CPUID.05H.EDX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ u_int cpu_maxphyaddr; /* Max phys addr width in bits */ @@ -1606,6 +1607,7 @@ finishidentcpu(void) if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { do_cpuid(5, regs); cpu_mon_mwait_flags = regs[2]; + cpu_mon_mwait_edx = regs[3]; cpu_mon_min_size = regs[0] & CPUID5_MON_MIN_SIZE; cpu_mon_max_size = regs[1] & CPUID5_MON_MAX_SIZE; } From nobody Mon Feb 24 18:17:05 2025 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 4Z1pq62fjDz5pcd8; Mon, 24 Feb 2025 18:17:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1pq61qzcz3G7L; Mon, 24 Feb 2025 18:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740421026; 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=y8WYG52VaxGiY3n5gJa9ZhIX7b+zvLsoC7ZRM6d7X6s=; b=GONlLNAhPckmiVW2lOeQueYlmnCxndIzsAKRs66yzXFLfE4QMbP0LR0EmA7VKRxM8LTu3+ U35PczfSmGQra8j+nDJl9iWoe8bz+akyNbCpIP/nIHHMJT1aG+OOuAGcH2m2gubLjh+s8F khd5faOKXZbWaSRlfa5pKoljwErPEONxxBmwtD8dnVfBTx9KvrBUkprzmjfdipKvxlUINe 9ELZNDuBnUDQHb5iF0dghzMXUdBn2RAkOCVXJNSti8rwXmUsM1GBgvypCjQeyCrHAz2bHa h8nh0UPBluRwELhIwtQ8nzx4MCSK3cJ/uwe0Q1qVX/A9CqB4zEmnMzSLFN5kAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740421026; a=rsa-sha256; cv=none; b=DSDvHkmQhLIo3+2afvPsjwxF9f5rkIqq7DWurMCKLlpkomjoWw72pISRReQYoQ3Gj9/W8+ POSr/CWl6X5JbyVmtJkMlFukF7vVKaC3y6nk1mEwjStmWnOhfYBDYi9uCfuQ8YA57CSfBg jBiQwpnqMozjUTIrUOpaib+/yvIfhmg0qD7hgU1jHHlYEU9yMmhXZHzEeMo5KwJTQLZa7H Jlo7W5Vvb0kX55CosQymNfLbyvO8uGwpZEH04dzp19rr/O8mN+QQEMBSWSpJrMhNsX/WH6 IMbKgHD5u1+DznU3R4VF+xI8xK+9IIz97EDfZ3cU9THXcwuHzSQ3bNMtuuapPQ== 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=1740421026; 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=y8WYG52VaxGiY3n5gJa9ZhIX7b+zvLsoC7ZRM6d7X6s=; b=GRff5VwJHvf3ANFkWH71skL2BDIGrK7Oaj41puEoUOIah08L/4onBwfAlYw6bFDy2cyrjW sfCOHjtPutcOBJuW+HcxUPz+Tp/xmfh4VUqnMvupKIxEbxt4t4WJibIVyHN1f92JDi+8kx r0Z6/wAEW/xltMhcIOrho3/2ruIIHc2ABIRlfCvjDNQGr0+RCIfLOv5Y7oxhB5P6E7oNBz snEL8Dz6iNMq+bcxMc7LnSwXvAChJfHo3H7eCu59w6Trezc7XhWgczy19pZhDoOZAzg8N/ gEca/LrQJ1A0EVboT/dgo3cOK3ueUnu9E5+vWEPA56SbIEsAH7YH3iqlR+BF5w== 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 4Z1pq60scLzrwd; Mon, 24 Feb 2025 18:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OIH56e084717; Mon, 24 Feb 2025 18:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OIH5Ee084714; Mon, 24 Feb 2025 18:17:05 GMT (envelope-from git) Date: Mon, 24 Feb 2025 18:17:05 GMT Message-Id: <202502241817.51OIH5Ee084714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0932ae6b9977 - stable/14 - lpd: Tighten permissions on /var/run/printer 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0932ae6b99779a4da1c8032f6622e46750786181 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0932ae6b99779a4da1c8032f6622e46750786181 commit 0932ae6b99779a4da1c8032f6622e46750786181 Author: Stanislav Shalunov AuthorDate: 2024-10-11 15:49:02 +0000 Commit: Ed Maste CommitDate: 2025-02-24 18:11:34 +0000 lpd: Tighten permissions on /var/run/printer Exclude group read/write permissions as well. Otherwise, group wheel can submit things w/o the normal accounting. While group wheel is generally trusted on the machine, submitting jobs w/o checks is not one of the functions we document for that group. PR: 17289 Differential Revision: https://reviews.freebsd.org/D47040 (cherry picked from commit 6cde8f3ef7cd060be39d78055eaf982b06b19a3b) --- usr.sbin/lpr/lpd/lpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c index 19456c9406df..c9a7e1615b74 100644 --- a/usr.sbin/lpr/lpd/lpd.c +++ b/usr.sbin/lpr/lpd/lpd.c @@ -326,7 +326,7 @@ main(int argc, char **argv) sigaddset(&nmask, SIGTERM); sigprocmask(SIG_BLOCK, &nmask, &omask); - (void) umask(07); + (void) umask(077); signal(SIGHUP, mcleanup); signal(SIGINT, mcleanup); signal(SIGQUIT, mcleanup); From nobody Mon Feb 24 18:17:45 2025 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 4Z1pqt5F4Pz5pcQG; Mon, 24 Feb 2025 18:17:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1pqs5CH5z3GZ2; Mon, 24 Feb 2025 18:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740421065; 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=Qwjz2aJVxsqG7GNAoc8qGzIT3K+wXaDiTYQrbZAIcP0=; b=lqxb9PpThEvoWMVzXyOzenjEvGoy31b5TTbTReRjXP8AxwupMAam1+hcPwn+pQHq/Gj8+r dRXskLUfamsvuG+kMIjkFSIO5N8qcAHgFbYLx5KYC9X5u/tKwGYPgkCWJytA5/nV4zq+Sl rE3wO0U57kDIGvAo8MUMXNUICXC3zcAzQcBcTlE/ltpUesNGFEs8JhvLWioyVV0v9QWvQE 2s0tzdHxT158ir3Up80VpdMWNf0fpdcMy3pIUbgGIVRS0+Iayl6cF0Lue2AvkOhFKGJmS+ ZTt1FdnVRrkEM2qP8DCeDtnZGgatRZllbvvUNbUVywc53YCUg9Gyi52MPC8RFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740421065; a=rsa-sha256; cv=none; b=ucZ9237PAJWgy+rUtKl217XpnYfqkLXOKs6DNO7Pa9ql4wQQE8pNOxJmyn9ufpUQGaUvvK A4YH9z1Fyd1+7o6+EX24AsHrDVMcPzBqfDHi5K2zEjsRlPl/meh3QPU1fMv04aSDNNXEEb EgmjS1iLCBPiQe9Pvlyba32/miBTGb6Zcsadc24cZrhcBrMDddtHu0CzYj5TwT1LI8LS2P H2TbDkiVI+NZmSRZiH5AgCbfTBmyvCZ1tqgzjF67znAS5Zix6XMLJY7imdMGdAdeYpGYrC j60tCV6n0dLT9CGgPJyHkyLwILF9Vvi3AKnaS1yy6aWQhr8bDKH/JXlGIkINjA== 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=1740421065; 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=Qwjz2aJVxsqG7GNAoc8qGzIT3K+wXaDiTYQrbZAIcP0=; b=J1AKdpUUPXynwCec5dW+exfnZ4E7APR7FqCnu7HMZTW5zpJJZcY55EiTC3wgYW60SoDqxC St7272ENspsJYZeFEmxEBi3YLe9mIyWslQsSkADq8yC4sX3MIQ+4B+p03ODuiRHq8sKeMA dHoSckKkPnePkLZ46lN7FfiAUWrTfiEmrWvgND7SdrUlOwz0tMEE/NuYwYdcPFVihevyJK 01sfGQ/RVku3peBX1RFkjWmfcSLNGr25Twnud07mQVU+Xk2DbyVQm0jIhHJZpry76f84Fq j6fLjsbFVW/oHmadsjsc3T/gosri4ONlpUNvypoWIy2le14jjnYA5ofMgyuBUw== 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 4Z1pqs4p3Zzrns; Mon, 24 Feb 2025 18:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OIHjlM085039; Mon, 24 Feb 2025 18:17:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OIHjVo085036; Mon, 24 Feb 2025 18:17:45 GMT (envelope-from git) Date: Mon, 24 Feb 2025 18:17:45 GMT Message-Id: <202502241817.51OIHjVo085036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: fc889167c319 - stable/14 - firewire: Add deprecation notice 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fc889167c319dfa9952bb2bcad6d5dbcad00cf7a Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fc889167c319dfa9952bb2bcad6d5dbcad00cf7a commit fc889167c319dfa9952bb2bcad6d5dbcad00cf7a Author: Ed Maste AuthorDate: 2025-01-22 20:51:45 +0000 Commit: Ed Maste CommitDate: 2025-02-24 18:11:34 +0000 firewire: Add deprecation notice This was originally discussed as part of FreeBSD 15 planning, but did not happen in time. Add the deprecation notice now, with an expectation that it will be removed before FreeBSD 16. Reviewed by: brooks, imp Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48598 (cherry picked from commit cda74c35cb37aa8ecb536aae8d93451eafec15df) --- share/man/man4/firewire.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/firewire.4 b/share/man/man4/firewire.4 index 4195d4da694c..27c502ddef40 100644 --- a/share/man/man4/firewire.4 +++ b/share/man/man4/firewire.4 @@ -29,7 +29,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 6, 2022 +.Dd January 23, 2025 .Dt FIREWIRE 4 .Os .Sh NAME @@ -49,6 +49,11 @@ module at boot time, place the following line in .Bd -literal -offset indent firewire_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed prior to +.Fx 16.0 . .Sh DESCRIPTION .Fx provides machine-independent bus support and raw drivers for From nobody Mon Feb 24 20:27:04 2025 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 4Z1sj44qFqz5ppys; Mon, 24 Feb 2025 20:27:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj41pMvz3nw9; Mon, 24 Feb 2025 20:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428824; 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=s6ohe8mBuqmFxUxJ5dvurhD0wKG7bfYTIGBXJGbvu5M=; b=dCibmDmjVn2KNVzNC6M55PBb0GGDQnoxwSR4bpUVD84U9rMaDoD31x65l9tsGyfdCtS3jO gCvs56VIK1PabvsKmas/WTMJ2ZfhANQkqSnd6CgjoeT5JhmRP+LRhRa2Zyvrst5RFpr7TF Mv+Xu0pD7ZW6wYEkUmNG7kPfUpN+Np7Mts3ZtROUcQYnJIC4u5jqexe3OezqEv6eGndyZg yTs0SuYFxFvUkEAr6N/4uW4OtqaVsREwKIF4UIywqm2T8Zt+K78f7woZE8kFIv6cedG5PZ CfkgEp7x3EkOsX5l+u5wkQCZtnmgTxH5zt9/4A9KlDBqa6BjnXdbvGpxQAzVAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428824; a=rsa-sha256; cv=none; b=WNTXOqKi4z0S38AOzLVE8QKMKfLhiFGLy/RybqFz8eReJP4VUOadDwfuqglZGdCuYwOba0 1vlu9UMpl8zn4JaZBEwCxuwQOIn4IqK9iEOsdIRyv/X+MrXLdUF0QISwncSYTIN+2VShUr rg1GRiuhN8cVLpfR1CtEKhVqGa6rKDGwsaZPw/XgwvTdWHTdNgRJWqcQ1XoH2sqzOe93vS gVjuPGkxlECuTBKx/j80Py+psRZPSQpgne1wdt++rEFmxarpKH8k2Wronq25KyfQMVG1Lp Ihk1X6AtBMhLIyTgo+gD/iMq+wf2BcYxKCuDzokF5j0O+2Q/coh9Wx2mxl/maQ== 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=1740428824; 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=s6ohe8mBuqmFxUxJ5dvurhD0wKG7bfYTIGBXJGbvu5M=; b=Q1qNUdtkMzL8rdnCGbiu4ioFhA/I2R1UJYPU+5S39ErJGwtbexR0JaEOrKdw1ZptPvBVXR kCGUu/53rWtnJnhFwW2oc/Yjn1FWNWSJGMhJlFTwghealeCZGRgLubhptgn03SZsGDRzat inTrJmK7iiyLJXCHQ39YOYKYogCJS3FlbjAlrYPkhK6wg2IB2Tuh/MCD79BCl+3GArOJQB PSwTMjSkqbjWgRc75OWifgdFrcRneZvKCZEkJw8vmRBuSvi7+FfvdJowdvp2h6PyHw4ba5 bU8miREkGj7YU00sqgVe1qrjDdziQlL1evip+SmOJk5tXqjHi1qzYY4UkruJyQ== 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 4Z1sj4194szvnF; Mon, 24 Feb 2025 20:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR4oj027050; Mon, 24 Feb 2025 20:27:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR4nC027047; Mon, 24 Feb 2025 20:27:04 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:04 GMT Message-Id: <202502242027.51OKR4nC027047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7563a2b96f56 - stable/14 - net80211/ifconfig: swap IEEE80211_FVHT_USEVHT160 and 80P80 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 7563a2b96f567018d63744a957a33e546aa39ed1 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7563a2b96f567018d63744a957a33e546aa39ed1 commit 7563a2b96f567018d63744a957a33e546aa39ed1 Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211/ifconfig: swap IEEE80211_FVHT_USEVHT160 and 80P80 ieee80211_setupcurchan() compares the flags in a greater than manner. In this case VHT160 should be > VHT80P80 as it is preferable. Swap the two flags and add a comment to note this. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48976 (cherry picked from commit 8f2e5b6ef32304ce340b91057b1eb4b191dbeac1) --- sbin/ifconfig/ifieee80211.c | 4 ++-- sys/net80211/ieee80211_var.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index d4dcfdf63254..9f66281931c0 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -133,8 +133,8 @@ #define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ #define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ #define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ -#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ -#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000008 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000010 /* CONF: Use VHT160 */ #define IEEE80211_FVHT_STBC_TX 0x00000020 /* CONF: STBC tx enabled */ #define IEEE80211_FVHT_STBC_RX 0x00000040 /* CONF: STBC rx enabled */ #endif diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 4c5dbcb7cfc0..afd3beeb5d73 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -728,11 +728,15 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FVEN_BITS "\20" +/* + * These flags are compared in ieee80211_setupcurchan(). + * Thus 160 should be > 80P80. + */ #define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ #define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ #define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ -#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ -#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000008 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000010 /* CONF: Use VHT160 */ #define IEEE80211_FVHT_STBC_TX 0x00000020 /* CONF: STBC tx enabled */ #define IEEE80211_FVHT_STBC_RX 0x00000040 /* CONF: STBC rx enabled */ From nobody Mon Feb 24 20:27:02 2025 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 4Z1sj36qNxz5ppr3; Mon, 24 Feb 2025 20:27:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj337SBz3nkg; Mon, 24 Feb 2025 20:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428823; 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=fA+AI6Nbn9L89uoetMEn2xwBwfQFpggCnI1VnWAXOhY=; b=NusfFURpXM7AxGEYh0EmQwOoh1/8Fec8lLsDpalotTOaUjQ2IA423B59GBPLHqlHORwl8d IgEkZdE7xC37mc1UougOZH8dbWVUHC8h3eiYYItbCbOh1+v9SNF//OcTOh81X9LJAP+pPu KCgRsjN9qqen5FgqTrnt6mFb60EQ3wyXaOpQ0RRE0LnnBQMnQzhU8KJhWTjpWawI/EJDYf v+zy+PrU+CWY6TcqFUtNyN2gmmeb7iawTydp9PBVrt+fqvV05PovHp/KbjcJPPCAcDbbaX vceQW4q09CcqppfHSUBXqlocFAnOIJpXBH3zosgkhgQepEtzZ8V5iJTd0zD9Eg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428823; a=rsa-sha256; cv=none; b=pZhXiQ9XTQOEtQsVFHrD7yH+Z4rY+TKSpP55rh7z4ispbxQkl06VFHf89JXJnKFWY7eMjQ Wsvfr5OuJ6A6iggvgB0uGp5TsdE5rpUHLEoi95DlYiw1SYks/FUcWkyAO105ZjiWPDkfu9 qjdFSUMaPDSq8tUw+M8Ot0DG1EgRqSCtazryyrpdyCG2JuKwWFczq3WeT+0J991kDTk83l dAfAm4PdMAcK6l8SPGzNw1fy4jzYxQDNJaQH/7xb7HJZNObiwLNl/LBD37FiJ7+R7yBXxM 7R1FrItU4UTqVUwvQn24KJ66nAENMw/o8OoxJUzgOF142qoyAnJtRd+gofzu6g== 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=1740428823; 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=fA+AI6Nbn9L89uoetMEn2xwBwfQFpggCnI1VnWAXOhY=; b=xlv7TK+F+J/kOuCjCeOfoRlqKY42bgzag3LSUQf4SK7hUxdgqHA4TK2GcOVp5C2sqoa2cY 8ZVq1n1NCxwIeats+Lb76z8kwTLBGmY/Cp99eaBOkTyvSUSNkq4hKy4AmYBTbBRE754G3K /i+N9+uGyD54KU9igCVjcVFPdu9RAxR4lB9RcEcUISTloI4LnLd4AUcMGDpjQWz6VOb5Mi TvNaCbYfqGHT3+s+Uq2mMSINW80rv1p+wTmRQU6VHYjjEP+y/YNNcBCE5zERPctcIcpTiU aDKF/8eABvUBWOzGZYQvOmilOoeNuc5xJRbtmaRa54yttg4C/X7v2Lgc9UUn8w== 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 4Z1sj30lh6zwYN; Mon, 24 Feb 2025 20:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR2xQ027012; Mon, 24 Feb 2025 20:27:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR2Nj027009; Mon, 24 Feb 2025 20:27:02 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:02 GMT Message-Id: <202502242027.51OKR2Nj027009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b3c037c2bcad - stable/14 - net80211 / LinuxKPI 802.11: add 802.11-2016 VHT Extended NSS BW defines 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: b3c037c2bcad385b372539875e57fdd2f7215e3d Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b3c037c2bcad385b372539875e57fdd2f7215e3d commit b3c037c2bcad385b372539875e57fdd2f7215e3d Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211 / LinuxKPI 802.11: add 802.11-2016 VHT Extended NSS BW defines Add the mask and shift for the VHT Extended NSS BW Support field. Document them in net80211 and further related bitmasks in LinuxKPI. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48975 (cherry picked from commit 75fb66d8241d0487baf482c975c1de3b55d9a315) --- sys/compat/linuxkpi/common/include/linux/ieee80211.h | 3 ++- sys/compat/linuxkpi/common/include/net/cfg80211.h | 3 ++- sys/net80211/ieee80211.h | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 58ebbcfe0097..0169e12b1804 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -115,7 +115,8 @@ enum ieee80211_rate_control_changed_flags { #define IEEE80211_TKIP_ICV_LEN 4 #define IEEE80211_TKIP_IV_LEN 8 /* WEP + KID + EXT */ -#define IEEE80211_VHT_EXT_NSS_BW_CAPABLE (1 << 13) /* assigned to tx_highest */ +/* 802.11-2016, 9.4.2.158.3 Supported VHT-MCS and NSS Set field. */ +#define IEEE80211_VHT_EXT_NSS_BW_CAPABLE (1 << 13) /* part of tx_highest */ #define IEEE80211_VHT_MAX_AMPDU_1024K 7 /* 9.4.2.56.3 A-MPDU Parameters field, Table 9-163 */ diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 0b6a66033536..ee16449ecd1c 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -236,7 +236,8 @@ struct ieee80211_sta_ht_cap { #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK */ -#define IEEE80211_VHT_CAP_EXT_NSS_BW_MASK 0xc0000000 +#define IEEE80211_VHT_CAP_EXT_NSS_BW_MASK IEEE80211_VHTCAP_EXT_NSS_BW +#define IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT IEEE80211_VHTCAP_EXT_NSS_BW_S struct ieee80211_sta_vht_cap { /* TODO FIXME */ diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index af411016a170..814221430f7f 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -970,6 +970,10 @@ struct ieee80211_vht_operation { #define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x20000000 #define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN_S 29 +/* 802.11-2016, 9.4.2.158.2 VHT Capabilities Information field. */ +#define IEEE80211_VHTCAP_EXT_NSS_BW 0xc0000000 +#define IEEE80211_VHTCAP_EXT_NSS_BW_S 30 + /* * XXX TODO: add the rest of the bits */ From nobody Mon Feb 24 20:27:05 2025 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 4Z1sj60xTlz5ppnp; Mon, 24 Feb 2025 20:27:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj53Mzmz3p1L; Mon, 24 Feb 2025 20:27:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428825; 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=wRzmUCMi36xmtuSLNezWOB725mF5STr+L4sH39Stee4=; b=PcwXMRQQQO/Zm0JxoYwSiTTFIoiXtaMrGJ3GuidNxPxUESiNI87DvjCC3lG9Er5jbAGuYj iEaejdsAMRt/abVLT+0fb164xVvgtETiCplWtHJI9qWKuIZ5IRwB4hpjFCSPRSEnueQXZV MhnDqMgRzfPYlBvm10bVBW6tce0Zn6Izz1LNS/wWsVdBkZUgHUWb2f9HwnY3b5XoLPD61O u/l6stO/CXo1LyQI94cucz3iMPqNLuaIZSPu27TBMW7k7dG/k1f/ZbRiMubelmdRFVbRFj HZ4unHwW73Gi6BTs3Y5Wu7UyiUB7KiMj2ftTNlFMfmDtEw6EApHKIubM6sq3KQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428825; a=rsa-sha256; cv=none; b=DZ4P3nWVBZ75iHPZ0rmIpqz3UxfUP7xfG6P10837dIosSzuIRbh5fpnEyYt0q/mfV4qiCp +LxnNjWo8vAjVGdROyKscJsODxpL3OYaYJvVA6MwTJ/SKXZCdUrypltq1g9oEqskAqZ+NJ l/YYkJmk7SR1/2gGqbRKwM1hOw0czdp+XNfiKRqxZHL91apwVRidUCE0DsFeDBW5nwgwcJ PtLqIVit52YYdkISRByttNU4DXeSkVtvMCFP5Lmw7qXr9dQHKvsCybRB7IJ3HG3zPcfXwU reJao03hsA1OPfLDAWFfERZDHRsO7pwWjsPnkCzyMucsDvrZf3KWQlLV4IuguQ== 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=1740428825; 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=wRzmUCMi36xmtuSLNezWOB725mF5STr+L4sH39Stee4=; b=hKwvNi76ZhSe2/yPLvLtcJGSahtdh2OpFDwyNEPJ1SX+G6Qe+DzzcQWCDrquVrlS4VRjkZ Z3idjZsa/DoQICIzsRr3YxjLAe1g3Pg60GFz6+yWe4mMmcgYiw462OE/ZUWD0uBDJimvaV s33H0L3pgbU5Btq/0+1ce8QALM/9ePWI2RXJt5IWiXlvav2i/V+gwXXOgCYSKjwIHZIQSJ QKNOxIQx3xIzGRYArkEqxLzqsATvYegRp2/FokiZpZ2ElwuxunG90IdWnTzLxrWNTkqFNd fk+JVHG3Rmy++pDDJ86dNie2qVYm99RajXVWnAfLTjyvjR7Tem8oNfd1+AiYQQ== 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 4Z1sj52hY3zwMY; Mon, 24 Feb 2025 20:27:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR5dp027086; Mon, 24 Feb 2025 20:27:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR58R027083; Mon, 24 Feb 2025 20:27:05 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:05 GMT Message-Id: <202502242027.51OKR58R027083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 48f8ed03d32d - stable/14 - net80211: rename \4 in IEEE80211_VHTCAP_BITS for clarity 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 48f8ed03d32de35a2075271512edab9902e19377 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=48f8ed03d32de35a2075271512edab9902e19377 commit 48f8ed03d32de35a2075271512edab9902e19377 Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211: rename \4 in IEEE80211_VHTCAP_BITS for clarity Bits 2 and 3 (\3 and \4 of the %b flag mask) are the 'Supported Channel Width Set' indicating VHT160 (B2) or VHT160 and VHT80P80 (B3) support. Though longer rename \4 from CHAN80P80 to CHAN160+80P80 to not confuse the reader that VHT160 might not be supported. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48977 (cherry picked from commit 7f31d95c98e64eff7b269e457789ed9cfc7b2779) --- sys/net80211/ieee80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index 814221430f7f..a5008796d89f 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -978,7 +978,7 @@ struct ieee80211_vht_operation { * XXX TODO: add the rest of the bits */ #define IEEE80211_VHTCAP_BITS \ - "\20\1MPDU7991\2MPDU11454\3CHAN160\4CHAN8080\5RXLDPC\6SHORTGI80" \ + "\20\1MPDU7991\2MPDU11454\3CHAN160\4CHAN160+80P80\5RXLDPC\6SHORTGI80" \ "\7SHORTGI160\10RXSTBC1\11RXSTBC2\12RXSTBC3\13RXSTBC4\14BFERCAP" \ "\15BFEECAP\27VHT\37RXANTPTN\40TXANTPTN" From nobody Mon Feb 24 20:27:06 2025 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 4Z1sj717RPz5ppr4; Mon, 24 Feb 2025 20:27:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj64GhGz3nmn; Mon, 24 Feb 2025 20:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428826; 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=icE8xMwtllwWzQ4NtzCng+y6JAcQKL8hJarcJpgkjw0=; b=wW/OWSiDY0rfEOvZAup1E7hcOj6hDGLLG3poQfHCcN8tuTD2AH0DYcLU5azwL7Rh60BjfC +ib7XtQOCCut+yO3KDKaZK18uOoy0bx/V6/O3yNPV27i5fVitxaAKMVK1ddW0uBWSyS0lv QY9UgWdegSS3he7NAkyLVLxj96eoo9Jtr9DXnZLZ0pihdGHQ9AbOA+cWIMRYaoqP/sn/q6 b/hg2r36V8/9vLDxdHbYI8uSiJGKk3Tmw69tCcDPWe/m1qbeokXvhdmmRc/JJFjQ1RBWaZ 87B92/ch4UrO5pF5g93K5f+UKz+Ndxe4+3hnlF1JYpOLBdCEf2OwAkENu3BrLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428826; a=rsa-sha256; cv=none; b=K241p7171SLvmHA+3a+PN24xbO8ntVnpyTynD6M0hZYVxRUVdCC0e2ywfi4JUV78Sl+hNB +ppSiG9JB6xqGQBNQYt8YVhLPeV5Q2GAu9Lxx0Aw1+QR6LItvv6zHIwiXUboqcVI9vt5uG sMfryg35aewlTlk9SyjdZMjWA9M86HHfMn69UFsNvfztN0+9d4HQYLasif6fmmLInhAg9G yHCNxo7NLDblX2HkDxZKA0xCz1JpskhUhBKoqu5OhBEdwKRt1MchJ30ZqWV8qrBXip1J3Y TX3zqDM5HWwgXIFUQRE5IL8mVG6kKmjMvR8/EZceCrl/zJXNNn+C3TraTiqBCQ== 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=1740428826; 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=icE8xMwtllwWzQ4NtzCng+y6JAcQKL8hJarcJpgkjw0=; b=uPZMFvXt31WBDHp4CtQHAAPNaRWBPQtP4Kat8lyMM/RmH5kiaUqNvkb4M+QuXX15AClNo4 26HQN92tO1KgaQEqFtAYvjBFp72ChZ21+c7ZYZ9rk4tOICVT+SQDpU8cL3Ha5hNv5+IbJR WOIoyCHeMzeSe72UEuBBGaoc7Rjhrcd6OBettCkzpeOn0O1+eJEicB6mzcwRCzDvz6Blz1 Sj/A704h1e+EawaadQLmswfoAIk3cVjGKAzlrPXtGmtZal0tXOob4Ugz4qZlstKIE3eJVI AzwHEDu423sGkU7EfRsH7UqwGnGjdWviXlX4XxqDx6O4ck1z7H8Bjb0RnU7IaQ== 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 4Z1sj62xhlzwW0; Mon, 24 Feb 2025 20:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR6Co027122; Mon, 24 Feb 2025 20:27:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR6xd027119; Mon, 24 Feb 2025 20:27:06 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:06 GMT Message-Id: <202502242027.51OKR6xd027119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3b84a5133a57 - stable/14 - net80211: crypto: enhance comment about IEEE80211_RX_F_MMIC_STRIP 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3b84a5133a57fd9be48a738b524460f4222815f3 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3b84a5133a57fd9be48a738b524460f4222815f3 commit 3b84a5133a57fd9be48a738b524460f4222815f3 Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:40 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211: crypto: enhance comment about IEEE80211_RX_F_MMIC_STRIP net80211 crypto currently re-uses the M[ichael]MIC flag for MIC as well at least in CCMP. This is a bit confusing so at least try to improve the comment that it becomes more obvious. In the long-term we may want to just add a MIC flag as well? Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48978 (cherry picked from commit d688c20395a9f46d89edab4c57b863b6d752b061) --- sys/net80211/_ieee80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 1ac9328714f7..929de475f4bf 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -567,7 +567,7 @@ struct ieee80211_mimo_info { #define IEEE80211_RX_F_FAIL_MIC 0x00000080 /* Failed MIC check */ #define IEEE80211_RX_F_DECRYPTED 0x00000100 /* Hardware decrypted */ #define IEEE80211_RX_F_IV_STRIP 0x00000200 /* Decrypted; IV stripped */ -#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; MMIC stripped */ +#define IEEE80211_RX_F_MMIC_STRIP 0x00000400 /* Decrypted; [Micheal] MIC ([M]MIC) stripped */ #define IEEE80211_RX_F_SHORTGI 0x00000800 /* This is a short-GI frame */ #define IEEE80211_RX_F_CCK 0x00001000 #define IEEE80211_RX_F_OFDM 0x00002000 From nobody Mon Feb 24 20:27:07 2025 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 4Z1sj80xspz5ppr7; Mon, 24 Feb 2025 20:27:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj74CSsz3p1X; Mon, 24 Feb 2025 20:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428827; 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=1V8KYL0heYPpIQQ+2wNL4IpckPWOj/h7FuP4IH+gbQA=; b=M+TT5SMsJSVcUXzzqmhbNJ+Zi521aLLOMxPk9gvN+u9UqmYMXTzWUGkPG039b3pBJ3wSBd woOHbW0IAk27ixNu4ZXaTzD1BHomOyMPshbhG/bmEefTn8REfLRWius4bx1kfNCZwQezfa Q8wnpPV6NHiC1Ff3srs8uz4YXXaW4CggQN8bRosrlmr4vubqg54U13r/xkcCeMnXE7QLj7 vAXSmsdlYYf9HuML6Kx+UQXsbrtO3p8RK7o216dwh1EXKz/PQ1m2KSGoxEBYvxh40kKeqv 5shRR9j7Rl4WhQfoO4Qe+8C0kkZhqvI/u4EYRo6skwIRf54UIXHy8kKwEJG/vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428827; a=rsa-sha256; cv=none; b=KxfJSv/MoShEW7dMSHEGvYpa4t9qexVhtSaBVpvd2j1PoJ/TzgL066nXXpgA/PmnWTqi6t rV13lwpsJE4PjGJ1xWBMFsapRlwPtLd0bu7d7foRjW5jVvKJ7P+O6of3VA3eUAjUhvzGAi yytFbR1S0Cbuj+mxbx6fb8uNN3otK2VVD66zSdZaUrA2nIUGSteGIlHb5YyZHGdKcX5Ffm o/q7pkrgaAv2pAbf2VjBbFjxTofg0m90oGXTSQgr2cQ0dbAE9kzqNQnLApntWixzWAtPZ6 ZH67ntnYJlru06B7776ICMxJK+ZNin5rRd/dcdYvUp/77m01kV4snr2oCBEENg== 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=1740428827; 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=1V8KYL0heYPpIQQ+2wNL4IpckPWOj/h7FuP4IH+gbQA=; b=EtXb3HZ9zuCk9lGvxa1WMlcvqeFdNXLtjmorvit513q4xXbfSPIbbxGxyfewrRWzCWC7lW s86eXnXzrOM5zVtyRbSbWh+v7TPHHrPbmlK+FA9v3B2jVRwTPveIEZFcO7gsQCB4teO26u AfUcHVNw9zUKNPDS4Brm5BBgAz3Y6jszBFs+1tSvxaTyA4xaLHDGVT1w6jEsE3942nThzs 6+zbF1b2KGpOK8lRlW3WMFTEvrj2PY9APsR+zHj/X0tHhivTqj7uR1vTfmZkXH2rl+++ck GKSMcwtz48xtCuOZBzf3dqBMjvgvkBmEdFqv9RfgiixkKMD41khcYro0MQDzGg== 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 4Z1sj73bB1zw3X; Mon, 24 Feb 2025 20:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR7K6027165; Mon, 24 Feb 2025 20:27:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR7pI027162; Mon, 24 Feb 2025 20:27:07 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:07 GMT Message-Id: <202502242027.51OKR7pI027162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6ddcff36f154 - stable/14 - net80211: use IEEE80211_KEY_UNDEFINED() insetad of checking they keyix 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ddcff36f1545b8868094eff686132e293553d52 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6ddcff36f1545b8868094eff686132e293553d52 commit 6ddcff36f1545b8868094eff686132e293553d52 Author: Bjoern A. Zeeb AuthorDate: 2025-02-15 12:40:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:47 +0000 net80211: use IEEE80211_KEY_UNDEFINED() insetad of checking they keyix For ieee80211_node_delucastkey() rather than checking the keyix to be IEEE80211_KEYIX_NONE use the IEEE80211_KEY_UNDEFINED() macro (which chekes the wk_cipher to be 'none'). Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48980 (cherry picked from commit 9763fec11b83a7bfc2d2ba0681830d186a3f6a6e) --- sys/net80211/ieee80211_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 17ddc8533e41..f2fc3d21a361 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2209,7 +2209,7 @@ ieee80211_node_delucastkey(struct ieee80211_node *ni) IEEE80211_NODE_LOCK(nt); nikey = NULL; status = 1; /* NB: success */ - if (ni->ni_ucastkey.wk_keyix != IEEE80211_KEYIX_NONE) { + if (IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) { keyix = ni->ni_ucastkey.wk_rxkeyix; status = ieee80211_crypto_delkey(ni->ni_vap, &ni->ni_ucastkey); if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) { From nobody Mon Feb 24 20:27:08 2025 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 4Z1sj91LQfz5pptK; Mon, 24 Feb 2025 20:27:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj85sN7z3nn5; Mon, 24 Feb 2025 20:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428828; 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=8PeaQyGTimWYxlcmAEee5c/n8h9wOQZsIJGkyfxJB6A=; b=ZpggzUoycjDn+XrHcDGJoDnyBFAXWgUeBk5gRe6wQM855tZpl3viWNm1+hRsSoEWC84s4q Ax4LXvq2mwYDJACGWfYJ17b6/BbGMgvfgWkEDIHCefWJj8HAUCYkoCjg66qLqux6B8RnAc EnuySnx43vHhN65ZJsi0fCZP/zmdiSjtIg03cqEf6B/jEpRWYjXLkvS+lCLcJ6uuXRkC9m 6gc/J7HYAc/RtdPKp/k5N4+0CRnI0GN8SU1jqbLKqccsWpDM91BEotXaX6qtziAI9yMslg uFXoW0kTZtpmb9sd2WIKcnHwBk5Ep27vG7UqoJi+0g6TiXQxDGoiEAuDgHIQeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428828; a=rsa-sha256; cv=none; b=JgDfOE3VEdFqYWVokmPazh+j4XvLebfPezX/VIn1I78zfVTecbBjaky54bf9nJ6cEMyO0j t5IWLj6IfN+k0V4ydEk4IZO6/GnJ7VtGp30DBOfYns/2Lk/tT4UZyIXOzKdArm4tGHQQCy 4Owaavr4Kcfy9K9S8Xch31tpP6s6Gi3upbbMzVQ+D6Ma17WjfeSxI2ghRKrnKqma+SVXR3 feEUB43yU1te1AhDzEA0JqG886dDgQ6cnReO6oHsqQJSjS0CAzVb+TPtJB2nmW8KvL9pTH mN2oqPrQlOGOgamzx9XkzOEO2U2TVmn0xPo+bKm3JixJ6XX81VpT3+SiTky1lQ== 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=1740428828; 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=8PeaQyGTimWYxlcmAEee5c/n8h9wOQZsIJGkyfxJB6A=; b=BwrwaHji5B9QXa6IIyLL9KAzVQ6AXmpoQp8QmmfvuVTCUxrO7jYARvoLCCCHEGdUqGIEea gaw2gX7hMk/8RuYXvbVpCj5qwxD582eAxRVL7hfaDxhFNaKA7P8vC4DpGqH7lVwdLahWaE 1rYxTpFGWsaZSmDCISdW9mFYDdCfxoK/aelyM8KtZE+dEbAEpNDpC3N5Kh6FFSKiY/Kie5 TiP8glUbT3vRGcn3nxMvIIn7f6TTjsOVTLuPill1syHLM7VAMNnE3Cmc1InF9HsJ3mErB/ 3G54FdhPmC7zTbxj2KejFFE47CUPm2chvoVFRZvL58zw2Hk7aLqdsoDsbTnnxQ== 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 4Z1sj84n8ZzvnG; Mon, 24 Feb 2025 20:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR8JM027201; Mon, 24 Feb 2025 20:27:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR8G6027198; Mon, 24 Feb 2025 20:27:08 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:08 GMT Message-Id: <202502242027.51OKR8G6027198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 09d83ae036c7 - stable/14 - LinuxKPI: 802.11: adjust the hw_scan channel list 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 09d83ae036c7cd28256fede833fbd33f78afd769 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=09d83ae036c7cd28256fede833fbd33f78afd769 commit 09d83ae036c7cd28256fede833fbd33f78afd769 Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 23:26:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 LinuxKPI: 802.11: adjust the hw_scan channel list Until net80211 will grow proper scan offload with the various options needed and will allow switching the scan engine try to improve the situation if we are doing a hw_scan and the device supports SINGLE_SCAN_ON_ALL_BANDS. In that case create the channel list from our device information of supported channels rather than from the net80211 scan list. Filter out currently unsupported bands. While the general "scan EBUSY" problem remains at least in my local testing I am seeing a lot more 2 and 5 GHz band results rather than being stuck on a single band (as was also often the case with iwm for me in the past). Tested by: rene (previous version) (cherry picked from commit c272abc5c6a72881f1252f069d79990201559d1a) --- sys/compat/linuxkpi/common/src/linux_80211.c | 61 +++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index d0dde529c7a8..02cacc62a4c2 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 2020-2024 The FreeBSD Foundation - * Copyright (c) 2020-2024 Bjoern A. Zeeb + * Copyright (c) 2020-2025 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -3268,7 +3268,6 @@ sw_scan: /* XXX want to adjust ss end time/ maxdwell? */ } else { - struct ieee80211_channel *c; struct ieee80211_scan_request *hw_req; struct linuxkpi_ieee80211_channel *lc, **cpp; struct cfg80211_ssid *ssids; @@ -3285,14 +3284,31 @@ sw_scan: band_mask = 0; nchan = 0; - for (i = ss->ss_next; i < ss->ss_last; i++) { - nchan++; - band = lkpi_net80211_chan_to_nl80211_band( - ss->ss_chans[ss->ss_next + i]); - band_mask |= (1 << band); - } - - if (!ieee80211_hw_check(hw, SINGLE_SCAN_ON_ALL_BANDS)) { + if (ieee80211_hw_check(hw, SINGLE_SCAN_ON_ALL_BANDS)) { +#if 0 /* Avoid net80211 scan lists until it has proper scan offload support. */ + for (i = ss->ss_next; i < ss->ss_last; i++) { + nchan++; + band = lkpi_net80211_chan_to_nl80211_band( + ss->ss_chans[ss->ss_next + i]); + band_mask |= (1 << band); + } +#else + /* Instead we scan for all channels all the time. */ + for (band = 0; band < NUM_NL80211_BANDS; band++) { + switch (band) { + case NL80211_BAND_2GHZ: + case NL80211_BAND_5GHZ: + break; + default: + continue; + } + if (hw->wiphy->bands[band] != NULL) { + nchan += hw->wiphy->bands[band]->n_channels; + band_mask |= (1 << band); + } + } +#endif + } else { IMPROVE("individual band scans not yet supported, only scanning first band"); /* In theory net80211 should drive this. */ /* Probably we need to add local logic for now; @@ -3346,9 +3362,11 @@ sw_scan: *(cpp + i) = (struct linuxkpi_ieee80211_channel *)(lc + i); } +#if 0 /* Avoid net80211 scan lists until it has proper scan offload support. */ for (i = 0; i < nchan; i++) { - c = ss->ss_chans[ss->ss_next + i]; + struct ieee80211_channel *c; + c = ss->ss_chans[ss->ss_next + i]; lc->hw_value = c->ic_ieee; lc->center_freq = c->ic_freq; /* XXX */ /* lc->flags */ @@ -3357,6 +3375,27 @@ sw_scan: /* lc-> ... */ lc++; } +#else + for (band = 0; band < NUM_NL80211_BANDS; band++) { + struct ieee80211_supported_band *supband; + struct linuxkpi_ieee80211_channel *channels; + + /* Band disabled for scanning? */ + if ((band_mask & (1 << band)) == 0) + continue; + + /* Nothing to scan in band? */ + supband = hw->wiphy->bands[band]; + if (supband == NULL || supband->n_channels == 0) + continue; + + channels = supband->channels; + for (i = 0; i < supband->n_channels; i++) { + *lc = channels[i]; + lc++; + } + } +#endif hw_req->req.n_ssids = ssid_count; if (hw_req->req.n_ssids > 0) { From nobody Mon Feb 24 20:27:09 2025 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 4Z1sjC0yvhz5pq1h; Mon, 24 Feb 2025 20:27:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sj96Yhpz3nlK; Mon, 24 Feb 2025 20:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428830; 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=fM92Zes/vdGct5LmEIUCbt3SwUd84isdViCoD4eKEMo=; b=TIIpimJ0CPU+nFUrfDOJkRJVQPhPQBE/cnD3EwreCyIEOLqoAqjnrs/4KAjd5fN9SPpxCs 3wRQVV8JXaA8tMiSQDoFdVDTUzXKphqseKvDvPl/64BhL75jB/W/K5Pq38W9o21vCYum6z aX6uktIUbHMnYQmq9KLYRtKTyYsGlax34jUJD0JlCOg93WBDPelL4v0ttXIuL4RbXxSokI EU8met4Mm5YNKt6eqT8o1hMLJvX6VOeBiKMiJeRkSVG+v7+zaO+ig3Z+eoUSjgboEDRzR0 NbHoFKuSrRP7Qegb0EWu327NwT7jmrUCOyLc3cAWX9AdbZ+YhRVUd9xEcH2Tdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428830; a=rsa-sha256; cv=none; b=y2qapqUKRkRiy599gCl12PxWuW8mSVEUoP4yHbDywyYYwSY1moDyi2VZ7SX04fQw53K3Ul oFxdsuxPI9QU2I0vRw1XczF1yMCVydtxSeROvEOfRSLI8IHI/9nbsPRtmnNHMkRayrmdyo L+zhCJcmBwHDqEdvo58XSof/v0Wk65YKMPObAv72w0kKOHGU/X1FfJg2ldLekMHJdp4Hi8 0pc+R8gT9aiZNi1HcRvRF3OdVM/GCJOD0oGoSq87Nr25LOtWe1rOBWR2vsFQbam0KiKdRc i87CmQ5c+6alQGN678ke4HF8xb4lYm1wtEtYP3dIYkDzqDise2Zl/IB/YaIzUQ== 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=1740428830; 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=fM92Zes/vdGct5LmEIUCbt3SwUd84isdViCoD4eKEMo=; b=vigChASSiu3ZvxpokKnY9sNoDgScip7SLYFMl2CEOKfR3+2SSU1gsXlXSJEFg8PRaeTs7T JQTnLE3stcvnErtLds8Z3KPXIYTxTgcxENuAZNgJnxPbyhwBzhidtRUeC/yMB+4K0BBCZx JT6k1jY8YksCsBJRbtzrlLPNbAlsB2x/UYeJruvTKX7kNM0td2bGpxR19JMDlMqd0KZFBh 97A0sL7snRNHm0yAG0cF/r+uNq9hPmaAzOo7TReKwmDcsUzVrCPHCGRy2skVR3Q9LelKJt vWG8vm9UVRq+L7LtyXXIPHoJpiFm8Lx6WyTFtG7jZIjmj5SHr2RIKCC71Xpppg== 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 4Z1sj95sZGzwSY; Mon, 24 Feb 2025 20:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKR9Af027236; Mon, 24 Feb 2025 20:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKR96p027233; Mon, 24 Feb 2025 20:27:09 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:09 GMT Message-Id: <202502242027.51OKR96p027233@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6062817529c8 - stable/14 - LinuxKPI: 802.11: implement various VHT helper functions 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6062817529c88812af89607a0bde14720c64cc16 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6062817529c88812af89607a0bde14720c64cc16 commit 6062817529c88812af89607a0bde14720c64cc16 Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 11:05:33 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 LinuxKPI: 802.11: implement various VHT helper functions Implement ieee80211_rate_set_vht(), ieee80211_rate_get_vht_{mcs,nss}(), and ieee80211_get_vht_max_nss(). Sponsored by: The FreeBSD Foundation (cherry picked from commit 5778cbdae7616c09efa6ccdd8c611d82cbc75f00) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 136 +++++++++++++++++++--- 1 file changed, 118 insertions(+), 18 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 8872be569e44..f5d3e1036edc 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2024 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2020-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -1876,26 +1877,133 @@ ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, /* -------------------------------------------------------------------------- */ -static __inline void -ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint32_t f1, uint32_t f2) +static inline void +ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint8_t mcs, uint8_t nss) { - TODO(); + + /* XXX-BZ make it KASSERTS? */ + if (((mcs & 0xF0) != 0) || (((nss - 1) & 0xf8) != 0)) { + printf("%s:%d: mcs %#04x nss %#04x invalid\n", + __func__, __LINE__, mcs, nss); + return; + } + + r->idx = mcs; + r->idx |= ((nss - 1) << 4); } -static __inline uint8_t +static inline uint8_t ieee80211_rate_get_vht_nss(struct ieee80211_tx_rate *r) { - TODO(); - return (0); + return (((r->idx >> 4) & 0x07) + 1); } -static __inline uint8_t +static inline uint8_t ieee80211_rate_get_vht_mcs(struct ieee80211_tx_rate *r) { - TODO(); - return (0); + return (r->idx & 0x0f); } +static inline int +ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, + enum ieee80211_vht_chanwidth chanwidth, /* defined in net80211. */ + int mcs /* always 0 */, bool ext_nss_bw_cap /* always true */, int max_nss) +{ + enum ieee80211_vht_mcs_support mcs_s; + uint32_t supp_cw, ext_nss_bw; + + switch (mcs) { + case 0 ... 7: + mcs_s = IEEE80211_VHT_MCS_SUPPORT_0_7; + break; + case 8: + mcs_s = IEEE80211_VHT_MCS_SUPPORT_0_8; + break; + case 9: + mcs_s = IEEE80211_VHT_MCS_SUPPORT_0_9; + break; + default: + printf("%s: unsupported mcs value %d\n", __func__, mcs); + return (0); + } + + if (max_nss == 0) { + uint16_t map; + + map = le16toh(vht_cap->supp_mcs.rx_mcs_map); + for (int i = 7; i >= 0; i--) { + uint8_t val; + + val = (map >> (2 * i)) & 0x03; + if (val == IEEE80211_VHT_MCS_NOT_SUPPORTED) + continue; + if (val >= mcs_s) { + max_nss = i + 1; + break; + } + } + } + + if (max_nss == 0) + return (0); + + if ((le16toh(vht_cap->supp_mcs.tx_mcs_map) & + IEEE80211_VHT_EXT_NSS_BW_CAPABLE) == 0) + return (max_nss); + + supp_cw = le32_get_bits(vht_cap->vht_cap_info, + IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); + ext_nss_bw = le32_get_bits(vht_cap->vht_cap_info, + IEEE80211_VHT_CAP_EXT_NSS_BW_MASK); + + /* If requested as ext nss not supported assume ext_nss_bw 0. */ + if (!ext_nss_bw_cap) + ext_nss_bw = 0; + + /* + * Cover 802.11-2016, Table 9-250. + */ + + /* Unsupported settings. */ + if (supp_cw == 3) + return (0); + if (supp_cw == 2 && (ext_nss_bw == 1 || ext_nss_bw == 2)) + return (0); + + /* Settings with factor != 1 or unsupported. */ + switch (chanwidth) { + case IEEE80211_VHT_CHANWIDTH_80P80MHZ: + if (supp_cw == 0 && (ext_nss_bw == 0 || ext_nss_bw == 1)) + return (0); + if (supp_cw == 1 && ext_nss_bw == 0) + return (0); + if ((supp_cw == 0 || supp_cw == 1) && ext_nss_bw == 2) + return (max_nss / 2); + if ((supp_cw == 0 || supp_cw == 1) && ext_nss_bw == 3) + return (3 * max_nss / 4); + break; + case IEEE80211_VHT_CHANWIDTH_160MHZ: + if (supp_cw == 0 && ext_nss_bw == 0) + return (0); + if (supp_cw == 0 && (ext_nss_bw == 1 || ext_nss_bw == 2)) + return (max_nss / 2); + if (supp_cw == 0 && ext_nss_bw == 3) + return (3 * max_nss / 4); + if (supp_cw == 1 && ext_nss_bw == 3) + return (2 * max_nss); + break; + case IEEE80211_VHT_CHANWIDTH_80MHZ: + case IEEE80211_VHT_CHANWIDTH_USE_HT: + if ((supp_cw == 1 || supp_cw == 2) && ext_nss_bw == 3) + return (2 * max_nss); + break; + } + + /* Everything else has a factor of 1. */ + return (max_nss); +} + + static __inline void ieee80211_reserve_tid(struct ieee80211_sta *sta, uint8_t tid) { @@ -2239,14 +2347,6 @@ ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif, uint32_t link_id) return (-1); } -static __inline int -ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, uint32_t chanwidth, - int x, bool t, int nss) -{ - TODO(); - return (-1); -} - static __inline bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif, uint32_t link_id) { From nobody Mon Feb 24 20:27:10 2025 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 4Z1sjD3zJWz5pq3w; Mon, 24 Feb 2025 20:27:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjC1X4Vz3p1w; Mon, 24 Feb 2025 20:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428831; 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=503gNOOULJ4Fj/0mM3Cf5Ru17Mu34NC5Mxi+/S5MWCU=; b=ER3bkE8TvRWb5vxWPTP/WZCgBEVBG1CLlAe1sXLGv6Z9yTw+O7WSx16IYTlEAobMC05OTu ZORPpFqi64nBhcuVupdDH0HnDdH3P5fDdwDKnp5U72sTOgq2fVmZRJyzKPC/5fSJDbobDR aPuDMeOa6sXdays2p5mfM9qSyPryR+RqDhCRMZBR3rzDqOMkdFlLEV1EzBQUw8rxFnobY/ RSVUfONtaUYeBSBGEiqJeqfvbyvRFqml2FxGyJm2+uJNscbIbGFSQPxzLfWhZUttMSpn2L R52ij9ijSZa1cXCzk5vyxgWVyZMZFsHz881gYbEGgqy1OksODskllV+CM9FSvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428831; a=rsa-sha256; cv=none; b=koBrjWzaizpoQ/1kpICEA/CTcmbSHubSZ+7gGzv744O2TyDGp9UjjwlGNbNlGJSlgJdcJ7 kd/2WYw+VQ76lLdAq/Q1bWbgIOLXDBkIF48PoMnIEHsab4647aBFqlj897lKwQ0Lk9hHQa uMNdWiiJlakNNUFRwm3N3iYOEBU1aLEQ8j+DAqLJmX2JrikI8MX2jgf0M9gYkoRUsp9UCA ZJg6hgreKGsSxwCupEogLnyj2bzLeZCh2jSgj4nMalaHanQ20s20q87ql35GZt4MJ+T8/7 8xNvc7lbBkQfTqXBdKs2mBXlhzahCL+W4inNTdLaC0XmNdIDOwrTL5UhFhn7kw== 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=1740428831; 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=503gNOOULJ4Fj/0mM3Cf5Ru17Mu34NC5Mxi+/S5MWCU=; b=yqsVnDVPqUgoNk9UfZlPGNxRMZAI+Os/vkp4zPKqXLKvhn6Gnl9hdNdC3q9Y29dG5f4p5Q DiamvN30T3VaG5d/XzvjK3+gsXJsoCvSw629XiYeFALmqox53SWlX4UAGMZT44dM17AmC4 1uChkumGgNRRa8954RGUkYr++t6lw7GskgKsYF5Z4TqqNhExpmDbUqG5HDdLqIpYuW4xNY tVoOURnKBUs8sungh44ZqL3HD9LmChUAE2I5Hp4qKe6+gMAwuTbzI8pJm2uKAWWJVLT+I8 F6E4ajrXSXsb3sZc90f1xTAsGCpbdsTh+9i93jYxh8zdfQd0IJ+Z3kNYe975yA== 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 4Z1sjB6l8rzwYP; Mon, 24 Feb 2025 20:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRApC027273; Mon, 24 Feb 2025 20:27:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRAdr027270; Mon, 24 Feb 2025 20:27:10 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:10 GMT Message-Id: <202502242027.51OKRAdr027270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bdc94f09bd96 - stable/14 - net80211/crypto: LinuxKPI/802.11: introduce IEEE80211_RX_F_PN_VALIDATED 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: bdc94f09bd96b28dcb841afa31f44b0879130134 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bdc94f09bd96b28dcb841afa31f44b0879130134 commit bdc94f09bd96b28dcb841afa31f44b0879130134 Author: Bjoern A. Zeeb AuthorDate: 2025-01-07 12:02:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 net80211/crypto: LinuxKPI/802.11: introduce IEEE80211_RX_F_PN_VALIDATED There are cases when we see "rx seq# violation (CCMP)". Historically these were AHDEMO/IBBS cases (IEEE80211_KEY_NOREPLAY, see 5d766a09daab2). With iwlwifi(4) doing RSS for newer chipsets and us not having any idea about multiple rx-queues (passed all the way through) leads to the same problem. An easy way to trigger this is doing an IPv6 all-nodes echo request. With a sufficient amount of nodes answering the answers will be hashed to different queues and re-ordering will likely take place as queues get released individually. However crypto validation is already done in fw/driver for these cases and we need to carry the state forward. Add IEEE80211_RX_F_PN_VALIDATED to indicate that the checks were done passing the information from driver through LinuxKPI to net80211. LinuxKPI enforces that a frame was indeed decrypted; otherwise the flag would be invalid. This also avoids returning an error and no key from ieee80211_crypto_decap() and thus avoids dropping the frame. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D49029 (cherry picked from commit ec6185c52661d3af0dac6dcc8701fc49fae3e1d9) --- sys/compat/linuxkpi/common/src/linux_80211.c | 16 +++++++++++++++- sys/net80211/_ieee80211.h | 1 + sys/net80211/ieee80211_crypto_ccmp.c | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 02cacc62a4c2..7b0ddc3cbf9a 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2024 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2020-2025 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -5425,6 +5425,20 @@ no_trace_beacons: rx_stats.c_freq = rx_status->freq; rx_stats.c_ieee = ieee80211_mhz2ieee(rx_stats.c_freq, rx_stats.c_band); + /* + * We only need these for LKPI_80211_HW_CRYPTO in theory but in + * case the hardware does something we do not expect always leave + * these enabled. Leaving this commant as documentation for the || 1. + */ +#if defined(LKPI_80211_HW_CRYPTO) || 1 + if (rx_status->flag & RX_FLAG_DECRYPTED) { + rx_stats.c_pktflags |= IEEE80211_RX_F_DECRYPTED; + /* Only valid if decrypted is set. */ + if (rx_status->flag & RX_FLAG_PN_VALIDATED) + rx_stats.c_pktflags |= IEEE80211_RX_F_PN_VALIDATED; + } +#endif + /* XXX (*sta_statistics)() to get to some of that? */ /* XXX-BZ dump the FreeBSD version of rx_stats as well! */ diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 929de475f4bf..8b86cd612168 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -573,6 +573,7 @@ struct ieee80211_mimo_info { #define IEEE80211_RX_F_OFDM 0x00002000 #define IEEE80211_RX_F_HT 0x00004000 #define IEEE80211_RX_F_VHT 0x00008000 +#define IEEE80211_RX_F_PN_VALIDATED 0x00010000 /* Decrypted; PN validated */ /* Channel width */ #define IEEE80211_RX_FW_20MHZ 1 diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 45e795a8799b..8f7d5eed593c 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -238,6 +238,7 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) struct ieee80211_frame *wh; uint8_t *ivp, tid; uint64_t pn; + bool noreplaycheck; rxs = ieee80211_get_rx_params_ptr(m); @@ -261,8 +262,10 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) } tid = ieee80211_gettid(wh); pn = READ_6(ivp[0], ivp[1], ivp[4], ivp[5], ivp[6], ivp[7]); - if (pn <= k->wk_keyrsc[tid] && - (k->wk_flags & IEEE80211_KEY_NOREPLAY) == 0) { + + noreplaycheck = (k->wk_flags & IEEE80211_KEY_NOREPLAY) != 0; + noreplaycheck |= (rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_PN_VALIDATED) != 0; + if (pn <= k->wk_keyrsc[tid] && !noreplaycheck) { /* * Replay violation. */ @@ -302,7 +305,14 @@ finish: * Ok to update rsc now. */ if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { - k->wk_keyrsc[tid] = pn; + /* + * Do not go backwards in the IEEE80211_KEY_NOREPLAY cases + * or in case hardware has checked but frames are arriving + * reordered (e.g., LinuxKPI drivers doing RSS which we are + * not prepared for at all). + */ + if (pn > k->wk_keyrsc[tid]) + k->wk_keyrsc[tid] = pn; } return 1; From nobody Mon Feb 24 20:27:11 2025 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 4Z1sjD6zXdz5pq40; Mon, 24 Feb 2025 20:27:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjD3h8Sz3njC; Mon, 24 Feb 2025 20:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428832; 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=+2+EbZHH3SQ2mu7iisAAptsUqrqRPVTNTl7sEweS3+4=; b=r09A5tUaX+kdoSeyaITL4Jl298ehdpnG9mzlkM8OKIhQhneVXOz7DJMCMHOYiM9m/aHILw gfGJd1olTy9+FCUkZ9ktcUs1HXhEp/ljZWsHiqzJ4PE/M/HEWtBGbe5BhSaTZTldIsU0bP m8HnBkwzhMetNLPe8AyzI1d8lMcotayqTmLysgpXo0aOTGZpMPoXByGVej2rlbvZ9LNcNP gX912W9cwTLY+s2rWKGJgdgs1vrcGWX6j2xBk0e+/dSa+DmApd1CdTwjCPZ50TND5mSoIF w7QvNo+tu9upToMn7IRtKw6tcv7E9Ci4RW8cy9p1qMtOu4LqcNAiwU722kPfag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428832; a=rsa-sha256; cv=none; b=nF93kqeCKChHYsAvirtKcUkguHk+Gov2dEfUeHa/7eX2JPRrHSpeCG64ttqM4FELOftauw s3xyDJw25OgnMIY0vRPSpd6hDGsyB2hUQ1TG78U7m3O89/JIH9SCQvaIqNwB6zJ9ojnqhL eW444IeJvSCfc5AjLpOz1r1NaJiYWlJU0TBoBy1Dm2zUuPUVyv8PMW/JF8kFyw0m9vVdzr 1pNP/10OoUD4bpbxArxCUJrm5ZSnqsk70nl38wn5e6WurGAsZ00vF96Cl0coovTb7Vsm/i 19q3yTPVNGJoyq6M0lVvzdcWwrne2m2xnk+wT357gOqIkKbOvEIISocm6tJYGA== 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=1740428832; 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=+2+EbZHH3SQ2mu7iisAAptsUqrqRPVTNTl7sEweS3+4=; b=R8JyV6tbmwdhEmsv+OGbw+pWE4emHmpRNlxzrd5ZX7WK7JyG83nieah/y4/2JqHalLYvj0 7ot0lkwkPGcoU88ALGdp2L0qagjqDomcosdO20aFZU6HayUzRYhrRMU2j7qLd4Yyt2TdeN ea4QVxyF07MDxFKaAXJsQltCIDKXFqQQqgE2lTI4npWsm0MKs8PN9nkpDXU3OMATIGixAJ eVaTiZM4nJX85+aoxJCaD3pJs1K/SOJCYhgU3oBbnWsZAR4iSy6ieiE6n9dxatPzAex+Vl yvFb+OsMNtVIGg96XnMile89Q+YIZj01BiQuVp31FiPp2esq1JrcLEc6KjKnzg== 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 4Z1sjD0RxMzw3Y; Mon, 24 Feb 2025 20:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRBCH027308; Mon, 24 Feb 2025 20:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRBOG027305; Mon, 24 Feb 2025 20:27:11 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:11 GMT Message-Id: <202502242027.51OKRBOG027305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e8376bc284f1 - stable/14 - net80211: crypto: ccmp: fix more hardware offload bits 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: e8376bc284f187e0299def398259a9a4ecdeb61f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e8376bc284f187e0299def398259a9a4ecdeb61f commit e8376bc284f187e0299def398259a9a4ecdeb61f Author: Bjoern A. Zeeb AuthorDate: 2025-01-27 13:54:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 net80211: crypto: ccmp: fix more hardware offload bits Add the missing IEEE80211_RX_F_DECRYPTED and IEEE80211_RX_F_MMIC_STRIP (really just MIC_STRIP) checks to make hwaccel offload work. This makes rtw8x drivers pass RX packets again at least with LinuxKPI if HW_CRYPTO support is enabled. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D49030 (cherry picked from commit 3afc0bfecb1a927c37672dc245688c575e4d9ec4) --- sys/net80211/ieee80211_crypto_ccmp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 8f7d5eed593c..06028cf2a37c 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -602,6 +602,7 @@ done: static int ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen) { + const struct ieee80211_rx_stats *rxs; struct ccmp_ctx *ctx = key->wk_private; struct ieee80211vap *vap = ctx->cc_vap; struct ieee80211_frame *wh; @@ -613,6 +614,10 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen uint8_t *pos; u_int space; + rxs = ieee80211_get_rx_params_ptr(m); + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_DECRYPTED) != 0) + return (1); + ctx->cc_vap->iv_stats.is_crypto_ccmp++; wh = mtod(m, struct ieee80211_frame *); @@ -675,6 +680,14 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct mbuf *m, int hdrlen space = m->m_len; } } + + /* + * If the MIC (we use MMIC despite not being Micheal) was stripped + * by HW/driver we are done. + */ + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) != 0) + return (1); + if (memcmp(mic, a, ccmp.ic_trailer) != 0) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, "%s", "AES-CCM decrypt failed; MIC mismatch"); From nobody Mon Feb 24 20:27:13 2025 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 4Z1sjJ5NJxz5pptQ; Mon, 24 Feb 2025 20:27:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjG4nZZz3nlb; Mon, 24 Feb 2025 20:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428834; 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=YerEhvD4HTQm6KJS76s/GgHQk9FdAQfGigCl9er8N7M=; b=yZ4NNb8oH/wDoM2Gy/4s9BZthi/l+i6FllFHyFE4+UvOJcQ9UhiXf1bJMiD62vZmHOclF9 OkxzLqYVupL8lmVSoXT7tqa7uL84zHH5+bSdRVJaVIDTtI3+5EhzxP8lO/Oqp+I68az/yC dBbo6SepQS6an78pSxPpv43MVI+ScFStTu86yCc0SKAgT1wkemZM6k+sDlf8eVH8yoeIS5 tQoFD5Nsl6nyw99AYksvd0sA/AcEVikTHIKoqKc5QN93quHEBrygYOuUd870ACrJWgpQdt s6YvlGG412OgKWQUokbpl6dXJgde8BjJ+0cpf1WtVF3kc+bbSmx/+rH4ZEJc8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428834; a=rsa-sha256; cv=none; b=wfl8DVEoqG7HolHMuppjQh6a1g9zkKzuYBBJ98oTP87bSEJgMiBa8m0s41OXond+9fuOrY 2FzkvNYwy+O2fLEvrrGLtl4V+Gdz3SwS9VoL/BsyTLGl02i5ysBPj16RHXay+COOlS/cIH CD9k989d6kRiYIUnzld+6vk+bn04BMd9iHNFxzS6djRMi/B6ASO4zvJkH3LboNtJxiPVo1 YxVYKbBkRxizswwzU3dbDcyM1qxH4K81A6puQWbyJ54TiXsthTZ9fVr/6LA2GMW61dFqu2 OpomaVnRI/71rQFpbA4w/iFH4NTT/Dfc8Ljbd4sLEdf7RlF1ZZZ7CL15tolyIw== 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=1740428834; 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=YerEhvD4HTQm6KJS76s/GgHQk9FdAQfGigCl9er8N7M=; b=Jqwu457K44h4K3imPnkZkYysQ7Mzdm5vJdmJo/7Mgdl9d2yp3FLOYW7TdHsE0YmiCk7/ur j0Jpxi6CN3nb1pVXnKrvCVx5/uRGTXNV90cuj4y3crw3AtHmVMjiLIUk13gWewq1ntsupZ tUt+flDZjH6GYgYZ4YKmZNn53iBG2Ah0NBSDaXeUeuYN9c6yWANHblIcYqeVKAjnhrvjzc Zi4juvb3J+f7OtISbFZlQVYhol6bph2JDf2z3irr40vZ1qWuckPTKiXwdgkbHXXZcLXSsu S/7ZId1MCsMdIa+kQgspXp1Ck/832BDvIQdZYpg+NizjeaipiJl96TvuX1tQlw== 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 4Z1sjF1d07zwPx; Mon, 24 Feb 2025 20:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRD3D027350; Mon, 24 Feb 2025 20:27:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRDGC027347; Mon, 24 Feb 2025 20:27:13 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:13 GMT Message-Id: <202502242027.51OKRDGC027347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6b244c766608 - stable/14 - LinuxKPI: 802.11: fill in a lot more RX status fields 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6b244c766608d70ea4e9e7615f34c4339b86486c Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6b244c766608d70ea4e9e7615f34c4339b86486c commit 6b244c766608d70ea4e9e7615f34c4339b86486c Author: Bjoern A. Zeeb AuthorDate: 2025-01-28 00:20:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 LinuxKPI: 802.11: fill in a lot more RX status fields Convert a lot more LinuxKPI rx_status fields to net80211 rx_stats bits for as much as we can see fit. Factor the entire logic out into its own function as it got quite long. Now only net80211 needs to start using more of these values and report them. Also fix some related fields and struct definitions in LinuxKPI. Sponsored by: The FreeBSD Foundation (cherry picked from commit 49010ba706d39fba0d8bc128d96e6122e65eb8ad) --- .../linuxkpi/common/include/linux/ieee80211.h | 4 +- sys/compat/linuxkpi/common/include/net/cfg80211.h | 9 +- sys/compat/linuxkpi/common/include/net/mac80211.h | 10 +- sys/compat/linuxkpi/common/src/linux_80211.c | 196 +++++++++++++++++---- 4 files changed, 170 insertions(+), 49 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 0169e12b1804..20527a8174f5 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -100,7 +100,9 @@ struct ieee80211_mmie_16 { #define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020 #define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100 -#define IEEE80211_RATE_SHORT_PREAMBLE BIT(0) +enum ieee80211_rate_flags { + IEEE80211_RATE_SHORT_PREAMBLE = BIT(0), +}; enum ieee80211_rate_control_changed_flags { IEEE80211_RC_BW_CHANGED = BIT(0), diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index ee16449ecd1c..bcbf629abb2f 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -175,11 +175,10 @@ struct rate_info { }; struct ieee80211_rate { - /* TODO FIXME */ - uint32_t bitrate; - uint32_t hw_value; - uint32_t hw_value_short; - uint32_t flags; + uint32_t flags; /* enum ieee80211_rate_flags */ + uint16_t bitrate; + uint16_t hw_value; + uint16_t hw_value_short; }; struct ieee80211_sta_ht_cap { diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index f5d3e1036edc..43df740b0bd0 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -600,8 +600,10 @@ enum ieee80211_rx_status_flags { RX_FLAG_DUP_VALIDATED = BIT(5), RX_FLAG_FAILED_FCS_CRC = BIT(6), RX_FLAG_ICV_STRIPPED = BIT(7), - RX_FLAG_MACTIME_PLCP_START = BIT(8), - RX_FLAG_MACTIME_START = BIT(9), + RX_FLAG_MACTIME = BIT(8) | BIT(9), + RX_FLAG_MACTIME_PLCP_START = 1 << 8, + RX_FLAG_MACTIME_START = 2 << 8, + RX_FLAG_MACTIME_END = 3 << 8, RX_FLAG_MIC_STRIPPED = BIT(10), RX_FLAG_MMIC_ERROR = BIT(11), RX_FLAG_MMIC_STRIPPED = BIT(12), @@ -616,12 +618,12 @@ enum ieee80211_rx_status_flags { RX_FLAG_AMPDU_IS_LAST = BIT(21), RX_FLAG_AMPDU_LAST_KNOWN = BIT(22), RX_FLAG_AMSDU_MORE = BIT(23), - RX_FLAG_MACTIME_END = BIT(24), + /* = BIT(24), */ RX_FLAG_ONLY_MONITOR = BIT(25), RX_FLAG_SKIP_MONITOR = BIT(26), RX_FLAG_8023 = BIT(27), RX_FLAG_RADIOTAP_TLV_AT_END = BIT(28), - RX_FLAG_MACTIME = BIT(29), + /* = BIT(29), */ RX_FLAG_MACTIME_IS_RTAP_TS64 = BIT(30), RX_FLAG_FAILED_PLCP_CRC = BIT(31), }; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 7b0ddc3cbf9a..0cffa36d96cb 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5309,6 +5309,160 @@ lkpi_80211_lhw_rxq_task(void *ctx, int pending) } } +static void +lkpi_convert_rx_status(struct ieee80211_hw *hw, + struct ieee80211_rx_status *rx_status, + struct ieee80211_rx_stats *rx_stats, + uint8_t *rssip) +{ + struct ieee80211_supported_band *supband; + int i; + uint8_t rssi; + + memset(rx_stats, 0, sizeof(*rx_stats)); + rx_stats->r_flags = IEEE80211_R_NF | IEEE80211_R_RSSI; + /* XXX-BZ correct hardcoded noise floor, survey data? */ + rx_stats->c_nf = -96; + if (ieee80211_hw_check(hw, SIGNAL_DBM) && + !(rx_status->flag & RX_FLAG_NO_SIGNAL_VAL)) + rssi = rx_status->signal; + else + rssi = rx_stats->c_nf; + /* + * net80211 signal strength data are in .5 dBm units relative to + * the current noise floor (see comment in ieee80211_node.h). + */ + rssi -= rx_stats->c_nf; + if (rssip != NULL) + *rssip = rssi; + rx_stats->c_rssi = rssi * 2; + rx_stats->r_flags |= IEEE80211_R_BAND; + rx_stats->c_band = + lkpi_nl80211_band_to_net80211_band(rx_status->band); + rx_stats->r_flags |= IEEE80211_R_FREQ | IEEE80211_R_IEEE; + rx_stats->c_freq = rx_status->freq; + rx_stats->c_ieee = ieee80211_mhz2ieee(rx_stats->c_freq, rx_stats->c_band); + + rx_stats->c_rx_tsf = rx_status->mactime; + + /* XXX RX_FLAG_MACTIME_IS_RTAP_TS64 ? */ + if ((rx_status->flag & RX_FLAG_MACTIME) == + (RX_FLAG_MACTIME_START|RX_FLAG_MACTIME_END)) { + rx_stats->r_flags |= IEEE80211_R_TSF64; + /* XXX RX_FLAG_MACTIME_PLCP_START ? */ + if ((rx_status->flag & RX_FLAG_MACTIME) == RX_FLAG_MACTIME_START) + rx_stats->r_flags |= IEEE80211_R_TSF_START; + if ((rx_status->flag & RX_FLAG_MACTIME) == RX_FLAG_MACTIME_END) + rx_stats->r_flags |= IEEE80211_R_TSF_END; + /* XXX-BZ if TSF_END will net80211 do the unwind of time? */ + } + + if (rx_status->chains != 0) { + int cc; + int8_t crssi; + + rx_stats->c_chain = rx_status->chains; + rx_stats->r_flags |= IEEE80211_R_C_CHAIN; + + cc = 0; + for (i = 0; i < nitems(rx_status->chain_signal); i++) { + if (!(rx_status->chains & BIT(i))) + continue; + crssi = rx_status->chain_signal[i]; + crssi -= rx_stats->c_nf; + rx_stats->c_rssi_ctl[i] = crssi * 2; + rx_stats->c_rssi_ext[i] = crssi * 2; /* XXX _ext ??? ATH thing? */ + /* We currently only have the global noise floor value. */ + rx_stats->c_nf_ctl[i] = rx_stats->c_nf; + rx_stats->c_nf_ext[i] = rx_stats->c_nf; + cc++; + } + if (cc > 0) + rx_stats->r_flags |= (IEEE80211_R_C_NF | IEEE80211_R_C_RSSI); + } + + /* XXX-NET80211 We are not going to populate c_phytype! */ + + switch (rx_status->encoding) { + case RX_ENC_LEGACY: + supband = hw->wiphy->bands[rx_status->band]; + if (supband != NULL) + rx_stats->c_rate = supband->bitrates[rx_status->rate_idx].bitrate; + /* Is there a LinuxKPI way of reporting IEEE80211_RX_F_CCK / _OFDM? */ + break; + case RX_ENC_HT: + rx_stats->c_pktflags |= IEEE80211_RX_F_HT; + if ((rx_status->enc_flags & RX_ENC_FLAG_SHORT_GI) != 0) + rx_stats->c_pktflags |= IEEE80211_RX_F_SHORTGI; + rx_stats->c_rate = rx_status->rate_idx; /* mcs */ + break; + case RX_ENC_VHT: + rx_stats->c_pktflags |= IEEE80211_RX_F_VHT; + if ((rx_status->enc_flags & RX_ENC_FLAG_SHORT_GI) != 0) + rx_stats->c_pktflags |= IEEE80211_RX_F_SHORTGI; + rx_stats->c_rate = rx_status->rate_idx; /* mcs */ + rx_stats->c_vhtnss = rx_status->nss; + break; + case RX_ENC_HE: + case RX_ENC_EHT: + TODO("net80211 has not matching encoding for %u", rx_status->encoding); + break; + } + + switch (rx_status->bw) { + case RATE_INFO_BW_20: + rx_stats->c_width = IEEE80211_RX_FW_20MHZ; + break; + case RATE_INFO_BW_40: + rx_stats->c_width = IEEE80211_RX_FW_40MHZ; + break; + case RATE_INFO_BW_80: + rx_stats->c_width = IEEE80211_RX_FW_80MHZ; + break; + case RATE_INFO_BW_160: + rx_stats->c_width = IEEE80211_RX_FW_160MHZ; + break; + case RATE_INFO_BW_320: + case RATE_INFO_BW_HE_RU: + case RATE_INFO_BW_EHT_RU: + case RATE_INFO_BW_5: + case RATE_INFO_BW_10: + TODO("net80211 has not matching bandwidth for %u", rx_status->bw); + break; + } + + if ((rx_status->enc_flags & RX_ENC_FLAG_LDPC) != 0) + rx_stats->c_pktflags |= IEEE80211_RX_F_LDPC; + if ((rx_status->enc_flags & RX_ENC_FLAG_STBC_MASK) != 0) + rx_stats->c_pktflags |= IEEE80211_RX_F_STBC; + + /* + * We only need these for LKPI_80211_HW_CRYPTO in theory but in + * case the hardware does something we do not expect always leave + * these enabled. Leaving this commant as documentation for the || 1. + */ +#if defined(LKPI_80211_HW_CRYPTO) || 1 + if (rx_status->flag & RX_FLAG_DECRYPTED) { + rx_stats->c_pktflags |= IEEE80211_RX_F_DECRYPTED; + /* Only valid if decrypted is set. */ + if (rx_status->flag & RX_FLAG_PN_VALIDATED) + rx_stats->c_pktflags |= IEEE80211_RX_F_PN_VALIDATED; + } + if (rx_status->flag & RX_FLAG_MMIC_STRIPPED) + rx_stats->c_pktflags |= IEEE80211_RX_F_MMIC_STRIP; + if (rx_status->flag & RX_FLAG_MIC_STRIPPED) { + /* net80211 re-uses M[ichael]MIC for MIC too. Confusing. */ + rx_stats->c_pktflags |= IEEE80211_RX_F_MMIC_STRIP; + } + if (rx_status->flag & RX_FLAG_IV_STRIPPED) + rx_stats->c_pktflags |= IEEE80211_RX_F_IV_STRIP; + if (rx_status->flag & RX_FLAG_MMIC_ERROR) + rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_MIC; + if (rx_status->flag & RX_FLAG_FAILED_FCS_CRC) + rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_FCSCRC; +#endif +} + /* For %list see comment towards the end of the function. */ void linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, @@ -5326,7 +5480,7 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, struct ieee80211_hdr *hdr; struct lkpi_sta *lsta; int i, offset, ok; - int8_t rssi; + uint8_t rssi; bool is_beacon; if (skb->len < 2) { @@ -5403,44 +5557,8 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, no_trace_beacons: #endif - memset(&rx_stats, 0, sizeof(rx_stats)); - rx_stats.r_flags = IEEE80211_R_NF | IEEE80211_R_RSSI; - /* XXX-BZ correct hardcoded rssi and noise floor, how? survey? */ - rx_stats.c_nf = -96; - if (ieee80211_hw_check(hw, SIGNAL_DBM) && - !(rx_status->flag & RX_FLAG_NO_SIGNAL_VAL)) - rssi = rx_status->signal; - else - rssi = rx_stats.c_nf; - /* - * net80211 signal strength data are in .5 dBm units relative to - * the current noise floor (see comment in ieee80211_node.h). - */ - rssi -= rx_stats.c_nf; - rx_stats.c_rssi = rssi * 2; - rx_stats.r_flags |= IEEE80211_R_BAND; - rx_stats.c_band = - lkpi_nl80211_band_to_net80211_band(rx_status->band); - rx_stats.r_flags |= IEEE80211_R_FREQ | IEEE80211_R_IEEE; - rx_stats.c_freq = rx_status->freq; - rx_stats.c_ieee = ieee80211_mhz2ieee(rx_stats.c_freq, rx_stats.c_band); - - /* - * We only need these for LKPI_80211_HW_CRYPTO in theory but in - * case the hardware does something we do not expect always leave - * these enabled. Leaving this commant as documentation for the || 1. - */ -#if defined(LKPI_80211_HW_CRYPTO) || 1 - if (rx_status->flag & RX_FLAG_DECRYPTED) { - rx_stats.c_pktflags |= IEEE80211_RX_F_DECRYPTED; - /* Only valid if decrypted is set. */ - if (rx_status->flag & RX_FLAG_PN_VALIDATED) - rx_stats.c_pktflags |= IEEE80211_RX_F_PN_VALIDATED; - } -#endif - - /* XXX (*sta_statistics)() to get to some of that? */ - /* XXX-BZ dump the FreeBSD version of rx_stats as well! */ + rssi = 0; + lkpi_convert_rx_status(hw, rx_status, &rx_stats, &rssi); lhw = HW_TO_LHW(hw); ic = lhw->ic; From nobody Mon Feb 24 20:27:14 2025 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 4Z1sjL3RJYz5pq6M; Mon, 24 Feb 2025 20:27:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjJ5fmzz3nnh; Mon, 24 Feb 2025 20:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428836; 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=ph74QVLhjWNDm8MlCOaE0Mopv9Ih21j1gDA6s+EhBvk=; b=c8v7k1wXFm/+ynd5EQuuGcAKhtNsP4dvWj2vLpTw5Z1KkVXibYCmfmjDw3t5KCQ9vRA6yf Z2A9vcydivUq1GDu4o1T+iW5iCZZhf6RfEvgrr5IXkUHpYWwCH+RsWuUdjQBf41Qc8KHeM Xg757SvgbqSGjJ+G2oy3WS9nmpXnxHzFuUtjnv0Jt8FK13mtAIfnnIo5Wdb8pOrGyVJeDk PjkVUaYtLZOkQ/x4gdvwuA6I29n1QQL46HlcazCgJ9DAXVp8UuAYqBihtuZ4d0gkacfEUy secw0AjFALx5eDi/K570iH7bL1IbgPlOTGqmojOXL2KGjvB6+DrlYtzmHzNgLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428836; a=rsa-sha256; cv=none; b=tHxp62mjyh/6EgINgd7kXQKqbnyikevvu6+x+0ocq0TNqvglmHuFszPHge8FgqFM6wyCSr elLJrttocSRWUcohu9BjPbUTX+FHjIa06ViO8N8karwGAJDHEE0GjDiiKhSGxMJ0SaCBX6 Q4anzC1HMrRS1VEtbQjS//R5QIB99bwYm667UDHa12p8mRR2/RPUXkt1eOKX5moesg9LmV l1WITkY7YZMIhyks6Nz51tYZvgpSqoMjjH87lB3Y/dZKtVvlVjPxyyrxZbwgdjuzKIJf76 B5eTPncQOdC03CoE+NVBKluq7XWk/x2IqMGkQyU53BsgN4NEWCSrAejtN9KiNQ== 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=1740428836; 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=ph74QVLhjWNDm8MlCOaE0Mopv9Ih21j1gDA6s+EhBvk=; b=vRYJS+H79KxWUNLncZghqXSHOld9EAspeg20OlrbjhogH97PekVa3r4hQQXSHKkZxhx7CS 2gUsRUddub5e90I1KYWKzzRTAAR4dz4Frtt8VScw1CElO78IgzOawK5A4MqBHJQno5Z6ca XIHi+ZeZtRTOQb0XPR9FaIWNRs3rmDmvQGbEAORjyj78JdcZzw/4xNO2evtqEX939glKJN VheZ95/4Wx7YAsypYtDT5TWt9x1Y5l0momzbHPytbMn78rDpjXJ2FsaDjroaxtzPfYtg07 kyeA+uI2RBq27gNL0J9notuBHBEJlbCVXyGvfaSBkp+ylh+5BozMW4qAlBdPJQ== 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 4Z1sjG2jjBzvnH; Mon, 24 Feb 2025 20:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKREP0027385; Mon, 24 Feb 2025 20:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRE7b027382; Mon, 24 Feb 2025 20:27:14 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:14 GMT Message-Id: <202502242027.51OKRE7b027382@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 75418cb41978 - stable/14 - LinuxKPI: 802.11: make struct ieee80211_tx_info a bit more packed 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 75418cb419785947c409969efe2ee82c6a2ed38c Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=75418cb419785947c409969efe2ee82c6a2ed38c commit 75418cb419785947c409969efe2ee82c6a2ed38c Author: Bjoern A. Zeeb AuthorDate: 2025-01-26 19:37:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:48 +0000 LinuxKPI: 802.11: make struct ieee80211_tx_info a bit more packed Given I was looking at the struct make it more packed at the beginning at least. In fact it did not shrink but the tx_time_est got expanded. Sponsored by: The FreeBSD Foundation (cherry picked from commit 470aaf42c3c0661821a8744ae7c29b096adb4aa3) --- sys/compat/linuxkpi/common/include/linux/ieee80211.h | 2 +- sys/compat/linuxkpi/common/include/linux/nl80211.h | 2 +- sys/compat/linuxkpi/common/include/net/mac80211.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 20527a8174f5..ca1493e666c6 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -413,7 +413,7 @@ enum ieee80211_tx_info_flags { IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(18), IEEE80211_TX_CTL_LDPC = BIT(19), IEEE80211_TX_CTL_STBC = BIT(20), -}; +} __packed; enum ieee80211_tx_status_flags { IEEE80211_TX_STATUS_ACK_SIGNAL_VALID = BIT(0), diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 254ed6e13f5c..1babd23d65fe 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -133,7 +133,7 @@ enum nl80211_band { /* Keep this last. */ NUM_NL80211_BANDS -}; +} __packed; enum nl80211_chan_flags { /* XXX TODO */ diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 43df740b0bd0..f1b1ec97cbbc 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -879,11 +879,11 @@ struct ieee80211_prep_tx_info { /* XXX-BZ too big, over-reduce size to u8, and array sizes to minuimum to fit in skb->cb. */ /* Also warning: some sizes change by pointer size! This is 64bit only. */ struct ieee80211_tx_info { - enum ieee80211_tx_info_flags flags; + enum ieee80211_tx_info_flags flags; /* 32 bits */ /* TODO FIXME */ - u8 band; - u8 hw_queue; - bool tx_time_est; + enum nl80211_band band; /* 3 bits */ + uint16_t hw_queue:4, /* 4 bits */ + tx_time_est:10; /* 10 bits */ union { struct { struct ieee80211_tx_rate rates[4]; From nobody Mon Feb 24 20:27:15 2025 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 4Z1sjM3McDz5pq6N; Mon, 24 Feb 2025 20:27:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjJ67pfz3p3y; Mon, 24 Feb 2025 20:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428836; 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=ITUeeOy6fb//Yq65rbEVH32wgW/kHIanIbOoauVr6rY=; b=XUCMq0d+P+ivc4J9RKXb74ZQ/pThzWor85azZyiCpo4y4gUXZCP9avHjuFwGbOGdHw++Ov hdcuuLSEWbgHFmIjUIlx7O4oWfaGx3q8jSesAAWeWiDO8EvA1GZTDh3pgc6ucE35lKPLwW p/82v27zhrHX/n1XEXqjRhKvfDBYjIdnsuK754GoEfRWW1TWiyzdupg+j0xgOHvqyB5CsY ldGXcb+sd5G6+/UMdCOCyTbYCUuHjRGX4eF0zpyBNH28pahsa907z/07LjVcx1bEAPTeeB 2qojo7qQzRvAefRX/B3gExtv9pWB5VE9P3UR1b2L4Tqy362vhjx4rU+El8w+gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428836; a=rsa-sha256; cv=none; b=ZjTDXEdL8bsuXrZLyEkOGHCExXx1H2xZHeheNuMNsu2mfMicD19FX57lFXDRZKLlyucywe LRGZN2uhZCCcgm9hisCi2X+uxCwGydZs+1TdiyjwhOnDjcx3XqJI4IAeJKVMecFO6nOv93 MSfD6vffmJZYrwD7ZSrDnANcCSDtZeadBWRLFOmKxjCaPIxP9FZ01HIPOI+LNIYGB24Qvh bqIZfIcA2i+32qOKUv7UAJ+xD+lywnTiz4jLWF08yUlrOmTzZksYw9zOzdeeDI40iLHzGU PgJrsoHox+Ro5/IRQN2E0ArQVayCJv6fkVnx2JwP1in/3AkWqOtCOXbdzU3bXw== 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=1740428836; 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=ITUeeOy6fb//Yq65rbEVH32wgW/kHIanIbOoauVr6rY=; b=fepeAoBvsJi2MqGfX+G0Ti0fsRrFBTYI36/kKJKAccxrrs0XqDAvaCt6yUYJeTg2kZo/4z pqPQBaktnZ2sHv3ID7vAHlRCGcLVsqpURfwQfwbM4IyKKEgZhULOhME9Fjd/sGe7xfhyoJ X4R/qaCj86iOKpAxh1L8lO1om9FtSeoJSwQ4eaaK98wtHOr5a7zz3mu8sknRT1GhCS1D0/ GAlUVv7NPkErbRHtvN+162HCyBq+pHp0HCd3u3GnhqZmkboTh+R8KuNBt4yT98lAp1Da7v +zZFKNeHXmbF5mYYqoU2+34u9e+1Ji406qxaG/r7pLBsPGA+oksX/N0W0RZtPA== 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 4Z1sjH5RZMzvrR; Mon, 24 Feb 2025 20:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRFxe027420; Mon, 24 Feb 2025 20:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRFei027417; Mon, 24 Feb 2025 20:27:15 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:15 GMT Message-Id: <202502242027.51OKRFei027417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 00fc02712d23 - stable/14 - LinuxKPI; 802.11: start implementing cfg80211_calculate_bitrate() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 00fc02712d23663b993f887aa41081fff9760163 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=00fc02712d23663b993f887aa41081fff9760163 commit 00fc02712d23663b993f887aa41081fff9760163 Author: Bjoern A. Zeeb AuthorDate: 2024-12-28 10:10:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI; 802.11: start implementing cfg80211_calculate_bitrate() For now we only return the legacy rate and have two TODOs for HT and VHT which still need to be implemented as needed. Sponsored by: The FreeBSD Foundation (cherry picked from commit a7c19b8a99a604e8940c7475220df5de7e295ffa) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 6 ++--- sys/compat/linuxkpi/common/src/linux_80211.c | 30 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index bcbf629abb2f..cf1e05dde7ea 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1304,6 +1304,7 @@ void linuxkpi_wiphy_delayed_work_cancel(struct wiphy *, int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, struct linuxkpi_ieee80211_regdomain *regd); +uint32_t linuxkpi_cfg80211_calculate_bitrate(struct rate_info *); uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band); uint32_t linuxkpi_ieee80211_frequency_to_channel(uint32_t, uint32_t); struct linuxkpi_ieee80211_channel * @@ -1574,11 +1575,10 @@ cfg80211_find_vendor_ie(unsigned int oui, int oui_type, return (__DECONST(uint8_t *, elem)); } -static __inline uint32_t +static inline uint32_t cfg80211_calculate_bitrate(struct rate_info *rate) { - TODO(); - return (-1); + return (linuxkpi_cfg80211_calculate_bitrate(rate)); } static __inline uint32_t diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 0cffa36d96cb..7bb051a67ade 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5891,6 +5891,36 @@ linuxkpi_wiphy_free(struct wiphy *wiphy) kfree(lwiphy); } +static uint32_t +lkpi_cfg80211_calculate_bitrate_ht(struct rate_info *rate) +{ + TODO("cfg80211_calculate_bitrate_ht"); + return (rate->legacy); +} + +static uint32_t +lkpi_cfg80211_calculate_bitrate_vht(struct rate_info *rate) +{ + TODO("cfg80211_calculate_bitrate_vht"); + return (rate->legacy); +} + +uint32_t +linuxkpi_cfg80211_calculate_bitrate(struct rate_info *rate) +{ + + /* Beware: order! */ + if (rate->flags & RATE_INFO_FLAGS_MCS) + return (lkpi_cfg80211_calculate_bitrate_ht(rate)); + + if (rate->flags & RATE_INFO_FLAGS_VHT_MCS) + return (lkpi_cfg80211_calculate_bitrate_vht(rate)); + + IMPROVE("HE/EHT/..."); + + return (rate->legacy); +} + uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t channel, enum nl80211_band band) From nobody Mon Feb 24 20:27:16 2025 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 4Z1sjM3N38z5ppwM; Mon, 24 Feb 2025 20:27:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjK47s3z3nx7; Mon, 24 Feb 2025 20:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428837; 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=UBjHTKLRe+H25ogrPp1PSsSE2h7GBDoeNIsb+Onykp0=; b=VolY+KLc2eS0CpbFL1q4SPP2ME7dt8yILEciRhpdrBuQv1DCpE6hlE50NeF7hhCFWAveDv z4UbiEHld2fzjepnaWgc5fGYJFUZ8CqdSsDW7sZ/uevsa2sx1FmTxGg6FJYPBHFjBLiwf4 FuECalFInUpDd81Lms9U9mzHtW9hjx91SyYYJ2YGcDJl1kLugm7fa7lB1QrvcJu9DFNEEd CcUANG9WPd+2DAiQfWTo+mtna2vgV9QRCzs7AWoFZ47kHyryFJ/sdK0GPVUgSaiwrvtphs dGXTi6+JNvHqkiRgOPgZkXEC7tdOfwT0ZM0p+gSZQJj6QdvgU42zdJ0Pt+Ca2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428837; a=rsa-sha256; cv=none; b=GiH01r345OUuV2XIkZyvNtS9jZL7hqFzeSDlD06+H39sJFeNj2FDA0DMCvhAmCirlAMz2d bcRjMhVrzMFpWu8w0kJbfBIzVlYx4OXepTemuMp44jH2vbLPBV2RZ+nqCG+sf+E1ihUEb/ QyNtLTepvWiArORasWmoXvXgLsjEyIfVQkFw8bR8DzOfTFFcJwhet61vkBmgj4iVkvfLhu FX8YddKBsLFYKpuF9pQP6hJmDe+EowZ1Mh0YGnMRD36WtnIsPdnXYQOarsxDpAKUVfPW1P 9zFsprAJc0ukUJABARQR0D+k6+6D+OcIB8HtKcAUJarQKQAXmWc2YtMtvVOnHg== 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=1740428837; 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=UBjHTKLRe+H25ogrPp1PSsSE2h7GBDoeNIsb+Onykp0=; b=S7Laar+uDsmkeoLLR99zsHW+T/5q/VSOxKfNN3K7l+O1/HEADptOc3iPvwcwJyXLfWv90N NANvnCYIBTAj6yNSpQbZbZZNqXgczEWloHEHBA5Me9iDZe8wnYVYkdBz722rmTCekuVDq9 +kjTjUwYpZ9XOpZ6nC8EC1AqWSMla77ZfdLuDozYJlADOEco9M1qwEpodEB33VkvSsatoY bcyi2Kq0XeBV2z3pQ9E+iSWd4Dxuf5LPY8oQRYX3cZSPNfw3wWusMgHRthud9wNaN/o/Lq UwvQ6h0uFB7YTfSquz4YjRm64TYVrln/0Fz0Pg6GZFEr5mjccbPCmEyv+rEvww== 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 4Z1sjJ4HT0zwSZ; Mon, 24 Feb 2025 20:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRGe2027457; Mon, 24 Feb 2025 20:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRGTv027454; Mon, 24 Feb 2025 20:27:16 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:16 GMT Message-Id: <202502242027.51OKRGTv027454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 00295a19ab1a - stable/14 - LinuxKPI: 802.11: ieee80211_vif_usable_links() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 00295a19ab1ad789bdad9f88e692ab9efeb99d38 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=00295a19ab1ad789bdad9f88e692ab9efeb99d38 commit 00295a19ab1ad789bdad9f88e692ab9efeb99d38 Author: Bjoern A. Zeeb AuthorDate: 2025-01-25 11:59:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: ieee80211_vif_usable_links() ieee80211_vif_usable_links() shows up in TODO() tracking. Turns out the return (1) is likely wrong and should be 0 given we do not support MLD yet. For now return the valid_links bitmap and leave an IMPROVE as likely not all of the valid ones will be useable. Sponsored by: The FreeBSD Foundation (cherry picked from commit d2407a21bd032587194dff46779862ffcd5c33d8) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index f1b1ec97cbbc..8d6d690b2f57 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -2539,8 +2539,8 @@ ieee80211_get_eht_iftype_cap_vif(const struct ieee80211_supported_band *band, static inline uint32_t ieee80211_vif_usable_links(const struct ieee80211_vif *vif) { - TODO(); - return (1); + IMPROVE("MLO usable links likely are not just valid"); + return (vif->valid_links); } static inline bool From nobody Mon Feb 24 20:27:18 2025 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 4Z1sjR2Smpz5ppwV; Mon, 24 Feb 2025 20:27:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjM6HYPz3p0b; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428839; 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=JiLsIinGYspe7z5iNSeV/JOhoMWOCgEyll4ph4ETRnA=; b=lxItJiH0sL9IeUxAFwmtYX9kmfKhHcsSijxpMK1pMxlxBGgIj6UhzAQbzzhpFWEKCF53e5 RVkafwH5dQ/lUWFvY8cKOI6eFV5ilzPQgdRbrRFpt/geSV8KswI3IUpuW1t7QEA7jLFV3U mVy80eJNCZ7Q6D/DhDMTKVst88cgsKSjsN0IBzdqrhJ1zKCj29VwI8yqSXJuMyPNM/orTb WWgPA1mu8K+dMy9MI1xcbX8fPmKZDwXrGAtYpJ9OqPpgA4ozv1y9/XHzqoHiyVsviPRThN Ie0IG5ZGRXaPTQ93JCV1X9jqH+Q3oKcfpG4sE4HsjgQXBRa1tallEk7m250m/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428839; a=rsa-sha256; cv=none; b=RkJKXAvVUYRUEeR/zi/JQkNrQV0vLw6N3nhr+3wVAkuniZHn1E4wd8TwIO2zWTTx9QyEhB O62tNVyS2H+CpZAA2niiMq+buRcFQYDd/RDeH93GxsllAPverbFbmcCPgNdLnRzRyZi1DK SNM/uQfujpxtFsCBYuvsVksmXYGxq17YOfwY7SHPPtebZH2uAhQr/s41zju5tDF496BPhz Ei1pZPT0AUgVi8OMsaoXYqfL/F9qZIb8NAn0PCbg1OmOqXOarkg/FcPaxKIf5KnOg4bKV+ 4QeiFSRZaYIdyYG74r5lQFHFVFlkXgceQKfoMHM8CdfS1f3nBdRb7Djz2Heb2w== 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=1740428839; 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=JiLsIinGYspe7z5iNSeV/JOhoMWOCgEyll4ph4ETRnA=; b=dVvb+d9YYsnIHonB15RIF14q7xfScxuOP6BwLqPVamolog/5aqaSaTPiHl9C+6yb8MR/HH Ea+QRQeqRSjkW61DT6YDYCsR5/I76pMuHJ0qGbmBJWI/zD43brVWIvDBH8SJ5Qn2RFcDja WtbX//0mSD4qQg89y4VZGfAXVG+6ONg0YfXsL7qO0eIeOYw/e3k0+xpW6DhhPgSnwLHtjx hNgRAPYN/U7jGBMh6juI+WtuOdtQoyYM0b4BaBXS/quWrO7/hmWjjXlSYMqwv6E9wFVEvK YZlz5kNOVDfhnwSci2hiVg37ZyDG8hGuMRKy9qvMcuKTB06hLvkJww5ZnmysLw== 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 4Z1sjL6WhWzvrT; Mon, 24 Feb 2025 20:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRIam027533; Mon, 24 Feb 2025 20:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRIsJ027530; Mon, 24 Feb 2025 20:27:18 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:18 GMT Message-Id: <202502242027.51OKRIsJ027530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a960f6e71743 - stable/14 - LinuxKPI: 802.11: dump station_info using (*sta_statistics)() as sysctl 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: a960f6e717438983da18a03786531c97a41253d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a960f6e717438983da18a03786531c97a41253d3 commit a960f6e717438983da18a03786531c97a41253d3 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: dump station_info using (*sta_statistics)() as sysctl Implement the mac80211 (*sta_statistics) to obtain station statistics. Fix up struct station_info for that. Add supporting funtions to decode station_info and rate_info_bw fields to make the output more usable to human beings. Add a per-VIF (VAP) sysctl to export that information. This is mostly used for now to see what the driver/fw thinks about its TX rate. We should later gather this information in different ways and pass it to net80211 to export it to user space so we can finally have nice station information (also for the non-AP side). Sponsored by: The FreeBSD Foundation (cherry picked from commit 408394185fe9be0c158189b7671bde316ac14ac9) --- sys/compat/linuxkpi/common/include/linux/nl80211.h | 1 + sys/compat/linuxkpi/common/include/net/cfg80211.h | 38 +++- sys/compat/linuxkpi/common/src/linux_80211.c | 221 ++++++++++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.h | 5 +- .../linuxkpi/common/src/linux_80211_macops.c | 30 +++ 5 files changed, 283 insertions(+), 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 1babd23d65fe..80546e56f0c1 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -247,6 +247,7 @@ enum nl80211_ext_feature { NUM_NL80211_EXT_FEATURES }; +/* Keep in order with lkpi_nl80211_sta_info_to_str() */ enum nl80211_sta_info { /* XXX TODO */ NL80211_STA_INFO_BEACON_RX, diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index cf1e05dde7ea..338ffb82bd83 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -81,6 +81,9 @@ enum cfg80211_rate_info_flags { /* Max 8 bits as used in struct rate_info. */ }; +#define CFG80211_RATE_INFO_FLAGS_BITS \ + "\20\1MCS\2VHT_MCS\3SGI\5HE_MCS\10EHT_MCS" + extern const uint8_t rfc1042_header[6]; extern const uint8_t bridge_tunnel_header[6]; @@ -164,7 +167,7 @@ enum rate_info_bw { struct rate_info { uint8_t flags; /* enum cfg80211_rate_info_flags */ - uint8_t bw; + uint8_t bw; /* enum rate_info_bw */ uint16_t legacy; uint8_t mcs; uint8_t nss; @@ -546,18 +549,39 @@ struct station_del_parameters { }; struct station_info { - /* TODO FIXME */ - int assoc_req_ies_len, connected_time; - int generation, inactive_time, rx_bytes, rx_dropped_misc, rx_packets, signal, tx_bytes, tx_packets; - int filled, rx_beacon, rx_beacon_signal_avg, signal_avg; - int rx_duration, tx_duration, tx_failed, tx_retries; - int ack_signal, avg_ack_signal; + uint64_t filled; /* enum nl80211_sta_info */ + uint32_t connected_time; + uint32_t inactive_time; + + uint64_t rx_bytes; + uint32_t rx_packets; + uint32_t rx_dropped_misc; + + uint64_t rx_duration; + uint32_t rx_beacon; + uint8_t rx_beacon_signal_avg; + + int8_t signal; + int8_t signal_avg; + int8_t ack_signal; + int8_t avg_ack_signal; + + /* gap */ + int generation; + + uint64_t tx_bytes; + uint32_t tx_packets; + uint32_t tx_failed; + uint64_t tx_duration; + uint32_t tx_retries; int chains; uint8_t chain_signal[IEEE80211_MAX_CHAINS]; uint8_t chain_signal_avg[IEEE80211_MAX_CHAINS]; uint8_t *assoc_req_ies; + size_t assoc_req_ies_len; + struct rate_info rxrate; struct rate_info txrate; struct cfg80211_ibss_params bss_param; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 853d77fd4a96..b276f502be76 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -88,14 +89,14 @@ static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); /* -------------------------------------------------------------------------- */ -/* Keep public for as long as header files are using it too. */ -int linuxkpi_debug_80211; - -#ifdef LINUXKPI_DEBUG_80211 SYSCTL_DECL(_compat_linuxkpi); SYSCTL_NODE(_compat_linuxkpi, OID_AUTO, 80211, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "LinuxKPI 802.11 compatibility layer"); +/* Keep public for as long as header files are using it too. */ +int linuxkpi_debug_80211; + +#ifdef LINUXKPI_DEBUG_80211 SYSCTL_INT(_compat_linuxkpi_80211, OID_AUTO, debug, CTLFLAG_RWTUN, &linuxkpi_debug_80211, 0, "LinuxKPI 802.11 debug level"); @@ -154,6 +155,200 @@ static void lkpi_ieee80211_free_skb_mbuf(void *); static int lkpi_wme_update(struct lkpi_hw *, struct ieee80211vap *, bool); #endif +static const char * +lkpi_rate_info_bw_to_str(enum rate_info_bw bw) +{ + + switch (bw) { + + case RATE_INFO_BW_20: + return ("20"); + break; + case RATE_INFO_BW_5: + return ("5"); + break; + case RATE_INFO_BW_10: + return ("10"); + break; + case RATE_INFO_BW_40: + return ("40"); + break; + case RATE_INFO_BW_80: + return ("80"); + break; + case RATE_INFO_BW_160: + return ("160"); + break; + case RATE_INFO_BW_HE_RU: + IMPROVE("nl80211_he_ru_alloc"); + return ("HE_RU"); + break; + case RATE_INFO_BW_320: + return ("320"); + break; + case RATE_INFO_BW_EHT_RU: + IMPROVE("nl80211_eht_ru_alloc"); + return ("EHT_RU"); + break; + default: + return ("?"); + break; + } +} + +static void +lkpi_nl80211_sta_info_to_str(struct sbuf *s, const char *prefix, + const uint64_t flags) +{ + int bit, i; + + sbuf_printf(s, "%s %#010jx", prefix, flags); + + i = 0; + for (bit = 0; bit < BITS_PER_TYPE(flags); bit++) { + + if ((flags & BIT_ULL(bit)) == 0) + continue; + +#define EXPAND_CASE(_flag) \ + case NL80211_STA_INFO_ ## _flag: \ + sbuf_printf(s, "%c%s", (i == 0) ? '<' : ',', #_flag); \ + i++; \ + break; + + switch (bit) { + EXPAND_CASE(BEACON_RX) + EXPAND_CASE(BEACON_SIGNAL_AVG) + EXPAND_CASE(BSS_PARAM) + EXPAND_CASE(CHAIN_SIGNAL) + EXPAND_CASE(CHAIN_SIGNAL_AVG) + EXPAND_CASE(CONNECTED_TIME) + EXPAND_CASE(INACTIVE_TIME) + EXPAND_CASE(SIGNAL) + EXPAND_CASE(SIGNAL_AVG) + EXPAND_CASE(STA_FLAGS) + EXPAND_CASE(RX_BITRATE) + EXPAND_CASE(RX_PACKETS) + EXPAND_CASE(RX_BYTES) + EXPAND_CASE(RX_DROP_MISC) + EXPAND_CASE(TX_BITRATE) + EXPAND_CASE(TX_PACKETS) + EXPAND_CASE(TX_BYTES) + EXPAND_CASE(TX_BYTES64) + EXPAND_CASE(RX_BYTES64) + EXPAND_CASE(TX_FAILED) + EXPAND_CASE(TX_RETRIES) + EXPAND_CASE(RX_DURATION) + EXPAND_CASE(TX_DURATION) + EXPAND_CASE(ACK_SIGNAL) + EXPAND_CASE(ACK_SIGNAL_AVG) + default: + sbuf_printf(s, "%c?%d", (i == 0) ? '<' : ',', bit); + break; + } + } +#undef EXPAND_CASE + if (i > 0) + sbuf_printf(s, ">"); + sbuf_printf(s, "\n"); +} + +static int +lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) +{ + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + struct station_info sinfo; + struct sbuf s; + int error; + + if (req->newptr) + return (EPERM); + + lvif = (struct lkpi_vif *)arg1; + vif = LVIF_TO_VIF(lvif); + vap = LVIF_TO_VAP(lvif); + lhw = vap->iv_ic->ic_softc; + hw = LHW_TO_HW(lhw); + + sbuf_new_for_sysctl(&s, NULL, 1024, req); + + wiphy_lock(hw->wiphy); + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + sta = LSTA_TO_STA(lsta); + + sbuf_putc(&s, '\n'); + sbuf_printf(&s, "lsta %p sta %p added_to_drv %d\n", lsta, sta, lsta->added_to_drv); + + memset(&sinfo, 0, sizeof(sinfo)); + error = lkpi_80211_mo_sta_statistics(hw, vif, sta, &sinfo); + if (error == EEXIST) /* Not added to driver. */ + continue; + if (error == ENOTSUPP) { + sbuf_printf(&s, " sta_statistics not supported\n"); + continue; + } + if (error != 0) { + sbuf_printf(&s, " sta_statistics failed: %d\n", error); + continue; + } + + lkpi_nl80211_sta_info_to_str(&s, " nl80211_sta_info (valid fields)", sinfo.filled); + sbuf_printf(&s, " connected_time %u inactive_time %u\n", + sinfo.connected_time, sinfo.inactive_time); + sbuf_printf(&s, " rx_bytes %ju rx_packets %u rx_dropped_misc %u\n", + (uintmax_t)sinfo.rx_bytes, sinfo.rx_packets, sinfo.rx_dropped_misc); + sbuf_printf(&s, " rx_duration %ju rx_beacon %u rx_beacon_signal_avg %d\n", + (uintmax_t)sinfo.rx_duration, sinfo.rx_beacon, (int8_t)sinfo.rx_beacon_signal_avg); + + sbuf_printf(&s, " tx_bytes %ju tx_packets %u tx_failed %u\n", + (uintmax_t)sinfo.tx_bytes, sinfo.tx_packets, sinfo.tx_failed); + sbuf_printf(&s, " tx_duration %ju tx_retries %u\n", + (uintmax_t)sinfo.tx_duration, sinfo.tx_retries); + + sbuf_printf(&s, " signal %d signal_avg %d ack_signal %d avg_ack_signal %d\n", + sinfo.signal, sinfo.signal_avg, sinfo.ack_signal, sinfo.avg_ack_signal); + + sbuf_printf(&s, " generation %d assoc_req_ies_len %zu chains %d\n", + sinfo.generation, sinfo.assoc_req_ies_len, sinfo.chains); + + for (int i = 0; i < sinfo.chains && i < IEEE80211_MAX_CHAINS; i++) { + sbuf_printf(&s, " chain[%d] signal %d signal_avg %d\n", + i, (int8_t)sinfo.chain_signal[i], (int8_t)sinfo.chain_signal_avg[i]); + } + + /* assoc_req_ies, bss_param, sta_flags */ + + sbuf_printf(&s, " rxrate: flags %b bw %u(%s) legacy %u kbit/s mcs %u nss %u\n", + sinfo.rxrate.flags, CFG80211_RATE_INFO_FLAGS_BITS, + sinfo.rxrate.bw, lkpi_rate_info_bw_to_str(sinfo.rxrate.bw), + sinfo.rxrate.legacy * 100, + sinfo.rxrate.mcs, sinfo.rxrate.nss); + sbuf_printf(&s, " he_dcm %u he_gi %u he_ru_alloc %u eht_gi %u\n", + sinfo.rxrate.he_dcm, sinfo.rxrate.he_gi, sinfo.rxrate.he_ru_alloc, + sinfo.rxrate.eht_gi); + sbuf_printf(&s, " txrate: flags %b bw %u(%s) legacy %u kbit/s mcs %u nss %u\n", + sinfo.txrate.flags, CFG80211_RATE_INFO_FLAGS_BITS, + sinfo.txrate.bw, lkpi_rate_info_bw_to_str(sinfo.txrate.bw), + sinfo.txrate.legacy * 100, + sinfo.txrate.mcs, sinfo.txrate.nss); + sbuf_printf(&s, " he_dcm %u he_gi %u he_ru_alloc %u eht_gi %u\n", + sinfo.txrate.he_dcm, sinfo.txrate.he_gi, sinfo.txrate.he_ru_alloc, + sinfo.txrate.eht_gi); + } + wiphy_unlock(hw->wiphy); + + sbuf_finish(&s); + sbuf_delete(&s); + + return (0); +} + #if defined(LKPI_80211_HT) static void lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *ht_rx_nss) @@ -2803,6 +2998,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], struct ieee80211_vif *vif; struct ieee80211_tx_queue_params txqp; enum ieee80211_bss_changed changed; + struct sysctl_oid *node; size_t len; int error, i; uint16_t ac; @@ -2976,6 +3172,20 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], hw->wiphy->rts_threshold = vap->iv_rtsthreshold; lkpi_80211_mo_set_rts_threshold(hw, vap->iv_rtsthreshold); /* any others? */ + + /* Add per-VIF/VAP sysctls. */ + sysctl_ctx_init(&lvif->sysctl_ctx); + + node = SYSCTL_ADD_NODE(&lvif->sysctl_ctx, + SYSCTL_CHILDREN(&sysctl___compat_linuxkpi_80211), + OID_AUTO, if_name(vap->iv_ifp), + CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, NULL, "VIF Information"); + + SYSCTL_ADD_PROC(&lvif->sysctl_ctx, + SYSCTL_CHILDREN(node), OID_AUTO, "dump_stas", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, lvif, 0, + lkpi_80211_dump_stas, "A", "Dump sta statistics of this vif"); + IMPROVE(); return (vap); @@ -3015,6 +3225,9 @@ lkpi_ic_vap_delete(struct ieee80211vap *vap) EVENTHANDLER_DEREGISTER(iflladdr_event, lvif->lvif_ifllevent); + /* Clear up per-VIF/VAP sysctls. */ + sysctl_ctx_free(&lvif->sysctl_ctx); + LKPI_80211_LHW_LVIF_LOCK(lhw); TAILQ_REMOVE(&lhw->lvif_head, lvif, lvif_entry); LKPI_80211_LHW_LVIF_UNLOCK(lhw); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 0c4c615d82e5..bb1ecb45636f 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -168,6 +168,8 @@ struct lkpi_vif { struct ieee80211vap iv_vap; eventhandler_tag lvif_ifllevent; + struct sysctl_ctx_list sysctl_ctx; + struct mtx mtx; struct wireless_dev wdev; @@ -442,6 +444,7 @@ int lkpi_80211_mo_set_key(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_key_conf *); int lkpi_80211_mo_ampdu_action(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_ampdu_params *); - +int lkpi_80211_mo_sta_statistics(struct ieee80211_hw *, struct ieee80211_vif *, + struct ieee80211_sta *, struct station_info *); #endif /* _LKPI_SRC_LINUX_80211_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index e60ccbdeb4ce..7440d1d3c26c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -718,3 +718,33 @@ lkpi_80211_mo_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, out: return (error); } + +int +lkpi_80211_mo_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, struct station_info *sinfo) +{ + struct lkpi_hw *lhw; + struct lkpi_sta *lsta; + int error; + + lhw = HW_TO_LHW(hw); + if (lhw->ops->sta_statistics == NULL) { + error = EOPNOTSUPP; + goto out; + } + + lsta = STA_TO_LSTA(sta); + if (!lsta->added_to_drv) { + error = EEXIST; + goto out; + } + + lockdep_assert_wiphy(hw->wiphy); + + LKPI_80211_TRACE_MO("hw %p vif %p sta %p sinfo %p", hw, vif, sta, sinfo); + lhw->ops->sta_statistics(hw, vif, sta, sinfo); + error = 0; + +out: + return (error); +} From nobody Mon Feb 24 20:27:19 2025 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 4Z1sjR4Sgzz5pq0H; Mon, 24 Feb 2025 20:27:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjN2vhCz3nxL; Mon, 24 Feb 2025 20:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428840; 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=xvQjMCHmi6s2u4GUsamQ+G15qKDpbgnThzzRP+qS1HU=; b=ndNekVlsDdjVwtRe3+NZTaRE+IzKXukREFLRZG9Vff8QPA90yxOPGwT83SaXAH8r82lCes wHLq/yzLVe9qH2pC4JB1Zm+D14EazwbKCieGVw4SKL9hXb+5vRFsGP3GK0snFxjETmFtv2 OQkiKgLM2RDqx0/GlSKWKA4VZE0/Kw3NW2JNHOr5+8cqh+atF/yBXpSsiu9PCJv3WdJrGZ hxVXnocI+4Sx25XhyZJW34lqpmciRwhqFr2UCyvCZo5cZG98JT0iARG0jFQ6a6DZa5xZQw gTATu8k9nfMt3934xI8qdeg5nkVdcy7di8tF8w36nmZWxy3DcfVNjR8fXpbK7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428840; a=rsa-sha256; cv=none; b=Q1RKSA0VGKcI6hI+jMVlg4miAVK87gpj+ry6yS7kcVBp3GH+d+nDNIXiQf4aL+TY2mIWM/ OhRXnJAJsW/1CZbAXd1jL5kfAno5mZyyB53t/63cdrslgyBlg1CX4FLbV9qXA/5mf7whao hbb6xMgyu74x9tVvsQI5mRWQycdWwdvUnHtuDkZ2OOK/s4rhUtlVqFi9M+5RdErT4TLwUr 6wsn72Ppxl9nxbd0H9n1VSyT9/mGhRLeY9A1qDrWFmU0N94sC0zEsuUZxJiCv8gaPfOGEc QmGaLTkOs2uGWVdXjsgQaIE/xApR77R++E1KLV5nUzIJVZ3bhLWh8FwDId1ukQ== 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=1740428840; 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=xvQjMCHmi6s2u4GUsamQ+G15qKDpbgnThzzRP+qS1HU=; b=gblxJG1ZpQw2d4BXldH8gK8845Igu8McBw0Qp9rV8WSxTVhYtlAKlODkxPpXDe5sO7Xign qSMUFVXTvKSrWQa6Zi+sR81pt72zTtnPqERF1FSTCSX1C2GElFQlGxHb9GVLryF2YPj/8w ahNLWTD5sDFrNThaHCGOtuvmnkCreWES+6mjn0rvxj9U8mROQh1GfAZ7m/Mlf8CJtIS93k 4hpeKZCzftolnrW8rjUMqCsW5AJzU6CScxKbf9u82cCCwtHkHHBplabPAxAOz8i+qAfG6p kiBHKtKi5FZ/BrDtDeeg4NbXrkvakQqc0bFTsH0DoVl+UOF0Pq0c8JeRC5medA== 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 4Z1sjM70lGzwPy; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRJ9U027569; Mon, 24 Feb 2025 20:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRJ2o027566; Mon, 24 Feb 2025 20:27:19 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:19 GMT Message-Id: <202502242027.51OKRJ2o027566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5d6b85d086bc - stable/14 - LinuxKPI: 802.11: hardware crypto offload improvements 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5d6b85d086bc76730f052b6a69241fa6dc7c52c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5d6b85d086bc76730f052b6a69241fa6dc7c52c7 commit 5d6b85d086bc76730f052b6a69241fa6dc7c52c7 Author: Bjoern A. Zeeb AuthorDate: 2024-01-27 22:39:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: hardware crypto offload improvements Implement mac80211 functions ieee80211_iter_keys[_rcu](), and ieee80211_get_key_rx_seq() (*). Implement an internal function lkpi_sta_del_keys() to delete keys when we are leaving RUN (AUTHORIZED) state. Improve and make work (*) the net80211 vap function pointers (*iv_key_set)(), (*iv_key_delete)() implementations. Correct the logic in lkpi_80211_txq_tx_one() and factor most crypto related bits out into lkpi_hw_crypto_prepare() (*). (*) We are currently supporting CCMP only. I would hope we will not have to do full WEP/TKIP support anymore given both are deprecated. The entire logic remains behind the LKPI_80211_HW_CRYPTO pre-processor condition and with this commit in addition behind a tunable. The code is compiled in by default now but the tunable remains off until wider testing has shown no problems. I have seen one net80211 triggered panic on shutdown related to deleting keys which I cannot reproduce anymore and could have been fixed by 9763fec11b83; otherwise we will have to investigate as it shows again. The dedicated hw crypto tracing option can help in that case with debug kernels. Sponsored by: The FreeBSD Foundation Fixes: b35f6cd06612 (cherry picked from commit 11db70b6057e41b259dc2245cd893d5b19179fcc) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 81 ++-- sys/compat/linuxkpi/common/src/linux_80211.c | 492 ++++++++++++++++++--- sys/compat/linuxkpi/common/src/linux_80211.h | 3 +- .../linuxkpi/common/src/linux_80211_macops.c | 2 + 4 files changed, 489 insertions(+), 89 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 8d6d690b2f57..69956c90042c 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -555,6 +555,9 @@ enum ieee802111_key_flag { }; struct ieee80211_key_conf { +#if defined(__FreeBSD__) + const struct ieee80211_key *_k; /* backpointer to net80211 */ +#endif atomic64_t tx_pn; uint32_t cipher; uint8_t icv_len; /* __unused nowadays? */ @@ -1154,7 +1157,7 @@ void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *, struct ieee80211_vif *, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), - void *); + void *, bool); void linuxkpi_ieee80211_iterate_chan_contexts(struct ieee80211_hw *, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, void *), @@ -1520,25 +1523,22 @@ ieee80211_iterate_interfaces(struct ieee80211_hw *hw, linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); } -static __inline void +static inline void ieee80211_iter_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), void *arg) { - - linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); + linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg, false); } -static __inline void +static inline void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), void *arg) { - - IMPROVE(); /* "rcu" */ - linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); + linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg, true); } static __inline void @@ -2094,33 +2094,6 @@ ieee80211_sta_set_buffered(struct ieee80211_sta *sta, uint8_t tid, bool t) TODO(); } -static __inline void -ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, uint8_t tid, - struct ieee80211_key_seq *seq) -{ - - KASSERT(keyconf != NULL && seq != NULL, ("%s: keyconf %p seq %p\n", - __func__, keyconf, seq)); - - TODO(); - switch (keyconf->cipher) { - case WLAN_CIPHER_SUITE_CCMP: - case WLAN_CIPHER_SUITE_CCMP_256: - memset(seq->ccmp.pn, 0xfa, sizeof(seq->ccmp.pn)); /* XXX TODO */ - break; - case WLAN_CIPHER_SUITE_AES_CMAC: - memset(seq->aes_cmac.pn, 0xfa, sizeof(seq->aes_cmac.pn)); /* XXX TODO */ - break; - case WLAN_CIPHER_SUITE_TKIP: - seq->tkip.iv32 = 0xfa; /* XXX TODO */ - seq->tkip.iv16 = 0xfa; /* XXX TODO */ - break; - default: - pr_debug("%s: unsupported cipher suite %d\n", __func__, keyconf->cipher); - break; - } -} - static __inline void ieee80211_sched_scan_results(struct ieee80211_hw *hw) { @@ -2466,6 +2439,44 @@ ieee80211_remove_key(struct ieee80211_key_conf *key) TODO(); } +static inline void +ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, int8_t tid, + struct ieee80211_key_seq *seq) +{ + const struct ieee80211_key *k; + const uint8_t *p; + + KASSERT(keyconf != NULL && seq != NULL, ("%s: keyconf %p seq %p\n", + __func__, keyconf, seq)); + KASSERT(tid <= IEEE80211_NUM_TIDS, ("%s: tid out of bounds %d\n", + __func__, tid)); + k = keyconf->_k; + KASSERT(k != NULL, ("%s: keyconf %p ieee80211_key is NULL\n", __func__, keyconf)); + + switch (keyconf->cipher) { + case WLAN_CIPHER_SUITE_CCMP: + case WLAN_CIPHER_SUITE_CCMP_256: + if (tid < 0) + p = (const uint8_t *)&k->wk_keyrsc[IEEE80211_NUM_TIDS]; /* IEEE80211_NONQOS_TID */ + else + p = (const uint8_t *)&k->wk_keyrsc[tid]; + memcpy(seq->ccmp.pn, p, sizeof(seq->ccmp.pn)); + break; + case WLAN_CIPHER_SUITE_AES_CMAC: + TODO(); + memset(seq->aes_cmac.pn, 0xfa, sizeof(seq->aes_cmac.pn)); /* XXX TODO */ + break; + case WLAN_CIPHER_SUITE_TKIP: + TODO(); + seq->tkip.iv32 = 0xfa; /* XXX TODO */ + seq->tkip.iv16 = 0xfa; /* XXX TODO */ + break; + default: + pr_debug("%s: unsupported cipher suite %d\n", __func__, keyconf->cipher); + break; + } +} + static __inline void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *key, int tid, struct ieee80211_key_seq *seq) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b276f502be76..683de6e0d474 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -39,7 +39,12 @@ * We call the internal versions lxxx (e.g., hw -> lhw, sta -> lsta). */ -#include +/* + * TODO: + * - lots :) + * - HW_CRYPTO: we need a "keystore" and an ordered list for suspend/resume. + */ + #include #include #include @@ -72,12 +77,16 @@ #include "linux_80211.h" #define LKPI_80211_WME -/* #define LKPI_80211_HW_CRYPTO */ -/* #define LKPI_80211_VHT */ +#define LKPI_80211_HW_CRYPTO /* #define LKPI_80211_HT */ +/* #define LKPI_80211_VHT */ + #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) #define LKPI_80211_HT #endif +#if defined(LKPI_80211_HT) && !defined(LKPI_80211_HW_CRYPTO) +#define LKPI_80211_HW_CRYPTO +#endif static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); @@ -93,6 +102,12 @@ SYSCTL_DECL(_compat_linuxkpi); SYSCTL_NODE(_compat_linuxkpi, OID_AUTO, 80211, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "LinuxKPI 802.11 compatibility layer"); +#if defined(LKPI_80211_HW_CRYPTO) +static bool lkpi_hwcrypto = false; +SYSCTL_BOOL(_compat_linuxkpi_80211, OID_AUTO, hw_crypto, CTLFLAG_RDTUN, + &lkpi_hwcrypto, 0, "Enable LinuxKPI 802.11 hardware crypto offload"); +#endif + /* Keep public for as long as header files are using it too. */ int linuxkpi_debug_80211; @@ -439,7 +454,7 @@ lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, ieee80211_dump_node(NULL, ni); printf("\ttxq_task txq len %d mtx\n", mbufq_len(&lsta->txq)); printf("\tkc %p state %d added_to_drv %d in_mgd %d\n", - lsta->kc, lsta->state, lsta->added_to_drv, lsta->in_mgd); + &lsta->kc[0], lsta->state, lsta->added_to_drv, lsta->in_mgd); #endif } @@ -905,20 +920,173 @@ linuxkpi_ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) #ifdef LKPI_80211_HW_CRYPTO static int -_lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, - enum set_key_cmd cmd) +lkpi_sta_del_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct lkpi_sta *lsta) +{ + int error; + + if (!lkpi_hwcrypto) + return (0); + + lockdep_assert_wiphy(hw->wiphy); + ieee80211_ref_node(lsta->ni); + + error = 0; + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) { + struct ieee80211_key_conf *kc; + int err; + + if (lsta->kc[keyix] == NULL) + continue; + kc = lsta->kc[keyix]; + + err = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, + LSTA_TO_STA(lsta), kc); + if (err != 0) { + ic_printf(lsta->ni->ni_ic, "%s: set_key cmd %d(%s) for " + "sta %6D failed: %d\n", __func__, DISABLE_KEY, + "DISABLE", lsta->sta.addr, ":", err); + error++; + + /* + * If we free the key here we will never be able to get it + * removed from the driver/fw which will likely make us + * crash (firmware). + */ + continue; + } +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(lsta->ni->ni_ic, "%s: set_key cmd %d(%s) for " + "sta %6D succeeded: keyidx %u hw_key_idx %u flags %#10x\n", + __func__, DISABLE_KEY, "DISABLE", lsta->sta.addr, ":", + kc->keyidx, kc->hw_key_idx, kc->flags); +#endif + + lsta->kc[keyix] = NULL; + free(kc, M_LKPI80211); + } + ieee80211_free_node(lsta->ni); + return (error); +} + +static int +_lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) { struct ieee80211com *ic; struct lkpi_hw *lhw; struct ieee80211_hw *hw; struct lkpi_vif *lvif; + struct lkpi_sta *lsta; struct ieee80211_vif *vif; struct ieee80211_sta *sta; struct ieee80211_node *ni; struct ieee80211_key_conf *kc; + struct ieee80211_node_table *nt; int error; + bool islocked; - /* XXX TODO Check (k->wk_flags & IEEE80211_KEY_SWENCRYPT) and don't upload to driver/hw? */ + ic = vap->iv_ic; + lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + + if (vap->iv_bss == NULL) { + ic_printf(ic, "%s: iv_bss %p for vap %p is NULL\n", + __func__, vap->iv_bss, vap); + return (0); + } + ni = ieee80211_ref_node(vap->iv_bss); + lsta = ni->ni_drv_data; + if (lsta == NULL) { + ic_printf(ic, "%s: ni %p (%6D) with lsta NULL\n", + __func__, ni, ni->ni_bssid, ":"); + ieee80211_free_node(ni); + return (0); + } + sta = LSTA_TO_STA(lsta); + + if (lsta->kc[k->wk_keyix] == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: sta %6D and no key information, " + "keyidx %u wk_macaddr %6D; returning success\n", + __func__, sta->addr, ":", + k->wk_keyix, k->wk_macaddr, ":"); +#endif + ieee80211_free_node(ni); + return (1); + } + + /* This is inconsistent net80211 locking to be fixed one day. */ + nt = &ic->ic_sta; + islocked = IEEE80211_NODE_IS_LOCKED(nt); + if (islocked) + IEEE80211_NODE_UNLOCK(nt); + + wiphy_lock(hw->wiphy); + kc = lsta->kc[k->wk_keyix]; + /* Re-check under lock. */ + if (kc == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: sta %6D and key information vanished, " + "returning success\n", __func__, sta->addr, ":"); +#endif + error = 1; + goto out; + } + + error = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, sta, kc); + if (error != 0) { + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D failed: %d\n", + __func__, DISABLE_KEY, "DISABLE", sta->addr, ":", error); + error = 0; + goto out; + } + +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D succeeded: " + "keyidx %u hw_key_idx %u flags %#10x\n", __func__, + DISABLE_KEY, "DISABLE", sta->addr, ":", + kc->keyidx, kc->hw_key_idx, kc->flags); +#endif + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + error = 1; +out: + wiphy_unlock(hw->wiphy); + if (islocked) + IEEE80211_NODE_LOCK(nt); + ieee80211_free_node(ni); + return (error); +} + +static int +lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + + /* XXX-BZ one day we should replace this iterating over VIFs, or node list? */ + /* See also lkpi_sta_del_keys() these days. */ + return (_lkpi_iv_key_delete(vap, k)); +} + +static int +_lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct lkpi_vif *lvif; + struct lkpi_sta *lsta; + struct ieee80211_vif *vif; + struct ieee80211_sta *sta; + struct ieee80211_node *ni; + struct ieee80211_key_conf *kc; + uint32_t lcipher; + int error; ic = vap->iv_ic; lhw = ic->ic_softc; @@ -926,10 +1094,50 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - memset(&kc, 0, sizeof(kc)); - kc = malloc(sizeof(*kc) + k->wk_keylen, M_LKPI80211, M_WAITOK | M_ZERO); - kc->cipher = lkpi_net80211_to_l80211_cipher_suite( + if (vap->iv_bss == NULL) { + ic_printf(ic, "%s: iv_bss %p for vap %p is NULL\n", + __func__, vap->iv_bss, vap); + return (0); + } + ni = ieee80211_ref_node(vap->iv_bss); + lsta = ni->ni_drv_data; + if (lsta == NULL) { + ic_printf(ic, "%s: ni %p (%6D) with lsta NULL\n", + __func__, ni, ni->ni_bssid, ":"); + ieee80211_free_node(ni); + return (0); + } + sta = LSTA_TO_STA(lsta); + + wiphy_lock(hw->wiphy); + if (lsta->kc[k->wk_keyix] != NULL) { + IMPROVE("Still in firmware? Del first. Can we assert this cannot happen?"); + ic_printf(ic, "%s: sta %6D found with key information\n", + __func__, sta->addr, ":"); + kc = lsta->kc[k->wk_keyix]; + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + kc = NULL; /* safeguard */ + } + + lcipher = lkpi_net80211_to_l80211_cipher_suite( k->wk_cipher->ic_cipher, k->wk_keylen); + switch (lcipher) { + case WLAN_CIPHER_SUITE_CCMP: + break; + case WLAN_CIPHER_SUITE_TKIP: + default: + ic_printf(ic, "%s: CIPHER SUITE %#x not supported\n", __func__, lcipher); + IMPROVE(); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); + return (0); + } + + kc = malloc(sizeof(*kc) + k->wk_keylen, M_LKPI80211, M_WAITOK | M_ZERO); + kc->_k = k; /* Save the pointer to net80211. */ + atomic64_set(&kc->tx_pn, k->wk_keytsc); + kc->cipher = lcipher; kc->keyidx = k->wk_keyix; #if 0 kc->hw_key_idx = /* set by hw and needs to be passed for TX */; @@ -938,6 +1146,11 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, kc->keylen = k->wk_keylen; memcpy(kc->key, k->wk_key, k->wk_keylen); + if (k->wk_flags & (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV)) + kc->flags |= IEEE80211_KEY_FLAG_PAIRWISE; + if (k->wk_flags & IEEE80211_KEY_GROUP) + kc->flags &= ~IEEE80211_KEY_FLAG_PAIRWISE; + switch (kc->cipher) { case WLAN_CIPHER_SUITE_CCMP: kc->iv_len = k->wk_cipher->ic_header; @@ -945,44 +1158,41 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, break; case WLAN_CIPHER_SUITE_TKIP: default: + /* currently UNREACH */ IMPROVE(); - return (0); + break; }; + lsta->kc[k->wk_keyix] = kc; - ni = vap->iv_bss; - sta = ieee80211_find_sta(vif, ni->ni_bssid); - if (sta != NULL) { - struct lkpi_sta *lsta; - - lsta = STA_TO_LSTA(sta); - lsta->kc = kc; - } - - error = lkpi_80211_mo_set_key(hw, cmd, vif, sta, kc); + error = lkpi_80211_mo_set_key(hw, SET_KEY, vif, sta, kc); if (error != 0) { - /* XXX-BZ leaking kc currently */ - ic_printf(ic, "%s: set_key failed: %d\n", __func__, error); + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D failed: %d\n", + __func__, SET_KEY, "SET", sta->addr, ":", error); + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); return (0); - } else { - ic_printf(ic, "%s: set_key succeeded: keyidx %u hw_key_idx %u " - "flags %#10x\n", __func__, - kc->keyidx, kc->hw_key_idx, kc->flags); - return (1); } -} -static int -lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) -{ +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D succeeded: " + "kc %p keyidx %u hw_key_idx %u flags %#010x\n", __func__, + SET_KEY, "SET", sta->addr, ":", + kc, kc->keyidx, kc->hw_key_idx, kc->flags); +#endif - /* XXX-BZ one day we should replace this iterating over VIFs, or node list? */ - return (_lkpi_iv_key_set_delete(vap, k, DISABLE_KEY)); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); + return (1); } + static int lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) { - return (_lkpi_iv_key_set_delete(vap, k, SET_KEY)); + return (_lkpi_iv_key_set(vap, k)); } #endif @@ -2425,6 +2635,24 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_lsta_dump(lsta, ni, __func__, __LINE__); +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + wiphy_lock(hw->wiphy); + error = lkpi_sta_del_keys(hw, vif, lsta); + wiphy_unlock(hw->wiphy); + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: lkpi_sta_del_keys " + "failed: %d\n", __func__, __LINE__, error); + /* + * Either drv/fw will crash or cleanup itself, + * otherwise net80211 will delete the keys (at a + * less appropriate time). + */ + /* goto out; */ + } + } +#endif + /* Update sta_state (ASSOC to AUTH). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " @@ -2563,6 +2791,24 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_lsta_dump(lsta, ni, __func__, __LINE__); +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + wiphy_lock(hw->wiphy); + error = lkpi_sta_del_keys(hw, vif, lsta); + wiphy_unlock(hw->wiphy); + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: lkpi_sta_del_keys " + "failed: %d\n", __func__, __LINE__, error); + /* + * Either drv/fw will crash or cleanup itself, + * otherwise net80211 will delete the keys (at a + * less appropriate time). + */ + /* goto out; */ + } + } +#endif + /* Update sta_state (ASSOC to AUTH). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " @@ -3143,13 +3389,13 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif->iv_update_bss = vap->iv_update_bss; vap->iv_update_bss = lkpi_iv_update_bss; - /* Key management. */ - if (lhw->ops->set_key != NULL) { #ifdef LKPI_80211_HW_CRYPTO + /* Key management. */ + if (lkpi_hwcrypto && lhw->ops->set_key != NULL) { vap->iv_key_set = lkpi_iv_key_set; vap->iv_key_delete = lkpi_iv_key_delete; -#endif } +#endif #ifdef LKPI_80211_HT /* Stay with the iv_ampdu_rxmax,limit / iv_ampdu_density defaults until later. */ @@ -3161,6 +3407,15 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status, mac); +#ifdef LKPI_80211_HT + /* + * Modern chipset/fw/drv will do A-MPDU in drv/fw and fail + * to do so if they cannot do the crypto too. + */ + if (!lkpi_hwcrypto && ieee80211_hw_check(hw, AMPDU_AGGREGATION)) + vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_RX; +#endif + if (hw->max_listen_interval == 0) hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval); hw->conf.listen_interval = hw->max_listen_interval; @@ -3991,13 +4246,74 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, return (0); } +#ifdef LKPI_80211_HW_CRYPTO +static int +lkpi_hw_crypto_prepare(struct lkpi_sta *lsta, struct ieee80211_key *k, + struct sk_buff *skb) +{ + struct ieee80211_tx_info *info; + struct ieee80211_key_conf *kc; + struct ieee80211_hdr *hdr; + uint32_t hlen, hdrlen; + uint8_t *p; + + KASSERT(lsta != NULL, ("%s: lsta is NULL", __func__)); + KASSERT(k != NULL, ("%s: key is NULL", __func__)); + KASSERT(skb != NULL, ("%s: skb is NULL", __func__)); + + kc = lsta->kc[k->wk_keyix]; + + info = IEEE80211_SKB_CB(skb); + info->control.hw_key = kc; + + /* MUST NOT happen. KASSERT? */ + if (kc == NULL) { + ic_printf(lsta->ni->ni_ic, "%s: lsta %p k %p skb %p, " + "kc is NULL on hw crypto offload\n", __func__, lsta, k, skb); + return (ENXIO); + } + + + IMPROVE("the following should be WLAN_CIPHER_SUITE specific"); + /* We currently only support CCMP so we hardcode things here. */ + + hdr = (void *)skb->data; + + /* + * Check if we have anythig to do as requested by driver + * or if we are done? + */ + if ((kc->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) == 0 && + (kc->flags & IEEE80211_KEY_FLAG_GENERATE_IV) == 0 && + /* MFP */ + !((kc->flags & IEEE80211_KEY_FLAG_GENERATE_IV_MGMT) != 0 && + ieee80211_is_mgmt(hdr->frame_control))) + return (0); + + hlen = k->wk_cipher->ic_header; + if (skb_headroom(skb) < hlen) + return (ENOSPC); + + hdrlen = ieee80211_hdrlen(hdr->frame_control); + p = skb_push(skb, hlen); + memmove(p, p + hlen, hdrlen); + + /* If driver request space only we are done. */ + if ((kc->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) != 0) + return (0); + + p += hdrlen; + k->wk_cipher->ic_setiv(k, p); + + return (0); +} +#endif + static void lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) { struct ieee80211_node *ni; -#ifndef LKPI_80211_HW_CRYPTO struct ieee80211_frame *wh; -#endif struct ieee80211_key *k; struct sk_buff *skb; struct ieee80211com *ic; @@ -4012,6 +4328,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) struct ieee80211_hdr *hdr; struct lkpi_txq *ltxq; void *buf; + ieee80211_keyix keyix; uint8_t ac, tid; M_ASSERTPKTHDR(m); @@ -4022,20 +4339,30 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) ni = lsta->ni; k = NULL; -#ifndef LKPI_80211_HW_CRYPTO - /* Encrypt the frame if need be; XXX-BZ info->control.hw_key. */ + keyix = IEEE80211_KEYIX_NONE; wh = mtod(m, struct ieee80211_frame *); if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { - /* Retrieve key for TX && do software encryption. */ - k = ieee80211_crypto_encap(ni, m); - if (k == NULL) { - ieee80211_free_node(ni); - m_freem(m); - return; + +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + k = ieee80211_crypto_get_txkey(ni, m); + if (k != NULL && lsta->kc[k->wk_keyix] != NULL) + keyix = k->wk_keyix; } - } #endif + /* Encrypt the frame if need be. */ + if (keyix == IEEE80211_KEYIX_NONE) { + /* Retrieve key for TX && do software encryption. */ + k = ieee80211_crypto_encap(ni, m); + if (k == NULL) { + ieee80211_free_node(ni); + m_freem(m); + return; + } + } + } + ic = ni->ni_ic; lhw = ic->ic_softc; hw = LHW_TO_HW(lhw); @@ -4146,7 +4473,19 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) sta = LSTA_TO_STA(lsta); #ifdef LKPI_80211_HW_CRYPTO - info->control.hw_key = lsta->kc; + if (lkpi_hwcrypto && keyix != IEEE80211_KEYIX_NONE) { + int error; + + error = lkpi_hw_crypto_prepare(lsta, k, skb); + if (error != 0) { + /* + * We only have to free the skb which will free the + * mbuf and release the reference on the ni. + */ + dev_kfree_skb(skb); + return; + } + } #endif IMPROVE(); @@ -5107,7 +5446,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) ic->ic_cryptocaps = 0; #ifdef LKPI_80211_HW_CRYPTO - if (hw->wiphy->n_cipher_suites > 0) { + if (lkpi_hwcrypto && hw->wiphy->n_cipher_suites > 0) { for (i = 0; i < hw->wiphy->n_cipher_suites; i++) ic->ic_cryptocaps |= lkpi_l80211_to_net80211_cyphers( hw->wiphy->cipher_suites[i]); @@ -5346,15 +5685,62 @@ linuxkpi_ieee80211_iterate_interfaces(struct ieee80211_hw *hw, LKPI_80211_LHW_LVIF_UNLOCK(lhw); } +static void +lkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + ieee80211_keyix keyix, struct lkpi_sta *lsta, + void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, + struct ieee80211_sta *, struct ieee80211_key_conf *, void *), + void *arg) +{ + if (!lsta->added_to_drv) + return; + + if (lsta->kc[keyix] == NULL) + return; + + iterfunc(hw, vif, LSTA_TO_STA(lsta), lsta->kc[keyix], arg); +} + void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), - void *arg) + void *arg, bool rcu) { + struct lkpi_sta *lsta; + struct lkpi_vif *lvif; - UNIMPLEMENTED; + lvif = VIF_TO_LVIF(vif); + + if (rcu) { + if (vif == NULL) { + TODO(); + } else { + IMPROVE("We do not actually match the RCU code"); + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); + keyix++) + lkpi_ieee80211_iterate_keys(hw, vif, + keyix, lsta, iterfunc, arg); + } + } + } else { + TODO("Used by suspend/resume; order of keys as installed to " + "firmware is important; we'll need to rewrite some code for that"); + lockdep_assert_wiphy(hw->wiphy); + + if (vif == NULL) { + TODO(); + } else { + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); + keyix++) + lkpi_ieee80211_iterate_keys(hw, vif, + keyix, lsta, iterfunc, arg); + } + } + } } void diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index bb1ecb45636f..40b11ebfef13 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -67,6 +67,7 @@ #define D80211_TRACEX (D80211_TRACE_TX|D80211_TRACE_RX) #define D80211_TRACEX_DUMP (D80211_TRACE_TX_DUMP|D80211_TRACE_RX_DUMP) #define D80211_TRACE_STA 0x00010000 +#define D80211_TRACE_HW_CRYPTO 0x00020000 #define D80211_TRACE_MO 0x00100000 #define D80211_TRACE_MODE 0x0f000000 #define D80211_TRACE_MODE_HT 0x01000000 @@ -151,7 +152,7 @@ struct lkpi_sta { struct mbufq txq; struct mtx txq_mtx; - struct ieee80211_key_conf *kc; + struct ieee80211_key_conf *kc[IEEE80211_WEP_NKID]; enum ieee80211_sta_state state; bool txq_ready; /* Can we run the taskq? */ bool added_to_drv; /* Driver knows; i.e. we called ...(). */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index 7440d1d3c26c..1da3c582adb4 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -684,6 +684,8 @@ lkpi_80211_mo_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct lkpi_hw *lhw; int error; + lockdep_assert_wiphy(hw->wiphy); + lhw = HW_TO_LHW(hw); if (lhw->ops->set_key == NULL) { error = EOPNOTSUPP; From nobody Mon Feb 24 20:27:17 2025 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 4Z1sjR2LL8z5pq1v; Mon, 24 Feb 2025 20:27:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjM5wMKz3p45; Mon, 24 Feb 2025 20:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428839; 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=tsytHZVXSKjTm2pJe7S1LufKv2veD80VnVKRiKBOZ9E=; b=iSR107s4RD/d7a9LCtVwdiWwf9KZ47lrZjDSicTOEDI2dsgdsfw+luvbcP9jcpcusuGhAo R/FcLpncUXD9ZBj6MUve0yT48/HNOS511ZypQBR0TLDTEXf9wKqz6OuBOx+ouCb9hXCE0j LVZRANxYduw2uXdFT7rLpUO6rnNtywhtPt7COUkpeMdWnu4o+DsCsaEvf2eup6j595kZ/z Ih96fymF7yREamf6x2AG/1TANWCl4kx2MRfK4otAHtJby9LcJBHm7vvlk6EXKs3JkfD7ur ldyqb1CYZsXSy9WXyQD+zVyrNdBKu7mxmeap448lwSr47kkwAGwXgZChuYjjUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428839; a=rsa-sha256; cv=none; b=mmTWz0HsuaLDnJGUtCZVUDyr251Q01DgPHRfLArrJ0232QNuqNdeZZ2xcHyny9MWjgVmS4 3MMHkGxKbJg+0KZrVwxucrLn7xYyrtfPleQJghM6oZynBWvVTS6GdOHyMgI1/JcaLh+K1B znMEdof0fE808VLKeGArMNoCXhPoRusU9IES7zDjJLbgxKrGcpheP2qfMo0n99l/8xSUXw ri00Vpganr/0DBCTjxlThTWqz7vUO5+En5u8zzf+JSefg4nNK5Yw7Ew1LDBfwojhQVLjit dGs2VF6fHGjZZHUwxzoALDv6w1JbmV282sVPEwbQ3EQierAhhsaquWL5EvytAw== 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=1740428839; 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=tsytHZVXSKjTm2pJe7S1LufKv2veD80VnVKRiKBOZ9E=; b=hMj3kqo+keC5684egxg8F3Z7wSX33JQYDDkRZgWrUAzR3a1JAKi/USQZx6M7xEipDZkFUq HvD1aHhEO7XSDd23ZNKGy528yENWlNuySb5oOLgSYHK3AEdokhG7VViMr7c2MpBc8tL3Fu u85TWewz56QvlolAJqcAHu5QqtG52V1MSb8E9yb8Kb74qv5FcY3+j9sCSaJoMvVAYnTven NopEpJwnP23LFsqUwVU0VeGX1mDrPKsELQYKorv7epmTVjMW9Z0rETQYGR4mavDmH5NDC4 8ugme0ap52RdKh/fZhabT3lQ4f3RwgkJEQndGN+KCvmRie2ImQ+7ocrvPUdNFg== 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 4Z1sjK4lvXzvrS; Mon, 24 Feb 2025 20:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRHgo027492; Mon, 24 Feb 2025 20:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRHd5027489; Mon, 24 Feb 2025 20:27:17 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:17 GMT Message-Id: <202502242027.51OKRHd5027489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b2999f02278d - stable/14 - LinuxKPI: 802.11/skb: add extra information for skb alloc 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: b2999f02278dd4f98fed4089d778639bc980a551 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b2999f02278dd4f98fed4089d778639bc980a551 commit b2999f02278dd4f98fed4089d778639bc980a551 Author: Bjoern A. Zeeb AuthorDate: 2024-12-27 21:26:52 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11/skb: add extra information for skb alloc failures rtw88 seems to have an skb leak still. Add a WARN_ONCE to __skb_queue_purge() just to make sure there is no glitch due to missing locking. Also add a rolling error reporting for skb allocation failures in LinuxKPI to gather some more information if possible about queue states. This is a corrected version of what was initially part of D48474. Sponsored by: The FreeBSD Foundation (cherry picked from commit bcf1d8ee355213eef4a125c0b8518f1cb4f35df4) (cherry picked from commit 1432e0f20ccde8eaa23d3d3e20fca2989cd344b6) --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 2 ++ sys/compat/linuxkpi/common/src/linux_80211.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 341ed33ddfcd..43f35d8f065f 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -706,6 +706,8 @@ __skb_queue_purge(struct sk_buff_head *q) SKB_TRACE(q); while ((skb = __skb_dequeue(q)) != NULL) kfree_skb(skb); + WARN_ONCE(skb_queue_len(q) != 0, "%s: queue %p not empty: %u", + __func__, q, skb_queue_len(q)); } static inline void diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 7bb051a67ade..853d77fd4a96 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3855,7 +3855,22 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) */ skb = dev_alloc_skb(hw->extra_tx_headroom + m->m_pkthdr.len); if (skb == NULL) { - ic_printf(ic, "ERROR %s: skb alloc failed\n", __func__); + static uint8_t skb_alloc_failures = 0; + + if (skb_alloc_failures++ == 0) { + int tid; + + sta = LSTA_TO_STA(lsta); + ic_printf(ic, "ERROR %s: skb alloc failed %d + %d, lsta %p sta %p ni %p\n", + __func__, hw->extra_tx_headroom, m->m_pkthdr.len, lsta, sta, ni); + for (tid = 0; tid < nitems(sta->txq); tid++) { + if (sta->txq[tid] == NULL) + continue; + ltxq = TXQ_TO_LTXQ(sta->txq[tid]); + ic_printf(ic, " tid %d ltxq %p seen_dequeue %d stopped %d skb_queue_len %u\n", + tid, ltxq, ltxq->seen_dequeue, ltxq->stopped, skb_queue_len(<xq->skbq)); + } + } ieee80211_free_node(ni); m_freem(m); return; From nobody Mon Feb 24 20:27:20 2025 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 4Z1sjS3WGYz5pprQ; Mon, 24 Feb 2025 20:27: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjR2SzYz3p6g; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428843; 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=5Qc3d0P/j23XNMx2GL6tI20SLtNuFcob74vviFsPf5c=; b=uEKGaO83MxSGPfTtYA5/5IgN0eS6QJJvM310z7Xceej/S4wK5ntDR6FRtuPpy6ovyPPkyg ZYnRr6cR2b/L/5GFYTeaEUcBB6g6CybjugD0MRAu7s+URq809JHA2X6/V0YaAlmM9q8WYk ibQ+RbqZeF4WpfRKo1xp5r5Vd+dHVOU01HkvEfawXgSq2HG7qR76B+ieAcHCnN/8RN6534 XUnGm7tdAeb0Uok8oyETLUGZnojNMFNAULz5h002SMMLUClF1W09zWKPK4diV47UTZY4Gw Ri+RobCx1Z22qVuD03pQEYO31mvJOCXXfGNb6OtJll+2b/PKlpl1mpsF61Ontg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428843; a=rsa-sha256; cv=none; b=owQk8ycSRLdPJ9J70pgia4L5f3PoXvDRs1nQ5dWJ4nUO77BZ1t3v4E5tZ2ZckGoDvyYrwV nkdiUgmCjQDmVj6ubHsFK9bELsWEQWwrecVarYJwMvJwjLiGJFD2MODf5KZByf/PIFy18s ND6YPhYuEoEcHr0ARnv2YC0zdHpiueQcAQc6xef3BGsr6AWF9bItHDhT1tWYyPKzJiqH5N HF2CjRWpDKirXnGDuYs9EKa+49+2PElYPp/gLj+AcGIVm3QZPtp6t59PrgXSJReMIrA9Vb 9nJvXw4VF/UT0W8/HbFl6v7IM3VImEJZDP5o/UcO4yZhCUVQprJoSjoXQLA9MA== 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=1740428843; 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=5Qc3d0P/j23XNMx2GL6tI20SLtNuFcob74vviFsPf5c=; b=PwKHyHOyQnYg92HRiwIsaZ3dl6ISChHcUG97h+p/dS0n/odUHiOlS6JbDxWOS4cJPDd/f3 4/J9Dc/zt7qYXaCUqICun/NS1aS3fwzWcbDuvMANQ4+CrCQdWxWMI7Ieke3maSflWA6m5L 2pCH8/Ug/l3ObNeWWkyhoo5ugmFgXxAiD8hG59in/xGs84RDuyXzkLRmNiN+b6U9bbHpTj cJGNK7jLYl5u5nXWYBhiJoIEgTXovzlQ9FHBZ/1sztJoiw/SWxTm6zFVj/AmGgcnYDAU3x 7jGFcqhz9C2GMSr7zdrQdc6Sg6pGfhb763agJ7uKD7xVPjCw7o0XkGmEoFtmEA== 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 4Z1sjP0DHKzwMZ; Mon, 24 Feb 2025 20:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRKa0027605; Mon, 24 Feb 2025 20:27:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRKwf027602; Mon, 24 Feb 2025 20:27:20 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:20 GMT Message-Id: <202502242027.51OKRKwf027602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eaa2fca952b3 - stable/14 - LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f commit eaa2fca952b33f67b8d9c13da5d4cec8054f0e4f Author: Bjoern A. Zeeb AuthorDate: 2025-02-19 12:04:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:49 +0000 LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly Rather than just printing the cipher suite as uint32_t hex (or split into OUI and number) also print a short name. iwlwifi(4), for example, now prints on startup with HW_CRYPTO on: unsupported WLAN Cipher Suite 0x000fac | 8 (GCMP) unsupported WLAN Cipher Suite 0x000fac | 9 (GCMP_256) unsupported WLAN Cipher Suite 0x000fac | 6 (AES_CMAC) unsupported WLAN Cipher Suite 0x000fac | 11 (BIP_GMAC_128) unsupported WLAN Cipher Suite 0x000fac | 12 (BIP_GMAC_256) Likewise _lkpi_iv_key_set() would now print: iwlwifi0: _lkpi_iv_key_set: CIPHER SUITE 0xfac02 (TKIP) not supported Sponsored by: The FreeBSD Foundation (cherry picked from commit 12a511c844706917e49e24c8d1daa861288aea23) --- sys/compat/linuxkpi/common/src/linux_80211.c | 47 +++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 683de6e0d474..9de81f3f9b28 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -750,6 +750,38 @@ lkpi_opmode_to_vif_type(enum ieee80211_opmode opmode) } #ifdef LKPI_80211_HW_CRYPTO +static const char * +lkpi_cipher_suite_to_name(uint32_t wlan_cipher_suite) +{ + + switch (wlan_cipher_suite) { + case WLAN_CIPHER_SUITE_WEP40: + return ("WEP40"); + case WLAN_CIPHER_SUITE_TKIP: + return ("TKIP"); + case WLAN_CIPHER_SUITE_CCMP: + return ("CCMP"); + case WLAN_CIPHER_SUITE_WEP104: + return ("WEP104"); + case WLAN_CIPHER_SUITE_AES_CMAC: + return ("AES_CMAC"); + case WLAN_CIPHER_SUITE_GCMP: + return ("GCMP"); + case WLAN_CIPHER_SUITE_GCMP_256: + return ("GCMP_256"); + case WLAN_CIPHER_SUITE_CCMP_256: + return ("CCMP_256"); + case WLAN_CIPHER_SUITE_BIP_GMAC_128: + return ("BIP_GMAC_128"); + case WLAN_CIPHER_SUITE_BIP_GMAC_256: + return ("BIP_GMAC_256"); + case WLAN_CIPHER_SUITE_BIP_CMAC_256: + return ("BIP_CMAC_256"); + default: + return ("??"); + } +} + static uint32_t lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) { @@ -770,12 +802,16 @@ lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_256: case WLAN_CIPHER_SUITE_BIP_CMAC_256: - printf("%s: unsupported WLAN Cipher Suite %#08x | %u\n", __func__, - wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff); + printf("%s: unsupported WLAN Cipher Suite %#08x | %u (%s)\n", + __func__, + wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff, + lkpi_cipher_suite_to_name(wlan_cipher_suite)); break; default: - printf("%s: unknown WLAN Cipher Suite %#08x | %u\n", __func__, - wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff); + printf("%s: unknown WLAN Cipher Suite %#08x | %u (%s)\n", + __func__, + wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff, + lkpi_cipher_suite_to_name(wlan_cipher_suite)); } return (0); @@ -1127,7 +1163,8 @@ _lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) break; case WLAN_CIPHER_SUITE_TKIP: default: - ic_printf(ic, "%s: CIPHER SUITE %#x not supported\n", __func__, lcipher); + ic_printf(ic, "%s: CIPHER SUITE %#x (%s) not supported\n", + __func__, lcipher, lkpi_cipher_suite_to_name(lcipher)); IMPROVE(); wiphy_unlock(hw->wiphy); ieee80211_free_node(ni); From nobody Mon Feb 24 20:27:22 2025 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 4Z1sjT1qC7z5pq1y; Mon, 24 Feb 2025 20:27:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjS1V9Kz3nxk; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428844; 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=avW8VBX5dyINalJWQF2GXTpYWOSNi2VE1Ib8c3bzkHo=; b=SFIjapJuOz+k43gQlAEse2YehxZpDBTz8eIwR68mrRbYl50f7ySQbkaMrpIbUitHRoG9W+ K32f4u+Pr9ZMdt84f1s1nRxcqRCFTRYMcVhbrOZs6AKQADIrYclj36GII+UH4j7sCOpykD js7i4mbVt7whcQTFg51gRFepiOMLpYdkAwHuN7qeAiAMHU3HSl1iz1/BPofnD6uSX/epT1 awyO3QRecDLCBJ84OYOGMy8nC+WI0bIDnK2Htb4IzkUDzFWk3gKSbHzyQzlQhNHcy/K/q4 ZaG/vuJjX37c4hSpEgpg7+r5Kdp1dApAqLLekJWgt2+5DR9oSFM2XYKYTz5P8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428844; a=rsa-sha256; cv=none; b=l/WUrGivHRvn6BgeK+cvelzZjI/usMZOiibYixm+WnNj+MAaFnbRMYLyg/vYKdGxd7WLhB 2zsIbtr+m/ZDKbPyLkflbMN6B+oOBpruNggQKKQR8BRlCGZf9rb2LpYFoQ9xnoSX4p1kqx mjCscdD8UjGFMMJ0U+3ecS3Qm+ynb0aJq4IYHB+dM3Pec4cR6d2D6sppLKfBzFT1KuTfFb k51R7dgpU+uBSR5nFdvDYQBKQAujxvFPkRNfKo5vkhk6qlnglHEVm44oRQWgkav17mvmIU xHEgWprHrgzLXO7jcSXYtBMGDm0K40NMvdofI1yG451U9kVyt6B2VK/wMkykJQ== 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=1740428844; 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=avW8VBX5dyINalJWQF2GXTpYWOSNi2VE1Ib8c3bzkHo=; b=V7I/mg5koaexIk3vm4jaMgL5UQlypnEOGgsj1BdaK8x6DgHYZBDNh0MylsFLuCt5kfCY66 PQ/NApHYRPpbmWTBhLoxBudtbRJGq7zD/KihsFXM7Fl9XRvnutSqar6UHnmMIO+3R9KQ0M Kz1jGhJda2E+KLmN7KZ/Ir8IO4eC20geHYSJwIu0rfs4on3TSM895J9E0T2cD6GHqQsoqD MWy4meajoqxfyCPU1AFqoWvf+/UzBn+TrO/kQuWdj8mLjgxDyqpYADsOpO9U9hBN08fF4X 92PHwpP2sQ/UWC6y2MJkDrknaKZwPWgE9KtRUXD4/ASFVnSO20ZQFwS+3XfTiw== 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 4Z1sjQ2F9czwMb; Mon, 24 Feb 2025 20:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRMlP027641; Mon, 24 Feb 2025 20:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRMA6027638; Mon, 24 Feb 2025 20:27:22 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:22 GMT Message-Id: <202502242027.51OKRMA6027638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8468f05ff74d - stable/14 - LinuxKPI: 802.11: switch vif station list to a linux list 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8468f05ff74d84d9f4f9094bf42f7356a9ac6045 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8468f05ff74d84d9f4f9094bf42f7356a9ac6045 commit 8468f05ff74d84d9f4f9094bf42f7356a9ac6045 Author: Bjoern A. Zeeb AuthorDate: 2025-01-25 23:39:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:50 +0000 LinuxKPI: 802.11: switch vif station list to a linux list We ran into problems with locking the VIF for the lsta tailq on and off. Switch from a native tailq to the LinuxKPI list. This allows us to implement the "rcu" part in linuxkpi_ieee80211_iterate_keys() which we could not before. Further using either rcu or the wiphy lock we no longer run into problems with the lock not being sleepable. The last case was rtw89 debugfs which was doing a sleepable alloc in the iterator callback of linuxkpi_ieee80211_iterate_stations_atomic(). Sponsored by: The FreeBSD Foundation (cherry picked from commit a8f735a66130aa737999fad9b3246159099dc9eb) --- sys/compat/linuxkpi/common/src/linux_80211.c | 60 ++++++++++++++-------------- sys/compat/linuxkpi/common/src/linux_80211.h | 9 ++++- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 9de81f3f9b28..0574d4a502de 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -74,6 +74,7 @@ #include #include +#include #include "linux_80211.h" #define LKPI_80211_WME @@ -294,7 +295,7 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) sbuf_new_for_sysctl(&s, NULL, 1024, req); wiphy_lock(hw->wiphy); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry(lsta, &lvif->lsta_list, lsta_list) { sta = LSTA_TO_STA(lsta); sbuf_putc(&s, '\n'); @@ -463,12 +464,11 @@ lkpi_lsta_remove(struct lkpi_sta *lsta, struct lkpi_vif *lvif) { - LKPI_80211_LVIF_LOCK(lvif); - KASSERT(lsta->lsta_entry.tqe_prev != NULL, - ("%s: lsta %p lsta_entry.tqe_prev %p ni %p\n", __func__, - lsta, lsta->lsta_entry.tqe_prev, lsta->ni)); - TAILQ_REMOVE(&lvif->lsta_head, lsta, lsta_entry); - LKPI_80211_LVIF_UNLOCK(lvif); + wiphy_lock(lsta->hw->wiphy); + KASSERT(!list_empty(&lsta->lsta_list), + ("%s: lsta %p ni %p\n", __func__, lsta, lsta->ni)); + list_del_init(&lsta->lsta_list); + wiphy_unlock(lsta->hw->wiphy); } static struct lkpi_sta * @@ -488,6 +488,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], if (lsta == NULL) return (NULL); + lsta->hw = hw; lsta->added_to_drv = false; lsta->state = IEEE80211_STA_NOTEXIST; /* @@ -1773,10 +1774,10 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lsta->txq_ready = true; LKPI_80211_LSTA_TXQ_UNLOCK(lsta); - LKPI_80211_LVIF_LOCK(lvif); + wiphy_lock(hw->wiphy); /* Insert the [l]sta into the list of known stations. */ - TAILQ_INSERT_TAIL(&lvif->lsta_head, lsta, lsta_entry); - LKPI_80211_LVIF_UNLOCK(lvif); + list_add_tail(&lsta->lsta_list, &lvif->lsta_list); + wiphy_unlock(hw->wiphy); /* Add (or adjust) sta and change state (from NOTEXIST) to NONE. */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); @@ -3297,7 +3298,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif = malloc(len, M_80211_VAP, M_WAITOK | M_ZERO); mtx_init(&lvif->mtx, "lvif", NULL, MTX_DEF); - TAILQ_INIT(&lvif->lsta_head); + INIT_LIST_HEAD(&lvif->lsta_list); lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; vap = LVIF_TO_VAP(lvif); @@ -5751,11 +5752,12 @@ linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, lvif = VIF_TO_LVIF(vif); if (rcu) { + rcu_read_lock_held(); /* XXX-BZ is this correct? */ + if (vif == NULL) { TODO(); } else { - IMPROVE("We do not actually match the RCU code"); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) lkpi_ieee80211_iterate_keys(hw, vif, @@ -5770,7 +5772,7 @@ linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, if (vif == NULL) { TODO(); } else { - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry(lsta, &lvif->lsta_list, lsta_list) { for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) lkpi_ieee80211_iterate_keys(hw, vif, @@ -5831,14 +5833,14 @@ linuxkpi_ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw, LKPI_80211_LHW_LVIF_LOCK(lhw); TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) { - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { if (!lsta->added_to_drv) continue; sta = LSTA_TO_STA(lsta); iterfunc(arg, sta); } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); } LKPI_80211_LHW_LVIF_UNLOCK(lhw); } @@ -6605,14 +6607,14 @@ lkpi_find_lsta_by_ni(struct lkpi_vif *lvif, struct ieee80211_node *ni) { struct lkpi_sta *lsta, *temp; - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH_SAFE(lsta, &lvif->lsta_head, lsta_entry, temp) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { if (lsta->ni == ni) { - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (lsta); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (NULL); } @@ -6622,20 +6624,20 @@ struct ieee80211_sta * linuxkpi_ieee80211_find_sta(struct ieee80211_vif *vif, const u8 *peer) { struct lkpi_vif *lvif; - struct lkpi_sta *lsta, *temp; + struct lkpi_sta *lsta; struct ieee80211_sta *sta; lvif = VIF_TO_LVIF(vif); - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH_SAFE(lsta, &lvif->lsta_head, lsta_entry, temp) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { sta = LSTA_TO_STA(lsta); if (IEEE80211_ADDR_EQ(sta->addr, peer)) { - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (sta); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (NULL); } @@ -7175,8 +7177,8 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) #endif lvif->hw_queue_stopped[ac] = false; - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { struct ieee80211_sta *sta; sta = LSTA_TO_STA(lsta); @@ -7199,7 +7201,7 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); } } } diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 40b11ebfef13..b17e6072066c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -126,6 +126,8 @@ struct lkpi_radiotap_rx_hdr { (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)) +struct lkpi_hw; + struct lkpi_txq { TAILQ_ENTRY(lkpi_txq) txq_entry; @@ -142,8 +144,9 @@ struct lkpi_txq { struct lkpi_sta { - TAILQ_ENTRY(lkpi_sta) lsta_entry; + struct list_head lsta_list; struct ieee80211_node *ni; + struct ieee80211_hw *hw; /* back pointer f. locking. */ /* Deferred TX path. */ /* Eventually we might want to migrate this into net80211 entirely. */ @@ -164,6 +167,7 @@ struct lkpi_sta { #define STA_TO_LSTA(_sta) container_of(_sta, struct lkpi_sta, sta) #define LSTA_TO_STA(_lsta) (&(_lsta)->sta) +/* Either protected by wiphy lock or rcu for the list. */ struct lkpi_vif { TAILQ_ENTRY(lkpi_vif) lvif_entry; struct ieee80211vap iv_vap; @@ -179,7 +183,8 @@ struct lkpi_vif { enum ieee80211_state, int); struct ieee80211_node * (*iv_update_bss)(struct ieee80211vap *, struct ieee80211_node *); - TAILQ_HEAD(, lkpi_sta) lsta_head; + struct list_head lsta_list; + struct lkpi_sta *lvif_bss; bool lvif_bss_synched; bool added_to_drv; /* Driver knows; i.e. we called add_interface(). */ From nobody Mon Feb 24 20:27:23 2025 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 4Z1sjW1Cgqz5pq6S; Mon, 24 Feb 2025 20:27:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjS1VSHz3p0w; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428844; 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=e/3zdNWwUI8nWeMH035gduZc/Al/N1z73utxMFmpfPY=; b=TzlyLonBL0afI7dlCEK+tfGzs7MSQzFx/OLUGdyrHhN7LgMvIhxCx9RzU28TAagc1vBOzI R2CovYFYmbNSc57+5lajEZOSLWqP3sPAxqvsZlDxmbi51tE8zp7lckdjbX23nmVKjibYar z71/BiYMZp25hamazIAXmLxIh7GGkThbnVB51RbPjIHIir8eBFpr9FtARinpAsjz015DMe WPh5nuCQjsLbF1QQ/WE+oHu3Kfe+KIWgHrdfpjjyGPhzlWvFchalqR2GmzYo5DovRjgeZc 5AUXN5bQkhcuMa1O9orKOttP/vGSj0h62c/FRHWvb/prN8L35IUbcBlA+zYMRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428844; a=rsa-sha256; cv=none; b=eqDedOQBbprEExOFA86P791PhYNSPr48xssHlFUrTF2f3zbH0fTvg1jfm/9lxQt7wS96/a oQwgb2VLmym/Lg2RF7eoDZpUVJwWdW4DO8g8DkWG0f8DTiL5gk75ZCwUXNRu90NPk/eZ+K nmXc+XRFaSiK2f5EB7xK0RiqHPFGErv08kUph7ASinEZhXfxIQlIUw2tdXsRkNWNqNUeAV xmJVtAQuoC7SrZlbcdsg0B9+WGI2gNPNQrow1GgKS6HIqk5/D5o13Ex1dwjKhZNxko/vO4 EnLB2xiaNc175xQOpu72OVMY+oXMUT9wz1dhHdxMn3QPVLH02NF8Iq4WgNEACw== 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=1740428844; 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=e/3zdNWwUI8nWeMH035gduZc/Al/N1z73utxMFmpfPY=; b=YYYcV3W4Jdh5IG87q9drho5njdWV3oiApl52Z9sofzyf4I4bePMPwybB1dFpR8nuNRJfbF Tgd6URCOTWwG0NYDTh2su/UjNYTtVgGqi44vl7NytaQ/Z5ewSaf4aw8dhDtR1eUigJSt/d rKFzB5+BabAW17tvOLnzn93q93tVrOZMm5cVzJ+6bFerCJIiXYOs/f5htMNA+FecG4g1Cu 5tdUl3dccq81Z/QRlirCxvUi7sJUWdKHocY6SoFf1J4M3LHFpIG+d2WQFNEhBYgZTnPW1z 5RAqfOfDoe49ZY2I4EAmyezvVrHL9/wB7/Vy0KInrhmiBG8lDNXGKOn4WTG7ig== 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 4Z1sjR28WWzwYQ; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRNGT027677; Mon, 24 Feb 2025 20:27:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRNdc027674; Mon, 24 Feb 2025 20:27:23 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:23 GMT Message-Id: <202502242027.51OKRNdc027674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8feaeb95440b - stable/14 - net80211: crypto: ccmp: simplify and style(9) 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8feaeb95440b851202d59f12d7bde0500109be5b Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8feaeb95440b851202d59f12d7bde0500109be5b commit 8feaeb95440b851202d59f12d7bde0500109be5b Author: Bjoern A. Zeeb AuthorDate: 2025-01-27 13:54:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:50 +0000 net80211: crypto: ccmp: simplify and style(9) Comply with style(9) and andd checks for booleaness when doing bit tests. If there is no need for double negated checks simplify them. This all makes the conditions a lot easier to read. Slip in a comment about MIC vs. MMIC. No functional changes. Sponsored by: The FreeBSD Foundation Reviewed by: emaste, adrian Differential Revision: https://reviews.freebsd.org/D49055 (cherry picked from commit 8dcdffdb086103e9ce36bfa82fc1179c88ebc31b) --- sys/net80211/ieee80211_crypto_ccmp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 06028cf2a37c..404996b1cbca 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -242,7 +242,7 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) rxs = ieee80211_get_rx_params_ptr(m); - if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP)) + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP) != 0) goto finish; /* @@ -297,14 +297,15 @@ finish: /* * XXX TODO: see if MMIC_STRIP also covers CCMP MIC trailer. + * Well no as it's a MIC not MMIC but we re-use the same flag for now. */ - if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP))) + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) == 0) m_adj(m, -ccmp.ic_trailer); /* * Ok to update rsc now. */ - if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP) == 0) { /* * Do not go backwards in the IEEE80211_KEY_NOREPLAY cases * or in case hardware has checked but frames are arriving From nobody Tue Feb 25 00:37:56 2025 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 4Z1zGX6n7kz5p2MF; Tue, 25 Feb 2025 00:37:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGX5qXhz3Yk0; Tue, 25 Feb 2025 00:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443876; 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=TCxx4Ubhqy0Kxr7kjyNqsZnVWXeeTIpbLnMOR4EtCJU=; b=rgGy6HehBmR4/pBSCJra7VyEOayvQqda2LGnAgOF3bZ+J/dFqZio7uEHHRBHBlsEYa2g8b JdKda6H+qlVoh5LdKA08s+gVaq1M5oI76CI4ERsrXpn6/pHgItQt6VdACrKu9rwH3AA4/Q E43ZlKXYXOVJirU++8Z0HzKPrCAzDXnWTkywWAv8/4dGHI+Rrf5/qunwrPP1cd8PBMEXy1 ctIRpTYE3oBHxtuwfDYBaSmWUtvTL4LI7bi6YveB2eu32AKTThk5wzxXzJsPPOosx6hWHp 3VUDr0b+fcLjnhC+jkYqa/Le/uP+4HPKQOc8copgvP00MBkdsRP9C7PWFpm9cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443876; a=rsa-sha256; cv=none; b=Rz0T0kF8nuf7cajVByTD1kBSHdtbBmB8aZHo2YRJG+kWLw9wSh9rcPlo/QRlu/xxFWbf6s nxGepBMTNL7TEvL+41UegEBfRCSbrFUowpfjmrMw0z8IHISxac0nimNT7VlvIDWjTpx7g0 Nsq/WFVCYAtqP7Mo5aKp0JnsBNz+j/T59oHZjiRArFBQTgZ0ovqMvR5cBYL67De+xXoTs5 kJf8AsmpCEe4u+fNvixev2VxHw1JKCS34T4ACspjYr9aKVjP9X/n9ZYk3SQU0pt3mc/Tnv l9kuTqF/MOaCwdNqjL8X/dJP8t+crorJH1jm24HsOusaMd7lOQKy0di2Cs5SnA== 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=1740443876; 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=TCxx4Ubhqy0Kxr7kjyNqsZnVWXeeTIpbLnMOR4EtCJU=; b=nQphNk1uF01AGW4WyBBljtxpSJ7vw1aWgvzg4rURvH2ZZRBPE5WC4zHkvvDQ+vsVsOe2zq mwBUAISI0uvevn6CzmVfw7KmgRu4qytTayr5/G7KB7A8TrMGC170Jf8Ni9hfULNc82eqGW loVW75tDGxipHbhMV+TQSTWIj8iohMF+fe1vCOkKYRNks4Ve6m980I/3jtLwGaWQJlMmi/ +W10ryP1y+t6EtvfTWR/DKMigM28HaMxTZ8E5BtjfRd5qArw4eEtsEjF33kNr5om1x8DV0 g2WMUHLjPwN7wlapq6yYEwRU4SKJ57vslq6ue+h/UvYVJ++BG6QSuv+AWBOIMQ== 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 4Z1zGX52rPz13FZ; Tue, 25 Feb 2025 00:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0buqh096625; Tue, 25 Feb 2025 00:37:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0buNT096622; Tue, 25 Feb 2025 00:37:56 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:37:56 GMT Message-Id: <202502250037.51P0buNT096622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 1a241a911dc8 - stable/14 - ntpd: Use the ntpd -u option in preference to the rc su plumbing 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a241a911dc8635c3803f1a6620e1ab4692f6ecf Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=1a241a911dc8635c3803f1a6620e1ab4692f6ecf commit 1a241a911dc8635c3803f1a6620e1ab4692f6ecf Author: Cy Schubert AuthorDate: 2024-12-12 20:03:09 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:37:46 +0000 ntpd: Use the ntpd -u option in preference to the rc su plumbing Using the rc plumbing to setuid(2) is preferred as it allows the user to use the -i option in ntpd_flags to chroot ntpd. Chrooting ntpd by default will be a 2025 project. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48191 (cherry picked from commit 521f66715afb312b356afafc68cbc044a436a753) --- libexec/rc/rc.d/ntpd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd index 76d83149ae1a..36df4ae08c96 100755 --- a/libexec/rc/rc.d/ntpd +++ b/libexec/rc/rc.d/ntpd @@ -98,7 +98,6 @@ ntpd_precmd() # by the admin, we don't add the option. If the file exists in the old # default location we use that, else we use the new default location. if can_run_nonroot; then - _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || [ -n "${rc_flags}" ] && @@ -112,7 +111,13 @@ ntpd_precmd() fi # Set command_args based on the various config vars. - command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}" + command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt} -u ${ntpd_user:=ntpd:ntpd}" + + # Unset ntpd_user because rc.subr uses $${name}_user to determine + # whether to invoke su(1) to setuid() to $ntpd_user for us. We want + # ntpd to do the setuid() itself through the -u argument, above. + unset ntpd_user + if checkyesno ntpd_sync_on_start; then command_args="${command_args} -g" fi From nobody Tue Feb 25 00:37:57 2025 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 4Z1zGZ0GGwz5p26D; Tue, 25 Feb 2025 00:37:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGY5SxKz3YpW; Tue, 25 Feb 2025 00:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443877; 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=NMf3puub2H5cS9wiUlr9E2MKMFkoYhvBhNN6XVkWfmk=; b=Nm4G7Bz4FtjEQ6+V5TtyvJodurUGImOkSmn2c8EtXfQOZWihi2GaJFIEUyDf3vTz5nxLf3 AQlIOXLoGosE47CEYjRZGHc4AUvo4rZYSeriaLz4+vimMM1w9rjQX0m59iRkg7jch1feN8 VrE5oTA6N7gZ0+jCH2bhy+I7Ca/OhDHsmbZWdQyTaU/1g66/YjA/klm6EaSF8mVizzn1S6 Z0YYZZehZXt4ZTA023wkT1adZ0titChWBwNIyTw2xgZXo6ZiLSYXl2D7ZRDW4WNqbR1xvV cubu0fRKGujMD+kvXNRfayoinmwjSOiGvM+r9BdN16IXGPI6ix4xym1As4uP3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443877; a=rsa-sha256; cv=none; b=QMW8NY1SJP0uQCzFtW0zjwDgX61mQ0HeoOOSld3T8XYQn+dp6e24Gt1nVRB8gNlbVSUWg/ ULaSMZw/4dRtSwQdFA2VP3Bgpw45vt5VVFW+QRWpcqx3CQQ4tWvjB/zE/PdagD8YrOVg36 UUeSRgnrQYOUheG67aBkB8sZgVLI4ruWOz8kI40/LHPqzcGDJEc00fQvMPnRKoMpARnwvp 6v2khOdlVrfSg582o6c8cNnkuZMgEIPtMc0sruNzZUppmkBQquhCDb/RPGR7m6yAz+PpVE 8bXJD3ONZfyz3mYVzD173eMN9+vppaymHV2r/5gpQpKu9CORCtmBC6Qr/pNhfw== 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=1740443877; 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=NMf3puub2H5cS9wiUlr9E2MKMFkoYhvBhNN6XVkWfmk=; b=AUYBCCeO/IYtn9FftfnYFom0wPsHu/Vsna8Xu0a0u/aDzyZed/JGN6jaxPII7gqIqdR2Wr IFyUHA+eVMZpQFln6trkRcvUdkARJkirJiWmdlEQCA7NGNIvxhY8IlyRFnOhcbX0EsRcra FAzWV6+5Mu4R0ZUHG+Tz45Hb8nzGH0OpRWVBzaWevUmQvJIadJZdsalI3OiWsu6iHddUXi n+4P4s5Wi6WSjL7L0LVrUQhMcHQXaw3tWu2ewUTxJDvjeIG8btVi2Fcb9qPr888WZLiuUr RrMp4L3h/u94L+DGYvyUCGWYG84QvZnGJxNWhsO9yAlYzsEw2S0axDc/xPETsg== 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 4Z1zGY52Cwz13J2; Tue, 25 Feb 2025 00:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0bvCu096659; Tue, 25 Feb 2025 00:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0bvXb096656; Tue, 25 Feb 2025 00:37:57 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:37:57 GMT Message-Id: <202502250037.51P0bvXb096656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: b006133ca117 - stable/14 - shar: Handle special characters or white space in file names fed to shar 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b006133ca1176a89abd3f96bb87989a85342f6a8 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=b006133ca1176a89abd3f96bb87989a85342f6a8 commit b006133ca1176a89abd3f96bb87989a85342f6a8 Author: Cy Schubert AuthorDate: 2025-01-02 03:35:31 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:37:46 +0000 shar: Handle special characters or white space in file names fed to shar Obtained from: NetBSD hg commit 365370:124268924386 MFC after: 1 week (cherry picked from commit 1080f5315427b382221651b342227b4923106f83) --- usr.bin/shar/shar.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index 77ef3789c8b3..f7496716acba 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -64,14 +64,14 @@ echo "#" for i do - if [ -d $i ]; then - echo "echo c - $i" - echo "mkdir -p $i > /dev/null 2>&1" + if [ -d "$i" ]; then + echo "echo c - '$i'" + echo "mkdir -p '$i' > /dev/null 2>&1" else - md5sum=`echo -n $i | md5` - echo "echo x - $i" - echo "sed 's/^X//' >$i << '$md5sum'" - sed 's/^/X/' $i || exit + md5sum=`echo -n "$i" | md5` + echo "echo x - '$i'" + echo "sed 's/^X//' >'$i' << '$md5sum'" + sed 's/^/X/' "$i" || exit echo "$md5sum" fi done From nobody Tue Feb 25 00:37:58 2025 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 4Z1zGb33cHz5p2C2; Tue, 25 Feb 2025 00:37:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGZ6ZGdz3YVk; Tue, 25 Feb 2025 00:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443878; 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=x/83Dcvl+Kni5M1oyRSR30QhjZRQbkuCm4xpU6KVH6A=; b=hd74yImCZ76rd8wzwZcqGS1xgKfAftQB7E6KacVic8t3SIO3ASUjr/yK6SOsZOqcE/lR4e JOjPGCQPku58hy4uWKVjGZMaohB+l27sqyrOMONKOU/oKLkt0fi3Wa7HJnL95TdZsLtnZ6 eRxwKZ/jO2knyyeDZTQh5bi8jiGUqhmXm6L2JjKDAQLYqlEVu2QlyZjbdqC4kdu+HcZrUZ AlPoGVEA3V/to2+XRzR5kV7GPV/W2BpQxZsnn6j5UP+pbOzC/Yz+fklM1l8nF0wMx/c9OR bYgGfWPSX8jNtJVYvJJKxE5tI6Cn4DkroVtCtk6hpO21oScwGusElkNVrStSCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443878; a=rsa-sha256; cv=none; b=Vh2tqlgH7r8w9UtpP1V4HzaXwo5BLwtOCCw+mj2LYwW/c74IKHwdOJD0Wfu3Bjy/IGCieV OoUAc6f3YOiYq+z1fT04IGEcRmorx1LEXZF/6G5I+Ttrga6OZPZpQ5SHRY96p3GdXQXOpY 49iejVQzHMCbxc7fy0ELUlrCguYe/0K7TJ03rde0MBJSjuSDlxH71ShSe2/QkHsGqB6Kb/ xShxPxKRdM6YNJGLnaHOHkCKKyIHDMhnK1Hx6LrdsIn/Kk8w1ETXsRK3niEjh14C9h4U8y 9tmwHIy7LVtKATrYUR6qjn4o5Wi5AaghJS3qBGWJhmNpseb4U75LvSCcq0NbRw== 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=1740443878; 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=x/83Dcvl+Kni5M1oyRSR30QhjZRQbkuCm4xpU6KVH6A=; b=WQc7MIPrTuWbAhchAMClr5BKBN3fUAMb9gKpZs3Y5T5CBDub6C/R6RwDBovYsaIKMi8Ybu X2egY2oJLtUVBid4JjZp5rCn6LryQJUl3AvqJxp9gfdoa41CAoZ9lL9SPqvD9Uo/LHnUHx RJojZkbvdvxVQPrxQIwhBzDX8dNkDkflOxxvlPLl7hSY9dPt4qlcTJtKL7JzADWeVz3fNZ SIuvyaV2xHA+xtMsY3UHx5b+x67ajsrD88GDXR+hO7DglAR3iz1F08i4Pj8SBhdLOKqKnR nxfaiKzv1twHpEVUo4S3D/AbSNhNAMkQuHC856ajBP8CAqICOgfKWXffvVuMkg== 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 4Z1zGZ60Fnz13J3; Tue, 25 Feb 2025 00:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0bwqu096693; Tue, 25 Feb 2025 00:37:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0bwQt096690; Tue, 25 Feb 2025 00:37:58 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:37:58 GMT Message-Id: <202502250037.51P0bwQt096690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 6a4a1a238523 - stable/14 - shar: Make sure a sed failure in the generated archive results in failure 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a4a1a238523d5640f474fd2775163275ac466f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6a4a1a238523d5640f474fd2775163275ac466f4 commit 6a4a1a238523d5640f474fd2775163275ac466f4 Author: Cy Schubert AuthorDate: 2025-01-02 03:44:18 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:37:46 +0000 shar: Make sure a sed failure in the generated archive results in failure Obtained from: NetBSD hg commit 365369:21b92f0055b4 MFC after: 1 week (cherry picked from commit f0c8d2cd622a47e06c08620a10e13ad7519e9102) --- usr.bin/shar/shar.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index f7496716acba..97e7768da6c7 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -71,7 +71,7 @@ do md5sum=`echo -n "$i" | md5` echo "echo x - '$i'" echo "sed 's/^X//' >'$i' << '$md5sum'" - sed 's/^/X/' "$i" || exit + sed 's/^/X/' "$i" || exit 1 echo "$md5sum" fi done From nobody Tue Feb 25 00:38:16 2025 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 4Z1zGw4yFQz5p2Fy; Tue, 25 Feb 2025 00:38:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGw1ndZz3ZBS; Tue, 25 Feb 2025 00:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443896; 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=tFgu9E+nNtRAVunjmL3NIXw2TBnlADHSoD3dACpZMOI=; b=T11wkvIlu9zENJwOvNC2fS6h3rxXnQ1Qlfw6/XC81h5udSoYRuyNQ/bo0TPlcwZA/oyGdG gA2hKI6Tn7znKUfu3S93Mw7FmnKX6t1Lxqk7vSWyXulTxbxBJpI3AxOrWjym5vn1f/CFyL fG/0NAyj3L3P8xLdKye1VgTiCTm55zQD/UVHuDeDSSZ4HSBhNVwIpdjehMhWv5SoBNnOt4 gl11eAr4u8rFxgOktzVWlbgl72l3F9sPYqY/SQ+I4pAH3iqD0bQ/aO+3PVnF94W7Wpl4hL SKdh8dfpS8gTC/wwOTscwtXJB9pLEGYs66mEa2flrUXm7YKw9Z5GriDRcnERJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443896; a=rsa-sha256; cv=none; b=KmT17ZQgANasdUo+y/0W7huF5d7vuzNXZ+GN78x6IlKKrDcBzMcD1X3dKhWT9sjgcUVqwx wvqt0xyXlKS+Ng9ywOuD7Uq+P5SDu8Azg76dJVhZvXSmTUM50586IXJ3zO8XCaIFXUFje1 3QbTfeSxPDeC69GKWvxBSb/JeFt9gIEg4yp/EMsmxFLTbL7XBtCr+Ornd9Wd0TbBttMQUN IQn7gaGAm5KAht4F+QE53ZXwKyrkzmHhL7rtGOBdSBF6H0ELI+fsXvZ/UdDFmVtqNp0FQR VGOo22yw9SR3JgkhdSsuWTMm3XhgQiFfTpHrU0EjCBVBwYBNc7V9XKaTp8syng== 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=1740443896; 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=tFgu9E+nNtRAVunjmL3NIXw2TBnlADHSoD3dACpZMOI=; b=bbZX+TUDy/80CyZehuYgNyqt8d6MLpgLafysFCMWGrHSOI5MyMXjbP+b5EPNLAa5NdlHrj UoX0SMkKwXRRRucjn18PzFkfDDo02zJu1RHVw1bJMbx+MlcG18+GGSQqgcyTU4nxqYL8ed 2eHhsyXhKIqhUGLxcl9kR8jGPqYBF7CZHlhI1DSArSlJG7MVaBXSUNxCfJi9vrgeUHXw+l IrDWRB+WxsdrVqzsJoTffq9Cc6OCmZ5dy+hOhT1hgvVpwL0uH20psIRUklRv24NKnjVRda Y+h/D7or4NxFE/jI36Jt8m3zQNBQQepFMVR08HRjHIXqz6W0QU/pcZHsO1bVEQ== 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 4Z1zGw1Fc7z131B; Tue, 25 Feb 2025 00:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0cGWw096923; Tue, 25 Feb 2025 00:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0cG4u096920; Tue, 25 Feb 2025 00:38:16 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:38:16 GMT Message-Id: <202502250038.51P0cG4u096920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 92c834c6980d - stable/13 - ntpd: Use the ntpd -u option in preference to the rc su plumbing 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 92c834c6980d5e86768509104242316a51c064dc Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=92c834c6980d5e86768509104242316a51c064dc commit 92c834c6980d5e86768509104242316a51c064dc Author: Cy Schubert AuthorDate: 2024-12-12 20:03:09 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:38:10 +0000 ntpd: Use the ntpd -u option in preference to the rc su plumbing Using the rc plumbing to setuid(2) is preferred as it allows the user to use the -i option in ntpd_flags to chroot ntpd. Chrooting ntpd by default will be a 2025 project. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48191 (cherry picked from commit 521f66715afb312b356afafc68cbc044a436a753) --- libexec/rc/rc.d/ntpd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd index 76d83149ae1a..36df4ae08c96 100755 --- a/libexec/rc/rc.d/ntpd +++ b/libexec/rc/rc.d/ntpd @@ -98,7 +98,6 @@ ntpd_precmd() # by the admin, we don't add the option. If the file exists in the old # default location we use that, else we use the new default location. if can_run_nonroot; then - _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || [ -n "${rc_flags}" ] && @@ -112,7 +111,13 @@ ntpd_precmd() fi # Set command_args based on the various config vars. - command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}" + command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt} -u ${ntpd_user:=ntpd:ntpd}" + + # Unset ntpd_user because rc.subr uses $${name}_user to determine + # whether to invoke su(1) to setuid() to $ntpd_user for us. We want + # ntpd to do the setuid() itself through the -u argument, above. + unset ntpd_user + if checkyesno ntpd_sync_on_start; then command_args="${command_args} -g" fi From nobody Tue Feb 25 00:38:17 2025 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 4Z1zGx5c23z5p2Y7; Tue, 25 Feb 2025 00:38:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGx2kH2z3ZLM; Tue, 25 Feb 2025 00:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443897; 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=mmtopY/Nu1DT+ZM+8N82KSzB9+fYOom7yczaQ23dQys=; b=HdCho5juHBMRSgGq4nhIs7J+QLf+qcqVUsjc4R6ZLEsjrHMmhoQJHtylFBILA8DyXpJLoD xI+R9qQWwe968t0MvQP4l7wM6vM46TeexGaurTZs3LhjMnvDI/aaWAarGQT/E5VoBFCEJl ANElb20KUDvur3mhDsH5ZDW6YAAsQLDMu9DDyTIcclPp9o0pn7YPn3UipLZMjw/JxqcBJD Rbx6CufkscCk6jXB8LMvkFogBe19Tw3hImZHvD5rMdkKnp/HraSwKh4BVV6BbxESJt5uoO rZEMghLnMZSxv5i1PPphIC0mphC567l5hE+swlsMeOhPyLF1Qv2H6VaM2fQluA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443897; a=rsa-sha256; cv=none; b=HXG2OPP68NhUgsJbDDGhWmXzwWlMnkj2kQdZ+oN9Qm3m2j5ZCb+HMqwisw8sNQOacp0Zry FEWhQs+pMyQkF9vXZz+YAGjdUx5iQCpHx34zHYsfbRci5Wxfy/NKLUm9JtKQHEuaN/RNjC 32DX6bRWVI5TvMvpOzmEeD2G3Ut8Ip68TQruC6Tb9Z/9rMvaByLTE6zNPVoimm7AHdR2pU gcc7BNI/CTNh+3NxTIXTRL/LsSZLbzCsvlYbAlsGdQ/JWOHZMDY7U4fAyg7bE8Ma24mdo8 BwL2d+7USxafJznQSuspakAwXVQgVdUBWx2kgmk8GHh9IxFYCBoH9VvxGrFc1w== 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=1740443897; 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=mmtopY/Nu1DT+ZM+8N82KSzB9+fYOom7yczaQ23dQys=; b=romaKPNaLPVuXqzA0+Mr00G5QtouNEm4ws1hHj/aKqWf6V2Clw3rwuTl3G6VUQ26388mov +qQuNvXqDEu22/Bw7cgLSrvlRdqqJnXlX0l1KzDHa6s1HsejOXay/1yzjyb5eRWVZsqSxP mnGe4GeODSMoBzDlozssETkPb9RxlaqoccuaiW2e13FTINjNGqsCxR9BK9sMGNgjqT5I2n 6c8Y4ZdI94/z936Q+4by95L6D7i5cjTrpT8K1HE1qXEdcCkyeXVGriiKQDVZ9fIZoTEgVl naBBRgZu0omErKByS4EYP434cTXnIoUV0do4ACg/5DKufOK0JGJCJGugzqrwTA== 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 4Z1zGx24ZGz131C; Tue, 25 Feb 2025 00:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0cHFs096964; Tue, 25 Feb 2025 00:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0cHqv096961; Tue, 25 Feb 2025 00:38:17 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:38:17 GMT Message-Id: <202502250038.51P0cHqv096961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9b70262b0807 - stable/13 - shar: Handle special characters or white space in file names fed to shar 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b70262b08076ecde0262173e33d9cfc805b14b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9b70262b08076ecde0262173e33d9cfc805b14b5 commit 9b70262b08076ecde0262173e33d9cfc805b14b5 Author: Cy Schubert AuthorDate: 2025-01-02 03:35:31 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:38:10 +0000 shar: Handle special characters or white space in file names fed to shar Obtained from: NetBSD hg commit 365370:124268924386 MFC after: 1 week (cherry picked from commit 1080f5315427b382221651b342227b4923106f83) --- usr.bin/shar/shar.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index 77ef3789c8b3..f7496716acba 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -64,14 +64,14 @@ echo "#" for i do - if [ -d $i ]; then - echo "echo c - $i" - echo "mkdir -p $i > /dev/null 2>&1" + if [ -d "$i" ]; then + echo "echo c - '$i'" + echo "mkdir -p '$i' > /dev/null 2>&1" else - md5sum=`echo -n $i | md5` - echo "echo x - $i" - echo "sed 's/^X//' >$i << '$md5sum'" - sed 's/^/X/' $i || exit + md5sum=`echo -n "$i" | md5` + echo "echo x - '$i'" + echo "sed 's/^X//' >'$i' << '$md5sum'" + sed 's/^/X/' "$i" || exit echo "$md5sum" fi done From nobody Tue Feb 25 00:38:18 2025 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 4Z1zGy6TwHz5p2Tp; Tue, 25 Feb 2025 00:38:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1zGy3Hdyz3ZSn; Tue, 25 Feb 2025 00:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740443898; 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=bqYsKOJH43fZkpmzvTgAnIIXzzhByb1E78mHrdoTEZo=; b=I+IzH6Q/x1tbJunIIev1glK6A95nbo+mGAn8pGyySdz8vkt//lTreHUwWsTvvz83l1dudZ RnM+9dRrW8cdv+HiaATZTOnry5/eJqDsFsQLKCI5mx7FKRfGqH0/XKbSBnLQL1XG5MU/z8 a+H9GJiVu4IPz27RlOykZrZMRj2liWZvZgojWVf42WR184cSs0q4v758stRj4v9kU5qM7Y MI3P1gFRr/03Y/amnom+9QyqnDyUB0VYUsdWFIt1HVVSz2E8W2DpsL6X+lQd2hIMvXRokB nUgFhfiFGhaeSWRurcyPka6h55HzbOREU60OXTxWAGUngKGOeo7VtsKnFb2hzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740443898; a=rsa-sha256; cv=none; b=qCtsK6qrx3ZtOd9f3miRmjW7b6HnmMkU9a+CoDeTZWatDobYYAS/UYTkTIfec9aOm6eOHN wOzy96wnZQwJENUNHAXeKjzk01UITVVSwjOxLsY5oGeuvF40kokM5mWy1e5AeHnVk8p4EP ukbpxkd6ZfKoQrEkVIwVsW/Pk7YYmjQ1eYlLek6auRsy6IuKrR6i6pVmkF1ZaLl2hR1ARQ mv4iVkt1wUa55wIn4IkO0+ZtInX7XizoxNiq9cmhTllXRJP8yxKMsqDrval3F2YPPc5ZLv K72l91S7iDYDuw2NkWBedGGLX2ye7CuYrLPLWlhkHtbro5/95lzYV5NPvVGfHw== 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=1740443898; 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=bqYsKOJH43fZkpmzvTgAnIIXzzhByb1E78mHrdoTEZo=; b=PrHfTNnXzPQejU6AadAu92KqdMKV8SZBhVRfl9z8jieDK2F6AMXPjqsy6cP46+mDEO+Ejt AfnKdwufuCCVj+l8xCatYFM0DPRBa6qJ8msyX0H296WVY8C2OfrMJ6ljRynTdtyej0U5WM jcFr/pA5RP6l+/ksa+dwl9itFbBfF6heUjQyM/OaZhPH+wEL7pdv2DNyIXVAMX0kws+Cqi PycqFGuYmbptJQkK9rBBzbD8WT4KyCIJbpdq+MkJ0RAkLU/Bo5/I43ZsPGY1R2j/2fgnB4 CT0SonlzqL2SDGCje4YDlDYoylIu41pfSiJHZwdrJHn4GjR45+3D+RyNbXO+KA== 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 4Z1zGy2qgdz13dF; Tue, 25 Feb 2025 00:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P0cIT2096996; Tue, 25 Feb 2025 00:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P0cIxr096993; Tue, 25 Feb 2025 00:38:18 GMT (envelope-from git) Date: Tue, 25 Feb 2025 00:38:18 GMT Message-Id: <202502250038.51P0cIxr096993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9b65c9cdbb94 - stable/13 - shar: Make sure a sed failure in the generated archive results in failure 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b65c9cdbb9419ea987a08b6aaa1e51e54bb52d0 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9b65c9cdbb9419ea987a08b6aaa1e51e54bb52d0 commit 9b65c9cdbb9419ea987a08b6aaa1e51e54bb52d0 Author: Cy Schubert AuthorDate: 2025-01-02 03:44:18 +0000 Commit: Cy Schubert CommitDate: 2025-02-25 00:38:10 +0000 shar: Make sure a sed failure in the generated archive results in failure Obtained from: NetBSD hg commit 365369:21b92f0055b4 MFC after: 1 week (cherry picked from commit f0c8d2cd622a47e06c08620a10e13ad7519e9102) --- usr.bin/shar/shar.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index f7496716acba..97e7768da6c7 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -71,7 +71,7 @@ do md5sum=`echo -n "$i" | md5` echo "echo x - '$i'" echo "sed 's/^X//' >'$i' << '$md5sum'" - sed 's/^/X/' "$i" || exit + sed 's/^/X/' "$i" || exit 1 echo "$md5sum" fi done From nobody Tue Feb 25 02:03:10 2025 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 4Z218t1v8Cz5p9ll; Tue, 25 Feb 2025 02:03:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z218t17SLz3TkG; Tue, 25 Feb 2025 02:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740448990; 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=pet6APQMnRSiEJ1dB1S/fVIS2waNkWSm1DobSiz9RUs=; b=eUiBXg23ENiTrZ9Xyoi1zr7aadtNe0gdY+uoqvLNqh1BqA2eFI/VlnKg2C4VtWCEz/tO7h eI02hpvbzytBnIxWd8eH5RHbSiCkoop7+PWbMLbjcOjkhBlKuIMDph7BBRWjxRW1M22387 Vwo3tmaz/r1rRmpPInVeRS9RdtUpU9kmb82a5yuOshwl6qA5REEM6YwitO3phWRhJmqbjt i9s86NWDuUr7ET1A70UK2vPDhZTh5DjubGNZN8WXPNNzyUTQtL2k+uBgB38Acrk8HVRyiI ojyTubXnBASrFZ2JTjOgb7lVxacWxExG5kDgQHPsKeW7qHo1aqCiFijeo9GMBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740448990; a=rsa-sha256; cv=none; b=qEG66b1fyb9CMZXUUozOK3RmuiWH2gN+zizUJrrg6gHOUfC9Ll5uAfhFtCNi0z7Y8REY0U mzrUYQm5JM59jbx+Vrd6ayQGumXvrQWEvSEF9W/ar/TYixi1MVm3qKWiOuapnDEsgHVpAM LQNJTk1w7KDGpQFIpcviKCButsUMaPX7AofOgYZiulE+15NhO/p6VbAIGhpTVuV0Gr6sFo 26iaGTfuYEBpHs37zsuxOr68zz9gKaMPjwLU7uvk/SC9Q/7Epoc7gi/HAKHJ0bl3YpG/XX XvSo9Z5EPB3p4hbuqrLjHoWqPvPTVscHkPHj14xE7HyphjgoHXd3LVUV3fQV1A== 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=1740448990; 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=pet6APQMnRSiEJ1dB1S/fVIS2waNkWSm1DobSiz9RUs=; b=nLpk/Re6s+MMN7kXj1/SwpojDzjlvhqdUurboxPvSZzwpZZKUG/0btT6RNZcmmcuwPl1Tx CAVe4zZj4PJ3dWuzARPbEE30qgTPVolxcJIkXavNMVXDtYfLTTMBwnpIhMFqvtXc9JZc6n j64p7XOyFhiPWNd6FXUntUFaLYmTmw7PSuBcdk8m9up4phJbfirtjtGuV3eQbzQ2AkLGOV 2ocJSz9AvTc52o5Eh/Qjn7v+oyJzsgHEXlMAKcGTquU52T3CpBO4dvPrugjIAXaKcc72+p miFQE9glucLOF7j+oG1aqiJDHgBykW7vApZ1zf1ZvEQ5ik96kHlbmArSLPq0yQ== 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 4Z218t0btyz15ml; Tue, 25 Feb 2025 02:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P23ASY063993; Tue, 25 Feb 2025 02:03:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P23AmB063990; Tue, 25 Feb 2025 02:03:10 GMT (envelope-from git) Date: Tue, 25 Feb 2025 02:03:10 GMT Message-Id: <202502250203.51P23AmB063990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 29c7551cf797 - stable/14 - nfscl: Re-initialize session seq#s when server shrinks slot table 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 29c7551cf7970dbe6a869b766a2740864653f3ff Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=29c7551cf7970dbe6a869b766a2740864653f3ff commit 29c7551cf7970dbe6a869b766a2740864653f3ff Author: Rick Macklem AuthorDate: 2025-02-11 23:50:57 +0000 Commit: Rick Macklem CommitDate: 2025-02-25 02:01:19 +0000 nfscl: Re-initialize session seq#s when server shrinks slot table When a NFSv4.1/4.2 server reduces the size of the slot table for a session as indicated by a smaller value for sr_target_highest_slot in a Sequence reply, the sequence numbers for the slots no longer in use must be re-initialized. This is needed since the slot table may be grown again by the server later. The RFC did not make the need for the sequence numbers to be re-initialized when a shrink/grow of the slot table size happens, but this has now been confirmed as correct behaviour. The patch adds the code that does this re-initialization. I am not currently aware of a NFSv4.1/4.2 server where the session slots fail if this is not done, but there may be such a case. (cherry picked from commit b97a478896e9523245c2041b064121ccb1f70426) --- sys/fs/nfs/nfs_commonkrpc.c | 42 ++++++++++++++++++++++++++++++++++-------- sys/fs/nfs/nfs_commonsubs.c | 2 ++ 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index e5c658ce76d2..e35172ee2b34 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -123,6 +123,7 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_da SYSCTL_INT(_vfs_nfs, OID_AUTO, dsretries, CTLFLAG_RW, &nfs_dsretries, 0, "Number of retries for a DS RPC before failure"); +static void nfs_resetslots(struct nfsclsession *); static void nfs_down(struct nfsmount *, struct thread *, const char *, int, int); static void nfs_up(struct nfsmount *, struct thread *, const char *, @@ -670,7 +671,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, struct thread *td, struct ucred *cred, u_int32_t prog, u_int32_t vers, u_char *retsum, int toplevel, u_int64_t *xidp, struct nfsclsession *dssep) { - uint32_t retseq, retval, slotseq, *tl; + uint32_t retseq, retval, retval0, slotseq, *tl; int i = 0, j = 0, opcnt, set_sigset = 0, slot; int error = 0, usegssname = 0, secflavour = AUTH_SYS; int freeslot, maxslot, reterr, slotpos, timeo; @@ -1039,7 +1040,7 @@ tryagain: sep->nfsess_badslots |= (0x1ULL << nd->nd_slotid); mtx_unlock(&sep->nfsess_mtx); /* And free the slot. */ - nfsv4_freeslot(sep, nd->nd_slotid, false); + nfsv4_freeslot(sep, nd->nd_slotid, true); } if (stat == RPC_INTR) error = EINTR; @@ -1192,15 +1193,22 @@ tryagain: if (retseq != sep->nfsess_slotseq[slot]) printf("retseq diff 0x%x\n", retseq); - retval = fxdr_unsigned(uint32_t, *++tl); + retval0 = fxdr_unsigned(uint32_t,*tl++); + retval = fxdr_unsigned(uint32_t, *tl); if ((retval + 1) < sep->nfsess_foreslots - ) + ) { sep->nfsess_foreslots = (retval + 1); - else if ((retval + 1) > - sep->nfsess_foreslots) - sep->nfsess_foreslots = (retval - < 64) ? (retval + 1) : 64; + nfs_resetslots(sep); + } else if ((retval + 1) > + sep->nfsess_foreslots) { + if (retval0 > retval) + printf("Sess:highest > " + "target_highest\n"); + sep->nfsess_foreslots = + (retval < NFSV4_SLOTS) ? + (retval + 1) : NFSV4_SLOTS; + } } mtx_unlock(&sep->nfsess_mtx); @@ -1463,6 +1471,24 @@ nfsmout: return (error); } +/* + * Reset slots above nfsess_foreslots that are not busy. + */ +static void +nfs_resetslots(struct nfsclsession *sep) +{ + int i; + uint64_t bitval; + + bitval = (1 << sep->nfsess_foreslots); + for (i = sep->nfsess_foreslots; i < NFSV4_SLOTS; i++) { + if ((sep->nfsess_slots & bitval) == 0 && + (sep->nfsess_badslots & bitval) == 0) + sep->nfsess_slotseq[i] = 0; + bitval <<= 1; + } +} + /* * Mark all of an nfs mount's outstanding requests with R_SOFTTERM and * wait for all requests to complete. This is used by forced unmounts diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 9e10bba28c90..ffd6d3e50654 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -5051,6 +5051,8 @@ nfsv4_freeslot(struct nfsclsession *sep, int slot, bool resetseq) mtx_lock(&sep->nfsess_mtx); if (resetseq) sep->nfsess_slotseq[slot]--; + else if (slot > sep->nfsess_foreslots) + sep->nfsess_slotseq[slot] = 0; if ((bitval & sep->nfsess_slots) == 0) printf("freeing free slot!!\n"); sep->nfsess_slots &= ~bitval; From nobody Tue Feb 25 04:01:57 2025 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 4Z23nx72H2z5pNTP; Tue, 25 Feb 2025 04:01: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z23nx6YYmz3xRB; Tue, 25 Feb 2025 04:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456117; 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=mkuC1e/HKSC5+NEbk0LpT3SsNxJqRT9VHJcMZ8VuqXY=; b=fWDWr4+umgvNerDZ6PsrxGNv8eJvrjcyfreuR6qovwJ0FGYoETNGrSrfcTP5b6dPO1n7NG K7DaAEZFaj8zaGClSxFHRj1UXQexZRvNo/oxJubNbSbCVkz7DWkDMfvA3QRr2yHo9T8rOS 95++X+aHAvkHStDfgwE66FabYRnCpPN4ySbwPM6na5Sqhqh34wee19yk9NJika+OQrmaef /Dqb16pmxEyFXy4MAtkpTVtAjdvqIBTpir44sBikck26uVEjJEuh0tNQwtgOo1cIzZ5YW1 BEcbLdlL3XC//Ced+dca13Y1JxXcBH8KUZWFBG0sDNi1MvuC/AOKl31PzEV+uQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740456117; a=rsa-sha256; cv=none; b=lMPiDLHsZiN/ebZXvPjeiXma9wT0oYy/s/oyDWGJrOVIrroc61Vs0rj0nmMWJMQ43I3O32 GhcqPVpgd7vovjbNyiQU0drnDeUFk7+Agam7EpcjQQwIc9vhHvb9GMTMB89VnX38GZPuAa uPUXE31x0Qj+eBNUfWOoSXSjDNTdgQhXI9Fg5Gqhhyx6CqDgNljwICgI3hXkiBmnDjxT0M qSe7oXkHkV7orkZewP8bmHeeGz+NAUvG4t7KbsiLSJE9kriob+k+ezVrf25sYVH8A+JQ+e IR4K9b67wfop7WuyVhl9LKxXhtuWEGW8C21aT4BMAzhUhmCxd/MUARHYk9J3Vw== 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=1740456117; 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=mkuC1e/HKSC5+NEbk0LpT3SsNxJqRT9VHJcMZ8VuqXY=; b=DkoElDIuTfNND03zHX2fsBc+NYFVsCheO52NPPmGs4ON8+BN1agTOeJAOVyyHO6fhpWYBq 1TQQ15uGnjBGuuoAs4Q+teVDEAUQ4g84kfJR3+02PPmYos45bT0N4XDENMYQEd6k7aqIfJ gy9GyPdDbkWDbITXLmwn2JsigsAqzEWYnld6yyDm37e3sAu5CoY4glNdV9OpOhbBOFCZls Rr2FmhMON6EmPIrpJaDyAff91VrhT7CxQa3VO/J9C2gpOt6qtbAjSGa7jO4nlscqD4XzcZ msIeglv7AMOYYXhWJHgcrxx/yF/gE7ipqK6stGJDR7cAOVsRtcyWuLYjEVAyeA== 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 4Z23nx68mRz18qq; Tue, 25 Feb 2025 04:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P41vqD086297; Tue, 25 Feb 2025 04:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P41v1n086294; Tue, 25 Feb 2025 04:01:57 GMT (envelope-from git) Date: Tue, 25 Feb 2025 04:01:57 GMT Message-Id: <202502250401.51P41v1n086294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d8d8b9c9ca38 - stable/14 - tests: carp: Update test case unicast_v4 to catch PR 284872 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d8d8b9c9ca387217bf70b2db1038529d80af280b Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d8d8b9c9ca387217bf70b2db1038529d80af280b commit d8d8b9c9ca387217bf70b2db1038529d80af280b Author: Zhenlei Huang AuthorDate: 2025-02-22 19:26:32 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-25 04:01:22 +0000 tests: carp: Update test case unicast_v4 to catch PR 284872 In the current test case unicast_v4, host one acts as a router, but it uses if_bridge(4) to verify the reachability to CARP master. Unfortunately, if_bridge(4) brings the two CARP hosts into the same broadcast domain, thus with an unusual (undocumented) setup, one host is in unicast mode but another one in multicast, or two hosts are both in multicast mode, the test case can falsely report success. Fix that by propagating route via routed(8). PR 284872 shows that CARP(4) happens to send packets with multicast destination when the unicast peer address is in the range x.x.x.224 ~ x.x.x.239. Update the peer address in test case to catch that bug. PR: 284872 Reviewed by: kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49076 (cherry picked from commit 93fbdef51a13b8facac3633f55804a59ca27f635) --- tests/sys/netinet/carp.sh | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index 8cea2f4cbf1b..e14bedb4f878 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -116,49 +116,53 @@ unicast_v4_head() unicast_v4_body() { carp_init - vnet_init_bridge - bridge=$(vnet_mkbridge) epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) - vnet_mkjail carp_uni_v4_one ${bridge} ${epair_one}a ${epair_two}a + vnet_mkjail carp_uni_v4_one ${epair_one}a ${epair_two}a vnet_mkjail carp_uni_v4_two ${epair_one}b vnet_mkjail carp_uni_v4_three ${epair_two}b - jexec carp_uni_v4_one ifconfig ${bridge} 192.0.2.4/29 up jexec carp_uni_v4_one sysctl net.inet.ip.forwarding=1 - jexec carp_uni_v4_one ifconfig ${bridge} addm ${epair_one}a \ - addm ${epair_two}a - jexec carp_uni_v4_one ifconfig ${epair_one}a up - jexec carp_uni_v4_one ifconfig ${epair_two}a up - jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.1/25 - jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.129/25 + jexec carp_uni_v4_one ifconfig ${epair_one}a inet 198.51.100.1/25 + jexec carp_uni_v4_one ifconfig ${epair_two}a inet 198.51.100.129/25 + jexec carp_uni_v4_two sysctl net.inet.ip.forwarding=1 jexec carp_uni_v4_two ifconfig ${epair_one}b 198.51.100.2/25 up - jexec carp_uni_v4_two route add default 198.51.100.1 + jexec carp_uni_v4_two route add 198.51.100.224 198.51.100.1 + # A peer address x.x.x.224 to catch PR 284872 jexec carp_uni_v4_two ifconfig ${epair_one}b add vhid 1 \ - peer 198.51.100.130 192.0.2.1/29 + peer 198.51.100.224 192.0.2.1/32 - jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.130/25 up - jexec carp_uni_v4_three route add default 198.51.100.129 + jexec carp_uni_v4_three sysctl net.inet.ip.forwarding=1 + jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.224/25 up + jexec carp_uni_v4_three route add 198.51.100.2 198.51.100.129 jexec carp_uni_v4_three ifconfig ${epair_two}b add vhid 1 \ - peer 198.51.100.2 192.0.2.1/29 + peer 198.51.100.2 192.0.2.1/32 # Sanity check atf_check -s exit:0 -o ignore jexec carp_uni_v4_two \ - ping -c 1 198.51.100.130 + ping -c 1 198.51.100.224 wait_for_carp carp_uni_v4_two ${epair_one}b \ carp_uni_v4_three ${epair_two}b + # Setup RIPv2 route daemon + jexec carp_uni_v4_two routed -s -Pripv2 + jexec carp_uni_v4_three routed -s -Pripv2 + jexec carp_uni_v4_one routed -Pripv2 + + # XXX Wait for route propagation + sleep 3 + atf_check -s exit:0 -o ignore jexec carp_uni_v4_one \ ping -c 3 192.0.2.1 # Check that we remain in unicast when tweaking settings atf_check -s exit:0 -o ignore \ jexec carp_uni_v4_two ifconfig ${epair_one}b vhid 1 advskew 2 - atf_check -s exit:0 -o match:"peer 198.51.100.130" \ + atf_check -s exit:0 -o match:"peer 198.51.100.224" \ jexec carp_uni_v4_two ifconfig ${epair_one}b } From nobody Tue Feb 25 04:01:58 2025 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 4Z23nz1ZQwz5pNLg; Tue, 25 Feb 2025 04:01:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z23nz0WKHz3xSh; Tue, 25 Feb 2025 04:01:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456119; 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=4hZ0eM6Y0+f09esMEhkYYIy6kjFx9PIJMKn2+98V8OI=; b=axqK4tBBOW3KkdcGTtxGd6K8Y7q5MakuekFZeYPDq4viv3q1OmNqB/97WWV+GgVu7T9sqW nSHmGtqbGdZeSsB6dHE4yqVjRz9w11IIHxPOZqcr4vyWGD1cWEjYbcipAxoXsutlzzVkST feqmDf/0AZQtzlI13HmZ53SJMUvTqxj13NilsO709b6oFXKMfq9gStiW2qepgF5XjOozGk jleuG/x6KXtnFWtRPEjrJRx8cOI0KISOeNMMQNFgRVQBmQtNCgzr/xiTfEiJH0t3p1kYlG wb3iUFk9Q/g8DUN6gGLIiVLoEPoVLyCmk96xvlRlVhBldtzjj7PkZ0utIn4YaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740456119; a=rsa-sha256; cv=none; b=LiyFsW9i8j8Xwx4L/F9vo4Ad4boG/JbpEe1CL+yvgon3t7bpNA5edQwkg8LLAnWt8c3mSC xee8u4r59DHv4ZtFImLcFrSTI9VErxgUwEdoiPKuTWgHMYpJF/6fPY+PYHkxjA/hUnF00j WagIUnKtu3wmHesEQykyfrUBPIZGRyTRx6VGx/2qk1kkh87ODmqlqh/husFSEeYnYMgV6i eo89JYGTzUk+Um5OOD4CvTTd/vnSV8w5xjPz4ZjguSW7TDoPBJ+QUN/t/GuQ6k7qfLvURt HLMEWa+LzyquSuuf33S1uLNVFQ94IO0auvHpDkIK5azQpXiHB6dIkGPj6XAk/w== 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=1740456119; 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=4hZ0eM6Y0+f09esMEhkYYIy6kjFx9PIJMKn2+98V8OI=; b=XQyrvz2zfrznzZfG0TeNlx/w7zk4pTnKpJBd/4ERPij82CbZ9wV9aKY+lBJEaaQtOGizvL U7QLxY/+vzy8yxsmhnZoHtudVSlYbGCBWkDLSYCZPd6+FBsl1mdpN0UIUmLhk9NO5NH6NJ fHogZstL1M08uB2007F+Af18r4TNYSbq1TssNJpac4VlC0DgwsruLuK0mzZqhju2dFKMDj UF5/M1e9sEqAHhDJcVO+8DZjsJLImPp6BaUOw/5zTFnqnwplVKlraGtEFS90hmVkOhAY3S cl3QtiBSA7UCY6nhzQKnEwNDjtXQgk56SEv75ZqYajWqZueBk5Dbnh1xagqHgg== 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 4Z23ny74w0z18Mp; Tue, 25 Feb 2025 04:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51P41wIW086335; Tue, 25 Feb 2025 04:01:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P41wjT086332; Tue, 25 Feb 2025 04:01:58 GMT (envelope-from git) Date: Tue, 25 Feb 2025 04:01:58 GMT Message-Id: <202502250401.51P41wjT086332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: cad2df3e90d1 - stable/14 - carp: Fix checking IPv4 multicast address 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cad2df3e90d19b083de11f940b20678716811459 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cad2df3e90d19b083de11f940b20678716811459 commit cad2df3e90d19b083de11f940b20678716811459 Author: Zhenlei Huang AuthorDate: 2025-02-22 19:26:33 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-25 04:01:22 +0000 carp: Fix checking IPv4 multicast address An IPv4 address stored in `struct in_addr` is in network byte order but `IN_MULTICAST` wants host order. PR: 284872 Reported by: Steven Perreau Reported by: Brett Merrick Reviewed by: Franco Fichtner , ae, kp, glebius Tested by: Steven Perreau Fixes: 137818006de5 carp: support unicast MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49053 (cherry picked from commit 1776633438f24df09cb9815650891bcef0152874) --- sys/netinet/ip_carp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index ddbc13e7c878..3223a76c7860 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -722,7 +722,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl) sc = ifa->ifa_carp; CARP_LOCK(sc); if (ifa->ifa_addr->sa_family == AF_INET) { - multicast = IN_MULTICAST(sc->sc_carpaddr.s_addr); + multicast = IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr)); } else { multicast = IN6_IS_ADDR_MULTICAST(&sc->sc_carpaddr6); } @@ -988,7 +988,7 @@ carp_send_ad_locked(struct carp_softc *sc) m->m_pkthdr.rcvif = NULL; m->m_len = len; M_ALIGN(m, m->m_len); - if (IN_MULTICAST(sc->sc_carpaddr.s_addr)) + if (IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr))) m->m_flags |= M_MCAST; ip = mtod(m, struct ip *); ip->ip_v = IPVERSION; From nobody Tue Feb 25 12:17:30 2025 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 4Z2Gnk6Lvmz5pm5f; Tue, 25 Feb 2025 12:17:30 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Gnk3YbDz47M8; Tue, 25 Feb 2025 12:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485850; 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=YRazfyBpbqOXyhmOJBegINdYwsXPpWA4v2xr7i1IWeQ=; b=r88oWgm05VP+0zw08/XEt6jgdvlmjim9bBZ7yRhaIHbWS1y5pc2J+rHXCamzG56A0EBbM7 1alP7cvFduADLmXP3GmWZXtGfbsEJzlCLB5nluRXqdC/EWLXmQaCFNgryt20Oir19SwzXH TIdKR/kTMhGx02KntD7otsl11VD/0CjIDWxO5lKMUWb1NY5mGsXf13zveKUnDq9scvyiab 5xOAcldwdQ3wR05RYzsy6mzb1TymQSYescGuT0iJEBFVm4Dka/YeNozErl5nz1PoY9ENZN ABorvMRQxNTisdL62pC19hv3ePExKt07frg5zwjrEgfdf/CkA3IZFDYRYSdrng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740485850; a=rsa-sha256; cv=none; b=NU1uQMi1587JxXuOE8jz82KOmGr+ys9shv/E+zedEjEzQAWlP5L1bYjNStUXWv1msHkr4j C24lkvZdO6hJ2jD+YcRFLAA7YeYm57EwluLCekK6G63vuSKQ1rscGufiKqwgRizn034kUQ bND+fPm08iQTbrG4pwGHCPk9sId9qMai/HeaoMd8elQqQC50C2WbpnwRcjN7vbcQB6Sqw9 eJW3aPaIXmk+TUK4521u2BBOqmxl0GpSM1nnuoTxWYamTt+shH+R/nuvs8gq+OJ17OyNXY TTEbh6XnC+Weq4mB8aKFDHNTRs61H7RJDQr7gFhAuhUJMjZJ0L+DEOzy3g09MQ== 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=1740485850; 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=YRazfyBpbqOXyhmOJBegINdYwsXPpWA4v2xr7i1IWeQ=; b=hL5RGbaxOPRdksqrlobg9+fPmgnhpI6pb1YSNjXd8d9+MM68BcuX+gmAdtw7vxGT5dZN7p LIUJANDe58bLEmpi5ELJlnzoh9kXmn/SRwL968uDbvxXED4KP5mPxY+6U4KbqMKbP0N9+N Zy5LCeqAndlzuu27IpXznmM9b/a9kaWhS1mG/DppMWMO+XohddBgEuofheJ5QcYJ0FN3Sj 8t7R8nC181su0IzatFegFz3EGEid4aWAUg1FNu5JhX0h2Ue0edQmSAfg611gtQiuklt9Ys BaRkrlDl4W89XZKcVu0iWS1veF37VTn4IHd3KtH5TxFtqvGnxt8pRitkpPwXKQ== 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 4Z2Gnk33lhz9pL; Tue, 25 Feb 2025 12:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PCHUJZ008008; Tue, 25 Feb 2025 12:17:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PCHUwq008005; Tue, 25 Feb 2025 12:17:30 GMT (envelope-from git) Date: Tue, 25 Feb 2025 12:17:30 GMT Message-Id: <202502251217.51PCHUwq008005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 47a067308ec9 - stable/14 - sound tests: Fix downshift calculation in pcm_read_write test 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 47a067308ec97358ef07b7a5fb660e2d5fcc023e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=47a067308ec97358ef07b7a5fb660e2d5fcc023e commit 47a067308ec97358ef07b7a5fb660e2d5fcc023e Author: Florian Walpen AuthorDate: 2025-02-18 19:35:54 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 12:17:14 +0000 sound tests: Fix downshift calculation in pcm_read_write test In some situations the feeders in the sound module lower the pcm sample resolution through a downshift of the sample value. The pcm_read_write test implements this operation with an arithmetic division to avoid implementation defined or architecture specific behavior. Due to different rounding, the test produced marginally different sample values, which made the test fail on 32 bit architectures. Correct this. Reported by: CI Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros") MFC after: 1 week Reviewed by: christos, markj Differential revision: https://reviews.freebsd.org/D48926 (cherry picked from commit 6672831bda883756d7f4598bb4b119f99eb1e7d2) --- tests/sys/sound/pcm_read_write.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/sys/sound/pcm_read_write.c b/tests/sys/sound/pcm_read_write.c index 7ef310a35c25..cfd89eec7c19 100644 --- a/tests/sys/sound/pcm_read_write.c +++ b/tests/sys/sound/pcm_read_write.c @@ -81,13 +81,21 @@ static struct afmt_test_data { static intpcm_t local_normalize(intpcm_t value, int val_bits, int norm_bits) { + int32_t divisor; + intpcm_t remainder; + /* Avoid undefined or implementation defined behavior. */ if (val_bits < norm_bits) /* Multiply instead of left shift (value may be negative). */ return (value * (1 << (norm_bits - val_bits))); - else if (val_bits > norm_bits) + else if (val_bits > norm_bits) { + divisor = (1 << (val_bits - norm_bits)); + /* Positive remainder, to discard lowest bits from value. */ + remainder = value % divisor; + remainder = (remainder + divisor) % divisor; /* Divide instead of right shift (value may be negative). */ - return (value / (1 << (val_bits - norm_bits))); + return ((value - remainder) / divisor); + } return value; } @@ -103,8 +111,7 @@ local_calc_limit(intpcm_t value, int val_bits) * behavior here. */ if (sizeof(intpcm32_t) == (32 / 8) && val_bits == 32) - /* Divide instead of right shift (value may be negative). */ - return (value / (1 << 8)); + return (local_normalize(value, 32, 24)); return value; } From nobody Tue Feb 25 12:17:29 2025 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 4Z2Gnj3LT8z5pm9M; Tue, 25 Feb 2025 12:17: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Gnj2WLKz47DN; Tue, 25 Feb 2025 12:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485849; 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=du57E3SgrsQBZ9jVZjMIVlmI8dg91mOIaLLDlvDVgXg=; b=Tu6k1ND0i2daCWjO3Ayg0LusWPX8bSbvpNXZSK9p0qCWiK7KwgNKzjI8LCYz3OWnPqLqyw y74lBM0BFR7AU7ilPMVgt1TNR5Gz7jt0HBsOHa32l4p9jWKajs16juRVw1ZHclPjQGsL97 +c+FWXfe7c/GmAj9hUru8l4nG7/QUJ1iFK8eLc3UXa6vlfblDDt+nKAT4pi9JDBBkWc3NR Pe4le/mwq6IJtsw0Ggk2sxso4cyPp1p7AmWVHG8RpNi6zJYlfuwT9MLKip+jdW6EeWN85n +cgaSdrJF+5EsQseld+7cHGO+fevhfCsYmKWL++FIwGr3cHHJzVOCNVQmbDiIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740485849; a=rsa-sha256; cv=none; b=pxt8yFYf0n5INjIjr7TbuS+9BmsVU1Nswvmba6pQ/fSbuUJ58fgcBKudCQMsVSoIKP0SU7 QkoKmw8qXgkrFXHIrBOovsR8lImyifr30tY48HrRKxHzVH/ND4FVROgrGwFpukaWFZE0sl 2c6KpTZVnIpNyOSUCSRQ3f8nS3r78pkdu51/N9WdJpARt6wR9lFYbUzFWfRt9QWnTfiEZZ RDYd3C2142s2pClxKTJC7DIzvxYVhoe2bFBOjc2pjzS8lkSYbKPAZdC1WhgtQc22aF6MI2 fnLDCn7FcAvRGkck8LrNQJAOqtiB24D9usHb8ghYtn2/dbvUEm2kDR8r+QTkHA== 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=1740485849; 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=du57E3SgrsQBZ9jVZjMIVlmI8dg91mOIaLLDlvDVgXg=; b=XCTSSXDU1k9l0eNS2GGPYHZulEgRLRQoqAMEoieEEObfeEi/QbxO0ZmS9DUMDS1poJSV5D dfJqC6ICsXn8XjCRllUVTdT6yJnM3lcyiLcIe+ETYLRmd6TiTiuAlmpKG3ZcIpk+jebqbW pRZakJ7UWCQSUpsO80eQRROCM1EKKrQJc3vMySnxuUqbiPv70EXSL14vih9x6/7M5oyHD8 ZaT4yEyVI+LVUNcxmUEIO9v+kCp7f2C5eeHyJk6y2PlUdJkXRXM/AUPDu3siIybtooh6ny dIeXoOvOsuhSINVQvuK6ZxouKNo2j2wIxPtw1oEL3FWRZvugyylX9O20LrsbNw== 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 4Z2Gnj258Yz9YX; Tue, 25 Feb 2025 12:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PCHT3p007975; Tue, 25 Feb 2025 12:17:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PCHTOw007972; Tue, 25 Feb 2025 12:17:29 GMT (envelope-from git) Date: Tue, 25 Feb 2025 12:17:29 GMT Message-Id: <202502251217.51PCHTOw007972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 999e714432ac - stable/14 - snd_hda: Fix typo (s/owerflow/overflow) 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 999e714432ace973ab548ddc2c2b0e9c7db3388a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=999e714432ace973ab548ddc2c2b0e9c7db3388a commit 999e714432ace973ab548ddc2c2b0e9c7db3388a Author: Christos Margiolis AuthorDate: 2025-02-18 19:35:52 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 12:17:14 +0000 snd_hda: Fix typo (s/owerflow/overflow) Sponsored by: The FreeBSD Foundation MFC after: 1 week (cherry picked from commit d4176fdb1370f5dcf2c40c153e6bd1ad0c4a2f85) --- sys/dev/sound/pci/hda/hdaa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index c0eb1864f145..3220ef69776b 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -3218,7 +3218,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo *devinfo) continue; } KASSERT(cnt < max, - ("%s: Associations owerflow (%d of %d)", + ("%s: Associations overflow (%d of %d)", __func__, cnt, max)); type = w->wclass.pin.config & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK; From nobody Tue Feb 25 12:17:32 2025 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 4Z2Gnm6p9Pz5pm5j; Tue, 25 Feb 2025 12:17:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Gnm5S58z47MG; Tue, 25 Feb 2025 12:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485852; 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=ghb0wIBlps8DlYg0OxAXu+s+WpDnPtvdST66icCwRGU=; b=Q2ZuFohNNKP9Lwf9weJOsbWuOwG8wYy4INAD7d+tVLeRX82s23qn7ftQXmW+kvJYwhueBO /r1O2aNpKKBL18LCCAZZUM3Q56ANIhqHkijJc5uzVv4kIy9c4ubksfbUCK5hmbmlNeGlQe 8xd5bjQVxVcAHVYMOYKncXudA8OyljhDaYleC/kwlE5OCqDoxbva0uO6noyfFipfSg/W91 EjYyLZ0e0xfAz5qQAEAMAOULXCZQFSquXbam0JGjjGKL3/tql8ccN11WVFel9V5hctD8BU cHnJ2dEFsK/ywBGsmtH2K3EQcHbpkJ0MoUb5aDM48F0EArfXrCU+l72wr4EXvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740485852; a=rsa-sha256; cv=none; b=tX1RzknDm1Cj/Ghr1RAsIG+5mzln23ySQO0HxXHuHhd82WctJxOICg7OPR+XPqh1JBPQrp rrr9X6LvZs5aj1BBAMa/2PXFWuWhNOI/CIIkEqu4r2XcwNBmQLUUDr+vnEaAL7HKbtfP1C nytsc9GCfGpow9CcT9BmFk8GNfe+5e2Olu2l8LNGdDcR2sTkrnh2IAzLS/6cxEKMK+NxeL kWziXGA49FyJ/bhPHMnoYZ6TyorsOWs1ea6ihxWQuv18EtPFc+0KXHLhU7AU09maW1I8k4 +AWR4JpZ+VCOh2pKDWSBWFL3FIK71kXxiwzHmCPdPJ0KBOrlforbQi5fFTvarQ== 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=1740485852; 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=ghb0wIBlps8DlYg0OxAXu+s+WpDnPtvdST66icCwRGU=; b=MTDFQJTrQZ21bamC3NZvNC7ZuhccpeDw/vO7A4rbdjwieM3ZTrsdVFw9tXFaKrXOmI+w8z IqOx+aWXV/Sw+yukzBkSQSFUzAaRBfbVhMXKUZJc3xsN7r2Af+v9TY8JE2uTMhhgIO6qOp b8ZoneavTFyb+gRwkm6Jn5DMX/F3eEEirOONjHe/MxPJ0uTzhjzC/B0x3JLr5MPe9m/J1D guUOdnnQ3JhGdlO3dzV5OlKjq4baurYrJZ1EEpxqL5WAqMENnbD3zx0LlTEGMJq2zA2xRz 13uaP2eq+saDjXTYbF5aPvjd4T951KLNZZaP2T6JNoWs9PRYnx5FKfl6hEPRcw== 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 4Z2Gnm4xxBz9xF; Tue, 25 Feb 2025 12:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PCHWCJ008076; Tue, 25 Feb 2025 12:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PCHWsK008073; Tue, 25 Feb 2025 12:17:32 GMT (envelope-from git) Date: Tue, 25 Feb 2025 12:17:32 GMT Message-Id: <202502251217.51PCHWsK008073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 0611b649eb20 - stable/14 - sound: Bail out early if a format is not supported 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0611b649eb20b258b31af7356b53a40f772529d1 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0611b649eb20b258b31af7356b53a40f772529d1 commit 0611b649eb20b258b31af7356b53a40f772529d1 Author: Christos Margiolis AuthorDate: 2025-02-18 19:36:48 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 12:17:15 +0000 sound: Bail out early if a format is not supported If a format is unsupported, the feeder_build_* functions will fail anyway, so bail out early to avoid unnecessary computation. This is also needed by a series of upcoming patches to the feeder framework. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48031 (cherry picked from commit 18457e7e25c55b8834e886fd925ec3b11b79d1b6) --- sys/dev/sound/pcm/feeder_chain.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 588bae2ff281..1c4ddca6cdd5 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -718,6 +718,17 @@ feeder_chain(struct pcm_channel *c) c->format = cdesc.target.afmt; c->speed = cdesc.target.rate; } else { + /* + * Bail out early if we do not support either of those formats. + */ + if ((cdesc.origin.afmt & AFMT_CONVERTIBLE) == 0 || + (cdesc.target.afmt & AFMT_CONVERTIBLE) == 0) { + device_printf(c->dev, + "%s(): unsupported formats: in=0x%08x, out=0x%08x\n", + __func__, cdesc.origin.afmt, cdesc.target.afmt); + return (ENODEV); + } + /* hwfmt is not convertible, so 'dummy' it. */ if (hwfmt & AFMT_PASSTHROUGH) cdesc.dummy = 1; From nobody Tue Feb 25 12:17:31 2025 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 4Z2Gnl6zK9z5plng; Tue, 25 Feb 2025 12:17:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2Gnl4Zx1z47VL; Tue, 25 Feb 2025 12:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740485851; 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=XUxV6F03l42dfBgAwaIf3HdmgO+YYmnLH9OYbxV3fTA=; b=sQPrhBRbF9qsR6vuDpL2ROGuW7GS9iNuUoutAbyp/34RE7wuXUULlxdSDRyUb/hraginas IWUYK9LM3e2snZKviNlGeN2JSDpHaI4MRsEPrB/zIDPjVZsIcDftiWmVWcPbosvlJlSii8 Rd2SM0gFk6HedJqhh10YnZC1qLI4jlaIeKXLA5CoiMMZGCTz2Y3KuT7Tslwkq423BCo2FS yBGlHYZ1tQ+0692VEGdE7wF25B5tc7aSmKQf54BsFlFLzJtGHgpIWodvgUPRNxNui/smvt j2jlY9I1eEOAsq3Ot68TUSij55VVq3j9PIBaHxzZNoIz1OVVjoI9sznZAmv+PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740485851; a=rsa-sha256; cv=none; b=nqgPLvpnxP2qDLlbbHiSMHfoXykWdRrf71Nm7oxrX0U7jGW+FNCsAp77YwID04ENHQ7jov PJWOUIV7anSy8Yd+FSbLSVFwuxOkLIgqgggiDxH0X3GpdQqNXfliQ0tMu9i27pxRwGIcE8 G3fCJK0fbCOnNC6lyl7nfURhFek1fpIhte2Z1vQFxxkLBv0hFTARf7cWeBa/ke9yAg2XeR OYeW0yRFVGm3OddWH9gse2w8Mrj+6yDSIBCiDZpmtigojcCu2C0XYbsn6Kls0ZXKwRQc/d epVAMuwygC6Zlrz3lOHbgH9fk3/2V6qTSM3ClTriov/E8OeVr6Ad3aUEBHvpyQ== 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=1740485851; 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=XUxV6F03l42dfBgAwaIf3HdmgO+YYmnLH9OYbxV3fTA=; b=l5t3sqyE2sfUBlj8Tkqzgi72si7qoEIBcd+y675sNZ1m+ksKPL+6nurY5ck/JXmY/ZziIj UlGgdGMoI0BxDmalrszhF4FDPyczRAb+Ug1nIgHOj0/dfnGjyuQ/LHm2gH2U+AgKzNCGDp cXt9gZ4vq3SDOBIg7E9vL4Juo3kR/96m+2v+s6nUsf/NEP/xEyVxQ2nyLfY6VPK2ZM3yuF qOlL+V/TtnYBy23Tw9dqVpS/4ZHgKhus5HYElQ8LRiBvN9xUJlzsKGrrugcP14RCP/zNEE dTIsdyYKHgz/skbHaFDlbe/+FwvZ9Fqds/x4gRZFlrOE9EPb6oypam1pKJROFA== 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 4Z2Gnl3zX9z9vn; Tue, 25 Feb 2025 12:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51PCHV7D008042; Tue, 25 Feb 2025 12:17:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51PCHVVN008039; Tue, 25 Feb 2025 12:17:31 GMT (envelope-from git) Date: Tue, 25 Feb 2025 12:17:31 GMT Message-Id: <202502251217.51PCHVVN008039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 1be7ae1a79a7 - stable/14 - snd_hda: Define ALC898 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1be7ae1a79a751a81920ea747ce134de35388bfd Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1be7ae1a79a751a81920ea747ce134de35388bfd commit 1be7ae1a79a751a81920ea747ce134de35388bfd Author: Christos Margiolis AuthorDate: 2025-02-18 19:36:42 +0000 Commit: Christos Margiolis CommitDate: 2025-02-25 12:17:15 +0000 snd_hda: Define ALC898 PR: 207996 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D48940 (cherry picked from commit c23d53490eb3ac5568050ca9a58534ac04846281) --- sys/dev/sound/pci/hda/hdac.h | 1 + sys/dev/sound/pci/hda/hdacc.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index f0e72f091a85..40b697b05e78 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -608,6 +608,7 @@ #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC897 HDA_CODEC_CONSTRUCT(REALTEK, 0x0897) +#define HDA_CODEC_ALC898 HDA_CODEC_CONSTRUCT(REALTEK, 0x0898) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) #define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) #define HDA_CODEC_ALCS1200A HDA_CODEC_CONSTRUCT(REALTEK, 0x0b00) diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c index a3a7b5950994..989e9dbe1060 100644 --- a/sys/dev/sound/pci/hda/hdacc.c +++ b/sys/dev/sound/pci/hda/hdacc.c @@ -147,6 +147,7 @@ static const struct { { HDA_CODEC_ALC889, 0, "Realtek ALC889" }, { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC897, 0, "Realtek ALC897" }, + { HDA_CODEC_ALC898, 0, "Realtek ALC898" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, { HDA_CODEC_ALCS1200A, 0, "Realtek ALCS1200A" }, From nobody Wed Feb 26 15:03:08 2025 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 4Z2yQP0D4dz5qGFr; Wed, 26 Feb 2025 15:03:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQN6gHgz3GF1; Wed, 26 Feb 2025 15:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582189; 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=BPAYYwuKKyXMriAtBXCz0LpKr19wPEuRLyxiHCmVQG0=; b=oOitmwDr5ieJoU2VzCpZpyJSi3MmCpkQG55HlHflaVnHljwkY+KmGvA5nccna2MHYnr6U4 jR4glK4XC/G2hzxKL8XGOXLtu5wLhY2yvJPUA1tSfljUYLkMozmbVRa6jiw+zV571OIqDT ctSCCLtxJNP2BE0VcxL7IxNm4/i6ajxdVZ/hPfhLcJMARkNcshseihk8iDrNx0Dcrtk0zZ w+Y/CndJghKbLxUQoYzcurFIC0X70lRbPdU15opOx7qL09lJyg8n11D6ntVAWi/tMVT8AO INbFrh5af/GRdc6bK8AxRHEyNtLPyW0iQHdYZkiMasURF23PHbS9VNmmGnlFiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582189; a=rsa-sha256; cv=none; b=TuqmVAJI2pegr7Uu+kUtN8oPpWZ/qkyc6meFwWxJDcIYmCuvro8KONjODfxWHRdm8QRQzB MqDzpGPcwPqR1IO8bBxFC6xcjTdfdrvn6vbSVvhE+WTF/Yu4Oj1fCxd60Fn6arqCUEY87s 87ZmVItLkBsrj747QLKKqarxFAjRzn3R3JHsLzzYsiA2y1AE4Btoxm4ZbHsnQhTl1BBTZU b3OnvQVuYPP0SkXM2UbdW4K8JJtewluwBCsLY57PSf4sc45tbscqNZlhWIHrRgc8Rs04ZN ikhJhyvsgKoZjIH9Zj9XoAt7riydaYS/LUSJgfy6kcu/ZqYxpfG8QByKI9R+8Q== 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=1740582189; 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=BPAYYwuKKyXMriAtBXCz0LpKr19wPEuRLyxiHCmVQG0=; b=ul0OiWbct6L+Z32EaCrUrfBBewuNJQdq9WviL8NdvkjE13jJx13ZW1LAJytix24ne1laf9 0ORc+e3+7lieI/U4rEJIX9svRVZRSmjw53TIFh3DH2SeNapdW5wBgM9zDlm6ZuPVPvX91r i8e0WsOItID33T/bog6jPgbWeIIOdTGgCy7AEY8Lm9yJcU9AHJ3iPlOzc06//8t1EzWUAt ivlEarp3PZvoDsahsPw7+PxmK3t9Dm//wdxb+n0aD+jrndnJIxA4GPsoOGxuychjzz0ee8 JcK9csBIPyYwYg58+iqsQk5SDTfRzRnn6Upb5BJDZ8DSJNx+ritf3PCLIDDMFA== 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 4Z2yQN6Gmlz1GnG; Wed, 26 Feb 2025 15:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF38rD014452; Wed, 26 Feb 2025 15:03:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF38Ir014449; Wed, 26 Feb 2025 15:03:08 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:08 GMT Message-Id: <202502261503.51QF38Ir014449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c1895bd9c035 - stable/14 - LinuxKPI: 802.11: improve cfg80211_chandef_create() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c1895bd9c035a1c4af8e44ce2505dc2e00478083 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c1895bd9c035a1c4af8e44ce2505dc2e00478083 commit c1895bd9c035a1c4af8e44ce2505dc2e00478083 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:13 +0000 LinuxKPI: 802.11: improve cfg80211_chandef_create() Implement cfg80211_chandef_create() to work with HT. Update enum with HT channel types. When calling the function from LinuxKPI 802.11 code, pass in NL80211_CHAN_HT20 if HT is supported rather than NO_HT. Sponsored by: The FreeBSD Foundation (cherry picked from commit 11450726d3cf8d76d2113d7cabe995f8ef31ec5a) --- sys/compat/linuxkpi/common/include/linux/nl80211.h | 6 ++-- sys/compat/linuxkpi/common/include/net/cfg80211.h | 35 ++++++++++------------ sys/compat/linuxkpi/common/src/linux_80211.c | 4 +-- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 80546e56f0c1..b2a33a28b3a7 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -135,9 +135,11 @@ enum nl80211_band { NUM_NL80211_BANDS } __packed; -enum nl80211_chan_flags { - /* XXX TODO */ +enum nl80211_channel_type { NL80211_CHAN_NO_HT, + NL80211_CHAN_HT20, + NL80211_CHAN_HT40PLUS, + NL80211_CHAN_HT40MINUS, }; enum nl80211_chan_width { diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 338ffb82bd83..4ae31b257ae0 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1483,36 +1483,33 @@ cfg80211_pmsr_report(struct wireless_dev *wdev, TODO(); } -static __inline void +static inline void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, - struct linuxkpi_ieee80211_channel *chan, enum nl80211_chan_flags chan_flag) + struct linuxkpi_ieee80211_channel *chan, enum nl80211_channel_type chan_type) { KASSERT(chandef != NULL, ("%s: chandef is NULL\n", __func__)); KASSERT(chan != NULL, ("%s: chan is NULL\n", __func__)); - memset(chandef, 0, sizeof(*chandef)); + /* memset(chandef, 0, sizeof(*chandef)); */ chandef->chan = chan; - chandef->center_freq2 = 0; /* Set here and only overwrite if needed. */ + chandef->center_freq1 = chan->center_freq; + /* chandef->width, center_freq2, punctured */ - switch (chan_flag) { + switch (chan_type) { case NL80211_CHAN_NO_HT: chandef->width = NL80211_CHAN_WIDTH_20_NOHT; - chandef->center_freq1 = chan->center_freq; break; - default: - IMPROVE("Also depends on our manual settings"); - if (chan->flags & IEEE80211_CHAN_NO_HT40) - chandef->width = NL80211_CHAN_WIDTH_20; - else if (chan->flags & IEEE80211_CHAN_NO_80MHZ) - chandef->width = NL80211_CHAN_WIDTH_40; - else if (chan->flags & IEEE80211_CHAN_NO_160MHZ) - chandef->width = NL80211_CHAN_WIDTH_80; - else { - chandef->width = NL80211_CHAN_WIDTH_160; - IMPROVE("80P80 and 320 ..."); - } - chandef->center_freq1 = chan->center_freq; + case NL80211_CHAN_HT20: + chandef->width = NL80211_CHAN_WIDTH_20; + break; + case NL80211_CHAN_HT40MINUS: + chandef->width = NL80211_CHAN_WIDTH_40; + chandef->center_freq1 -= 10; + break; + case NL80211_CHAN_HT40PLUS: + chandef->width = NL80211_CHAN_WIDTH_40; + chandef->center_freq1 += 10; break; }; } diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 0574d4a502de..cc6b72dbea59 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4118,7 +4118,7 @@ lkpi_ic_set_channel(struct ieee80211com *ic) hw = LHW_TO_HW(lhw); cfg80211_chandef_create(&hw->conf.chandef, chan, #ifdef LKPI_80211_HT - (ic->ic_htcaps & IEEE80211_HTC_HT) ? 0 : + (ic->ic_flags_ht & IEEE80211_FHT_HT) ? NL80211_CHAN_HT20 : #endif NL80211_CHAN_NO_HT); @@ -5589,7 +5589,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) cfg80211_chandef_create(&hw->conf.chandef, &channels[i], #ifdef LKPI_80211_HT - (ic->ic_htcaps & IEEE80211_HTC_HT) ? 0 : + (ic->ic_flags_ht & IEEE80211_FHT_HT) ? NL80211_CHAN_HT20 : #endif NL80211_CHAN_NO_HT); break; From nobody Wed Feb 26 15:03:09 2025 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 4Z2yQQ2WJwz5qG2f; Wed, 26 Feb 2025 15:03:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQQ0skFz3GF2; Wed, 26 Feb 2025 15:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582190; 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=PBMyq2sTWsF/a28VQH1td4zWBI7vavMl5eSsL+LjeBE=; b=Kcet7pfFAALMyTYQGVeAk/C/aNd7Km6Z7Mxt6xhsaGef8mUH87Y80VSJT66kwbskkNoeFk MVZ3NTDzwIX9PXICR1hppecnNU6p716xi3gZ76lGn44+MEQhVdzFcgB61C3sGV2OQTkL4/ Z2ZsVBICZJ7QnH8GY2RfCtA6rPc7I5uC6WIAwz7LFeeeLqselLTuShFKymb8MYzHIfLXY4 fpqyy0oVv4ZkK5rHPOZ03TmYe/0mGcWhj1HLsYUkhM4I468jEkohh1CJjHFGSvN/Pch4Tw Vx+KFuKil1OcH+U6qdoIZDCKAtLDAYd2wuTLnOcAUlrlnn/Lc3dMYyKNxMOgEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582190; a=rsa-sha256; cv=none; b=BjGprCL8KeW0bsM4AGNUJ/EgKkWyWW/zWbWUJiNNk0jpDtlsp/QA2CTl6Uc6MCA8tSeSm5 DOXhZ5jhIDbINTzOt/8TyYP+0hgP8Zw7MpaCNScSORn6/JfULIInzPE8lLOofVupV9q4dp 10mj/J4BcAqEX2EQIBZkas8FRkvl02s86XvVxGFD0ENvGm30BIYxcQx7JDZ1QPSa2u+ahG mM0eMXZkHT4Dj+ChQ/OqH6gajzCHVEzliECit6mTt8gjRRsP1S5Z5zTvxoKTjYLPxYDufr K3boeenVPgS+EDMCEBKjY2ibqYjJNdr61R0tWvhDzimJt6KsCsckt/JVZ5lO3Q== 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=1740582190; 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=PBMyq2sTWsF/a28VQH1td4zWBI7vavMl5eSsL+LjeBE=; b=bqPY/7Okm1vAvupJ0jMmbpx1LovfM5qnYZvvFEuUYslULKKYxK8utWFMxlvIPS8Xo/6pn3 ATSuj0U/KkOj9tpAa0vtOEM9+33uBAT4aCDBgwAFwepTjn0JuGC3izNTbrPIwNl0tLuSaj teJyLXpDNW6opZtuWsosuWG7+w1OEfYnCfuzh0MTTrIKU0mJeC3XLMSAWJ9gSWlSCJAH31 WPqHkf0KVf9k/mG3Fb3dZMXyVcI1+D7w5wKl+KbESIWAfqdquhl9CrbRGXnUzL6Lc1TYQe fKYkzfV0SAxxUJygCTa7UbgGCXB1loAydX6fOu4YJMpZKpXtDRQfUZRRaGyV6A== 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 4Z2yQQ0SDfz1Glj; Wed, 26 Feb 2025 15:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF39VR014487; Wed, 26 Feb 2025 15:03:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF39Tb014484; Wed, 26 Feb 2025 15:03:09 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:09 GMT Message-Id: <202502261503.51QF39Tb014484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8a7430903fad - stable/14 - LinuxKPI: 802.11: use net80211 macro instead of manual check 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8a7430903fadc526147aeee70e6b30eb13d01ee6 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8a7430903fadc526147aeee70e6b30eb13d01ee6 commit 8a7430903fadc526147aeee70e6b30eb13d01ee6 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:18 +0000 LinuxKPI: 802.11: use net80211 macro instead of manual check Use IEEE80211_CONF_VHT() instead of manually checking if hardware supports VHT. Sponsored by: The FreeBSD Foundation (cherry picked from commit 1f73e0ed539d2be48fed70b09e87ecccce4ca869) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index cc6b72dbea59..455b86284a7a 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5630,7 +5630,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw->scan_ie_len += sizeof(struct ieee80211_ie_htcap); #endif #if defined(LKPI_80211_VHT) - if ((ic->ic_flags_ext & IEEE80211_FEXT_VHT) != 0) + if (IEEE80211_CONF_VHT(ic)) lhw->scan_ie_len += 2 + sizeof(struct ieee80211_vht_cap); #endif From nobody Wed Feb 26 15:03:11 2025 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 4Z2yQR3vkNz5qFhc; Wed, 26 Feb 2025 15:03:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQR1l6sz3GSd; Wed, 26 Feb 2025 15:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582191; 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=vYOFYpmbf0/4dCiBXEqlmk2bL5ZgThqAnSppIGUz68s=; b=XG1q8Il2+FuYWwWsN3CbmUVDMbiMRCAaw7a/idVp5lbLzq+rTHDrEKBw0jOhFd1tLvFXCX do2I/UREY7i4szE6n8U+ZOrLpEsHUrn0u0VUusEvR1B7BkZva4zj8PtsGEMrvjCvnlGOCl DJ+wGWDx+gTJTu51aQVeszG0eXbm7npMXwUFbJYk6OagF7AT2QWbCbK76tsCU3TMqhUrAU ZBK0MpRHQK+txCVBq2/cMTaCwM05c6jJX/8q4XeMkR9GlHnolkcJS84yrVmk8iV/5xO3Tq TBR7Eh+Pbrvg7s+ZsclHr4oLdlm20QL5n0EXTUh4CpuB61rrdMm66TW0MngXPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582191; a=rsa-sha256; cv=none; b=IMJN727rIb2Io37RQ59ZF+eAs1oBZEoYNNGtFO5MJvHdI8RlQg73yxkwok1Rgeg18QrXJD jIzRlXJcIT7kJ3A8PTZHYsKhzGud4l+lI7nTHrjXR/yBqVu3c9Qj+qGscwkK4f9LM5t28I FESwFbxDCxNrAcX40JGIiVS7f6yEsJqM7ahIxZBh4h//bnV9MYaU+kAq3VCSE/dM11cj8Z qVNwv9ajwJYrGPF1IEorA5/vXTbL4kzt3MMlhO5W78aJobWCfng6BYNOU+HYmVm+wRJbVd jMtCQ82ZnCs8PnJXUURM463YO1RI2T2/dqxLBzP4J8NUaxs5dqV/0BM0XfDeAw== 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=1740582191; 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=vYOFYpmbf0/4dCiBXEqlmk2bL5ZgThqAnSppIGUz68s=; b=pnGAaJ9CdiDb3lWFwQX9oRjTq1w5t9JKs48Zsn3ii0CfAghUubgjawzOZd52WhxNwwJSrM 1r5jrADnPPh8gO9q3yUghU32r7+nOPU3NRVwRSXF42ZBmr514VhnIwTi80RTOuLqpLnpTD BJykT2N4hBhvGF/1INB9+k/IwW0KoF87DK//Uo6mbIPZ0s0EXW9l5Iw+P3C8u2xBirXVnx 0gJ6cWb7+ekbjoeywfZ0fNNFY1+kp5fMK5N7YTmLSLoVPY+qaXwkLL1iCzucI4WZKyfKqL 42Ah0gXZEqntqG098y8iUTgEkUK8o+cev55qQuS7d0GnrQ+b6ymo8rMBd3yFTA== 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 4Z2yQR1K29z1Gx1; Wed, 26 Feb 2025 15:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3BNt014529; Wed, 26 Feb 2025 15:03:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3BbW014526; Wed, 26 Feb 2025 15:03:11 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:11 GMT Message-Id: <202502261503.51QF3BbW014526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2b93e1f9bafd - stable/14 - LinuxKPI: 802.11: add further checks for deflink.supp_rates[] 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b93e1f9bafde3be0a493e5289cc1c6b8286ab1a Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2b93e1f9bafde3be0a493e5289cc1c6b8286ab1a commit 2b93e1f9bafde3be0a493e5289cc1c6b8286ab1a Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:23 +0000 LinuxKPI: 802.11: add further checks for deflink.supp_rates[] When setting the per-band supp_rates bitfield check for mandatory rates only. We cannot easily say at that point for 2Ghz whether 11g is supported so assume these days it is not pure-b. Sponsored by: The FreeBSD Foundation (cherry picked from commit 73cd1c5d44ead3b84cebcc0c24278429afa9e6ec) --- sys/compat/linuxkpi/common/src/linux_80211.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 455b86284a7a..1255691ccf70 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -550,10 +550,30 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], continue; for (i = 0; i < supband->n_bitrates; i++) { - - IMPROVE("Further supband->bitrates[i]* checks?"); - /* or should we get them from the ni? */ - sta->deflink.supp_rates[band] |= BIT(i); + switch (band) { + case NL80211_BAND_2GHZ: + switch (supband->bitrates[i].bitrate) { + case 240: /* 11g only */ + case 120: /* 11g only */ + case 110: + case 60: /* 11g only */ + case 55: + case 20: + case 10: + sta->deflink.supp_rates[band] |= BIT(i); + break; + } + break; + case NL80211_BAND_5GHZ: + switch (supband->bitrates[i].bitrate) { + case 240: + case 120: + case 60: + sta->deflink.supp_rates[band] |= BIT(i); + break; + } + break; + } } } From nobody Wed Feb 26 15:03:12 2025 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 4Z2yQS6qn6z5qG2l; Wed, 26 Feb 2025 15:03:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQS2fGvz3GNr; Wed, 26 Feb 2025 15:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582192; 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=vXdiVVXLcyuLG/avqxsXuFyuNU3lEGICfNHAk4znG+g=; b=hqtshfYIJ8mGCWG32naGbqAbuWMs6vYeUZ0PWcgfohFw02UO6BZZFoZmcCYj2UNPZgSBMQ FVgaUH7otlldXvIGXSc15/Bgh2U9Yab9fSDtniQ2Y0nMcXSBaZ6B0ercGBn+NPpFIL+bjk t8XbgkHfQaYoUFBPra+T83Tab7F6Qik/1dNQvSi0nRoULo5y5l3Fh5zob7jRGktJO1xqRM RfBW0YNmedDBQCbW7g9MF+hFPchEJKXt6J5SsQMsuW88pIRB5nujf7sWE7oAziJ+KADdzw eZ2NoIUvbwWwRNd9EgHDtISuRU77KOeo/4lNks+5IjUarad9pICupEwhici+mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582192; a=rsa-sha256; cv=none; b=XW3Qd0zq+beqjZsBqfzBqc6t+INdHcQdkJiTrRdPLpl6EELQk4qIIjssJ/q6iN8JuIitox Ej4wUE7TFg7H536fHfMw9nF/dMOkw1UjpbGlxe3/vWlNfbEP9nFGnBzeit8gleIlb+CcOw tRnWcf0qQXJ/VkfDdebyhX/7wQFphA0Q1NECVjvIzUB5kyCZmt90yCDjxpPuWzi9MPiTko iIQMgKLDACuX28iTKuz5CK3jjR/NphLrlXlFEnhVdRUp8le0Z6HHj2ROKn9ZEhoASCqoTv Itnq35txFXNnbRyW0coxDOlC7EpM1JBkPsvUuSVY7l3rjieAefVzRi/waADXjg== 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=1740582192; 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=vXdiVVXLcyuLG/avqxsXuFyuNU3lEGICfNHAk4znG+g=; b=jzxfxaUaKNALca4isiZQEARO7V9TY/fZYIxpFLsN/cCcI4o4B4wM9SOi2ge85Q5Z7qqcQu rgmHjkDkLhwQDRwjnus+531pHoSOGb2if7XHf6P1YsuA6kclzSw5P4aKNKSOaUMDUCRXXy KaDNHObA5q8MJYAMPcjRt53THJi7+D0WhuPrpFNAwsR9aqVF6pjPfqZ3YiKZRoGUGEmNOi LHXM2/aI+OI2Ogibk+EWrN8DMfBhg+8itP0+iKBOfL0Ldaw3oArCU6OGwGCu+fmekn0n7G xveo/kP9Tte6N1tWeMq5wxegmddX3HmitT5cmP3CRJbfAD4+NaaLAP/iqT+bDA== 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 4Z2yQS2CScz1Gtv; Wed, 26 Feb 2025 15:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3CC5014566; Wed, 26 Feb 2025 15:03:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3CgJ014563; Wed, 26 Feb 2025 15:03:12 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:12 GMT Message-Id: <202502261503.51QF3CgJ014563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 99589b0e1790 - stable/14 - LinuxKPI: rather than manually defining a value use the net80211 define 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 99589b0e1790df208c0bbfc2e0620a5cf8d23e7f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=99589b0e1790df208c0bbfc2e0620a5cf8d23e7f commit 99589b0e1790df208c0bbfc2e0620a5cf8d23e7f Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:25:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:27 +0000 LinuxKPI: rather than manually defining a value use the net80211 define Define cfg80211 IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK to net80211 IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK. We should likely at some point make a sweep and replace all the values with the defines from the comments for the matching net80211 version. Sponsored by: The FreeBSD Foundation (cherry picked from commit a6994e208cca65684d160e1795a3b9e8c0a2e0a9) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 4ae31b257ae0..3454b58f1db7 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2024 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2021-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -200,7 +200,7 @@ struct ieee80211_sta_ht_cap { #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) -#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000c /* IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK */ +#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 /* IEEE80211_VHTCAP_RXLDPC */ From nobody Wed Feb 26 15:03:13 2025 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 4Z2yQT6TRCz5qG5f; Wed, 26 Feb 2025 15:03:13 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQT4XQVz3GZF; Wed, 26 Feb 2025 15:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582193; 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=92I/McjY+QE0vhbVuIqv00Rwcm7jC7UXITAEqIuj8kk=; b=EbetE7JkbUEY92FKD4LuHrxyY7eWPCDysJn5aYw7lrl2oIBygT79t+Ldqrehlgd6CLmNlO fM9gGLG+hEWxSESJ4xnrAi+G1Ob+86DOjm2omWHBTPGMBLUrd2k1NDhjNzGQMFD7SRTx0O 44ZOypTaEYGfO4ffQll7MMk2g2nahnO2B5o9lUtU5fhEZeWhfdlEcmG5URnN1BMWWIpY/n hpR6ig0VHndl2plhgk8THlBBLDU5sIN8A2OPd6xo52uOKhsnN4ZtdDgnCSonele15AUzz5 VrXfAbgvxl11hworw6zl3jtBiIjZ4BoEUyYlJCj1URe6zKHZkYhtbnDLWukb3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582193; a=rsa-sha256; cv=none; b=u0i1Mtx1rvbwON+YG9YGyZFKKBK/wJga6Vc0TbXI31t2oUc/Zhg4ur/r3M+kbJHv9dgt7T +YTG+I2sTkREQw3CrTYvyGrIBNB0bjgeEVnEoUYpJGFcJKi/sjNVppzVAY3vd8ubgtxouc ueYpOvukrbfSlTL4jS8vs+59uB7ChllmmrTf/LAvABQuvnJ+hHf43wEZNGC8rrFRxrvhSS UZFnVtALHsh0pScim3qhVtRrgJRNHJ1JNHEJ/mSm9azsK9sOvw6kCKsVNryrF1IxGfKKRQ sGt6Fx45n5k1sre9EPLgzTZBWyytysPKL70kFeRdaZJrbwuJ1gl91K9SdCfnfw== 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=1740582193; 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=92I/McjY+QE0vhbVuIqv00Rwcm7jC7UXITAEqIuj8kk=; b=ehF6qM6dF1PSxE2qcZDf/atKZWGUAenKu6ATvLu+2F7rIVrqZ8VZxiC+MgE9/+E6f9LbKP //Z55QhgvurEZyibyhdq0Hc1LwG2T01N0fNVMRs5banQ5+HlUSXYSZ6PBsx5l4aPuYQe2n jv2TMbD40gK3kpWCBAPRjM63HxmPT5O0WHLm65PZNYkrXm9x4xeQw+cAMBojjbWx16zEvV zZGXjTF6bJbdxeUerQJLPKOAYWygx1jPATzm/IyMbWu3ERJYLLpLUcCyhahn+2KQiUi8px eFrJp8yeDQa/EhHZLdNy7nbuCylaEJSwFjYnQo4JmxO5sSPH0/3Hf7f3nCstnQ== 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 4Z2yQT3CyFz1Glk; Wed, 26 Feb 2025 15:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3Dmq014601; Wed, 26 Feb 2025 15:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3DW6014598; Wed, 26 Feb 2025 15:03:13 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:13 GMT Message-Id: <202502261503.51QF3DW6014598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: cb9ffb85c413 - stable/14 - LinuxKPI: 802.11: add condition to TODO in ieee80211_sta_recalc_aggregates 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: cb9ffb85c4135e496d244d20ca1e65bb31d03d85 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=cb9ffb85c4135e496d244d20ca1e65bb31d03d85 commit cb9ffb85c4135e496d244d20ca1e65bb31d03d85 Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:31:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:32 +0000 LinuxKPI: 802.11: add condition to TODO in ieee80211_sta_recalc_aggregates ieee80211_sta_recalc_aggregates() shows up in TODO traces but there is nothing we have to do there until we have active links (MLO support). Make the TODO conditional for a time when we will get there. Sponsored by: The FreeBSD Foundation (cherry picked from commit 72ee3d57f31eff420948048ba3c6afdefe4aab5b) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 69956c90042c..9faf58ed6ee5 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -2043,10 +2043,12 @@ ieee80211_sta_pspoll(struct ieee80211_sta *sta) TODO(); } -static __inline void +static inline void ieee80211_sta_recalc_aggregates(struct ieee80211_sta *sta) { - TODO(); + if (sta->valid_links) { + TODO(); + } } static __inline void From nobody Wed Feb 26 15:03:15 2025 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 4Z2yQW6jcmz5qGFy; Wed, 26 Feb 2025 15:03:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQW4tf6z3GRP; Wed, 26 Feb 2025 15:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582195; 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=KnOFKTYaOc5VVtIEyLFQe/tqt2xTsUYofVWt/2nqlzQ=; b=LokUCWjh33KihZUy+KrHc5i20ffkMv9GoSrdjfji2a3IGmm2QD8yJ+WBumU6vnMoSqZ7Pn PWU73qG12JrK6ZZsZvd5jNdyfGKiR+eYXdm5sVFV+XYwnMaZWUpu6uX3MYAIe96vyMpduE tVF/++vuEKdoj9mrI0g3FjQ8AthXdAHwDaxBEtfNa+TYfBeew0Xd1vFERx/ciGT/BvEH5w Iu//SpbkLU9K7vECkLUIPF6WgMfBk5HwDznxOp7PAvO06o2KfMKK6MiYuYkdUDM0Q4CVBT EBKs+z9/VtxOhkTjCuZw5b2OloAlKOArBA78B0oGDPhpKYgGYFhyoDnj0Hd2ZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582195; a=rsa-sha256; cv=none; b=yK4StvCMvgdXsiMbu50vOEDBX1xQn8SbNv9wWF7yQz2FQbybAJPL8PqZzId1Ck8yaDuqoC a0Adjk9vXmCve71uqTCvAu9gBlvWWUTEnQ/8oIMBxMmt44MPI5JBAd70jggo4E0fRC4nhl Ph6eAOOrTiUqES++LdITwtpNF63OH/GVQPFPXNsxHHMFi2mezMCN0T4l5kf4R1zREuisL0 WspADLoacFGLqUfQxYlT2mTqn7YcBMNfVVFqfA1DJXqW8fT7qQ7+skfkedltXffNY5sJ+T 9GF7fOBw09ShN5QREoaiZIcu+J5Tqn6EHpN2euHBlsQWpqiHK5pD9+dYBohNYg== 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=1740582195; 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=KnOFKTYaOc5VVtIEyLFQe/tqt2xTsUYofVWt/2nqlzQ=; b=HebuygLvTy4vmDqPx5NqKW1njM3SyWnjF2oh2oiI+oGI65xdgvLB5UsKdo/XR3GZmW4zHy AvN+F8jm5m5hr/J0bxg6I90q4lCrva11lMjVq4rZc2CG7vhTYdK3JiHHIjOBYSoa9Xf0Gr B4gRxKfkUPWrUG2BHTZL6+Lg1ErJWYsUFuW51/9bsDpXiE0fqwBt3KwzUzc3lmYgqa7u7o F6fMWLWLv4xi6erg0ml49V+NweaSC1D86+L3egy9sXayOtoTu4q7BsbqlHJzTFgTqw4Fxi TIPNwR1IXoCpZflQ3eRZa73utDTK6GpngFXVyIFbYa8mPBhh8uBio9Ud7mCHCg== 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 4Z2yQW3wwcz1GnJ; Wed, 26 Feb 2025 15:03:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3F0V014671; Wed, 26 Feb 2025 15:03:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3F9F014668; Wed, 26 Feb 2025 15:03:15 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:15 GMT Message-Id: <202502261503.51QF3F9F014668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e00588ed9cc5 - stable/14 - LinuxKPI: skbuff: add synchronization primitives and missing bits 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: e00588ed9cc572d1ec02a00b6d9006982ea1ce83 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e00588ed9cc572d1ec02a00b6d9006982ea1ce83 commit e00588ed9cc572d1ec02a00b6d9006982ea1ce83 Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 02:00:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:41 +0000 LinuxKPI: skbuff: add synchronization primitives and missing bits Make a pass over skbuff.h: - implement some missing bits, - sprinkle some const, - add locking and read/write_once calls as needed to provide synchronization as expected by Linux, - fix some typos, - remove return from void functions, - adjust tracing macros. Sponsored by: The FreeBSD Foundation PR: 283903 (rtw88 skb leak) Tested by: Guillaume Outters (guillaume-freebsd outters.eu) Tested by: oleg.nauman gmail.com Differential Revision: https://reviews.freebsd.org/D49101 (cherry picked from commit 2ab4a41956159e7c974979693cb0b13cf552128e) --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 281 +++++++++++++--------- sys/compat/linuxkpi/common/src/linux_skbuff.c | 2 +- 2 files changed, 165 insertions(+), 118 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 43f35d8f065f..9db29c72e20c 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2021-2023 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -45,6 +45,7 @@ #include #include #include +#include #include "opt_wlan.h" @@ -167,6 +168,7 @@ struct sk_buff { #define _SKB_FLAGS_SKBEXTFRAG 0x0001 enum sk_buff_pkt_type pkt_type; uint16_t mac_header; /* offset of mac_header */ + refcount_t refcnt; /* "Scratch" area for layers to store metadata. */ /* ??? I see sizeof() operations so probably an array. */ @@ -199,7 +201,7 @@ struct sk_buff *linuxkpi_dev_alloc_skb(size_t, gfp_t); struct sk_buff *linuxkpi_build_skb(void *, size_t); void linuxkpi_kfree_skb(struct sk_buff *); -struct sk_buff *linuxkpi_skb_copy(struct sk_buff *, gfp_t); +struct sk_buff *linuxkpi_skb_copy(const struct sk_buff *, gfp_t); /* -------------------------------------------------------------------------- */ @@ -242,6 +244,13 @@ kfree_skb(struct sk_buff *skb) linuxkpi_kfree_skb(skb); } +static inline void +consume_skb(struct sk_buff *skb) +{ + SKB_TRACE(skb); + kfree_skb(skb); +} + static inline void dev_kfree_skb(struct sk_buff *skb) { @@ -276,9 +285,12 @@ build_skb(void *data, unsigned int fragsz) /* -------------------------------------------------------------------------- */ -/* XXX BZ review this one for terminal condition as Linux "queues" are special. */ -#define skb_list_walk_safe(_q, skb, tmp) \ - for ((skb) = (_q)->next; (skb) != NULL && ((tmp) = (skb)->next); (skb) = (tmp)) +static inline bool +skb_is_nonlinear(struct sk_buff *skb) +{ + SKB_TRACE(skb); + return ((skb->data_len > 0) ? true : false); +} /* Add headroom; cannot do once there is data in there. */ static inline void @@ -350,12 +362,14 @@ skb_tailroom(struct sk_buff *skb) SKB_TRACE(skb); KASSERT((skb->end - skb->tail) >= 0, ("%s: skb %p tailroom < 0, " "end %p tail %p\n", __func__, skb, skb->end, skb->tail)); + if (unlikely(skb_is_nonlinear(skb))) + return (0); return (skb->end - skb->tail); } -/* Return numer of bytes available at the beginning of buffer. */ +/* Return number of bytes available at the beginning of buffer. */ static inline unsigned int -skb_headroom(struct sk_buff *skb) +skb_headroom(const struct sk_buff *skb) { SKB_TRACE(skb); KASSERT((skb->data - skb->head) >= 0, ("%s: skb %p headroom < 0, " @@ -502,13 +516,10 @@ skb_add_rx_frag(struct sk_buff *skb, int fragno, struct page *page, skb->len += size; skb->data_len += size; skb->truesize += truesize; - - /* XXX TODO EXTEND truesize? */ } /* -------------------------------------------------------------------------- */ -/* XXX BZ review this one for terminal condition as Linux "queues" are special. */ #define skb_queue_walk(_q, skb) \ for ((skb) = (_q)->next; (skb) != (struct sk_buff *)(_q); \ (skb) = (skb)->next) @@ -517,12 +528,23 @@ skb_add_rx_frag(struct sk_buff *skb, int fragno, struct page *page, for ((skb) = (_q)->next, (tmp) = (skb)->next; \ (skb) != (struct sk_buff *)(_q); (skb) = (tmp), (tmp) = (skb)->next) +#define skb_list_walk_safe(_q, skb, tmp) \ + for ((skb) = (_q), (tmp) = ((skb) != NULL) ? (skb)->next ? NULL; \ + ((skb) != NULL); \ + (skb) = (tmp), (tmp) = ((skb) != NULL) ? (skb)->next ? NULL) + static inline bool -skb_queue_empty(struct sk_buff_head *q) +skb_queue_empty(const struct sk_buff_head *q) { + SKB_TRACE(q); + return (q->next == (const struct sk_buff *)q); +} +static inline bool +skb_queue_empty_lockless(const struct sk_buff_head *q) +{ SKB_TRACE(q); - return (q->qlen == 0); + return (READ_ONCE(q->next) == (const struct sk_buff *)q); } static inline void @@ -537,7 +559,8 @@ static inline void skb_queue_head_init(struct sk_buff_head *q) { SKB_TRACE(q); - return (__skb_queue_head_init(q)); + __skb_queue_head_init(q); + spin_lock_init(&q->lock); } static inline void @@ -546,11 +569,11 @@ __skb_insert(struct sk_buff *new, struct sk_buff *prev, struct sk_buff *next, { SKB_TRACE_FMT(new, "prev %p next %p q %p", prev, next, q); - new->prev = prev; - new->next = next; - ((struct sk_buff_head_l *)next)->prev = new; - ((struct sk_buff_head_l *)prev)->next = new; - q->qlen++; + WRITE_ONCE(new->prev, prev); + WRITE_ONCE(new->next, next); + WRITE_ONCE(((struct sk_buff_head_l *)next)->prev, new); + WRITE_ONCE(((struct sk_buff_head_l *)prev)->next, new); + WRITE_ONCE(q->qlen, q->qlen + 1); } static inline void @@ -582,53 +605,62 @@ __skb_queue_tail(struct sk_buff_head *q, struct sk_buff *new) static inline void skb_queue_tail(struct sk_buff_head *q, struct sk_buff *new) { + unsigned long flags; + SKB_TRACE2(q, new); - return (__skb_queue_tail(q, new)); + spin_lock_irqsave(&q->lock, flags); + __skb_queue_tail(q, new); + spin_unlock_irqrestore(&q->lock, flags); } static inline struct sk_buff * -skb_peek(struct sk_buff_head *q) +skb_peek(const struct sk_buff_head *q) { struct sk_buff *skb; skb = q->next; SKB_TRACE2(q, skb); - if (skb == (struct sk_buff *)q) + if (skb == (const struct sk_buff *)q) return (NULL); return (skb); } static inline struct sk_buff * -skb_peek_tail(struct sk_buff_head *q) +skb_peek_tail(const struct sk_buff_head *q) { struct sk_buff *skb; - skb = q->prev; + skb = READ_ONCE(q->prev); SKB_TRACE2(q, skb); - if (skb == (struct sk_buff *)q) + if (skb == (const struct sk_buff *)q) return (NULL); return (skb); } static inline void -__skb_unlink(struct sk_buff *skb, struct sk_buff_head *head) +__skb_unlink(struct sk_buff *skb, struct sk_buff_head *q) { - SKB_TRACE2(skb, head); struct sk_buff *p, *n; - head->qlen--; + SKB_TRACE2(skb, q); + + WRITE_ONCE(q->qlen, q->qlen - 1); p = skb->prev; n = skb->next; - p->next = n; - n->prev = p; + WRITE_ONCE(n->prev, p); + WRITE_ONCE(p->next, n); skb->prev = skb->next = NULL; } static inline void -skb_unlink(struct sk_buff *skb, struct sk_buff_head *head) +skb_unlink(struct sk_buff *skb, struct sk_buff_head *q) { - SKB_TRACE2(skb, head); - return (__skb_unlink(skb, head)); + unsigned long flags; + + SKB_TRACE2(skb, q); + spin_lock_irqsave(&q->lock, flags); + __skb_unlink(skb, q); + spin_unlock_irqrestore(&q->lock, flags); } static inline struct sk_buff * @@ -636,32 +668,47 @@ __skb_dequeue(struct sk_buff_head *q) { struct sk_buff *skb; - SKB_TRACE(q); - skb = q->next; - if (skb == (struct sk_buff *)q) - return (NULL); + skb = skb_peek(q); if (skb != NULL) __skb_unlink(skb, q); - SKB_TRACE(skb); + SKB_TRACE2(q, skb); return (skb); } static inline struct sk_buff * skb_dequeue(struct sk_buff_head *q) { - SKB_TRACE(q); - return (__skb_dequeue(q)); + unsigned long flags; + struct sk_buff *skb; + + spin_lock_irqsave(&q->lock, flags); + skb = __skb_dequeue(q); + spin_unlock_irqrestore(&q->lock, flags); + SKB_TRACE2(q, skb); + return (skb); } static inline struct sk_buff * -skb_dequeue_tail(struct sk_buff_head *q) +__skb_dequeue_tail(struct sk_buff_head *q) { struct sk_buff *skb; skb = skb_peek_tail(q); if (skb != NULL) __skb_unlink(skb, q); + SKB_TRACE2(q, skb); + return (skb); +} +static inline struct sk_buff * +skb_dequeue_tail(struct sk_buff_head *q) +{ + unsigned long flags; + struct sk_buff *skb; + + spin_lock_irqsave(&q->lock, flags); + skb = __skb_dequeue_tail(q); + spin_unlock_irqrestore(&q->lock, flags); SKB_TRACE2(q, skb); return (skb); } @@ -677,27 +724,74 @@ __skb_queue_head(struct sk_buff_head *q, struct sk_buff *skb) static inline void skb_queue_head(struct sk_buff_head *q, struct sk_buff *skb) { + unsigned long flags; SKB_TRACE2(q, skb); - __skb_queue_after(q, (struct sk_buff *)q, skb); + spin_lock_irqsave(&q->lock, flags); + __skb_queue_head(q, skb); + spin_unlock_irqrestore(&q->lock, flags); } static inline uint32_t -skb_queue_len(struct sk_buff_head *head) +skb_queue_len(const struct sk_buff_head *q) { - SKB_TRACE(head); - return (head->qlen); + SKB_TRACE(q); + return (q->qlen); } static inline uint32_t -skb_queue_len_lockless(const struct sk_buff_head *head) +skb_queue_len_lockless(const struct sk_buff_head *q) +{ + + SKB_TRACE(q); + return (READ_ONCE(q->qlen)); +} + +static inline void +___skb_queue_splice(const struct sk_buff_head *from, + struct sk_buff *p, struct sk_buff *n) { + struct sk_buff *b, *e; - SKB_TRACE(head); - return (READ_ONCE(head->qlen)); + b = from->next; + e = from->prev; + + WRITE_ONCE(b->prev, p); + WRITE_ONCE(((struct sk_buff_head_l *)p)->next, b); + WRITE_ONCE(e->next, n); + WRITE_ONCE(((struct sk_buff_head_l *)n)->prev, e); } +static inline void +skb_queue_splice_init(struct sk_buff_head *from, struct sk_buff_head *to) +{ + + SKB_TRACE2(from, to); + + if (skb_queue_empty(from)) + return; + + ___skb_queue_splice(from, (struct sk_buff *)to, to->next); + to->qlen += from->qlen; + __skb_queue_head_init(from); +} + +static inline void +skb_queue_splice_tail_init(struct sk_buff_head *from, struct sk_buff_head *to) +{ + + SKB_TRACE2(from, to); + + if (skb_queue_empty(from)) + return; + + ___skb_queue_splice(from, to->prev, (struct sk_buff *)to); + to->qlen += from->qlen; + __skb_queue_head_init(from); +} + + static inline void __skb_queue_purge(struct sk_buff_head *q) { @@ -713,8 +807,19 @@ __skb_queue_purge(struct sk_buff_head *q) static inline void skb_queue_purge(struct sk_buff_head *q) { + struct sk_buff_head _q; + unsigned long flags; + SKB_TRACE(q); - return (__skb_queue_purge(q)); + + if (skb_queue_empty_lockless(q)) + return; + + __skb_queue_head_init(&_q); + spin_lock_irqsave(&q->lock, flags); + skb_queue_splice_init(q, &_q); + spin_unlock_irqrestore(&q->lock, flags); + __skb_queue_purge(&_q); } static inline struct sk_buff * @@ -729,7 +834,7 @@ skb_queue_prev(struct sk_buff_head *q, struct sk_buff *skb) /* -------------------------------------------------------------------------- */ static inline struct sk_buff * -skb_copy(struct sk_buff *skb, gfp_t gfp) +skb_copy(const struct sk_buff *skb, gfp_t gfp) { struct sk_buff *new; @@ -738,13 +843,6 @@ skb_copy(struct sk_buff *skb, gfp_t gfp) return (new); } -static inline void -consume_skb(struct sk_buff *skb) -{ - SKB_TRACE(skb); - SKB_TODO(); -} - static inline uint16_t skb_checksum(struct sk_buff *skb, int offs, size_t len, int x) { @@ -774,8 +872,7 @@ static inline size_t skb_frag_size(const skb_frag_t *frag) { SKB_TRACE(frag); - SKB_TODO(); - return (-1); + return (frag->size); } #define skb_walk_frags(_skb, _frag) \ @@ -800,8 +897,7 @@ static inline void * skb_frag_address(const skb_frag_t *frag) { SKB_TRACE(frag); - SKB_TODO(); - return (NULL); + return (page_address(frag->page + frag->offset)); } static inline void @@ -831,50 +927,7 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); -} - -static inline void -___skb_queue_splice(const struct sk_buff_head *from, - struct sk_buff *p, struct sk_buff *n) -{ - struct sk_buff *b, *e; - - b = from->next; - e = from->prev; - - b->prev = p; - ((struct sk_buff_head_l *)p)->next = b; - e->next = n; - ((struct sk_buff_head_l *)n)->prev = e; -} - -static inline void -skb_queue_splice_init(struct sk_buff_head *from, struct sk_buff_head *to) -{ - - SKB_TRACE2(from, to); - - if (skb_queue_empty(from)) - return; - - ___skb_queue_splice(from, (struct sk_buff *)to, to->next); - to->qlen += from->qlen; - __skb_queue_head_init(from); -} - -static inline void -skb_queue_splice_tail_init(struct sk_buff_head *from, struct sk_buff_head *to) -{ - - SKB_TRACE2(from, to); - - if (skb_queue_empty(from)) - return; - - ___skb_queue_splice(from, to->prev, (struct sk_buff *)to); - to->qlen += from->qlen; - __skb_queue_head_init(from); + skb->next = NULL; } static inline void @@ -901,25 +954,17 @@ skb_network_header(struct sk_buff *skb) return (skb->head + skb->l3hdroff); } -static inline bool -skb_is_nonlinear(struct sk_buff *skb) -{ - SKB_TRACE(skb); - return ((skb->data_len > 0) ? true : false); -} - static inline int __skb_linearize(struct sk_buff *skb) { SKB_TRACE(skb); SKB_TODO(); - return (ENXIO); + return (-ENXIO); } static inline int skb_linearize(struct sk_buff *skb) { - return (skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0); } @@ -953,7 +998,7 @@ skb_header_cloned(struct sk_buff *skb) { SKB_TRACE(skb); SKB_TODO(); - return (false); + return (true); } static inline uint8_t * @@ -996,7 +1041,6 @@ skb_orphan(struct sk_buff *skb) static inline __sum16 csum_unfold(__sum16 sum) { - SKB_TODO(); return (sum); } @@ -1022,7 +1066,8 @@ static inline struct sk_buff * skb_get(struct sk_buff *skb) { - SKB_TODO(); /* XXX refcnt? as in get/put_device? */ + SKB_TRACE(skb); + refcount_inc(&skb->refcnt); return (skb); } @@ -1057,7 +1102,8 @@ skb_list_del_init(struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); + __list_del_entry(&skb->list); + skb_mark_not_on_list(skb); } static inline void @@ -1088,6 +1134,7 @@ static inline void skb_mark_for_recycle(struct sk_buff *skb) { SKB_TRACE(skb); + /* page_pool */ SKB_TODO(); } diff --git a/sys/compat/linuxkpi/common/src/linux_skbuff.c b/sys/compat/linuxkpi/common/src/linux_skbuff.c index 0522d3fdff41..16a7083123be 100644 --- a/sys/compat/linuxkpi/common/src/linux_skbuff.c +++ b/sys/compat/linuxkpi/common/src/linux_skbuff.c @@ -169,7 +169,7 @@ linuxkpi_build_skb(void *data, size_t fragsz) } struct sk_buff * -linuxkpi_skb_copy(struct sk_buff *skb, gfp_t gfp) +linuxkpi_skb_copy(const struct sk_buff *skb, gfp_t gfp) { struct sk_buff *new; struct skb_shared_info *shinfo; From nobody Wed Feb 26 15:03:14 2025 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 4Z2yQW0G2Vz5qGCS; Wed, 26 Feb 2025 15:03:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2yQV4CD0z3GR6; Wed, 26 Feb 2025 15:03:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740582194; 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=xYPfhOhsSPm5r6+M4MSxP3BP9fO/VvHq7Vi//L90E5w=; b=oaibaGmFyEbUS6NI6Q+K12Re64kMLH4k3lo35pSqRSEBpyqxp2muwv/0jSsXFQmDyUMCjE jQFoTIrcsyjZVks1/AFcSl4d7v45jEzahmoMo7UbM+RixbKVuVSoKFdfEXBFzRwAKbGVrX Np9/nLUinbWbSw8TLpgzu1Ylb0+9erIZtkge0NOYhLG6vjDC6th0BQsqRzRhIzxDUF9Nd6 qdkQovRLPPV9T3oAvXtSgH9Ix1LXbERxYbw2zxH9QHuYjY7fkw12G4NekpXaZinbtjLS3V 2BSTUjtVk+y0BwmUEQcsVHVZ28obuZzNEDawzcOT7E4u+K37VrkXiZSaia5EsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740582194; a=rsa-sha256; cv=none; b=qoNCl+geajtrCsvRg3lZe6OTlkMiGbHppadK+Pf3w3b1v4I3O1b8AdgPmmHBzTRIMgf8z0 vW3Oor7TTORsU7pRQS5S7jQTxtJgcr5wdPOG8Cts8uogECgf2li3km6pDisuABbCYWLFVo j24KB5A8HYOttYN4vZld7gQGaCd9HOlnL3+OtKvhZ4GL8d2BkqzqOdI0c9NihuRwZn6JB+ TmqcJHc0AbVTkMHC4bz4pEIlducsCGNNOUaR+zVZUjs15UOK+fZcPy49SlQnQNyWLJfnIe s0tYolTEz7o6MXfHxEV7IPZiRDdeaOqrWaL1Qu5+iOuPyoyhtic/Meta1Z3Pbg== 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=1740582194; 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=xYPfhOhsSPm5r6+M4MSxP3BP9fO/VvHq7Vi//L90E5w=; b=qfAWtEvUZmPwjeVNel0P/32dV8FLw2KWJvVABFyHmoOI60x8Q0Gt3kncaFG3XIMQx0tM9T vyc3rUYVC5ix58/aI/4bV5R68KD5IgEyXOhWfQIaxQz6yaLrpRtecraccBbMZM0K15o5MJ SCRUx2/Wk8V11ZE/WcD60qSChWFu/S/1hewX/NAbY+WFRQltMtjmPR/suCb/1aHNy8apT8 +R4iN5fenWOK6RHYDxAICx/HmV8NHYQ+bolranNog/HaT0+uSt3sIcoAbssDTkEI946S86 X/BRXnUMGHV5I7Z9Z5kswkTrV2u2wU922Lb/re04onMMZxykjO8Ulz8VHrgXmw== 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 4Z2yQV3pKHz1GnH; Wed, 26 Feb 2025 15:03:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QF3Epi014636; Wed, 26 Feb 2025 15:03:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QF3E9l014633; Wed, 26 Feb 2025 15:03:14 GMT (envelope-from git) Date: Wed, 26 Feb 2025 15:03:14 GMT Message-Id: <202502261503.51QF3E9l014633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a775c23e4061 - stable/14 - LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: a775c23e406136b31d3c4c6bf6a7f2cf4a733c0b Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a775c23e406136b31d3c4c6bf6a7f2cf4a733c0b commit a775c23e406136b31d3c4c6bf6a7f2cf4a733c0b Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:38:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 02:39:35 +0000 LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop() net80211 has inconsistent locking when calling into (*ic_ampdu_rx_stop)(). Make use of 054c5ddf587a7 and conditionally check if the caller locked or not and if locked temporary drop the lock to avoid sleeping on a non-sleepaable lock during the downcall into the driver. Sponsored by: The FreeBSD Foundation (cherry picked from commit 65c573e47c40e3f167f3d7e41bd8db40b6b8f91e) --- sys/compat/linuxkpi/common/src/linux_80211.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 1255691ccf70..5ecfdf495948 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5024,6 +5024,7 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) struct ieee80211_ampdu_params params = { }; int error; uint8_t tid; + bool ic_locked; ic = ni->ni_ic; lhw = ic->ic_softc; @@ -5061,11 +5062,14 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) params.tid = tid; params.amsdu = false; - // IEEE80211_UNLOCK(ic); + ic_locked = IEEE80211_IS_LOCKED(ic); + if (ic_locked) + IEEE80211_UNLOCK(ic); LKPI_80211_LHW_LOCK(lhw); error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); LKPI_80211_LHW_UNLOCK(lhw); - // IEEE80211_LOCK(ic); + if (ic_locked) + IEEE80211_LOCK(ic); if (error != 0) ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n", __func__, error, ni, rap); From nobody Wed Feb 26 16:43:26 2025 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 4Z30f72rX3z52fj6; Wed, 26 Feb 2025 16:43:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z30f70hwCz46n5; Wed, 26 Feb 2025 16:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740588207; 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=RM/ATHS5sIuIPX/0fmYwmCrWV9r4TkmS26n9WianSHI=; b=jKX9lQnBO6vKtVBBZQEolHFTUDG2NE5gCQBaFBAcWG/nLrcLCvTDb8lyf8FgdAeFs/OnY4 10QDor2GBiyM7ufMzs3zlmjJxh29kU41Lnau0xjkDi90DCLh5mvPFpdyGr1s7FeuF04p1w VZmuXwznwIciuEhs+fLzexGsjk4wvTsxm8gNl6lkFGUa9soGWCOjxwbX/iYu1/I6ihxP5u ZoDlhkVsu/a1M08jAOsuty6ld/THyJ2SYArjHSQICoxMPSwsldjBpYVRa4T6R85tGMDKvN Q2Xt1TJDMHkXrGPIWxIbPGw8USOr4RcdpwW0/4p00cIerN5rxnKiLGOlS3qv3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740588207; a=rsa-sha256; cv=none; b=EaPvVAIuU7oU2Q9F8zIMZaVQr26cXIdfySufZIunQeThxFof33+SrkXmiuvvRmq20SlW0n lfeiIIy8EIotZF+rYbGRhdK/YOVP6hqsGxHDWUH+4r7xm9hfxNVYC9yoIAkMDoOXkyZJkm SfM2xl6lueTwARd63PTfjs7n3NABm6dixw3adxVcJCKA2o6vGkp5KERBkH9bnUfMGRAx5X EXdxmkC+IbkZwKMx/y3lHQcu+xweSK3uAhU0rw/D6cVSES4Etw/lbFzEXef7/3kNIxJ/s4 OGuZ0r8TXl1J+IpdMQNol04/eDut4D3Z0MwMdI17RmAsMWUgUlNS8x8ejZ+NTw== 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=1740588207; 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=RM/ATHS5sIuIPX/0fmYwmCrWV9r4TkmS26n9WianSHI=; b=iqBWCPsz3zCE6NaXyPN2tqVSmN7/nDXy9uk1cg2k6J4oTS9HSOmbmo0vtvT1zYmmyXCXfU 3HIht1oUX1eLXPKi5PJT/ffIQuN7v5xlTTJGqb7SKg+LDPM5mticejiAPMjyXGBLiGrwvS 4NyWktl0hUqZou2g1CSJgaxcpdS6UdewNWoGsCjZpctzwqAwATlJpamH2WQlLVIGu0uyus uqHlXTm4Pz+tI8WiNOHn8UXPJz+wOzLwCTEHR6BJ64wH3cAa9jj9aCI5vgkb8BpY8b/fdo /QJuJhASq1PvxE96kVzNcLRL6GiTIw50tynjsPglExYtn0xjmEzYOwvqeQPqqQ== 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 4Z30f70FJgz1Jqn; Wed, 26 Feb 2025 16:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QGhQYd001259; Wed, 26 Feb 2025 16:43:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QGhQs5001256; Wed, 26 Feb 2025 16:43:26 GMT (envelope-from git) Date: Wed, 26 Feb 2025 16:43:26 GMT Message-Id: <202502261643.51QGhQs5001256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 707ac59c2b31 - stable/14 - openssh: Fix blacklistd sshd-session integration 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 707ac59c2b31bdf3a593bc545d2fe233598cb97c Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=707ac59c2b31bdf3a593bc545d2fe233598cb97c commit 707ac59c2b31bdf3a593bc545d2fe233598cb97c Author: Jose Luis Duran AuthorDate: 2025-02-24 14:38:52 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-26 16:40:46 +0000 openssh: Fix blacklistd sshd-session integration In version 9.8, the server was split into a listener binary, sshd(8), and a per-session binary "sshd-session". Our blacklistd changes also have to be moved from sshd.c to sshd-session.c. Reviewed by: emaste Approved by: emaste (mentor) Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49116 (cherry picked from commit 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16) --- crypto/openssh/sshd-session.c | 3 +++ crypto/openssh/sshd.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c index 3092cd91242e..ee983176d3aa 100644 --- a/crypto/openssh/sshd-session.c +++ b/crypto/openssh/sshd-session.c @@ -109,6 +109,7 @@ #include "sk-api.h" #include "srclimit.h" #include "dh.h" +#include "blacklist_client.h" /* Re-exec fds */ #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) @@ -1316,6 +1317,8 @@ main(int ac, char **av) fatal("sshbuf_new loginmsg failed"); auth_debug_reset(); + BLACKLIST_INIT(); + if (privsep_preauth(ssh) == 1) goto authenticated; diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 68e48d75369a..fd48835ebd2a 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -101,7 +101,6 @@ #include "sk-api.h" #include "addr.h" #include "srclimit.h" -#include "blacklist_client.h" #ifdef LIBWRAP #include @@ -1876,9 +1875,6 @@ main(int ac, char **av) } #endif #endif - - - BLACKLIST_INIT(); } /* server specific fatal cleanup */ From nobody Wed Feb 26 16:43:53 2025 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 4Z30ff2gyZz52fHF; Wed, 26 Feb 2025 16:43:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z30fd1w1Fz47nq; Wed, 26 Feb 2025 16:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740588233; 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=RhhrbLNDI3Q/97A4XnE6NFyWDvvFShd7TiXve1sNSLk=; b=e0xW3xdzeQmNsHMc5LnJ4CdPBK7TU1ppdwlt1zY3CZT1V8JaKIvPfPEPNQozQDhJxMhVvs q3KkMAsZw9rsFSNAnDtjSZj1WbdRqqNjYd01s280rqIcftGyaMjaGOvp/ZerRS2fe2C7gL L3GUNnFa1d8ugOWxhHdxyWhygiYmj8RMCxZs0zf4TqoQ2/LfAKElOIrsWPVZlHuMwNcs81 lQd8OqPm6F438B1y7uS51kLq1Fb4fvdI0Kshn0bVMpzH6mECPG0gGZbFi7R2gb6inY1IMn 0EVMCXRpyLMNVKXccbw43z4Exn5CLwjnl/vTu4Yfq73Ui/O70NtEYh02PW+izA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740588233; a=rsa-sha256; cv=none; b=d9ZU+fcVHACtwJeqg6KzXXNIZiF/IyhMiYTW+GVkE6wDLSGciKzJVN6VT/JFcGWXCb9j9u N8zuPLyGvp8aH1OfNX9Wh5sU96ekFGZdNkE5mnxSWzBFdihB5htv3hO22pksnwyQ2aH7RX 2MIu48zXGZJQ6/QpUiYFwEAyRro1zRH70ROUkwySpmH1McHpYB1P4DeUxnlPq5O1RGqJBg jPVbci6x/qnrl/wYGtR6LDgEMWSRoOwRY0vdbeCWbKC1dGB2wEuxOkG1Nap5V2kLqKtM9p QKKit/cwkTLVU2EvfWfiZTzTGZkbAJtS7C+tz+Eq2SxsEf2PD7IUgV9/qi4eqw== 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=1740588233; 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=RhhrbLNDI3Q/97A4XnE6NFyWDvvFShd7TiXve1sNSLk=; b=FIF3OhoSZNUESRqWbRqZQ6R1SkP+REvsS/IHOu7orz9d0CqXF0Hd2I7W+5p+WmPsN06Mt1 PY2frp29QH4NhphplzKpOKVoGj7uw6lPBlbLqdJ9mNXBPFybn0Tvj1VrykGBqA6UmSUORz XcjM6T3R9NBsN7I6mC4yXYnhoyLtG2xJx5JEc9jKF9qlj0EqmFOosmILzkle8yiDaZrSih 5Gecv2vj7pgqFC2ww5RulpOzzUhkT7D0iVEltP8On9htuurXTXpTRkw0QT85rd2UWBd6dk b9CxrTC//WNXiwB4fruPlx2S0yssznxOzPRCev5VoJcYiHYHn1y67NkNl6tHKw== 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 4Z30fd1FMJz1KFh; Wed, 26 Feb 2025 16:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QGhrTR001509; Wed, 26 Feb 2025 16:43:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QGhrBq001506; Wed, 26 Feb 2025 16:43:53 GMT (envelope-from git) Date: Wed, 26 Feb 2025 16:43:53 GMT Message-Id: <202502261643.51QGhrBq001506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: f931a32bcaf3 - stable/13 - openssh: Fix blacklistd sshd-session integration 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f931a32bcaf3f86581d2dbe46f7809eb47d1b167 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=f931a32bcaf3f86581d2dbe46f7809eb47d1b167 commit f931a32bcaf3f86581d2dbe46f7809eb47d1b167 Author: Jose Luis Duran AuthorDate: 2025-02-24 14:38:52 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-26 16:42:45 +0000 openssh: Fix blacklistd sshd-session integration In version 9.8, the server was split into a listener binary, sshd(8), and a per-session binary "sshd-session". Our blacklistd changes also have to be moved from sshd.c to sshd-session.c. Reviewed by: emaste Approved by: emaste (mentor) Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49116 (cherry picked from commit 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16) (cherry picked from commit 707ac59c2b31bdf3a593bc545d2fe233598cb97c) --- crypto/openssh/sshd-session.c | 3 +++ crypto/openssh/sshd.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c index 3092cd91242e..ee983176d3aa 100644 --- a/crypto/openssh/sshd-session.c +++ b/crypto/openssh/sshd-session.c @@ -109,6 +109,7 @@ #include "sk-api.h" #include "srclimit.h" #include "dh.h" +#include "blacklist_client.h" /* Re-exec fds */ #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) @@ -1316,6 +1317,8 @@ main(int ac, char **av) fatal("sshbuf_new loginmsg failed"); auth_debug_reset(); + BLACKLIST_INIT(); + if (privsep_preauth(ssh) == 1) goto authenticated; diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 68e48d75369a..fd48835ebd2a 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -101,7 +101,6 @@ #include "sk-api.h" #include "addr.h" #include "srclimit.h" -#include "blacklist_client.h" #ifdef LIBWRAP #include @@ -1876,9 +1875,6 @@ main(int ac, char **av) } #endif #endif - - - BLACKLIST_INIT(); } /* server specific fatal cleanup */ From nobody Wed Feb 26 17:52:18 2025 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 4Z329b1tg2z52mpl; Wed, 26 Feb 2025 17:52:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z329b1F2vz3mNv; Wed, 26 Feb 2025 17:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740592339; 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=phmDoqWI/VEBeVZO3CddIflEx+mz1V4Mt9dWBoh3c4c=; b=feT8rVnU3AfGEtyOS1pZ7vYmWamt8htvgG9a/70OSPbSoawvxr1nCPAqfmgGO+i1Kz8QMD sPrx3nIQ/NszexEKalgInO1Dg0+lKeLlJRxI5xlEHBD751FsxW8Kz8v0y6aKtxjP2UL7vH MJZSUsqUinDwgHc2H3qwlDKTigqg4dZv8bPnedr6VcxNVbm3EsWonyBQWK0chB5IDEh0vk zaD6ZjiknPUz/k2m0wBfOChnDQBUL/LG1pihbu5+wAFmTu+/ZQmkLe3KS22wzRuXl81xFf 5i4XhsIUFq4uY9sVTGX8T/32W7HvdLdNUHr/N7pjzNc4bM/g4DIYdh0vh5ZZRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740592339; a=rsa-sha256; cv=none; b=Qa8tv8FXI/w/VgpU3B/TUodeIzKxl2b5gn784pqSDlhSnp6lhzvOSItyzfsWUYVvfuV6TP odrj9hA2fG6LVBUcKrKlM62X8OJAXCSj9WG/lHtL/zT7dOMnpuF+iugT3aOwhesQ48xvl5 jDWP7yRBXS3/I2OPp0eNVW6M+EWKA4opx1Cb0SEAhFb7vzuvKNycEimeH8DWVjEPkkSAPU Bq+F/BlOyKQY7ptqQrgLlRLI7/g5qxRtpdIEFtj5ClBHXH+h7DYkeOIaN848BE5O4kjs49 PFdHXS6NXNqraoDfbjI+hkXVYnW32ZbHFssygkQ+HazUvXgBa8LZ0cot1DzABg== 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=1740592339; 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=phmDoqWI/VEBeVZO3CddIflEx+mz1V4Mt9dWBoh3c4c=; b=Ro6Leu6nGPKfmFq3M6Qe01+pjodMETatzvBDy/xwfaWy66vEiEN2R4AU6u476aI5h0wb6x BCzkAHP6HxM417HKdhhKd+BemQ3sGpCTWFMfgibMb0WOwhYDIFXHfHXNfAgqC/NmpNCYYH rJ0zZC2ZlkfzEfzG7Yu5T1jopoOgvabEOk9j480V1TIp0RVgQayGBNLBr7CHnU5rhaHyCm pNOuz4fxIJnXwcNGyZXpsxfOqLbTAKu4Oddij3eOnZPqaYkwwBXUun9Dme0d9wG+UnjIX8 XTx79dPutv0JKYyXm62Uh/mB6KsmG8PNQ/eHvCCXAasNFyMMGHFfOEpcDy6OSQ== 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 4Z329b0bWSz1M21; Wed, 26 Feb 2025 17:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QHqI98031052; Wed, 26 Feb 2025 17:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QHqIli031049; Wed, 26 Feb 2025 17:52:18 GMT (envelope-from git) Date: Wed, 26 Feb 2025 17:52:18 GMT Message-Id: <202502261752.51QHqIli031049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: e8043c76e378 - releng/13.5 - openssh: Fix blacklistd sshd-session integration 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: e8043c76e3788c555f633a0de6395a4d10ea375b Auto-Submitted: auto-generated The branch releng/13.5 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=e8043c76e3788c555f633a0de6395a4d10ea375b commit e8043c76e3788c555f633a0de6395a4d10ea375b Author: Jose Luis Duran AuthorDate: 2025-02-24 14:38:52 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-26 17:16:16 +0000 openssh: Fix blacklistd sshd-session integration In version 9.8, the server was split into a listener binary, sshd(8), and a per-session binary "sshd-session". Our blacklistd changes also have to be moved from sshd.c to sshd-session.c. Reviewed by: emaste Approved by: emaste (mentor) Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49116 (cherry picked from commit 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16) (cherry picked from commit 707ac59c2b31bdf3a593bc545d2fe233598cb97c) (cherry picked from commit f931a32bcaf3f86581d2dbe46f7809eb47d1b167) Approved by: re (cperciva) --- crypto/openssh/sshd-session.c | 3 +++ crypto/openssh/sshd.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c index 3092cd91242e..ee983176d3aa 100644 --- a/crypto/openssh/sshd-session.c +++ b/crypto/openssh/sshd-session.c @@ -109,6 +109,7 @@ #include "sk-api.h" #include "srclimit.h" #include "dh.h" +#include "blacklist_client.h" /* Re-exec fds */ #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) @@ -1316,6 +1317,8 @@ main(int ac, char **av) fatal("sshbuf_new loginmsg failed"); auth_debug_reset(); + BLACKLIST_INIT(); + if (privsep_preauth(ssh) == 1) goto authenticated; diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 68e48d75369a..fd48835ebd2a 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -101,7 +101,6 @@ #include "sk-api.h" #include "addr.h" #include "srclimit.h" -#include "blacklist_client.h" #ifdef LIBWRAP #include @@ -1876,9 +1875,6 @@ main(int ac, char **av) } #endif #endif - - - BLACKLIST_INIT(); } /* server specific fatal cleanup */ From nobody Wed Feb 26 23:46:11 2025 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 4Z3B1w2NLnz5pBqW; Wed, 26 Feb 2025 23:46:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B1w141Qz3p8d; Wed, 26 Feb 2025 23:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613572; 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=hoW6j/T1bnpGdYu4dkm0uF9s6pDA6YL7BaKTIzVczk0=; b=bg78bTcF5uHIhePnvYPlBulMrXTyPS6fRn0tldua0BCb/hXX6jyWXcvs5/ZzQOTFYB7jsu +ngn5GT3d46ZSdGbdwZSR29ohZIBZuEUxGt9vi+AOgN9MiH9JbwZuOTGTDfQvsnWAMxaJA KJ6yNo3VDWCOKgisiEQRShBm5f82Sq0yYueIP5dNtVF3kXDnVgcQvfXPF7D9yufH+YOasB 6azCAjwGXYV0llUz6TeA6B/qaak/UcEAwrXr1zSN4/9vrDFz/q0jQ07FKH2VBYT5HVwtmJ N4ixFguoPyLKNSksSZfWOCXVq7mwPz6/2YQ4kCRq+Hi0qVQgy/8Lbhj7JH2v9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613572; a=rsa-sha256; cv=none; b=xk0Js4Qb4ZaQJeWDSQUnRyAb+Vy+zL2XBx0TOOx6eFJw8SKJz/Q6HB6WkXTsEYtfx7eL2s IecdEoipMC8d7owEnX8GQTo9ZcN9EFepBFsylLbRCn2+hcdlE8ipgQFkmLMZZvyKWNvD3z ZO3Myk67/dvkL+ArEfR1bciT4RgoN2xUyq9UyPVNTHbs5Rnjj2nMRblr6B8otuytcedW24 3wFKT2WJS+SZ7xUSzpWMkVkP8BNTfOfxZybEEftSUlRe0IftrF/14CzJiD7n+v7s8HA7D1 ft7xlP3C+O45+YWk7dMCCw0wsoVNXn6Uw4PhUI89B5L3CLfxjb8MbgEWKmGt4w== 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=1740613572; 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=hoW6j/T1bnpGdYu4dkm0uF9s6pDA6YL7BaKTIzVczk0=; b=yMtBtMFKf6rdXKdPgA0ff9ierDCYOVF1vaxDEkxeCdVybmcWpu6hh2qk3NLSglDMhbGS4t zIiur9nHObbhE9WaJjNegDKiSxjsV39VgFnOlNtc+a+wj5nyGGxZT8vxcUWyQxdLzyXwx8 Q5Tmj+D9B0n/8GOjK9XhoQgTf2wh/yNQk7O21tkRcnu+OoK5byM8Vc1lHRHR8RWulNRprO GvzxCvSwHl3iIU/BoCCJHF4ekUiwTzyImbB/xqIiZG4BByYLqqRa9pgY7x5nQP9Ev5cFRG emgCUP6j/6W5LLudnhligRu+3e3zcxwGoRFhkwJYyPnI9jC2l3QnxsMmGzVI8A== 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 4Z3B1w0Lz3z34Q; Wed, 26 Feb 2025 23:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkBvl086482; Wed, 26 Feb 2025 23:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkBTj086479; Wed, 26 Feb 2025 23:46:11 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:11 GMT Message-Id: <202502262346.51QNkBTj086479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7907a9276081 - stable/14 - usbconfig: add -l option to dump_device_desc for single line output 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 7907a9276081e9b1ccac839af91fe096e6779e9f Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7907a9276081e9b1ccac839af91fe096e6779e9f commit 7907a9276081e9b1ccac839af91fe096e6779e9f Author: Bjoern A. Zeeb AuthorDate: 2025-02-12 22:53:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 usbconfig: add -l option to dump_device_desc for single line output Like pciconf -l add a -l to dump_device_desc for usbconfig which will fold most fields into a single line. We do filter out some we think will not be interesting in this case. While mangling with string output in ways not always anticipated when the program was initially written this should help to parse the available devices for programs like fwget(8). While I had this in mind for other bits for a while I got prompted by D48678 to finally do it. Sponsored by: The FreebSD Foundation Reviewed by: bapt (LGTM), ziaee (man) Differential Revision: https://reviews.freebsd.org/D48974 (cherry picked from commit c66308d7bcc3931b60a096bfe6ba0f50105e77de) --- usr.sbin/usbconfig/dump.c | 145 +++++++++++++++++++++++++++++++++++------ usr.sbin/usbconfig/dump.h | 5 +- usr.sbin/usbconfig/usbconfig.8 | 6 +- usr.sbin/usbconfig/usbconfig.c | 20 ++++-- 4 files changed, 148 insertions(+), 28 deletions(-) diff --git a/usr.sbin/usbconfig/dump.c b/usr.sbin/usbconfig/dump.c index 36f026bfc2fb..2a4a5300efeb 100644 --- a/usr.sbin/usbconfig/dump.c +++ b/usr.sbin/usbconfig/dump.c @@ -3,6 +3,10 @@ * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 2024 Baptiste Daroussin + * Copyright (c) 2025 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,22 +32,32 @@ #include +#include #include #include #include +#include #include #include #include #include #include +#include #include #include +#include + #include "dump.h" #include "pathnames.h" +#ifndef IOUSB +#define IOUSB(a) a +#endif + #define DUMP0(n,type,field,...) dump_field(pdev, " ", #field, n->field); +#define DUMP0L(n,type,field,...) dump_fieldl(pdev, " ", #field, n->field); #define DUMP1(n,type,field,...) dump_field(pdev, " ", #field, n->field); #define DUMP2(n,type,field,...) dump_field(pdev, " ", #field, n->field); #define DUMP3(n,type,field,...) dump_field(pdev, " ", #field, n->field); @@ -113,11 +127,21 @@ dump_power_mode(uint8_t value) } static void -dump_field(struct libusb20_device *pdev, const char *plevel, - const char *field, uint32_t value) +_dump_field(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value, bool list_mode) { uint8_t temp_string[256]; + if (list_mode) { + /* Skip fields we are not interested in. */ + if (strcmp(field, "bLength") == 0 || + strcmp(field, "bDescriptorType") == 0 || + strcmp(field, "bMaxPacketSize0") == 0) + return; + + printf("%s=%#06x ", field, value); + return; + } printf("%s%s = 0x%04x ", plevel, field, value); if (strlen(plevel) == 8) { @@ -257,6 +281,20 @@ dump_field(struct libusb20_device *pdev, const char *plevel, printf("\n"); } +static void +dump_field(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value) +{ + _dump_field(pdev, plevel, field, value, false); +} + +static void +dump_fieldl(struct libusb20_device *pdev, const char *plevel, + const char *field, uint32_t value) +{ + _dump_field(pdev, plevel, field, value, true); +} + static void dump_extra(struct libusb20_me_struct *str, const char *plevel) { @@ -396,16 +434,34 @@ load_vendors(void) return (usb_vendors); } +enum _device_descr_list_type { + _DEVICE_DESCR_LIST_TYPE_DEFAULT = 0, + _DEVICE_DESCR_LIST_TYPE_UGEN = 1, + _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR = 2, +}; + static char * -_device_desc(struct libusb20_device *pdev) +_device_desc(struct libusb20_device *pdev, + enum _device_descr_list_type list_type) { static struct usb_vendors *usb_vendors = NULL; char *desc = NULL; const char *vendor = NULL, *product = NULL; - uint16_t vid = libusb20_dev_get_device_desc(pdev)->idVendor; - uint16_t pid = libusb20_dev_get_device_desc(pdev)->idProduct; + uint16_t vid; + uint16_t pid; struct usb_vendor_info *vi; struct usb_product_info *pi; + struct usb_device_info devinfo; + + if (list_type == _DEVICE_DESCR_LIST_TYPE_UGEN) { + asprintf(&desc, "ugen%u.%u", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev)); + return (desc); + } + + vid = libusb20_dev_get_device_desc(pdev)->idVendor; + pid = libusb20_dev_get_device_desc(pdev)->idProduct; if (usb_vendors == NULL) usb_vendors = load_vendors(); @@ -424,6 +480,44 @@ _device_desc(struct libusb20_device *pdev) } } } + + /* + * Try to gather the information; libusb2 unfortunately seems to + * only build an entire string but not save vendor/product individually. + */ + if (vendor == NULL || product == NULL) { + char buf[64]; + int f; + + snprintf(buf, sizeof(buf), "/dev/" USB_GENERIC_NAME "%u.%u", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev)); + + f = open(buf, O_RDWR); + if (f < 0) + goto skip_vp_recovery; + + if (ioctl(f, IOUSB(USB_GET_DEVICEINFO), &devinfo)) + goto skip_vp_recovery; + + + if (vendor == NULL) + vendor = devinfo.udi_vendor; + if (product == NULL) + product = devinfo.udi_product; + +skip_vp_recovery: + if (f >= 0) + close(f); + } + + if (list_type == _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR) { + asprintf(&desc, "vendor='%s' product='%s'", + (vendor != NULL) ? vendor : "", + (product != NULL) ? product : ""); + return (desc); + } + if (vendor == NULL || product == NULL) return (NULL); @@ -433,12 +527,12 @@ _device_desc(struct libusb20_device *pdev) product, vendor, libusb20_dev_get_bus_number(pdev)); - return (desc); } void -dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv) +dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv, + bool list_mode) { char buf[128]; uint8_t n; @@ -447,18 +541,22 @@ dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv) usage = libusb20_dev_get_power_usage(pdev); - desc = _device_desc(pdev); - - printf("%s, cfg=%u md=%s spd=%s pwr=%s (%umA)\n", - desc ? desc : libusb20_dev_get_desc(pdev), - libusb20_dev_get_config_index(pdev), - dump_mode(libusb20_dev_get_mode(pdev)), - dump_speed(libusb20_dev_get_speed(pdev)), - dump_power_mode(libusb20_dev_get_power_mode(pdev)), - usage); + desc = _device_desc(pdev, (list_mode) ? _DEVICE_DESCR_LIST_TYPE_UGEN : + _DEVICE_DESCR_LIST_TYPE_DEFAULT); + + if (list_mode) + printf("%s: ", desc); + else + printf("%s, cfg=%u md=%s spd=%s pwr=%s (%umA)\n", + desc ? desc : libusb20_dev_get_desc(pdev), + libusb20_dev_get_config_index(pdev), + dump_mode(libusb20_dev_get_mode(pdev)), + dump_speed(libusb20_dev_get_speed(pdev)), + dump_power_mode(libusb20_dev_get_power_mode(pdev)), + usage); free(desc); - if (!show_ifdrv) + if (list_mode || !show_ifdrv) return; for (n = 0; n != 255; n++) { @@ -531,12 +629,21 @@ dump_be_dev_quirks(struct libusb20_backend *pbe) } void -dump_device_desc(struct libusb20_device *pdev) +dump_device_desc(struct libusb20_device *pdev, bool list_mode) { struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; ddesc = libusb20_dev_get_device_desc(pdev); - LIBUSB20_DEVICE_DESC(DUMP0, ddesc); + if (list_mode) { + char *desc; + + LIBUSB20_DEVICE_DESC(DUMP0L, ddesc); + desc = _device_desc(pdev, _DEVICE_DESCR_LIST_TYPE_PRODUCT_VENDOR); + printf("%s\n", (desc != NULL) ? desc : ""); + free(desc); + } else { + LIBUSB20_DEVICE_DESC(DUMP0, ddesc); + } } void diff --git a/usr.sbin/usbconfig/dump.h b/usr.sbin/usbconfig/dump.h index 71adb47262ea..6adc8e54e5a9 100644 --- a/usr.sbin/usbconfig/dump.h +++ b/usr.sbin/usbconfig/dump.h @@ -32,10 +32,11 @@ const char *dump_mode(uint8_t value); const char *dump_speed(uint8_t value); const char *dump_power_mode(uint8_t value); void dump_string_by_index(struct libusb20_device *pdev, uint8_t index); -void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv); +void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv, + bool list_mode); void dump_be_quirk_names(struct libusb20_backend *pbe); void dump_be_dev_quirks(struct libusb20_backend *pbe); -void dump_device_desc(struct libusb20_device *pdev); +void dump_device_desc(struct libusb20_device *pdev, bool list_mode); void dump_device_stats(struct libusb20_device *pdev); void dump_config(struct libusb20_device *pdev, uint8_t all_cfg); diff --git a/usr.sbin/usbconfig/usbconfig.8 b/usr.sbin/usbconfig/usbconfig.8 index 3926b03747e5..511fa9c5dddb 100644 --- a/usr.sbin/usbconfig/usbconfig.8 +++ b/usr.sbin/usbconfig/usbconfig.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2022 +.Dd February 12, 2025 .Dt USBCONFIG 8 .Os .Sh NAME @@ -30,6 +30,7 @@ .Nd configure the USB subsystem .Sh SYNOPSIS .Nm +.Op Fl l .Op Fl v .Op Fl a Ar addr .Op Fl i Ar interface_index @@ -40,6 +41,7 @@ .Sm off .Oo Oo Cm /dev/ Oc Cm ugen Oc Ar unit Cm \&. Ar addr .Sm on +.Op Fl l .Op Fl v .Op Fl i Ar interface_index .Op Ar cmds ... @@ -70,6 +72,8 @@ Show help and available commands. Specify interface index as indicated by the command description. If this argument is not specified a value of zero will be used for the interface index. +.It Fl l Cm dump_device_desc +Show numeral only key=value output as one long line. .It Fl u Ar unit Limit device range to USB devices connected to the given USBUS unit. .It Fl v diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c index 7d257fea52cd..9337effd835d 100644 --- a/usr.sbin/usbconfig/usbconfig.c +++ b/usr.sbin/usbconfig/usbconfig.c @@ -25,6 +25,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -91,6 +92,7 @@ struct options { uint8_t got_dump_string:1; uint8_t got_do_request:1; uint8_t got_detach_kernel_driver:1; + uint8_t opt_dump_in_list_mode:1; }; struct token { @@ -504,11 +506,13 @@ flush_command(struct libusb20_backend *pbe, struct options *opt) if (opt->got_list || dump_any) { dump_device_info(pdev, - opt->got_show_iface_driver); + opt->got_show_iface_driver, + opt->opt_dump_in_list_mode && opt->got_dump_device_desc); } if (opt->got_dump_device_desc) { - printf("\n"); - dump_device_desc(pdev); + if (!opt->opt_dump_in_list_mode) + printf("\n"); + dump_device_desc(pdev, opt->opt_dump_in_list_mode); } if (opt->got_dump_all_config) { printf("\n"); @@ -518,14 +522,14 @@ flush_command(struct libusb20_backend *pbe, struct options *opt) dump_config(pdev, 0); } else if (opt->got_dump_all_desc) { printf("\n"); - dump_device_desc(pdev); + dump_device_desc(pdev, false); dump_config(pdev, 1); } if (opt->got_dump_stats) { printf("\n"); dump_device_stats(pdev); } - if (dump_any) { + if (dump_any && !opt->opt_dump_in_list_mode) { printf("\n"); } if (libusb20_dev_close(pdev)) { @@ -559,7 +563,7 @@ main(int argc, char **argv) if (pbe == NULL) err(1, "could not access USB backend\n"); - while ((ch = getopt(argc, argv, "a:d:hi:u:v")) != -1) { + while ((ch = getopt(argc, argv, "a:d:hi:lu:v")) != -1) { switch (ch) { case 'a': opt->addr = num_id(optarg, "addr"); @@ -596,6 +600,10 @@ main(int argc, char **argv) opt->iface = num_id(optarg, "iface"); break; + case 'l': + opt->opt_dump_in_list_mode = 1; + break; + case 'u': opt->bus = num_id(optarg, "busnum"); opt->got_bus = 1; From nobody Wed Feb 26 23:46:12 2025 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 4Z3B1x2zLvz5pBpW; Wed, 26 Feb 2025 23:46:13 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B1x0Xlbz3pHD; Wed, 26 Feb 2025 23:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613573; 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=SwQdpAz0/NTDRqpXR2JGrCiMNlY/95gy75LNz2744v8=; b=rHAriiY4qGpmZpvRitj+Bz8RvEiG/45j1+Q55GQRRo7Jpjw+IA5pv+2mfQfJfK/dlJAdP7 CcTgdmLO0y4xWkFW8oKIt5ea9YKLZAeBApUih1ecLbIfCuK1FTJmsBXqC7tf5RGBOl1CYQ HSGuxoOPZrsBvRl8KfaiNeQtJi/rmXxGCCMTvRftvvIGe6gKlFyI6wMNQxJKc4ah050MtM ake7l7VFD4mj3G+qEuSvOgu5E5c1TyyHAARn/KKiVuBZhcdfqzcqbBSs4jM3QuJjDgUF7U yM03QNokbGLCHOTrsNYe+9R6nVT3LaQPTG1FGI8Kkw/7u4iRKdHl6iIqiQ8vJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613573; a=rsa-sha256; cv=none; b=hngfsSfOk5gKwJRMhsD/XGrPHS+t0Rx0yjKOp/guOg9GLyaybLCqLgzqvcC/wjb+Ye7D4N Ky8oolvEjXDBo6arlyPlfojAffqtqMTmG08KOnP/23QwpSZBbspPKz3h2T8WfzxRxhL3xT n8beCiLjU0K+oiRXcOC6fc4g5TB2w4eaprVsQ7jdPsNguMpfb82lGUpJEU9xcVCgzPN4BJ TwOsrDKq5gTqTOVGnRjPWNXuq9hrfj/h9fJlGcWkUJmL/qAKtGr0EnygwFbr5D5ZKUjeEd 6qKSX9DEaI/G0l+WK8Kxs3TUouK/OplhnD1hNWYSYMjVe/+0PLPOPfKKZCaLuw== 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=1740613573; 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=SwQdpAz0/NTDRqpXR2JGrCiMNlY/95gy75LNz2744v8=; b=u3DyQzC2y5kwLYu+EDozDev+2nXwseDLerMwiOZA7EwrkxNSIyh9c0/vT48sEknVZ/eQ/G k7BCavt0ZV0Qps4qOUberAz6JgY8W+X2QDL/LbygQa5rkEbE5tUNlLgow7yeWuJP+ZRJY4 3cj77OfCArMGRylJ0HFi5CnmWGyYcaD6WiOsOJDcHTTk1GbuOcRjC1LUJGNLLBpWkwJXh2 1bfF0etxxTJ/ersup1YICQhiL9CmqAmh2vc43yUT8dYifOlx0wsawmLVbeV9PpssbcnGX5 dq6xrvB2lOpfLRQf9W8g2zn2h2m9IwSKJhDJTlrk68q6JVzLfi0NN3UwnjaDUA== 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 4Z3B1x06W0z3J0; Wed, 26 Feb 2025 23:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkCPb086519; Wed, 26 Feb 2025 23:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkCRf086516; Wed, 26 Feb 2025 23:46:12 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:12 GMT Message-Id: <202502262346.51QNkCRf086516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0ce3f5ee4e35 - stable/14 - LinuxKPI: 802.11: synchronize LinuxKPI 802.11 sta from net80211 ni 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0ce3f5ee4e3540b7071742cded5c3341e4c92d57 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0ce3f5ee4e3540b7071742cded5c3341e4c92d57 commit 0ce3f5ee4e3540b7071742cded5c3341e4c92d57 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: synchronize LinuxKPI 802.11 sta from net80211 ni Have a wrapper function dealing with the synchronization for all the dfferent standards (HT and VHT currently). In case HT or VHT is not supported make sure to turn the LinuxKPI "supported" flag off for that. Previously if it was on once it would never be turned off. For HT and VHT properly compute the NSS and also set the max_amsdu_len correctly. Set the NSS directly in the function (which is called in proper order for this) rather than passing the results back and do the setting in the caller. The only thing we need to make sure upfront is that it remains at least 1 (see f5a58c2da239). This all makes the caller and code a tiny bit simpler and work better. There is more synchronization to be done between the chanctx and the deflink bandwidth, which needs to happen dynamically in case net80211 decides to change that under us but no native driver seems to properly implement this (if at all). HT20-only, HT40, and VHT80 are supposed to work for now at least. VHT160 and VHT80P80 have further debug work to do as it does not yet seem to be consistently set in all cases to sync from. Sponsored by: The FreeBSD Foundation (cherry picked from commit f9c7a07d7f5e1c3694b463423c43051451b61e87) --- sys/compat/linuxkpi/common/src/linux_80211.c | 133 +++++++++++++++++++-------- 1 file changed, 96 insertions(+), 37 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 5ecfdf495948..aece603bb763 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -367,19 +367,17 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) #if defined(LKPI_80211_HT) static void -lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *ht_rx_nss) +lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) { struct ieee80211vap *vap; uint8_t *ie; struct ieee80211_ht_cap *htcap; int i, rx_nss; - if ((ni->ni_flags & IEEE80211_NODE_HT) == 0) + if ((ni->ni_flags & IEEE80211_NODE_HT) == 0) { + sta->deflink.ht_cap.ht_supported = false; return; - - if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && - IEEE80211_IS_CHAN_HT40(ni->ni_chan)) - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + } sta->deflink.ht_cap.ht_supported = true; @@ -401,43 +399,116 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, i sta->deflink.ht_cap.cap = htcap->cap_info; sta->deflink.ht_cap.mcs = htcap->mcs; + if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0) + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + + /* + * 802.11n-2009 20.6 Parameters for HT MCSs gives the mandatory/ + * optional MCS for Nss=1..4. We need to check the first four + * MCS sets from the Rx MCS Bitmask; then there is MCS 32 and + * MCS33.. is UEQM. + */ rx_nss = 0; - for (i = 0; i < nitems(htcap->mcs.rx_mask); i++) { + for (i = 0; i < 4; i++) { if (htcap->mcs.rx_mask[i]) rx_nss++; } - if (ht_rx_nss != NULL) - *ht_rx_nss = rx_nss; + if (rx_nss > 0) + sta->deflink.rx_nss = rx_nss; - IMPROVE("sta->wme, sta->deflink.agg.max*"); + IMPROVE("sta->wme"); + + if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_7935; + else + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_3839; + sta->deflink.agg.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA; +#ifdef __handled_by_driver__ /* iwlwifi only? actually unused? */ + for (i = 0; i < nitems(sta.deflink.agg.max_tid_amsdu_len); i++) { + sta->deflink.agg.max_tid_amsdu_len[j] = ; + } +#endif } #endif #if defined(LKPI_80211_VHT) static void -lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *vht_rx_nss) +lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) { + uint32_t width; + int rx_nss; + uint16_t rx_mcs_map; + uint8_t mcs; - if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) + if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) { + sta->deflink.vht_cap.vht_supported = false; return; + } - if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { -#ifdef __notyet__ - if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) { - sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; /* XXX? */ - } else + sta->deflink.vht_cap.vht_supported = true; + + sta->deflink.vht_cap.cap = ni->ni_vhtcap; + sta->deflink.vht_cap.vht_mcs = ni->ni_vht_mcsinfo; + + width = (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); + switch (width) { +#if 0 + case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ: + case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ: + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; + break; #endif - if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + default: + /* Check if we do support 160Mhz somehow after all. */ +#if 0 + if ((sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) != 0) sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; - else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + else +#endif sta->deflink.bandwidth = IEEE80211_STA_RX_BW_80; } - IMPROVE("VHT sync ni to sta"); - return; + + rx_nss = 0; + rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; + for (int i = 7; i >= 0; i--) { + mcs = rx_mcs_map >> (2 * i); + mcs &= 0x3; + if (mcs != IEEE80211_VHT_MCS_NOT_SUPPORTED) { + rx_nss = i + 1; + break; + } + } + if (rx_nss > 0) + sta->deflink.rx_nss = rx_nss; + + switch (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK) { + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_11454; + break; + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_7991; + break; + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895: + default: + sta->deflink.agg.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_3895; + break; + } } #endif +static void +lkpi_sta_sync_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) +{ + +#if defined(LKPI_80211_HT) + lkpi_sta_sync_ht_from_ni(sta, ni); +#endif +#if defined(LKPI_80211_VHT) + lkpi_sta_sync_vht_from_ni(sta, ni); +#endif +} + static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, const char *_f, int _l) @@ -480,8 +551,6 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], struct ieee80211_vif *vif; struct ieee80211_sta *sta; int band, i, tid; - int ht_rx_nss; - int vht_rx_nss; lsta = malloc(sizeof(*lsta) + hw->sta_data_size, M_LKPI80211, M_NOWAIT | M_ZERO); @@ -581,18 +650,9 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; sta->deflink.rx_nss = 1; - ht_rx_nss = 0; -#if defined(LKPI_80211_HT) - lkpi_sta_sync_ht_from_ni(sta, ni, &ht_rx_nss); -#endif - vht_rx_nss = 0; -#if defined(LKPI_80211_VHT) - lkpi_sta_sync_vht_from_ni(sta, ni, &vht_rx_nss); -#endif + lkpi_sta_sync_from_ni(sta, ni); - sta->deflink.rx_nss = MAX(ht_rx_nss, sta->deflink.rx_nss); - sta->deflink.rx_nss = MAX(vht_rx_nss, sta->deflink.rx_nss); - IMPROVE("he, ... smps_mode, .."); + IMPROVE("he, eht, bw_320, ... smps_mode, .."); /* Link configuration. */ IEEE80211_ADDR_COPY(sta->deflink.addr, sta->addr); @@ -2531,10 +2591,9 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IMPROVE("net80211 does not consider node authorized"); } -#if defined(LKPI_80211_HT) + sta->deflink.rx_nss = MAX(1, sta->deflink.rx_nss); IMPROVE("Is this the right spot, has net80211 done all updates already?"); - lkpi_sta_sync_ht_from_ni(sta, ni, NULL); -#endif + lkpi_sta_sync_from_ni(sta, ni); /* Update sta_state (ASSOC to AUTHORIZED). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); From nobody Wed Feb 26 23:46:15 2025 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 4Z3B1z61Vhz5pBKk; Wed, 26 Feb 2025 23:46:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B1z2f52z3pVf; Wed, 26 Feb 2025 23:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613575; 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=4x/VpMiGv3LJo8Z4InmBKoZT11LKsdrQBGDpyJfWHE8=; b=Z7zE8eMmfb1826A/zr2qDGTH+mz5KFtYgObIEYPARl7//JsQJHCcfb1RGqvDGcYbiSegAR VBrrhJqPuMS2lDMl3SwWxgAPdRXuf8ThemklKf/6oHuSUFjs2KrxB+/S27Pdm0iuWSwGNR POa8j4pW4R7BLt30g7W7z/WW+U6Pz8HRW0YnwqF6FAeMkGD5Eo0fC8vpV32ICVpYa5S4Q7 mT6TN37PUs/0A9Hyb65BgN2zS21G5T791283CzSM4LXr8LlmsZaBGVMColfJFARpYBMGIt y3oK8b1Jk+2zHGNzyF9uToDgyEChdUatTQSww5naejf09Rn3VPFmpQoEmx3YZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613575; a=rsa-sha256; cv=none; b=Rx9SToQB5MvUtuV0s/K8EpduN1i3sQHIADdpsLWdN09pcNvRbXzv1W8eRqBxH5y1t5WlQT OLG7TgzHKMNe7oMWmBNH7hQZmWqe3Mxz9OkyrAdu3IujLloRVTvo9HBi+yK9mSkWicp9LG XM3y3JO4K+qfMARbupJ+NqLqMDnveEVvo2lzRM5V2XESZBhNTb+XZXzKhr+1UljKm2yLkJ MCP7IYdFyByVmiTgbzoVXZawV2ltL6ZYVKqfxJfn5OyAI0w5d24xtkufr2t51i8JHNLX0B DnyuUX+cWXRoxtu0Pq9bEDkcrj3Hz+BPPtbYFj7GXvu3rXAw3ybziGjPqACCGg== 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=1740613575; 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=4x/VpMiGv3LJo8Z4InmBKoZT11LKsdrQBGDpyJfWHE8=; b=PuNibdx+LYAy2h9NAr/qfArA0rfQonVxefflG7y2BqiBMgIupprQw0EoQcW5yuvL3vnWRC LWC5g/95O4A30n9U70AvEwGBjlNUJTfHuGOohP/pm1u3WW+tEMiceYnQGnpxGbJoyP5f74 WAIGhNspyZmaZ3Ta+0FAE50HPtPiliUb9Tsp6A+Uy0PBRIAcXo/BBd9TYn/gRi7++e+H02 9B6+gGnf2t/OqCarDvIN1Urb0MLdOao1jsCwn6ShkEkv9FecDr1GQmRYSHfE/C4eij7nLF yU65EZh3Gm3qy1M7SSaOiequ1er5I0vuRb3n32beNnwsvM6wVHiEbZ8hIdFNKw== 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 4Z3B1z27Dvz315; Wed, 26 Feb 2025 23:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkF8p086589; Wed, 26 Feb 2025 23:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkFpR086586; Wed, 26 Feb 2025 23:46:15 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:15 GMT Message-Id: <202502262346.51QNkFpR086586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 56bc8d57d361 - stable/14 - LinuxKPI: 802.11: disable A-MDPU TX for now for LinuxKPI WiFi drivers 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 56bc8d57d3614ad34098f3542126f978b3d34db2 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=56bc8d57d3614ad34098f3542126f978b3d34db2 commit 56bc8d57d3614ad34098f3542126f978b3d34db2 Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 02:24:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: disable A-MDPU TX for now for LinuxKPI WiFi drivers Clear IEEE80211_FHT_AMPDU_TX from iv_flags_ht to avoid doing A-MPDU TX. For Intel we need to support two different variations at least, both likely needing net80211 surgery first. The good news is that turning it off in net80211 will make it work for modern iwlwifi/mvm chipsets/fw. Realtek will need some mac80211 functions to be implemented at least. Once we've done all and tested one after the other we can remove this again. Sponsored by: The FreeBSD Foundation (cherry picked from commit ac2c7271b7c2624d7cf3af6bdaf82b00323edfd3) --- sys/compat/linuxkpi/common/src/linux_80211.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 01d023f80257..4504a8f4f513 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3529,6 +3529,10 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], if (!lkpi_hwcrypto && ieee80211_hw_check(hw, AMPDU_AGGREGATION)) vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_RX; #endif +#if defined(LKPI_80211_HT) + /* 20250125-BZ Keep A-MPDU TX cleared until we sorted out AddBA for all drivers. */ + vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_TX; +#endif if (hw->max_listen_interval == 0) hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval); From nobody Wed Feb 26 23:46:16 2025 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 4Z3B205trdz5pBqc; Wed, 26 Feb 2025 23:46:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3B2045nCz3pSR; Wed, 26 Feb 2025 23:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740613576; 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=PbhWmySCt2SlHn4mBXsM1tvQtILURnFo2v8BoUwmsQg=; b=nn4cnnDxohKrKbGm5+V/6Vx45WiXLncIXfuNzCFWyEjyYjYD/iiG4By28RpBhNH50YiCN5 nd1EFi0Rn17SY3zZeMDD7lLSFJdWKLG1XBE/WF4P6BSH+wYRxIk5oO0StucDdwE4Sj5XrO SFPkPp46dQbZlfc+y9YZexciLMaGl/LX6WdvWJhPvssfMFWjNu6Eq8+BMC97RR96D5maPD rZnIT5jN0BMm8BT1qsgLy/9HxvKGAofOIc0CIphMJQEBjUflKyCzTIxXrH9Ej/OnpgOk8Y RPySWGamlCRRUPZiu5DVPrsSYmEd6hlLKwAUyQ1NWR2xDHQ5yhwtef8PvFlutQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740613576; a=rsa-sha256; cv=none; b=eNvr6E0Kf1tJFa/A5WmHOJ6QIFqjTjmqa4nngqM8YEVx7xkWn9mgIm5txaMulNIEYJZSFj m+A++LWxAb0/h03u9oo1IDjMi5L1lVVMnG5S9L1UCnVH9bocHGhZoM3k9e3Y2ig7pgc24m xxC1QzHWAIoEkL2S9iBKSoalpbjW7Tc7oKR7JGZu5CW0GRnmjL5rQZZHxt+vaFYtIlgvid bG3pexLWF41zOkzdjIjvdEAMTRR6gxbGgBslox5SbMo7ZBNBmwEDcX/71I10ukWnX7Rxet joKF7uaMpVo5OKdoB2NLt67TQbd6wGLArELlnAtzC+ZA1MPruNMTI0gIEAizuw== 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=1740613576; 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=PbhWmySCt2SlHn4mBXsM1tvQtILURnFo2v8BoUwmsQg=; b=eYUHo6BG0AY9hDHJa4zFZubNYFRpR6dVY0HR+n4sfA+p3KdgQ9YrbH63E8kIYs6j/sh+U/ HCGaKHxd9xcOUIewUqjuoUa6YA8Ch2W4ywHolOu3VtPH+93Fh2CXEhfD578UAlExr8W7NR AhunJbfYCPD0u7Je5h+9luVd/7kzwuRjP/OiVF/xs5HqEI5roHvXy+cmHjIq6OzvuKAE3c 6xIf5A/+bmmAU6RoqGhj1zP2xISAa4TI2Uo91DMH8pp+P/+yQgD+wGY49uagFVIGhoaMTL XG+vTPEKyJvIhgllGg5AQeaewpOpI6867/YedGKDxKR9vsBoOew/8/Vogt7ZaQ== 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 4Z3B203PfJz2lb; Wed, 26 Feb 2025 23:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QNkGi9086628; Wed, 26 Feb 2025 23:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QNkGb7086625; Wed, 26 Feb 2025 23:46:16 GMT (envelope-from git) Date: Wed, 26 Feb 2025 23:46:16 GMT Message-Id: <202502262346.51QNkGb7086625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7117d83bae36 - stable/14 - LinuxKPI: 802.11: factor out dynamic_rx_chains computation 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 7117d83bae368d9240b2596d9db26423877ff4f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7117d83bae368d9240b2596d9db26423877ff4f0 commit 7117d83bae368d9240b2596d9db26423877ff4f0 Author: Bjoern A. Zeeb AuthorDate: 2025-02-24 02:43:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-26 23:45:57 +0000 LinuxKPI: 802.11: factor out dynamic_rx_chains computation For the moment we set dynamic_rx_chains to the rx_nss value which should be correct given we count from 1 there too and we call lkpi_get_max_rx_chains() after we synced ht/vht initially already. Long-term some of these counting bits should be further factored out into their own functions and used both here and for the sync code. This will likely want to change as well once more dyamic synncronization takes place. Sponsored by: The FreeBSD Foundation (cherry picked from commit 389265e3ca827ad88b3b8ad787251471161d6634) --- sys/compat/linuxkpi/common/src/linux_80211.c | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 4504a8f4f513..b7d3d7a298fc 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -509,6 +509,33 @@ lkpi_sta_sync_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) #endif } +static uint8_t +lkpi_get_max_rx_chains(struct ieee80211_node *ni) +{ + uint8_t chains; +#if defined(LKPI_80211_HT) || defined(LKPI_80211_VHT) + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); +#endif + + chains = 1; +#if defined(LKPI_80211_HT) + IMPROVE("We should factor counting MCS/NSS out for sync and here"); + if (sta->deflink.ht_cap.ht_supported) + chains = MAX(chains, sta->deflink.rx_nss); +#endif + +#if defined(LKPI_80211_VHT) + if (sta->deflink.vht_cap.vht_supported) + chains = MAX(chains, sta->deflink.rx_nss); +#endif + + return (chains); +} + static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, const char *_f, int _l) @@ -1726,8 +1753,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf = &lchanctx->chanctx_conf; } - chanctx_conf->rx_chains_dynamic = 1; chanctx_conf->rx_chains_static = 1; + chanctx_conf->rx_chains_dynamic = 1; chanctx_conf->radar_enabled = (chan->flags & IEEE80211_CHAN_RADAR) ? true : false; chanctx_conf->def.chan = chan; @@ -1758,6 +1785,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf->def.width = NL80211_CHAN_WIDTH_80; } #endif + chanctx_conf->rx_chains_dynamic = lkpi_get_max_rx_chains(ni); /* Responder ... */ #if 0 chanctx_conf->min_def.chan = chanctx_conf->def.chan; From nobody Thu Feb 27 00:51:39 2025 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 4Z3CTR5zGkz5pKjR; Thu, 27 Feb 2025 00:51:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CTR5Jp6z3glm; Thu, 27 Feb 2025 00:51:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617499; 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=m85gEVlXRIxd3lIxL4yHaw515ojrbTnCEAfMpaxrv24=; b=aWq7ocGb+8L0e/bOtLk1DRIruYA9akmv2z1c7KjnNDN8QsGsBBmkNBCrnXdUFxCkMDlMl1 7PWhvzajzvJN9MjitakMZy7mQ5w2uhnV/042ZL8UWSPU+zE0DSUna9UaV8NxusxLy/LAzp 4Apg6eTE6fIzSEaKAtxjd2sED4Xc/WJrDKlqieEd4PiVwwK0xIkP1l33StybCTqKzfcVwI kYwwseeyE4LZbset+2nvV1pOE5Wd7OT6cIypNlqHS0tDVknSfi3OFzyh9ToS+XlypVaVC/ cml5htUntTCvb5d9PW8kIFgLOIz0+Yy0rGZ20PamRtWaZk4nXUYiC05qxgEpMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740617499; a=rsa-sha256; cv=none; b=jo+7VsWIApIr9MHMUhQAEREixRKs4qj7EKmy6lkbTlZmDGAXzF8eLRsmvJq6BEwbNr4bes XtCNFTXG1usMg1VWQAm4bCCKrJgigXcOxoXt8yB/YwWYfsqpTMHLeO8yE/ubwiXL8rwobc 2uI135KLWIiY31ZyRNbyNpGpffnE/JHBRUkcXVMWxR4lBX9PsOuhpOtpK18rHppOenpWTW o2vdUAVbkK/Mr3wXyYgzjUt/DMvcUNDM2HE+GU4aUkn4NMNhbuV88k8Pu/c3RgPpabCk0h R1xFU2ym6HrzN51Nt3aHX6AxFo7PtO0m2/lUQ0Eba2uX1gLDRAkTL/6vglxUkw== 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=1740617499; 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=m85gEVlXRIxd3lIxL4yHaw515ojrbTnCEAfMpaxrv24=; b=tSw5YZxArFCThxDTtMWyN1JFIAnoj+lEcDzthUZi+Q1OJxyZnNf1nN36roRVNVhjpuSw7U 9lvEiHVV3ADD0gfmxMqtTf1FM/EQircoKJl0ZKosYKN5EwuQcT+xvJFzRfD4Q3FT7ic/wI IdeQrkcwfFSZonwhwVVzDBqwPGCk68JnHMHWq8aWP/4K7HFmOrdFlBl7ifLjEbwmXIRoU/ cYCuvHMztlh04Q6ctYIi8Slx7rtMwtHi2tz0IYdb7+1lCWZAuO59eRlFDPvTu7kEFFIOC1 5QuU1S/UUlxNcQmR1lNO2ji4oFc4IFGVNf4QUjlBnnhm5D5y5/fqhmTYI11FwQ== 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 4Z3CTR4Qnxz5Cr; Thu, 27 Feb 2025 00:51:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R0pdpb011525; Thu, 27 Feb 2025 00:51:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R0pd1D011522; Thu, 27 Feb 2025 00:51:39 GMT (envelope-from git) Date: Thu, 27 Feb 2025 00:51:39 GMT Message-Id: <202502270051.51R0pd1D011522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 1ff76f6ddefa - stable/14 - gstat: Sync usage/synopsis + tag SPDX 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ff76f6ddefa66d9b37c6781943db143f0e2d29c Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=1ff76f6ddefa66d9b37c6781943db143f0e2d29c commit 1ff76f6ddefa66d9b37c6781943db143f0e2d29c Author: Alexander Ziaee AuthorDate: 2025-02-03 02:15:26 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 00:51:00 +0000 gstat: Sync usage/synopsis + tag SPDX Sort options using the slightly unusual convention used here as well. MFC after: 3 days Approved by: carlavilla (mentor), imp (src) Differential Revision: https://reviews.freebsd.org/D48800 (cherry picked from commit 8b35839346d0bd8d4244018489bfdef8fd48de53) --- usr.sbin/gstat/gstat.8 | 17 ++++++++++------- usr.sbin/gstat/gstat.c | 8 ++++---- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/usr.sbin/gstat/gstat.8 b/usr.sbin/gstat/gstat.8 index d328d26be23c..02dbbbc54a3d 100644 --- a/usr.sbin/gstat/gstat.8 +++ b/usr.sbin/gstat/gstat.8 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2003 Giorgos Keramidas .\" All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 1, 2021 +.Dd February 1, 2025 .Dt GSTAT 8 .Os .Sh NAME @@ -30,7 +33,7 @@ .Nd print statistics about GEOM disks .Sh SYNOPSIS .Nm -.Op Fl abBcdops +.Op Fl abBcCdops .Op Fl f Ar filter .Op Fl I Ar interval .Sh DESCRIPTION @@ -75,11 +78,6 @@ Only devices with the names matching will be displayed. The format of the regular expression is described in .Xr re_format 7 . -.It Fl o -Enable display of statistics for other operations -.Pq Dv BIO_FLUSH . -.It Fl s -Enable blocks' size statistics. .It Fl I Ar interval Refresh the .Nm @@ -92,8 +90,13 @@ or .Cm us (the default) indicates that the update interval is specified in seconds, milliseconds, or microseconds, respectively. +.It Fl o +Enable display of statistics for other operations +.Pq Dv BIO_FLUSH . .It Fl p Only display physical providers (those with rank of 1). +.It Fl s +Enable blocks' size statistics. .El .Sh INTERACTIVE COMMANDS These commands are currently recognized if diff --git a/usr.sbin/gstat/gstat.c b/usr.sbin/gstat/gstat.c index 887ae9dbee16..c650f7120a40 100644 --- a/usr.sbin/gstat/gstat.c +++ b/usr.sbin/gstat/gstat.c @@ -141,9 +141,6 @@ main(int argc, char **argv) "Invalid filter - see re_format(7)"); strlcpy(f_s, optarg, sizeof(f_s)); break; - case 'o': - flag_o = 1; - break; case 'I': p = NULL; i = strtoul(optarg, &p, 0); @@ -158,6 +155,9 @@ main(int argc, char **argv) i *= 1; flag_I = i; break; + case 'o': + flag_o = 1; + break; case 'p': flag_p = 1; break; @@ -615,7 +615,7 @@ out: static void usage(void) { - fprintf(stderr, "usage: gstat [-abBcCdps] [-f filter] [-I interval]\n"); + fprintf(stderr, "usage: gstat [-abBcCdops] [-f filter] [-I interval]\n"); exit(EX_USAGE); /* NOTREACHED */ } From nobody Thu Feb 27 00:52:29 2025 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 4Z3CVQ2W3dz5pKTw; Thu, 27 Feb 2025 00:52:30 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CVP4TYRz3hT3; Thu, 27 Feb 2025 00:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617549; 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=CwJKxHWUrECuI6sKUvlOLQzv6bGUj4fCnoBnxa2p8PI=; b=igJtcga87VQhuQpSSK++K9NIKigtyL2c9b0bpx1R/kYmY0rGKEx35y06IGP0yJ83CKdpNo FgkEYQKJLUGm8s9UxVIRiL5t4tu6U3+Og/EB4Xz9MedkGTE7g6Auc38Vz7lOvSicvkTPQf ABQBMPdGv0o6istBO9aCFW2iBhqYvDUWZBNOPdTsCCFzqzuJx2Qw4o3KVFI9Vcf5pOaucH HcWNsSjdWn04YXqF0TftgluDyr0suquffh3pD2smW11Yp1zCxFuZmafA+3dIkngl2XDc01 jYHK+yxctjx1RmL3pw+sKSGer6IE1/t+ip8BS+T1rD8m/toQLftXqyKmpzuZsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740617549; a=rsa-sha256; cv=none; b=O7gV+zHdGhUNAhLO9A8TQtlGPnDePNu3KYg98wZWUHxJHc6YU0BaQDm64P7tQ08n/lnXvU 6iNKyuM84kNFt/aViYaS3zpVyqlQETLtx/zp9u6AQep+/XtsQpdeh2KiirXd8llO/UheDE jMKnx8pZeMkR/1WmKRuO4yOMh3U0a4HrWNrnUwCFb6QANZJ2wP8TvS7MlxPr/8z3I7MfTa 3B+e9WPKfFdAaFBa8A1e6qTBfGqW9WI8U5WU6oRz9v50T/F3uJRKaJEZxFYk8qymDeMTVL UEmEJX85o/E0A73izbFo3AwSQt4lzvyKqZT4hDl5u45b9dJ7n9vnAYTUtbsCHA== 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=1740617549; 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=CwJKxHWUrECuI6sKUvlOLQzv6bGUj4fCnoBnxa2p8PI=; b=Tn0LWAe7z50VK/MW6K7hza6x4Sijhaw8sq/nqyjPqXxzdmZPUrIgqwogkMaS59+U5dtirn sozUOItbgKkb+LQHcdx7IvjlUEY0T6obq/s2M0eetKT65XqR5Feu5z91syCw0b98Rvsbfm vmUKsxMWdycIXbtKPpAVkQtL+Nnxt7STP8kSVuPEvRqC+SJ5PyyH9GAjVwDpBKTlV95ao4 EuAtX8lnfjPQrn4p8fHc4IjizlSjn4nVr1vktp7p3LqbFmNMDJ1h2og9RMP3//yQWh05xs c5y/0+7wXo7BEulK7Vy9U3HZIv2s2IKyJEzWNytn7cPojeSUxvCsr1NZTEsvpw== 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 4Z3CVP44mWz4dr; Thu, 27 Feb 2025 00:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R0qTph016114; Thu, 27 Feb 2025 00:52:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R0qTRp016092; Thu, 27 Feb 2025 00:52:29 GMT (envelope-from git) Date: Thu, 27 Feb 2025 00:52:29 GMT Message-Id: <202502270052.51R0qTRp016092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 3cedc5a9f14b - stable/14 - resizewin.1: Fix option list width typo + spdx 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3cedc5a9f14b7ccd93448141ceb37434dfd15009 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3cedc5a9f14b7ccd93448141ceb37434dfd15009 commit 3cedc5a9f14b7ccd93448141ceb37434dfd15009 Author: Alexander Ziaee AuthorDate: 2025-02-03 20:24:32 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 00:52:19 +0000 resizewin.1: Fix option list width typo + spdx MFC after: 3 days Accepted by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48349 (cherry picked from commit 4a5d51e73e48b27d90b21ed26999b23208f603d8) --- usr.bin/resizewin/resizewin.1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/resizewin/resizewin.1 b/usr.bin/resizewin/resizewin.1 index f917209f2c90..ba4abe53ea1d 100644 --- a/usr.bin/resizewin/resizewin.1 +++ b/usr.bin/resizewin/resizewin.1 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" resizewin .\" .\" Query terminal for size and inform the kernel @@ -44,7 +47,7 @@ the size known to the kernel using the ioctl. .Pp The following options are available: -.Bl -tag -width ".Fl z" +.Bl -tag -width "-z" .It Fl z Do nothing unless the current kernel terminal size is zero. This is useful when run from a user's profile (shell startup) scripts: From nobody Thu Feb 27 00:53:51 2025 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 4Z3CWz56zVz5pKRg; Thu, 27 Feb 2025 00:53:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CWz4bRjz3jbG; Thu, 27 Feb 2025 00:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740617631; 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=bL4DZErqpG1xn/4Rc5/3toIQjVtgDfXe95BKi1PcBbI=; b=fpHLJLzoxwanWmIKO4nOYO+LHOWAMvA+TY674HW7PcIUMga5zqFvTSC+Ags9BTnBrNmxN7 X9mF2KxeciHksYb1L2ETdhK+J4eSZu5iWamU8tjaCic3yjjCVDVhfRO70F7U953R4TWyhY 9zuXc+scsZBqFkZmyMoCCdrxn6Ee/h8lqMx3tNNSfW767EzvHdvvNrBcIeOSGEZ7OO7uNA NTFwkxYSnGjhnddik3Tq6Ar+MLnjX+paPlVyOn5fLdLHUI7y7f36fOJdXlz9nhkBFULxq8 ioYbnWw5uaauyDCzuxunF4a8Tfb/+c2NKo4fRN5e10nJNbwvoekvXoFXPBrewQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740617631; a=rsa-sha256; cv=none; b=qeAONmA2JXvIu0wKSUz3JQL/37+sNfhibh7UCzIMKoikdzwk5H5vFiir6UGW6X5MLgItaB SnfvBMFiGDexKAiMsjZjybFIQ5NFHse/t670KfHa+adP8RgX+TEXA6XmaB2z5X9aQuyNNn 2IJSZQmbqOWmVfxJu1GoAWlGwjkWkljV10numczqXeyrI2okRYfO53HqSqJEtyNzQd5zAz 6Y/fbQb1wrXedb8Whuj/lS6kEtHbppBKCi5wLTLB1Uxhui6cjzFjtfUxf7896dd/fKxdbx a7ede4MNx9U84L9b3y+DGEGP7Z4J0NGjfyUfYvaqkpeNcoo8i/0vsHmcHCoE9w== 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=1740617631; 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=bL4DZErqpG1xn/4Rc5/3toIQjVtgDfXe95BKi1PcBbI=; b=Jyb9eNCyRFCNJjQRyZW7bfnGJq+giU9x23gq8P+MwBUrpdwSUvutM02G0NaBj0QZwET7Ur JYo47aqquWUXcjWm0J37S1VCJDyMWrlEvNcPu62Sa7rznUgNSemmXtuj64/PDx/E1vNi2V AiX+fgeJlgDSW3ElAQWN3JhEnePn2eTf8b5/YjKJBrfW5LWfh1AQ84xVzMlNh0SzXBBe7y LpOQJ+i9xQO7f9fJX5gjmJvUTH6JCohweAkXe0TNJzcGRdSkdz2qTB6kGF+hXz98xEpt2F Q4XDa0QLx6LGO8HNSbZypcKw3XQLetYCH3TGT3hP15gqhafdnFwP3AO1cSXg1Q== 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 4Z3CWz47PGz4r2; Thu, 27 Feb 2025 00:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R0rpXO016777; Thu, 27 Feb 2025 00:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R0rpgZ016774; Thu, 27 Feb 2025 00:53:51 GMT (envelope-from git) Date: Thu, 27 Feb 2025 00:53:51 GMT Message-Id: <202502270053.51R0rpgZ016774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 9d32e928c207 - stable/14 - motd.5: Mention /etc/motd + alignment polish 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d32e928c207154b4a1385284f537f2fcbdf6855 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=9d32e928c207154b4a1385284f537f2fcbdf6855 commit 9d32e928c207154b4a1385284f537f2fcbdf6855 Author: Alexander Ziaee AuthorDate: 2024-12-14 21:49:33 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 00:53:38 +0000 motd.5: Mention /etc/motd + alignment polish + description: Space example by writing a little cleaner + files: Align files list width + explain /etc/motd link MFC after: 3 days Reviewed by: mhorne, rpokala Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48085 (cherry picked from commit 404802777003b7fb37ca8013fe938eaa4de36103) --- share/man/man5/motd.5 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/share/man/man5/motd.5 b/share/man/man5/motd.5 index 5dce1ccd52ae..109fc4e56ca4 100644 --- a/share/man/man5/motd.5 +++ b/share/man/man5/motd.5 @@ -2,7 +2,7 @@ .\" .\" This file is in the public domain. .\" -.Dd October 18, 2020 +.Dd December 14, 2024 .Dt MOTD 5 .Os .Sh NAME @@ -25,9 +25,8 @@ and the contents are written to can be updated without a system reboot by manually restarting the motd service after updating .Pa /etc/motd.template : -.Bd -literal -offset indent -compact -service motd restart -.Ed +.Pp +.Dl service motd restart .Pp Individual users may suppress the display of this file by creating a file named @@ -35,7 +34,10 @@ creating a file named in their home directories or through .Xr login.conf 5 . .Sh FILES -.Bl -tag -width $HOME/.hushlogin -compact +.Bl -tag -width "/etc/motd.template" -compact +.It Pa /etc/motd +Symbolic link to +.Pa /var/run/motd . .It Pa /etc/motd.template The template file that system administrators can edit. .It Pa /var/run/motd From nobody Thu Feb 27 01:13:56 2025 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 4Z3Cz91Ncyz5pMyY; Thu, 27 Feb 2025 01:13: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Cz90lBCz3vnG; Thu, 27 Feb 2025 01:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618837; 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=pSq+R4AmZ8UCHAxiYJRESisnLBUu7ewNb7AIXnzNBpE=; b=BlDiEUDqMXrvNoukObdrgAyHNFC+8+pYBZEfn6ltCoj+0Eyf8BfVhPIIMHSXNvW8zI+pKS V4m+lW1RnQLS7M7pUnVM97NaO9mON/dDI2MFBKs8QlQ6BFROytY3Mc0f/EgynwZfOg0lGT pveTMBm6qLCJD6dNGYdSrQ9dhqPbwFZOX9e3+jl6tpaSwCjCOggHqRLbY1zYXBhORMOILZ 23F0lwtA0k+dZelltG1a59Ki6dessR/60eeBF4kS+OrOq0CDtnmSMFP7pkT6+EMI+rpq5a NWP+py5Ey1r8BQnOA7zousLPPT176bUJBK5pnm0PhBO0am9j2EjddJhwPYw7yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740618837; a=rsa-sha256; cv=none; b=DV/0hNfngSwU5Ic/3b3niVoyoA40duU9GU9Wz6Wk1j2UQtV7wZjl7tIlKaJ1hhLXmWFXQA dcfjhwPOnINEAOu4XcqnC/dbQlpzRSFQ/1uz5oCktC0S1U8EF1N0nCGxeLUwu+WDuMNaEE tTyUv9YUihMOizEbZr+AseWVdVkZoBV7G3YwJhvxoJicp6VcyEKI3hK1+ORVUfuXYo5SPS PW89+4b5EdexjN74pPyxWgr85rlC9Xc3/SyfSC3LLSMmi/RFM+pSAo6u8tO5y7qMqV+n5d zL3LGZdYLFOwNuH338bvoLYkpR21FdatvDGiw6mh9RqQm6PYqDntgo1FMTbgKQ== 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=1740618837; 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=pSq+R4AmZ8UCHAxiYJRESisnLBUu7ewNb7AIXnzNBpE=; b=hjdk/0yIPwY3ZqdB88jCuvzunukqugTsEbP9oYcQMvUG8oIofamUAuGgY5qeLlB8JkJrKz CY504zOWurLzNp3za4MoGNar2/gJOciXIStuveRGIjLUh9Ei6S0zXy22Lgp20qa7Ky9PvR /mNCnsmn4eDkJuaiVprYuNDRf98varDt4/zJYT0yelJal6kUZ5IYNdP7oeanpc7bwwv/WI K5OOtXRy9IEG4xROJkg57VgqrKRX/KP+DVBE1c/tMtM64qkDsL4B7uQ8Y/u5r14VVW17kr Jljt5sFzlnQzhNBYf2iTNr7Vhw6dsGqZ/Z+eG2pdvD3xIa9QrfkyhnGV+yXdqQ== 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 4Z3Cz90KjBz5rY; Thu, 27 Feb 2025 01:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1DuuM054713; Thu, 27 Feb 2025 01:13:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1DuQn054710; Thu, 27 Feb 2025 01:13:56 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:13:56 GMT Message-Id: <202502270113.51R1DuQn054710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 4e2ab411ce62 - stable/14 - make_dev.9: Fix mda_cr typo + polish 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4e2ab411ce6239d7918eacfd1c4725bfc9508fa5 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=4e2ab411ce6239d7918eacfd1c4725bfc9508fa5 commit 4e2ab411ce6239d7918eacfd1c4725bfc9508fa5 Author: Alexander Ziaee AuthorDate: 2025-02-11 20:42:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 00:55:14 +0000 make_dev.9: Fix mda_cr typo + polish The make_dev_args_init structure example said mda_cred, however the correct form is mda_cr according to the reporter and my git grep. A new document description has been contributed by jhb. While here, fix grammar and trivial typos (spacing, colons before examples, trailing delimiter) and spdx. MFC after: 3 days Reported by: jhb (much polish and document description) Reported by: Evgenii Ivanov on Community Discord Reviewed by: carlavilla, mhorne, jhb, kib Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48516 (cherry picked from commit c48ca725a83c0c8b27210d50977835c0b916bf07) --- share/man/man9/make_dev.9 | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/share/man/man9/make_dev.9 b/share/man/man9/make_dev.9 index 2beb38586593..052f9a0cfd87 100644 --- a/share/man/man9/make_dev.9 +++ b/share/man/man9/make_dev.9 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1999 Chris Costello .\" All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 2, 2016 +.Dd January 19, 2025 .Dt MAKE_DEV 9 .Os .Sh NAME @@ -38,9 +41,7 @@ .Nm destroy_dev_sched_cb , .Nm destroy_dev_drain , .Nm dev_depends -.Nd manage -.Vt cdev Ns 's -and DEVFS registration for devices +.Nd create and destroy character devices including devfs registration .Sh SYNOPSIS .In sys/param.h .In sys/conf.h @@ -105,6 +106,7 @@ struct make_dev_args { void *mda_si_drv2; }; .Ed +.Pp Before use and filling with the desired values, the structure must be initialized by the .Fn make_dev_args_init @@ -166,10 +168,10 @@ member of the initialized The .Va args.mda_flags argument alters the operation of -.Fn make_dev_s. +.Fn make_dev_s . The following values are currently accepted: .Pp -.Bl -tag -width "It Dv MAKEDEV_CHECKNAME" -compact -offset indent +.Bl -tag -width "MAKEDEV_CHECKNAME" -compact -offset indent .It Dv MAKEDEV_REF reference the created device .It Dv MAKEDEV_NOWAIT @@ -200,12 +202,13 @@ is specified. .Pp The .Xr dev_clone 9 -event handler shall specify +event handler shall specify the .Dv MAKEDEV_REF -flag when creating a device in response to lookup, to avoid race where -the device created is destroyed immediately after -.Xr devfs_lookup 9 -drops his reference to cdev. +flag when creating a device in response to lookup, to avoid a race where +the created device is immediately destroyed after +.Fn devfs_lookup +drops its reference to +.Fa cdev . .Pp The .Dv MAKEDEV_ETERNAL @@ -226,13 +229,14 @@ and the device name is invalid or already exists. .Pp The .Fn make_dev_p -use of the form +use of the form: .Bd -literal -offset indent struct cdev *dev; int res; res = make_dev_p(flags, &dev, cdevsw, cred, uid, gid, perms, name); .Ed -is equivalent to the code +.Pp +is equivalent to the code: .Bd -literal -offset indent struct cdev *dev; struct make_dev_args args; @@ -241,7 +245,7 @@ int res; make_dev_args_init(&args); args.mda_flags = flags; args.mda_devsw = cdevsw; -args.mda_cred = cred; +args.mda_cr = cred; args.mda_uid = uid; args.mda_gid = gid; args.mda_mode = perms; @@ -250,10 +254,11 @@ res = make_dev_s(&args, &dev, name); .Pp Similarly, the .Fn make_dev_credf -function call is equivalent to +function call is equivalent to: .Bd -literal -offset indent - (void) make_dev_s(&args, &dev, name); +(void) make_dev_s(&args, &dev, name); .Ed +.Pp In other words, .Fn make_dev_credf does not allow the caller to obtain the return value, and in @@ -263,14 +268,14 @@ options, the function asserts that the device creation succeeded. .Pp The .Fn make_dev_cred -function is equivalent to the call +function is equivalent to the call: .Bd -literal -offset indent make_dev_credf(0, cdevsw, unit, cr, uid, gid, perms, fmt, ...); .Ed .Pp The .Fn make_dev -function call is the same as +function call is the same as: .Bd -literal -offset indent make_dev_credf(0, cdevsw, unit, NULL, uid, gid, perms, fmt, ...); .Ed @@ -377,7 +382,7 @@ is called, with argument .Fa arg . The .Fn destroy_dev_sched -function is the same as +function is the same as: .Bd -literal -offset indent destroy_dev_sched_cb(cdev, NULL, NULL); .Ed From nobody Thu Feb 27 01:13:58 2025 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 4Z3CzB5zXVz5pMtj; Thu, 27 Feb 2025 01:13:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CzB2X3zz3vlM; Thu, 27 Feb 2025 01:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618838; 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=/ZnVG3+val+8UZOnCZMiHqO2QKq9AMFBvh6Y3pJqEmc=; b=e5ZReXXf/mhXnzyJ3yCvhQxNxXcCurxdg8p0/Ar8xZmrLVtrEk1GeIdvzYS8xULwT5uRtQ Tn/Oc3g9tCmnlIzW5zYsz8XdhMlaOYg9db3A7yL14+F3wEvcDZR1pVHqgGQhpnYmBqZLUB 08MVKWwd37+wW51mCIAF6XITQJHYaiOrnaPgheeLZ+Uq2VztCIGoiwfbYReswc7cGbLAi7 YC2VFxFNIgeGbpApWg6fpFDikcE6hScUeCC/5eO3luu6b5COC+LHtIKMCN+qtItEBohvD2 2dsm/tOLpd589R00sXA/yQLN4G8ZEBk7IVTrW5aWosMisI1L88ENv9fSbUM7jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740618838; a=rsa-sha256; cv=none; b=vhke5NeCT0aL9AvcXC03JgsLk3aZtU8zQ68xWxm399KmBI8R3GMUkNlVfutFAl1MdFJhWy 3ukFCtO3v6T8hdAmOjn/8dljI2a/e6IzQen1J2zuM8lO3b1sPB33iyjht1xCC49DFNye7d cnpW30bZNj59q905bedixNeFSAsMIaRgzMuUwTOTmx1WGXB4OIouX+IxR6Ij0C+xhX5aTE faZNhQdWqm9k+h6pPl5L7RsCOTkQGf8oMBLPc4NTNi69l/bVm/X032d8n7q5AClqgZks+/ zkST5G+VPhD82MgDLOhSSsDC2rPuetpbhGW2EDfESoVBd9jkYcAJumMLp0shfA== 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=1740618838; 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=/ZnVG3+val+8UZOnCZMiHqO2QKq9AMFBvh6Y3pJqEmc=; b=GRz1eDaHseIohmqSNlpHDI3o4MtPTDiUcq0pj58SgA9gXwT+fWtxO8/g02o4Aou5JQUQHe 9+2mUpvaLs/9nIw+DzGSKDWo2PlozDkfvUA3DrAnjJ/Jx3wR+ruEFy6FYaefW+iHb8dQK7 DEFadc4AL/hvl5GVI1CugJXxonAym6mA4xqxQkei0j5mlCtD2vjRv5GzdfX6tn18KeUG15 zq1rduyGPk+naS3DGRwhWq2VKLr3FLlNpBTEly4JJh4HuhSmOgVIc4HDumv2DdR+P9qyB/ rlXuukGNwaf9VYfNTuB9sY9JMTLkQTBQTpNNGgerg3cvWj/xOZw+ca1OrO3Xig== 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 4Z3CzB1Wzlz5YP; Thu, 27 Feb 2025 01:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1Dwe7054747; Thu, 27 Feb 2025 01:13:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1Dwlf054744; Thu, 27 Feb 2025 01:13:58 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:13:58 GMT Message-Id: <202502270113.51R1Dwlf054744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 3b210577b85a - stable/14 - style.mdoc.5: maintenence 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3b210577b85a6dee3d5fa0bd4ac48b45bcf6ce23 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3b210577b85a6dee3d5fa0bd4ac48b45bcf6ce23 commit 3b210577b85a6dee3d5fa0bd4ac48b45bcf6ce23 Author: Alexander Ziaee AuthorDate: 2024-04-12 22:28:12 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:13:30 +0000 style.mdoc.5: maintenence - description: increase visibility by s/file/manual page/ - examples: s/No Doing Something/Doing Something/ - examples: remove depreciated .Li macro - examples: remove extra newline (one display block) - see also: link roff language reference for mandoc Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1130 (cherry picked from commit e7ff917057eaf209c003660f02decb64ccb811da) --- share/man/man5/style.mdoc.5 | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/share/man/man5/style.mdoc.5 b/share/man/man5/style.mdoc.5 index c1592bf8b87f..42dbc940074c 100644 --- a/share/man/man5/style.mdoc.5 +++ b/share/man/man5/style.mdoc.5 @@ -1,4 +1,4 @@ -.\" +.\"- .\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2018-2022 Mateusz Piotrowski <0mp@FreeBSD.org> @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 29, 2022 +.Dd April 12, 2024 .Dt STYLE.MDOC 5 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd .Fx .Xr mdoc 7 -file style guide +manual page style guide .Sh DESCRIPTION This file specifies the preferred style for manual pages in the .Fx @@ -82,17 +82,17 @@ Format the section in the following way: .Bd -literal -offset indent \&.Bl -tag -width 0n -\&.It Sy Example 1\\&: No Doing Something +\&.It Sy Example 1\\&: Doing Something \&.Pp The following command does something. \&.Bd -literal -offset 2n -\&.Li # Ic make -VLEGAL +\&.Ic # make -VLEGAL \&.Ed -\&.It Sy Example 2\\&: No Doing Something Different +\&.It Sy Example 2\\&: Doing Something Different \&.Pp The following command does something different. \&.Bd -literal -offset 2n -\&.Li # Ic bectl list +\&.Ic # bectl list \&.Ed \&.Pp It is good to know this command. @@ -100,24 +100,22 @@ It is good to know this command. .Ed .Pp which renders as: -.Bd -filled -offset indent .Bl -tag -width 0n -.It Sy Example 1\&: No Doing Something +.It Sy Example 1\&: Doing Something .Pp The following command does something. .Bd -literal -offset 2n -.Li # Ic make -VLEGAL +.Ic # make -VLEGAL .Ed -.It Sy Example 2\&: No Doing Something Different +.It Sy Example 2\&: Doing Something Different .Pp The following command does something different. .Bd -literal -offset 2n -.Li # Ic bectl list +.Ic # bectl list .Ed .Pp It is good to know this command. .El -.Ed .El .Ss Lists .Bl -dash -width "" @@ -285,6 +283,7 @@ that would be rendered as: .Xr man 1 , .Xr mandoc 1 , .Xr mdoc 7 , +.Xr roff 7 , .Xr style 9 .Sh HISTORY This manual page first appeared in From nobody Thu Feb 27 01:13:59 2025 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 4Z3CzC65nRz5pMdS; Thu, 27 Feb 2025 01:13:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3CzC3GXDz3vnL; Thu, 27 Feb 2025 01:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740618839; 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=YIMmYzkGYlBF/11HnlBiPQvq+lY359fPUzv0SddMXSQ=; b=vHRKrZipfOzVYHnvlKN42bJ/Ylmnnefty6F5GqpAIoXYVnYTpMduasz6MQkAorNuKSZCh9 tbtJys958rI5wv2/z/Mmsu/Mgjjd4v7fCoHtl+5kpaiLqRA9GD8MOiw+ihCa0Ibk/te1E0 NmlMcAEZiN9xfeRiZ6DfqzpzjXnbrAK/gFZyCYgqPaXVyW+QlxJcSZDjxUVHaMXX7OJZAK Nh+Epn6F2LEnyqq4Hfddj9IHnmBOe6x+qjlnzeBznUZUjmXnVHEe5DgXdQnUinMqanIjRi wZ5v80cgnZb3HSeMcXvAxY0ACDeIhLk5CpX2zuSQQ5bYDbj8DlGOB8cTBwKFYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740618839; a=rsa-sha256; cv=none; b=hi427+wfqtARxEKv4wDLgvaeeP+gi7hS0mln1VAzYCzsmA0YYhDtZeKArBQKfHe/KDSXqY QfBtffJ7W4khBCn2nDucX2FvjNELROjoGtbQgvyg8NIbxRbowGPnf9kjDAT3G/UswChf93 xwQnOzdpVo4qS/pLzi5A7IG1LTbmZk0Fjd3VFHJKPiv8qQJ4ByjB2jKm/tQG1OpdiCaeGS mcVdPE/3zPU+1Zw0E+TeidkE2ZKampIfTZUcuBhRVjOurDJvyl/WH8VFecSD25baG26vOU lWIxekx1xNYtGjtkwP4X0Q6f15pFxc6aU6/lb3jSLwAWSTF5m+c2J9I8UrYwfQ== 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=1740618839; 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=YIMmYzkGYlBF/11HnlBiPQvq+lY359fPUzv0SddMXSQ=; b=naxjy45k/xLqHY7enOq+ofxoso6UEgOZGhCMzlZyacHDEH1qxswV8zw9Vho4JB0wMpAbgE tXJ4c/y+XjMBnbFXo2Cz5WZD2EIhWgDIcZZ/59LmgvrBTn978/VyqX1PbBCuqFVlq5s1J5 KDuK42Rz7lc7I0T4NMDLMzz26GAaQBcldSZReOMvGGx+yvkY7Gg+022UmIEVO1tyCzwbWX 4jTG/tL7+JxinEj5MBwarw3/Ra60D9nHv0J2exSHlCT20DTs0G9vxiI4CBF9ROZB5hWqL7 6KrwQlwSjNg5aRN/MWNFESWrFZswR3n2owNQ2WWtaA9dEZQNNlQcCcvMRc08DQ== 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 4Z3CzC2VMsz5wt; Thu, 27 Feb 2025 01:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1Dx8k054781; Thu, 27 Feb 2025 01:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1Dx2O054778; Thu, 27 Feb 2025 01:13:59 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:13:59 GMT Message-Id: <202502270113.51R1Dx2O054778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 70858d8e20f1 - stable/14 - style.mdoc: fix list width alignment instructions 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 70858d8e20f10d9f8775c9c887119f8ed63d8737 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=70858d8e20f10d9f8775c9c887119f8ed63d8737 commit 70858d8e20f10d9f8775c9c887119f8ed63d8737 Author: Alexander Ziaee AuthorDate: 2024-11-15 18:57:49 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:13:45 +0000 style.mdoc: fix list width alignment instructions MFC after: 3 days Reported by: imp Reviewed by: mhorne, imp Approved by: mhorne (mentor) Pull Request: https://github.com/freebsd/freebsd-src/pull/1530 (cherry picked from commit 4152ed2b999a0a8ccabfc085120e1c848d4f934a) --- share/man/man5/style.mdoc.5 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/man/man5/style.mdoc.5 b/share/man/man5/style.mdoc.5 index 42dbc940074c..dd4d8a1f5fdf 100644 --- a/share/man/man5/style.mdoc.5 +++ b/share/man/man5/style.mdoc.5 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 12, 2024 +.Dd December 12, 2024 .Dt STYLE.MDOC 5 .Os .Sh NAME @@ -124,7 +124,8 @@ The .Fl width argument to the .Sy \&.Bl -macro should match the length of the longest item in the list, e.g.: +macro should match the length of the longest rendered item in the list, +e.g.: .Bd -literal -offset indent \&.Bl -tag -width "-a address" \&.It Fl a Ar address From nobody Thu Feb 27 01:19:36 2025 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 4Z3D5h4nggz5pNNv; Thu, 27 Feb 2025 01:19:36 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3D5h2Wyrz41VD; Thu, 27 Feb 2025 01:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619176; 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=jnjN/VEbnMZPLLRcsoDCWJTwQPssteCiP6qb9db1D4M=; b=heu8SmzGPQJ+iXXamWcOGvH8MFhHSiB2bkwRBgP7nZs9y8LCz4QWl+fPS3DR5bx3r8n7as s6W4MIv4qhPWbJFKtIBVUN87mRHHQk9jTm0lgYk+O+V6ez7CUiulRxmUlcvpJWaAzKkmoU lQDxuK0zOewWmRie8fHQAyn/YWSM5l6Ii/gngmN3ATK/fInKCg8EDV45ddV2ADa0tV+9cq UZzWRcy4Ml6AbdGjcVlhX+YFfFOFBuzgxlvioX+IEAAeZST8Vq47Cm2Ul/0HpmT9Ni4soi 3Dj4sG/Dd1rrFVDDa61f4LTaBKiF5Yk5gzJl2TmkS+y+8uYgwyJ8Q2JkkA7Xpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740619176; a=rsa-sha256; cv=none; b=TJGAMpSj9PU75SOGtWM+h5asAMEj7tPMa1Klt57fznRmSUiO1Fq03DZ6H0BF6/f6qDRNOd CY7u3M38CNE3uzti4nxxyTIK289GFjRIPfKoOyex3gTmYbaR62otZ32QhVpy/g3XFLrKLx xp6cyQrlItozq2SxWT8BlovINngQSkL7PyGwRC1Z61v5Hj6PTjhfk5xyDxDMMiZnJHfEOR wDqk9FJChFaOyZNiKGBU8YgvIPc/NrJN6k9m29g0+KUTC2lnluM0YDQHtEXRWozeCABqjL jmW9cJRwixO5UfyW56kAkV46b2XXA32te066Dr7bgQRmagtZNFxwUOB+cAoVuw== 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=1740619176; 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=jnjN/VEbnMZPLLRcsoDCWJTwQPssteCiP6qb9db1D4M=; b=gCUbyLtcrTQWZb5bWMGS2+g2cTxhJGF3NJnbrFutqseX7WGi4xmCv2lA0YvEVVAXMPVZTq ExGdJyZg+PsHdjsDmwGPBmB81y9qOFgnuAQA3V8Drted8a4z45mKD/60nKGg6L3U/JqFhi f+uIFKP3V9A9YY4b8EA43F9YVCEf8VzIR7uEEExAxDzEDBPFc4ZltDw404sGctyyV6Q59s qCANqgCuwFGDisuNIq42sguI0ChllSOzKjS1HiZq2WVmAADbYQcsqGC4kec7V99CO5HmgK 8i9PN+qfhj7mkyW1Qv0h6DmX1tYvOjUAIphi+PgdywbRa362KfiXblBsi4CMqA== 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 4Z3D5h1ngfz5lV; Thu, 27 Feb 2025 01:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1JarN056415; Thu, 27 Feb 2025 01:19:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1Ja6a056412; Thu, 27 Feb 2025 01:19:36 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:19:36 GMT Message-Id: <202502270119.51R1Ja6a056412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 7ba0d890903b - stable/14 - bridge.4: Remove incorrect line + polish 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7ba0d890903b6ad9ed17a873c373e68c2e763576 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=7ba0d890903b6ad9ed17a873c373e68c2e763576 commit 7ba0d890903b6ad9ed17a873c373e68c2e763576 Author: Alexander Ziaee AuthorDate: 2025-02-24 17:28:51 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:15:07 +0000 bridge.4: Remove incorrect line + polish In an AMA on Community Discord, it was revealed that simply setting a bridge to up is not equivelant to setting it as "inet6 auto_linklocal". Remove the incorrect line, and while here: + reset sysctl list width to indent, saving 2/13 lines on MANWIDTH 59/80 + tag spdx + break two long lines over 80 characters MFC after: 3 days Reported by: Antranig Vartanian Reported by: Jan Bramkamp Reported by: Niclas Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48981 (cherry picked from commit 5a0d9605a44bf39402211e009365f1043faa2b0b) --- share/man/man4/bridge.4 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 31a0ce43a263..b741ec0b73c8 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-4-Clause +.\" .\" $NetBSD: bridge.4,v 1.5 2004/01/31 20:14:11 jdc Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. @@ -33,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 10, 2023 +.Dd April 10, 2024 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -125,7 +128,8 @@ variable to .Li 0 . .Pp -All the bridged member interfaces need to be up in order to pass network traffic. +All the bridged member interfaces need to be up +in order to pass network traffic. These can be enabled using .Xr ifconfig 8 or @@ -165,11 +169,6 @@ variable configures an IPv6 link-local address on .Li bridge0 interface: .Bd -literal -offset indent -ifconfig_bridge0_ipv6="up" -.Ed -.Pp -or in a more explicit manner: -.Bd -literal -offset indent ifconfig_bridge0_ipv6="inet6 auto_linklocal" .Ed .Pp @@ -261,7 +260,7 @@ the appropriate interfaces. Either stage can be disabled. The filtering behavior can be controlled using .Xr sysctl 8 : -.Bl -tag -width ".Va net.link.bridge.pfil_onlyip" +.Bl -tag -width indent .It Va net.link.bridge.pfil_onlyip Controls the handling of non-IP packets which are not passed to .Xr pfil 9 . @@ -470,8 +469,8 @@ ifconfig_fxp0="up" .Ed .Pp Consider a system with two 4-port Ethernet boards. -The following will cause a bridge consisting of all 8 ports with Rapid Spanning -Tree enabled to be created: +The following will cause a bridge consisting of all 8 ports with +Rapid Spanning Tree enabled to be created: .Bd -literal -offset indent ifconfig bridge0 create ifconfig bridge0 \e From nobody Thu Feb 27 01:19:35 2025 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 4Z3D5g4Pdqz5pNJJ; Thu, 27 Feb 2025 01:19:35 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3D5g26p7z41Bn; Thu, 27 Feb 2025 01:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619175; 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=+n0tAVv2G/sag5FaqhLJOXYLN7CiS0/Te945vpOkqP0=; b=ZNFBiGByJirYo23OMZ8oOAwf1KgJGMWu7tYaCzVumevHjW95VAMGlN9OF1oVYUF+ierZ3c 69UMsbYPlVqyQH/XMuJStu2a/dMAd174I4IkIoqZiQYYuPKjoCYqlib7b9IZrJkGdXXO59 0u9GUspSS7lQHuq/cya4VJe31d1IFni8L89JahlwUY7PfWcpMNLLee3n1FfNN4WPxQPcXP RQ3MEptceVEd++nIOSALC6aBr7sqQvGKgN/UBA8vO671oSV9t08CaN9EcqpbiamQ/fuT1Y GQRjg1NZ7DjGLScaHgaEn6y/68qJTUo9TEMYzdt+zTkrJ7GsZy0OVeDkadBvQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740619175; a=rsa-sha256; cv=none; b=o72YcWinMCX4WM0TU8mubhDvJ79KhHBtQpbHJPNWvBYtr3sdK5yBSIyZVyxcalY09kH8qO P1t30Jg49fhpmVJLPAjwhkMjZfaIgxdtTJInrjcpC4PjH1X23bh+wKMifwKp/d0Zae1Gis ZzN+eYJynq9IsqPcKhwnn1A9Wt0NQQ2LEvwNwl2IyO8JCoee/afgpzp+8Ud24CIK/DWGH4 JT/iFVpSkJ6Sir7gkIoij1ZUvl+Pwhw6dwlCLkayFvHaXVlNbjR/qfxbjoem0veDK0OWe8 r6eCvfp0HbGWTt3NomFtVaj5H2fTnrFs6rRbaMQCEPIHJ58vMDubJpmNe0u8hA== 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=1740619175; 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=+n0tAVv2G/sag5FaqhLJOXYLN7CiS0/Te945vpOkqP0=; b=kC77NT8Jq2jOGFqEp+MBpjpJhJzqpb7//8jecDkZXnT3ZGPcuc3QGAlDBXx/0IgVWoTEtX 1Soih57TByqqgAcJeXqWSfzrOrYphRbKVz16evgrO6cAkBtGx1vd1RmMQM6Zpvtg2jtAVD yMd1DF5JjU0SQbpOotBaIKtTTG/1pC4ftmaHelXCAGaZmrsQjBJ7aZJKVAtNOk4foICI3J pVPJHUzE4e4bvmZPCXYtgkREtF4yVR+YbKdfrK3VzkLhUPi/zIvGWYtZT4diu9kZ5mnKQw TbS9xWsWwfOQvSfXRt9PDQBxF5LGngatWcgLhUK/vCV0DpdhGhsA8XsPJ5Etyg== 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 4Z3D5g1Zj1z5YR; Thu, 27 Feb 2025 01:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1JZV6056378; Thu, 27 Feb 2025 01:19:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1JZbG056375; Thu, 27 Feb 2025 01:19:35 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:19:35 GMT Message-Id: <202502270119.51R1JZbG056375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: cf522ceef8fa - stable/14 - ports/filesystems: Fix fallout 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cf522ceef8fa404dc1df865fb19f9a40e34e8c56 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=cf522ceef8fa404dc1df865fb19f9a40e34e8c56 commit cf522ceef8fa404dc1df865fb19f9a40e34e8c56 Author: Alexander Ziaee AuthorDate: 2025-01-27 19:59:17 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:14:37 +0000 ports/filesystems: Fix fallout A new filesystems category was created in the ports tree, with 142 filesystem related ports moved to there, some of them renamed. Update all references in the src tree to the new locations. PR: 283881 Fixes: ports:6e2da9672f79f44 (filesystems: add new category) MFC after: 1 month Reviewed by: fuz, mhorne, bapt Accepted by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48406 (cherry picked from commit 066ef2aec187ae93a9df01d25fa8e47d67ff972b) --- release/powerpc/generate-hfs.sh | 2 +- share/man/man4/ccd.4 | 2 +- share/man/man5/smbfs.5 | 2 +- stand/powerpc/boot1.chrp/generate-hfs.sh | 2 +- tools/test/stress2/misc/ext2fs.sh | 2 +- tools/test/stress2/misc/ext2fs2.sh | 2 +- tools/test/stress2/misc/ext2fs3.sh | 2 +- tools/test/stress2/misc/ext3fs.sh | 2 +- tools/test/stress2/misc/ext4fs.sh | 2 +- usr.sbin/autofs/autofs/special_media | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/release/powerpc/generate-hfs.sh b/release/powerpc/generate-hfs.sh index 50f77933f273..e88db0ad771e 100755 --- a/release/powerpc/generate-hfs.sh +++ b/release/powerpc/generate-hfs.sh @@ -1,7 +1,7 @@ #!/bin/sh # This script generates the dummy HFS filesystem used for the PowerPC boot -# blocks. It uses hfsutils (emulators/hfsutils) to generate a template +# blocks. It uses hfsutils (filesystems/hfsutils) to generate a template # filesystem with the relevant interesting files. These are then found by # grep, and the offsets written to a Makefile snippet. # diff --git a/share/man/man4/ccd.4 b/share/man/man4/ccd.4 index c44013dab11f..dfe66eed0a03 100644 --- a/share/man/man4/ccd.4 +++ b/share/man/man4/ccd.4 @@ -228,7 +228,7 @@ without mounting does not write anything to the .Tn Linux RAID. Then you do a -.Nm fsck.ext2fs Pq Pa ports/sysutils/e2fsprogs +.Nm fsck.ext2fs Pq Pa ports/filesystems/e2fsprogs on the .Nm device using the diff --git a/share/man/man5/smbfs.5 b/share/man/man5/smbfs.5 index 7be90c3ba882..9653be0e1bad 100644 --- a/share/man/man5/smbfs.5 +++ b/share/man/man5/smbfs.5 @@ -59,7 +59,7 @@ and may be removed from a future version of .Fx . Users are advised to evaluate the -.Pa sysutils/fusefs-smbnetfs +.Pa filesystems/smbnetfs port instead. .Ef .Sh SEE ALSO diff --git a/stand/powerpc/boot1.chrp/generate-hfs.sh b/stand/powerpc/boot1.chrp/generate-hfs.sh index c83306ed885d..dc2b12d8f826 100755 --- a/stand/powerpc/boot1.chrp/generate-hfs.sh +++ b/stand/powerpc/boot1.chrp/generate-hfs.sh @@ -1,7 +1,7 @@ #!/bin/sh # This script generates the dummy HFS filesystem used for the PowerPC boot -# blocks. It uses hfsutils (emulators/hfsutils) to generate a template +# blocks. It uses hfsutils (filesystems/hfsutils) to generate a template # filesystem with the relevant interesting files. These are then found by # grep, and the offsets written to a Makefile snippet. # diff --git a/tools/test/stress2/misc/ext2fs.sh b/tools/test/stress2/misc/ext2fs.sh index f4d33116faed..e93da12419b0 100755 --- a/tools/test/stress2/misc/ext2fs.sh +++ b/tools/test/stress2/misc/ext2fs.sh @@ -32,7 +32,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 diff --git a/tools/test/stress2/misc/ext2fs2.sh b/tools/test/stress2/misc/ext2fs2.sh index 748e45a33ffa..07ff5d5058fb 100755 --- a/tools/test/stress2/misc/ext2fs2.sh +++ b/tools/test/stress2/misc/ext2fs2.sh @@ -33,7 +33,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -x /usr/local/sbin/mke2fs ] || exit 0 mount | grep "$mntpoint" | grep -q md$mdstart && umount -f $mntpoint mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart diff --git a/tools/test/stress2/misc/ext2fs3.sh b/tools/test/stress2/misc/ext2fs3.sh index f33b4cc73547..f2a68d060fd9 100755 --- a/tools/test/stress2/misc/ext2fs3.sh +++ b/tools/test/stress2/misc/ext2fs3.sh @@ -35,7 +35,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 diff --git a/tools/test/stress2/misc/ext3fs.sh b/tools/test/stress2/misc/ext3fs.sh index e5a0d9a09481..210008ce3942 100755 --- a/tools/test/stress2/misc/ext3fs.sh +++ b/tools/test/stress2/misc/ext3fs.sh @@ -33,7 +33,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 diff --git a/tools/test/stress2/misc/ext4fs.sh b/tools/test/stress2/misc/ext4fs.sh index ac5656ed7be0..2e2ac8d77440 100755 --- a/tools/test/stress2/misc/ext4fs.sh +++ b/tools/test/stress2/misc/ext4fs.sh @@ -36,7 +36,7 @@ . ../default.cfg -# Uses mke2fs from sysutils/e2fsprogs +# Uses mke2fs from filesystems/e2fsprogs [ -z "`type mke2fs 2>/dev/null`" ] && echo "Skipping test as mke2fs not installed" && exit 0 diff --git a/usr.sbin/autofs/autofs/special_media b/usr.sbin/autofs/autofs/special_media index b397a8889623..917abae05595 100755 --- a/usr.sbin/autofs/autofs/special_media +++ b/usr.sbin/autofs/autofs/special_media @@ -43,7 +43,7 @@ print_map_entry() { echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},sync :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ - "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-exfat first" + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install filesystems/exfat first" exit 1 fi ;; @@ -52,7 +52,7 @@ print_map_entry() { echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},sync :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ - "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install filesystems/ntfs first" exit 1 fi ;; From nobody Thu Feb 27 01:19:37 2025 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 4Z3D5k2FQqz5pNJN; Thu, 27 Feb 2025 01:19:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3D5j33gfz41Q5; Thu, 27 Feb 2025 01:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740619177; 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=U5uI1vnbaec4RRLSuHkgfVLJ77om+tKK55xr4z1UNdc=; b=iY1Mf7u9XNFTatXHGSbhbSpVBaysBacubMwMRMrpdgFTenaW6ImutrbsrPlvhvk9etYXD0 XDIEMYBKT1TBONtw/ydGgadKaByVOjAPGNOotxB0fZfioW08UqCuIFKNA55S6RUCB92ZhL bSPkoJZqREZf+d0hTQJniL+o7T7y3wNsd1mh8lDJDyYj1lwKX6MhwNDtEvMuF3hSkVHPOh 23EZOTN1zp9BKyggzmBAxyIsv29lN3+3knMV7i4wfOCRw1HwdNo2Ja5FW8aKKJCA+nI3ZL q6/7fSKPpTRKotI0Vxx6oCATcGcSblTutM5vbrW5nUevVZle4ARpJQ/HrJnkkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740619177; a=rsa-sha256; cv=none; b=Vr7N36Hfl5YuZIwRDIJPf5gYqbnvju0v6Jg3HTNHDqAL2DXcs/O+kfV8p9QRDfjGYHH9Tw 8RUnKMyX1eWAGAA8KbmDEf/mWGZerNjnsJ4lCN0oU5n5pO0QjoZ5fsimhiuyM9N7KXisFy 7PNCKRMyOa/+Isk2jVc8fpDLLod4OCytaJupAgER3wEMXMvZ+NDVg+N1tndDqOfY6y6zcX L7hgZHGTwfcPGxL68aKv0kyg4eQYmEIoPcwFiNiIvZI8lq4RpmM2zOD8mzaI4gdP7VG4hk ktQACLrgtRGVcCVNrXmIo6zYhbeJ4AJD661v7YvKNT/M7csMzyqwXekooSgvbQ== 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=1740619177; 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=U5uI1vnbaec4RRLSuHkgfVLJ77om+tKK55xr4z1UNdc=; b=Z/16VPgJAbknqX5GMuY1kNWeXTb3gCQ/d1OLf0WhwjoAPYbAJGXjspbFd4q6QJtQiI5wUK i0kzeJCFXvxeaNAxFmlnIifc/RQyxRR/PETV/o8sYiQ7fzDHbSKE3NlIcSsh/vtap1tTCm 9ej1utmXc2mPYkKx5YV0Ug2yXWtcyRb9UIY1OFlybq7d7M4PsVZLekYq3LoFL3dWogFzuN rbEUpH73SnwBUXRtHR6EMKWhJ4kq6i5AILw+KtkWVhC1bHpsymbvpQoqfiiN/rMQwTLIbC UBjeHVQ5T90lmitmNk2wXuQZm85KDgyKwvtDpf+GfYrXmHOjEFYzKMYUt0rwhg== 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 4Z3D5j2ZFyz60K; Thu, 27 Feb 2025 01:19:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1JbOV056449; Thu, 27 Feb 2025 01:19:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1Jbo4056446; Thu, 27 Feb 2025 01:19:37 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:19:37 GMT Message-Id: <202502270119.51R1Jbo4056446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 78fa5b277a84 - stable/14 - safexel manuals: Improve apropos and HW relnotes 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 78fa5b277a84285de554b8dfb8d306bcee265212 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=78fa5b277a84285de554b8dfb8d306bcee265212 commit 78fa5b277a84285de554b8dfb8d306bcee265212 Author: Alexander Ziaee AuthorDate: 2024-11-22 17:45:36 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:15:25 +0000 safexel manuals: Improve apropos and HW relnotes safe.4: Improve document description (Nd) for apropos. Remove Nm from sysctls in synopsis. This was causing this page to get pulled into results for `apropos sysctl`. Instead, use kernel declaration macros like vt(4). Convert the HARDWARE tagged list to a column list for better rendering in HW Relnotes. Tested in man(1) at MANWIDTH 59 and 80. safexcel.4: Nd: s/security packet/cryptographic offload/ for apropos. HARDWARE: Create this section for inclusion in the HW relnotes. SPDX: both tagged MFC after: 3 days MFC to: 13.5 Reported by: markj (cryptographic offload, Inside Secure) Reviewed by: jhb, markj, mhorne Accepted by: markj (src), mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D47706 (cherry picked from commit 26eeda7bd65603cdc6ff764349f55416b9766b43) --- share/man/man4/safe.4 | 34 +++++++++++++++++++--------------- share/man/man4/safexcel.4 | 13 ++++++++++--- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/share/man/man4/safe.4 b/share/man/man4/safe.4 index 61f2041ff333..89375d058bf7 100644 --- a/share/man/man4/safe.4 +++ b/share/man/man4/safe.4 @@ -1,4 +1,6 @@ -.\"- +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2003 Sam Leffler, Errno Consulting .\" All rights reserved. .\" @@ -22,13 +24,13 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.\"/ -.Dd July 29, 2020 +.\" +.Dd November 22, 2024 .Dt SAFE 4 .Os .Sh NAME .Nm safe -.Nd SafeNet crypto accelerator +.Nd SafeNet SafeXcel 1141/1741 crypto accelerator .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -46,11 +48,15 @@ module at boot time, place the following line in safe_load="YES" .Ed .Pp -.Nm sysctl Va hw.safe.debug -.Nm sysctl Va hw.safe.dump -.Nm sysctl Va hw.safe.rnginterval -.Nm sysctl Va hw.safe.rngbufsize -.Nm sysctl Va hw.safe.rngmaxalarm +In +.Xr sysctl.conf 5 : +.Bd -ragged -offset indent +.Cd hw.safe.debug +.Cd hw.safe.dump +.Cd hw.safe.rnginterval +.Cd hw.safe.rngbufsize +.Cd hw.safe.rngmaxalarm +.Ed .Sh DESCRIPTION The .Nm @@ -106,15 +112,13 @@ to dump the hardware interrupt registers. .Sh HARDWARE The .Nm -driver supports cards containing any of the following chips: -.Bl -tag -width "SafeNet 1141" -offset indent -.It SafeNet 1141 -The original chipset. +driver supports the following SafeXcel chips: +.Bl -column "SafeNet 1141" "The original chipset. Supports" -offset indent +.It SafeNet 1141 Ta The original chipset. Supports DES, Triple-DES, AES, MD5, and SHA-1 symmetric crypto operations, RNG, public key operations, and full IPsec packet processing. -.It SafeNet 1741 -A faster version of the 1141. +.It SafeNet 1741 Ta A faster version of the 1141. .El .Sh SEE ALSO .Xr crypt 3 , diff --git a/share/man/man4/safexcel.4 b/share/man/man4/safexcel.4 index d5e079822ecc..e14eebe40da2 100644 --- a/share/man/man4/safexcel.4 +++ b/share/man/man4/safexcel.4 @@ -1,4 +1,6 @@ -.\"- +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2020 Rubicon Communications, LLC (Netgate) .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,12 +24,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 29, 2020 +.Dd November 22, 2024 .Dt SAFEXCEL 4 .Os .Sh NAME .Nm safexcel -.Nd Inside Secure SafeXcel-IP-97 security packet engine +.Nd Inside Secure SafeXcel-IP-97 cryptographic offload engine .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -69,6 +71,11 @@ AES-CCM .Nm also implements SHA1 and SHA2 transforms, and can combine AES-CBC and AES-CTR with SHA1-HMAC and SHA2-HMAC for encrypt-then-authenticate operations. +.Sh HARDWARE +The +.Nm +driver supports the cryptographic acceleration functions of the +Inside Secure EIP-97 device found on some Marvell systems-on-chip. .Sh SEE ALSO .Xr crypto 4 , .Xr ipsec 4 , From nobody Thu Feb 27 01:41:14 2025 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 4Z3DZg4KVkz5pQfY; Thu, 27 Feb 2025 01:41:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3DZf6WFpz4Km0; Thu, 27 Feb 2025 01:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620474; 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=lgPS4N0dH1wzMFbbtgTNowVUl35XPFHw4N+xa2a0GXc=; b=txH07kOhnFwxS6xqI8lmQM2lT1ckykmfSQI3SrKft4Q5d4n8AtNO92AkDUWutZv/LZhA1s llOiqczXo2nrtoIBPQ/AH2YrOKLv+5Bbv2uydKUceJiRy2lOEiJDX//oJ4aceMwj43sOuW OAwlmuxyK/7BJGGXYZoBseEo5QA0pgvpqJ+W+ii+WI/lm7L/NcvutzuU09a+R8qPxTrMUi BvFf8bC7/EITvQ8rj9zwVJZa3c//wc4Fq3g41cRAus0HirBjggTdZRKqt1LPucZ+maBZoG gYFIhG5yekRzM4DbA8yxjk1VJ3Ob4N1xQMXWKFkZRVpV0WPVSNkXBjMvihIGdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740620474; a=rsa-sha256; cv=none; b=fwrAFQt0GG+GLKXUn1GQrMvTXifWYTerpnEbPovb9KReP8SLGdmLzFu2POVet1jacCmWx4 OtVjPqyf7Mxi86svVvcoQSKugJgWmqgxeG/SrvRw4uY71hCk7YqXyftcLvH3qKCP9LqKRr jZEQf7sNcjYdrCTf/DDQuQPVdIyqPPIJij5oXAqSOHMoBUbosClNgSpik3W3Xdjf+UXB84 bGtWw0qqjMTWFZNt+bq88p+jPv09G7mrDHYOjFItHcYTQj5iJy3v16GU7oUEm/19RjiWX5 ZX1w7Cdl8jSH+DFijBJcy/dHCdTIqFJfGRVyj1+Xyqe6uMlQtN33fm1QuDiBiQ== 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=1740620474; 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=lgPS4N0dH1wzMFbbtgTNowVUl35XPFHw4N+xa2a0GXc=; b=HSBv5cRCMaqFklB3zGuAAHESryApA8m1Xu0U+HX2rrf7Zl5wspueHO/nMIlNkzf0xslR8E hVm8KnFZlg573SQIQun0Q5OLzOpmz6XLHWAy+A63SJcBmuJhdwTLFHO2Vki7oQJ8BfXpCE TauQS0WIUOq0EsaGu0wMgfp3bl9PFxkQ/8lwcXZrzgOAD79CHoHuV6k8e98QiPhMRz12v/ sDdrHpmOrj8ln6H9nAEY0p5qaYPBtovsgEyRiqDP6QRlcnif8nM3fqxggfG/xsPrtihZRF d0QazY4UEXXY657WyIbe//s1vu87l+ZVjNnCkypoQCyLTJf5UC4FlA1Skbs42A== 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 4Z3DZf64pQz5mt; Thu, 27 Feb 2025 01:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1fEd0008748; Thu, 27 Feb 2025 01:41:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1fEeA008745; Thu, 27 Feb 2025 01:41:14 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:41:14 GMT Message-Id: <202502270141.51R1fEeA008745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 77eacf827803 - stable/14 - sh.1: document optional arguments to `:` 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 77eacf8278036353ead50e1317f8936dfc49186d Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=77eacf8278036353ead50e1317f8936dfc49186d commit 77eacf8278036353ead50e1317f8936dfc49186d Author: Alexander Ziaee AuthorDate: 2025-01-09 17:51:57 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:40:40 +0000 sh.1: document optional arguments to `:` TIL the `:` command accepts and discards arguments, and this is occasionally used to embed comments in interesting places. While here, fix another `...` argument that was not marked up. MFC after: 3 days Thanks: Community Discord Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48398 (cherry picked from commit f4727eca405763dd1feb4ca3e17be40c2da337de) --- bin/sh/sh.1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index b220cf550f52..a780d730642c 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -33,7 +33,7 @@ .\" .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" -.Dd November 20, 2024 +.Dd January 10, 2025 .Dt SH 1 .Os .Sh NAME @@ -1937,8 +1937,9 @@ make it the first or last character listed. .Ss Built-in Commands This section lists the built-in commands. .Bl -tag -width indent -.It Ic \&: +.It Ic \&: Op Ar arg Ar ... A null command that returns a 0 (true) exit value. +Any arguments are discarded. .It Ic \&. Ar file The commands in the specified file are read and executed by the shell. The @@ -1960,7 +1961,7 @@ it is sought in the current working directory. .It Ic \&[ A built-in equivalent of .Xr test 1 . -.It Ic alias Oo Ar name Ns Oo = Ns Ar string Oc ... Oc +.It Ic alias Oo Ar name Ns Oo = Ns Ar string Oc Ar ... Oc If .Ar name Ns = Ns Ar string is specified, the shell defines the alias From nobody Thu Feb 27 01:45:23 2025 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 4Z3DgR5rZhz5pQtY; Thu, 27 Feb 2025 01:45:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3DgR3t05z4PYh; Thu, 27 Feb 2025 01:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620723; 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=t9RatGeKhvHw8DK47SniTjPhuitnxHK/tKgybTW3VUI=; b=Nxtu6i/aUs3IFreBeDw1g9SsRcDQSXu6t/cpHx6HYIon5Qgj8mrsOPIEQ9tXr0QM70rG5I brrYs7xpRENrL32Vd1ezbCg5pP1eRU+FR9bkARijvBgX56wuOs31NQj4/mC9Ya5pEGLy2w IGkcNe7lqamymyOBSKSQXn3b2N6yU62l99eoxLSEW3c1GVCAFaoaOzaIsAhudjfvCB+FRV Lari0I3aiISMcGo43JCnkL97WheeTM9yFktut3cR2Cv6pS0PYtVHTmIY5PRIIPBqlle5pu +1CJ8M8cqspwBSKN9DrsWi6eVBVu1YH4HnYIUBOL8VWd7wv7GRxpoMwpiHkYdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740620723; a=rsa-sha256; cv=none; b=sX2YTN7IXSVWHclzvZnskCfDFiy3dZCf8j+WtQoXWdNX10jiupikGUKAx/XtWYHlipwZj8 4ia2zpfPnsOQW5fiCg9oi6IJyNPsGLbyaNh1Jx/UvhzWTY6oPaw55A9bam3H5C/dga8Zca bBQ7SnIsIS1EDDucOin0JJri9QdQoPV+gG1jcuQ2Uxzbf+n6Mp/l96CK0k7DeWce2YTdu6 iEXWRSSkZNJ5sUc2EElQLhPY115KFSb5fK1gyCklhP2tF5DBhT/ddqTvvFXIpkwBCCr0+l 8u9Y166YbUCKJOtjVjq/ZcP+qW8FkpWt3R4z5sKtUx3+yCskrAqK3J77YEB5bQ== 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=1740620723; 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=t9RatGeKhvHw8DK47SniTjPhuitnxHK/tKgybTW3VUI=; b=wLTQVEElKSvd61otbtSD88vZgP63z0Tp/FNKxzA76sBRSvM+aXltIy2XyKKET1ZXnT8vJr M/htL6vbsf2XehmX7zKBErg/wWzkkUdV8A9qdRgZQ/SjqKCT3muUM1BHf7P4VOWGPfYKaE BrsZm6jkT7w5/CT5maOv5iirvL5y4BrwD2QoSrOQFrO3tBQGn+5cExhiAbFJxZe2YzdSRh k5hLvWSioLMGv2xaRIKUoEz657Dtrjfd2qBiW2NGFz+czgEyMvy+0i4+A7pUg9bxUQkiys nxiyQQo/EqlXPbSZUi77/LVWANMwGaXcnTmkAMqstHvwovhATnTQiXuBkZkV2A== 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 4Z3DgR3Nb3z69Y; Thu, 27 Feb 2025 01:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1jNFr011399; Thu, 27 Feb 2025 01:45:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1jNFe011396; Thu, 27 Feb 2025 01:45:23 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:45:23 GMT Message-Id: <202502270145.51R1jNFe011396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 2200da5fe059 - stable/14 - recv.2: Explain how recv functions can return 0 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2200da5fe05929d8455435a178188efaab7ee85f Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=2200da5fe05929d8455435a178188efaab7ee85f commit 2200da5fe05929d8455435a178188efaab7ee85f Author: Felix Johnson AuthorDate: 2025-02-13 03:40:59 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:44:28 +0000 recv.2: Explain how recv functions can return 0 Clarify the RETURN VALUES section with improved structure, the condition of the return value 0, and the setting of errno. PR: 174581 Reviewed by: jhb, ziaee Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48955 (cherry picked from commit 571df2c64a3c1af1fe011303ec08e391e887ecbc) --- lib/libc/sys/recv.2 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index 68dc70e14800..8d50086c3eb9 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -318,12 +318,19 @@ On data reception the .Fa msg_len field is updated to the length of the received message. .Sh RETURN VALUES -These calls except -.Fn recvmmsg +On successful completion, +.Fn recv , +.Fn recvfrom , +and +.Fn recvmsg return the number of bytes received. .Fn recvmmsg returns the number of messages received. -A value of -1 is returned if an error occurred. +If no messages are available to be received and the peer has +performed an orderly shutdown, 0 is returned. +Otherwise, -1 is returned and +.Va errno +is set to indicate the error. .Sh ERRORS The calls fail if: .Bl -tag -width Er From nobody Thu Feb 27 01:45:24 2025 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 4Z3DgT1MmNz5pRGv; Thu, 27 Feb 2025 01:45:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3DgS4yM1z4Ppf; Thu, 27 Feb 2025 01:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740620724; 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=TCiNxW9IohHODS0dQpYhWK4UADm8zp9wbC02sg53X9o=; b=SIKbaAQ4z9Yh31q+8JR0mjSvRkzPTmyvTfFSyPHEI4gNKGY3ScMFrNxcYs0tF5/15Qnysk 3Mp/CTeqw+yuBLWDxPNPNLYqhst0knZyDblaELufnkyKKY5E+pcwrCuLu6Oe3jl91TbBIY N9sdNasPeNGnMvOYpbTY+Nd4opfnJPHqRS4ANd8gxCKZ2ed8rN+C8BCZtIYpgEEEAQI7NP hRHdN5U3kuex7wVHAEidgMBkKCnAMIvDebq1wqF851CFrmZpDVe/tQEOmhFefyJ6Th1uxD MaC/9jWAwcN2pB/XAj/1/OvWvCYuZTlnbDot4kA2RK1RRinKsx84sk+eGHm7jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740620724; a=rsa-sha256; cv=none; b=QTbXICeomW/S68E8DLS8Xbbm9nIL5yi3BaE/oPDByXT8h5Fv8MFzUQth0epo22uVJaP5Jq QKiZR8JrQlmqxdXg6aTIwCJZAVRBM2pOMvQPfVhdRBugo6uyEgyjFj5YTy/oeNdOE+Wh3L vhpl70zYM+3BcRMKrftoh5nV6QWLSPnuuT3xhyvPtLQMrY9g3E5oQJa1UxxDfiqpCeZoXk 7xGic4jHfGMt55/Z5rfsEOR0UHBsaSEE68AfMupaxNdtPtQmJUb+fuvNxbGiCmUUM/YwaF bomk68ZnTv0CLbZmYG/6pD/dI4ERQ+tD4uXLnZbTECjENLmYloUv5rHLlFG5Qw== 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=1740620724; 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=TCiNxW9IohHODS0dQpYhWK4UADm8zp9wbC02sg53X9o=; b=bNu8GJiuJHZuziE/TGZ1J8eu0KZGwyfrOxHn2lMCEfWnH+hfgIiWjP9BUc14Hv34v0MPC+ 7QgkrTUmE2YhCJwI5crROq8U6JaYTtJ5dBZJ0Uup13Ln9SvBr8YY6LA6N7h2fnvnmQPZvY YOB954GyXHtv1M+xc7mqwksGxUIr57+fJCCKiCVyNVmiqqrUxgPZcg/OCgiT+FAaQfEeGg s/SN4jwssYbWJjiCBwORtanz3OkdEp0b5cBCx+sC4Skw/d2ytbIaJHU7xM0zqUZi1kXAvo ZhXvrk63uVBjFLjo0lqvkGIh7qPnr+qiePYXoc3IMRmpUU6pbw5d4AovSpF/fw== 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 4Z3DgS4Hfhz69Z; Thu, 27 Feb 2025 01:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R1jO8L011441; Thu, 27 Feb 2025 01:45:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R1jOTs011438; Thu, 27 Feb 2025 01:45:24 GMT (envelope-from git) Date: Thu, 27 Feb 2025 01:45:24 GMT Message-Id: <202502270145.51R1jOTs011438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 6875767cf2e2 - stable/14 - recv.2: Improve style in RETURN VALUES 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6875767cf2e21b49769d5d78e2dffaaf655ca8b4 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=6875767cf2e21b49769d5d78e2dffaaf655ca8b4 commit 6875767cf2e21b49769d5d78e2dffaaf655ca8b4 Author: Alexander Ziaee AuthorDate: 2025-02-24 17:33:24 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-27 01:44:37 +0000 recv.2: Improve style in RETURN VALUES Reported by: des MFC after: 3 days Fixes: 571df2c64a3c1 (Explain how recv functions can) Reviewed by: mhorne, des Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48995 (cherry picked from commit 7c3c8605d62f5d27a5228a3787aae6e573f77d59) --- lib/libc/sys/recv.2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index 8d50086c3eb9..8caef85db812 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -318,14 +318,14 @@ On data reception the .Fa msg_len field is updated to the length of the received message. .Sh RETURN VALUES -On successful completion, +On successful completion, the .Fn recv , .Fn recvfrom , and .Fn recvmsg -return the number of bytes received. +functions return the number of bytes received, while the .Fn recvmmsg -returns the number of messages received. +function returns the number of messages received. If no messages are available to be received and the peer has performed an orderly shutdown, 0 is returned. Otherwise, -1 is returned and From nobody Thu Feb 27 02:32:23 2025 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 4Z3Fjg43ysz5pWHb; Thu, 27 Feb 2025 02:32:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Fjg2MyLz3hnf; Thu, 27 Feb 2025 02:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740623543; 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=bht2IIMwZSmVYK8YFpVmyqO1jDcfRP1MujlUHruGX1I=; b=nkEbILFFTtQlcSfGF2GSHywhVGK3UV/bbcENKEswINBkaxrfn3KPVJLECUWvKa8BqB0sdF CdVDdnt9OrLsKgRMfbqy6L2jcLM7GrJyZplsQqQeBsnsuf930AX/VRwRBISWfjK2IXdkj+ BWJ1CsPA1Fl6M5lTXt32cfYmjlI11dGl+Z+yUfu1FA/Q4oEMbOwMlNmtZ1m0Pw+5AX1eCU /zkwP6nFO1b8yoZTLYwcM7Iqx46IZYzdaBmQ4BrD4uOuLo05T0YMiKs5WVrmI6AOyyrsaR IPeLCdmu66qLQD5ujRbZxNyozLkZmzrvGqxL78KrQ+wopAbQLApodMVERmcpuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740623543; a=rsa-sha256; cv=none; b=vptP7LwRvPStHpWm/Sxo8MOl7PkC3MKpKauSZ3aVdGQEGUgYBbh9Utm5nIJxsxW888K2VH T8+IpFvo7lF1Pzl8TcORhLy4dwei+2vI//1lCTB+L0fmJYVByF1zyJpYtibQGfFdSIECu3 uRkin62MIz2x86S7n7wCNCz3ea3qH1yT8ppRPPul/BYKrjbHIp1QSpFs12ycGwvWZsH+X5 oLamSTfPmIBC1XMopA2k7m+FPYtc3+fttWhID1SKDeXY0xkjuHY5brHqt2C+AFX9r91DLY 2N0P/68dZSJ1Gtj0NRDn1wsXTetNMlhx2KneTOxUptAgxW3Tj4yn1Xk9QEpAvw== 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=1740623543; 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=bht2IIMwZSmVYK8YFpVmyqO1jDcfRP1MujlUHruGX1I=; b=kspFIZqIl1rdRXADHCu5KsMloURPNkUBziJMvkUd83Z0nXAQWXYzYjmuHVR4IxCjUSD5/5 wcRZrJU+vS5cZx4gYFs96ruruFJcRSH5iSpUvnYCmMNQdWswyDj4ZRKVp06vyjPmja3e+S RkUUXBgtXP2FPgXhNw7tMbcdwZ0mZjPlYtTp9aQrF6K8hDnIMGELeSRg+HNEmb8PFWC6G4 t92pFcXwHI5SNaGlIBdQ8I9xDmxY8ktSgBddshzuqV57gu3nae0YOhwCROfDQ8KD+AucPp RisUcb51VNTBsOGro/yZZfDD7OLh8pyGognKUqoG3xJDkA4idim1+sWFESNDAg== 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 4Z3Fjg1t8Xz7yk; Thu, 27 Feb 2025 02:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R2WNTF004154; Thu, 27 Feb 2025 02:32:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R2WN9R004151; Thu, 27 Feb 2025 02:32:23 GMT (envelope-from git) Date: Thu, 27 Feb 2025 02:32:23 GMT Message-Id: <202502270232.51R2WN9R004151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 8ac895f924e7 - stable/14 - nfscl: Fix setting of mtime for the NFSv4.n client 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ac895f924e719be32a6173e06a6ee5d3e507932 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8ac895f924e719be32a6173e06a6ee5d3e507932 commit 8ac895f924e719be32a6173e06a6ee5d3e507932 Author: Rick Macklem AuthorDate: 2025-02-24 20:58:27 +0000 Commit: Rick Macklem CommitDate: 2025-02-27 02:31:01 +0000 nfscl: Fix setting of mtime for the NFSv4.n client It was reported on freebsd-fs@ that unrolling a tarball failed to set the correct modify time if delegations were being issued. This patch fixes the problem. This bug only affects NFSv4 mounts where delegations are being issued. Not running the nfscbd or disabling delegations on the NFSv4 server avoids the problem. (cherry picked from commit b616d997cb48eaafe13069eecd95f0495b2358eb) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clstate.c | 7 +++++-- sys/fs/nfsclient/nfs_clvnops.c | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 950e0c097457..c726d956fee2 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -626,7 +626,7 @@ int nfscl_renamedeleg(vnode_t, nfsv4stateid_t *, int *, vnode_t, nfsv4stateid_t *, int *, NFSPROC_T *); void nfscl_reclaimnode(vnode_t); void nfscl_newnode(vnode_t); -void nfscl_delegmodtime(vnode_t); +void nfscl_delegmodtime(struct vnode *, struct timespec *); void nfscl_deleggetmodtime(vnode_t, struct timespec *); int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *, struct nfsmount *, NFSPROC_T *); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 0a1eb51e279f..a666792c17f9 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5104,7 +5104,7 @@ nfscl_newnode(vnode_t vp) * to the local clock time. */ void -nfscl_delegmodtime(vnode_t vp) +nfscl_delegmodtime(struct vnode *vp, struct timespec *mtime) { struct nfsclclient *clp; struct nfscldeleg *dp; @@ -5128,7 +5128,10 @@ nfscl_delegmodtime(vnode_t vp) } dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) { - nanotime(&dp->nfsdl_modtime); + if (mtime != NULL) + dp->nfsdl_modtime = *mtime; + else + nanotime(&dp->nfsdl_modtime); dp->nfsdl_flags |= NFSCLDL_MODTIMESET; } NFSUNLOCKCLSTATE(); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index bf24a161b94b..a0bb781e5e5d 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1120,7 +1120,7 @@ nfs_setattr(struct vop_setattr_args *ap) * Call nfscl_delegmodtime() to set the modify time * locally, as required. */ - nfscl_delegmodtime(vp); + nfscl_delegmodtime(vp, NULL); } else NFSUNLOCKNODE(np); /* @@ -1158,6 +1158,8 @@ nfs_setattr(struct vop_setattr_args *ap) NFSUNLOCKNODE(np); } } + if (vap->va_mtime.tv_sec != VNOVAL && error == 0) + nfscl_delegmodtime(vp, &vap->va_mtime); return (error); } From nobody Thu Feb 27 02:36:40 2025 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 4Z3Fpd1hCNz5pWLc; Thu, 27 Feb 2025 02:36:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Fpd16wVz3kN4; Thu, 27 Feb 2025 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740623801; 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=41uQjnDGcUgzRKieSpbPT4yz0SXH7uDix2aFrxi/5vs=; b=v1rWjzo2qyNlJbG5pm33GaZEFeKjergZtsfWi9TYQcgQ2w2I+stXj/RJQl2c53snt4nBNO /vzuszeUc4vqVLDezOnBZ0dDXTYlHjDKAB3nxFJr6zfGlRxEDa3neClVgNgbmRkc7no3vN w4R8Ac+P3RtCj/bu+9rBuvCJ81baCJLu1tKz9pxY2rXWhU8y2Mbikwow0HWdqMRLAVbpov IUTrFxnFohlH4vGF/dhoJ1kcAldaWJ6o9TdSU0eF67ZMrsZ1o2mQqYgA/ms52L4RqqfE6E YqUS0qiADewNIy9sRlVn9kOiGaxXY/Gf/8mKR3Nlh/ba58Zb0R+90lHFt6cO0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740623801; a=rsa-sha256; cv=none; b=nZXt7wgchihcuusOg+Iy77irh8r6mDKd+cTDzBzs23iSdJSUneHVHvkvW5oDJ8jD1gYADG J9B/d08Wwltr9WJKxpZPam4lGzSLOC3vhErSBICTbCi8cye6uWsthiwuHTyD47EJUeGkZ8 Hf1TxhtFyrYvhllqyTKZ97tDivoUFxPycUhZ1dUZ1pSAgjLg1rALNrcoc1uBrBE0gDO8Qx Jwyu9kE3FEK0ugEv0w4vQmMLqcoV4Pshd7Hu7dnSVgZpdjFPrjMXr7XbOd7MZsqcbqtqhQ 0dK+CL+vDMsS+JDL5I1m4uzOQrdKkVXEizsnaEinE32XFcI0dYaXStLKPvGIcA== 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=1740623801; 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=41uQjnDGcUgzRKieSpbPT4yz0SXH7uDix2aFrxi/5vs=; b=dDXEApTTqzSht2lDnuAZEbnNp4a1w5whR+ptsWQmgOBE1Y70Xwt7K1W2pdK6FYUNFdeTDz mdCLT2Hbkwbfof4AHu6O/6ahX0HtLby0WFCmN/ldU75y6glv4sjqAI4QVXIUUXFy3TbQHi QnMDqBeGhbo9rFKpwuzgUvfLJt7v75yoZbWwFcfOt9UwjmmCtmEWckHy3mf4duI4C1GU4L 6dFDpN5iMpk3qjJai4kTHBnNTAdV1udK6bFIKtUH7SSHcpbU51USJRCeENDp5v9mBjnOtv IzdKx48JrEeTFV0ozBpuIZWATv3zJkzZ9jo+XR3yf8XuAHkze1hoNNMkXyyPUA== 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 4Z3Fpd0L39z7Zw; Thu, 27 Feb 2025 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51R2ae9N005593; Thu, 27 Feb 2025 02:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51R2aegH005590; Thu, 27 Feb 2025 02:36:40 GMT (envelope-from git) Date: Thu, 27 Feb 2025 02:36:40 GMT Message-Id: <202502270236.51R2aegH005590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 319b59fbde2f - stable/13 - nfscl: Fix setting of mtime for the NFSv4.n client 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 319b59fbde2fb90bd4e41d1f66aa59e56f66f1fe Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=319b59fbde2fb90bd4e41d1f66aa59e56f66f1fe commit 319b59fbde2fb90bd4e41d1f66aa59e56f66f1fe Author: Rick Macklem AuthorDate: 2025-02-24 20:58:27 +0000 Commit: Rick Macklem CommitDate: 2025-02-27 02:35:54 +0000 nfscl: Fix setting of mtime for the NFSv4.n client It was reported on freebsd-fs@ that unrolling a tarball failed to set the correct modify time if delegations were being issued. This patch fixes the problem. This bug only affects NFSv4 mounts where delegations are being issued. Not running the nfscbd or disabling delegations on the NFSv4 server avoids the problem. (cherry picked from commit b616d997cb48eaafe13069eecd95f0495b2358eb) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clstate.c | 7 +++++-- sys/fs/nfsclient/nfs_clvnops.c | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 083a974516b0..b5e2cd78749e 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -622,7 +622,7 @@ int nfscl_renamedeleg(vnode_t, nfsv4stateid_t *, int *, vnode_t, nfsv4stateid_t *, int *, NFSPROC_T *); void nfscl_reclaimnode(vnode_t); void nfscl_newnode(vnode_t); -void nfscl_delegmodtime(vnode_t); +void nfscl_delegmodtime(struct vnode *, struct timespec *); void nfscl_deleggetmodtime(vnode_t, struct timespec *); int nfscl_tryclose(struct nfsclopen *, struct ucred *, struct nfsmount *, NFSPROC_T *, bool); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 9ab0a29e9c5d..282e9e39536f 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5083,7 +5083,7 @@ nfscl_newnode(vnode_t vp) * to the local clock time. */ void -nfscl_delegmodtime(vnode_t vp) +nfscl_delegmodtime(struct vnode *vp, struct timespec *mtime) { struct nfsclclient *clp; struct nfscldeleg *dp; @@ -5107,7 +5107,10 @@ nfscl_delegmodtime(vnode_t vp) } dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) { - nanotime(&dp->nfsdl_modtime); + if (mtime != NULL) + dp->nfsdl_modtime = *mtime; + else + nanotime(&dp->nfsdl_modtime); dp->nfsdl_flags |= NFSCLDL_MODTIMESET; } NFSUNLOCKCLSTATE(); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 38a2f6c8f4f1..f4569068972f 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1119,7 +1119,7 @@ nfs_setattr(struct vop_setattr_args *ap) * Call nfscl_delegmodtime() to set the modify time * locally, as required. */ - nfscl_delegmodtime(vp); + nfscl_delegmodtime(vp, NULL); } else NFSUNLOCKNODE(np); /* @@ -1157,6 +1157,8 @@ nfs_setattr(struct vop_setattr_args *ap) NFSUNLOCKNODE(np); } } + if (vap->va_mtime.tv_sec != VNOVAL && error == 0) + nfscl_delegmodtime(vp, &vap->va_mtime); return (error); } From nobody Thu Feb 27 14:16:57 2025 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 4Z3YLd1wcDz5qGFT; Thu, 27 Feb 2025 14:16: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLd1Jjrz3xGf; Thu, 27 Feb 2025 14:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665817; 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=YKKjoliDg9VWxUIn4MkkUIsQESL1kgcm7HdG9GmGQWM=; b=OtxH0Xu4s4M+iom6Q6Re1CXQgOaEUV+UB57tfGx6XSZgwBsCrdG0kRqCI1nwZc1SEL/sx5 I7llgCXgvabG7KamNerKk4eEopNhPlv930WD/2tiVwlyMhusyiFfYBENUzHLIfOt8rYp2T e5+mECEq3v48cL2MV4zNMs7TR9/GBvJ4ofMZTqOayQ85NoCNyJo+uXve3EAdf+67oEFgDc 9xbx/BA1R03zbHk7dlfGSPcyZlpFXYtuR8xDRNk9pR78wiXYFoOmN7ezX0ZPZ7TdLVrsOL dmZU7+ZDbauxpqxCaEGsNriAdRv6zYtjsaWgv2fbQjs94EZZM1awRh8NBjA1Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665817; a=rsa-sha256; cv=none; b=IqTTE8/fCerzGn2dyWOdmfETgbteGD9xkLx8lL2R+KbzoqjR1WxGrYE7sle8hjr4FCovIl j88icJU7PVdZwwuoLPds+UWoEhp5CugH/qPMlZkzMdVxBUbc1KVjDuHj2KVzTOhke71bST sAjCAn35eFWzaGJhrm303WugM2K07xPsfsNBNt+pxGncs1LsnydBwEePlOHy9V1Blm+qmm LGUBFzuIZOZwkxEcJmdCXBQugIJSs/KUV59Y9gJmcAGTvIp73cylNs1sLGBZ44bUWxo9/y 8Uqekcc5uY2QLA2wQHXGSf1XxGiFm94/lH0ro32vqzaC551KaN14ad5b89wuDw== 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=1740665817; 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=YKKjoliDg9VWxUIn4MkkUIsQESL1kgcm7HdG9GmGQWM=; b=sLRVqopGpqb/77IcHSGiqxl7vGUxNApWurcoBYcWaYh2yOqNS3ZxMvDL9hbPW/0FzTvcZV 7sZhxMbLSFBkEX6LwjKYiDmo2vKUgX1ZVtnL7P6Ge2f5GDP0QwKj5rWucYbIWm0kr57cok u0+xr64AHTtNqbPHL2KDtfOE0fa29VInFOJzc29Mz5X8NOaNfsYJqtW9bdo7KalBxedyaR m5bFc3bT3JhO4wRNVwtZTiNaGpe6g6joJAslrl/Uzfp3nY2jYiB2i8gRmLmsOcwqtIbUXr 15kdQAtjeOgTd/adkkrjEi5WP5ETSI9iNnHaJfJRNEOnkk7SQvDFXAvgx2Lehg== 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 4Z3YLd0lvpzmdv; Thu, 27 Feb 2025 14:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGv29016455; Thu, 27 Feb 2025 14:16:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGvF7016452; Thu, 27 Feb 2025 14:16:57 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:57 GMT Message-Id: <202502271416.51REGvF7016452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 555691ca601d - stable/14 - pci_pci: Remove obsolete comment 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 555691ca601dc4efe390a7a4034bdec1906b705d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=555691ca601dc4efe390a7a4034bdec1906b705d commit 555691ca601dc4efe390a7a4034bdec1906b705d Author: John Baldwin AuthorDate: 2024-02-15 02:04:34 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_pci: Remove obsolete comment This comment referred to the layering violation fixed in commit b377ff8110e3489eb6e6b920b51a2384dfc4eb0b. (cherry picked from commit 57d312b8eac9862ae60da32a9aecb6d9ccf08171) --- sys/dev/pci/pci_pci.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 02fa8cf1fb9e..cda1597ac76e 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -1931,11 +1931,6 @@ pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w, pcib_child_name(child)); rman_set_rid(res, *rid); - /* - * If the resource should be active, pass that request up the - * tree. This assumes the parent drivers can handle - * activating sub-allocated resources. - */ if (flags & RF_ACTIVE) { if (bus_activate_resource(child, type, *rid, res) != 0) { rman_release_resource(res); From nobody Thu Feb 27 14:17:06 2025 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 4Z3YLp29sqz5qG2H; Thu, 27 Feb 2025 14:17:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLp1jZKz3xMW; Thu, 27 Feb 2025 14:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665826; 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=b1bLAbX33IFRPyJYDhH3VaZjYh0LuIroFg8uDl6SpS4=; b=I/mUq5wXBpHiDhB3WUI7vF5m61OdcgMbwFoqw4z/hxEVmixdL5b/hApSUNPPvUZHRQkrmQ AGs4LAaAqbmvT3oRUW6FxsTAHfJcHM4qOFo1USaJByx0b232QFOqojEPnw1AsNfuXFe8Ow o6gkTijDjynfahzkmYstUWHKs7sKzxFcYZRnt+J89CqCnGBgIhVEF53PuK9klf+8iFi8o8 SMrAUOXcbB1C/jVz4Rv58jpdhvBmL8j++5mFdc614qW4+bPd+I+buj4qVqaFtbQ19RUlpR wnYrMWHURj+dR2U1dtXkYpX5ikyoxtD989RpR92w4EgZQuol2MX9Q2BZmmc9VA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665826; a=rsa-sha256; cv=none; b=PVHCwzkMRpJfZwQPwcQpVQa5rv20kV/Uuk3DcIevG8Od1fzu0RCALDSdaVnyiQJO7B+Vkx cE5tgH/gnvrZgEHlHKjuTUvTJuSyins6i0lRL1cRRxs2H5i/Udedt7n07v304TEULh89cN NPoaNphaZm1BjDS/UyCKzREndUSN/jQgABPF89dyz3SVL62d7LSEJ6kfv4IKEqMBgEUaQ3 vyQTUeGGp6XTeL3HCKLjaK1632Gf/Hs1naoFoRnfo4b7ZN20xnMiNC0yg8YiTIthRBO8NY iW0W1bC/dO/TSMjWQpgHAoAFEVKspeYXdGIMjfdbipvo/hOFrzIUk1cuxcjbdA== 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=1740665826; 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=b1bLAbX33IFRPyJYDhH3VaZjYh0LuIroFg8uDl6SpS4=; b=l4rrCihzkhvqWTnPpf+7a7q+DGH1LluZQuVkFOf46HyMo9QsGj7bTVbia7joJimAzULigl FZLHhCtAMdj/KDSVpra1jhAldk2osfHsRGk0h2Uce57HS7QcMm9wJ/Ix29UYSC9xcw1NJE 7Zc25UHel+AVJATFOpiKmlTB8H+ILhLahcKVdVFyRjvPGxmErIyHeSTz4IyAQtPJQT4yH/ yu456T8Aygvmlr9X2OlByS1zvHIwwptGltVyxgunJLou44FbZPUPFcAdu7NMvfZWLyp/X6 B98vAwR3fYB9pMGicz+YX7vjg/6KDiXdBdlJn8AJwMq8IWXjXRVGn9BaDoX8uw== 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 4Z3YLp12ZRzmqP; Thu, 27 Feb 2025 14:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH6cO016746; Thu, 27 Feb 2025 14:17:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH6Mt016743; Thu, 27 Feb 2025 14:17:06 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:06 GMT Message-Id: <202502271417.51REH6Mt016743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2abfb125a565 - stable/14 - powerpc mpc85xx: Fix infinite recursion in multiple bus methods 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2abfb125a5658491ad899a41e38f234cc1035632 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2abfb125a5658491ad899a41e38f234cc1035632 commit 2abfb125a5658491ad899a41e38f234cc1035632 Author: John Baldwin AuthorDate: 2024-02-17 07:15:52 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 powerpc mpc85xx: Fix infinite recursion in multiple bus methods Similar to 68a3ff041129208ea98a3bd5142061176ab4165e, the default case needs to call bus_generic_* to pass the request up the tree, not bus_* which will just call this method again. Fixes: 5a7e717fb790 powerpc mpc85xx: Use bus_generic_rman_* (cherry picked from commit cd9d26ed91c049dd60919c71badced89e18a882a) --- sys/powerpc/mpc85xx/lbc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c index 1e17d613438a..47b2f60177b0 100644 --- a/sys/powerpc/mpc85xx/lbc.c +++ b/sys/powerpc/mpc85xx/lbc.c @@ -793,7 +793,7 @@ lbc_release_resource(device_t dev, device_t child, int type, int rid, return (bus_generic_rman_release_resource(dev, child, type, rid, res)); case SYS_RES_IRQ: - return (bus_release_resource(dev, type, rid, res)); + return (bus_generic_release_resource(dev, child, type, rid, res)); default: return (EINVAL); } @@ -811,7 +811,7 @@ lbc_activate_resource(device_t bus, device_t child, int type, int rid, return (bus_generic_rman_activate_resource(bus, child, type, rid, r)); case SYS_RES_IRQ: - return (bus_activate_resource(bus, type, rid, r)); + return (bus_generic_activate_resource(bus, child, type, rid, r)); default: return (EINVAL); } @@ -829,7 +829,7 @@ lbc_deactivate_resource(device_t bus, device_t child, int type, int rid, return (bus_generic_rman_deactivate_resource(bus, child, type, rid, r)); case SYS_RES_IRQ: - return (bus_deactivate_resource(bus, type, rid, r)); + return (bus_generic_deactivate_resource(bus, child, type, rid, r)); default: return (EINVAL); } From nobody Thu Feb 27 14:16:28 2025 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 4Z3YL51xsKz5qGJd; Thu, 27 Feb 2025 14:16: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL51Mdcz3wx3; Thu, 27 Feb 2025 14:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665789; 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=TSthiYhtrbHcclTcLw0XB8zN6U9/x+yQ52PxCo38lEE=; b=knyQsjhgHgFdLi7YCKOKrQ9iuWhMkZRDyA6oPgxU3hX9uIN6K3Pf1Z/4AGTNMpK8acfZrM C6fuQbEEvNNG6BOFzZeW/0GH+CeS3lDgLa+oeQbPOEFZ6io24aHu91jwCwGC+e5Z4NQ7ho 2vHD6/sjMg0wrl6JfaLzgYSLOGdkt5qDgccRYA02vSzcB2cTqpei+A3oo3oQW46/H/2GuU /qFVbvTE48+m0kyMFlnUd7AZYxwUWbdcZYyICI2N/NiyB1D0f85CcQpghhgbjE0WbDDhhM XYpRnPdSGxwuSnRN5/whAd8rkfuZEkXbD5Ti7PEjN4TE36D42bdLY07OlDO/qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665789; a=rsa-sha256; cv=none; b=hNB+2mdMUKHyI2XT7ZzeD0B9TaGbPOOwg25420jBYwG81RG8VBZjpMXp2IkviolgA3FVKn 6qSphlZHPtsW7YwZvV8J7vmoibYdVHRczu8/hGs0872qDDFa7T9LfeK1oPoI/5knNmiCec xUrQJ3tPUhtQ3JnOLA/tzern0TfAAkd/f+n0fxO53z1IIrpWtLos4aJF9t+kX7lz4IuKTr EmgAjiy1Jf0tScxagFG74OyMI4/pq9fgQW32pZaFm3uPL0Y7rOj9AdAS43eGt/YDazxK2f Ww69yzNqq4LWTvnikvFopSQQZptM9kMn77E117z0t70jyX0HN1mN3M57zIkU6A== 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=1740665789; 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=TSthiYhtrbHcclTcLw0XB8zN6U9/x+yQ52PxCo38lEE=; b=XIWs1C+2mWFDbUxxTTspvGDy4OblBUTZ3GxbNOxaHOn1qgzipMHA4//+cwekKIHD7E8Jm9 XjluMAKWli7Uh1n9cyZ7POk43wIOknTD4BVMnbwVHgsJgjfKlMYb4kLuj4zknhbUemoTWp 8Nzz2YohhiPsMXODu30OHtoxIdmy8awlT9XIuCYwNjRMYsfBw+HL+DnB349n4lzc55QNNm wVKeQfE3EHWiLlg4/fjhvCa54NwlIA6zX5e9lpDf8jbx+/s6c18XCiCH3Yty8/6A88Ay+4 Bvfy7AOMTAyYwIM27U1eNVxMe77YMTj5+yLcrmuDzVtnBeDUfON7dGbGWlZLXg== 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 4Z3YL50fz8zmpW; Thu, 27 Feb 2025 14:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGSvT015551; Thu, 27 Feb 2025 14:16:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGSDh015548; Thu, 27 Feb 2025 14:16:28 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:28 GMT Message-Id: <202502271416.51REGSDh015548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 959c3d77be1f - stable/14 - acpi_pcib: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 959c3d77be1ff1146cfee8da1bdcacc15cdaf0c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=959c3d77be1ff1146cfee8da1bdcacc15cdaf0c7 commit 959c3d77be1ff1146cfee8da1bdcacc15cdaf0c7 Author: John Baldwin AuthorDate: 2024-01-23 17:35:22 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:19 +0000 acpi_pcib: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43428 (cherry picked from commit c2d4fef658e0dfd998115f1395cd8705b432e3c8) --- sys/dev/acpica/acpi_pcib_acpi.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c index 06e6bc233720..451a8d8b736d 100644 --- a/sys/dev/acpica/acpi_pcib_acpi.c +++ b/sys/dev/acpica/acpi_pcib_acpi.c @@ -103,6 +103,12 @@ static int acpi_pcib_acpi_adjust_resource(device_t dev, static int acpi_pcib_acpi_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +static int acpi_pcib_acpi_activate_resource(device_t dev, + device_t child, int type, int rid, + struct resource *r); +static int acpi_pcib_acpi_deactivate_resource(device_t dev, + device_t child, int type, int rid, + struct resource *r); #endif #endif static int acpi_pcib_request_feature(device_t pcib, device_t dev, @@ -128,11 +134,13 @@ static device_method_t acpi_pcib_acpi_methods[] = { #endif #if defined(NEW_PCIB) && defined(PCI_RES_BUS) DEVMETHOD(bus_release_resource, acpi_pcib_acpi_release_resource), + DEVMETHOD(bus_activate_resource, acpi_pcib_acpi_activate_resource), + DEVMETHOD(bus_deactivate_resource, acpi_pcib_acpi_deactivate_resource), #else DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), @@ -764,6 +772,31 @@ acpi_pcib_acpi_release_resource(device_t dev, device_t child, int type, int rid, return (pci_domain_release_bus(sc->ap_segment, child, rid, r)); return (bus_generic_release_resource(dev, child, type, rid, r)); } + +int +acpi_pcib_acpi_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct acpi_hpcib_softc *sc; + + sc = device_get_softc(dev); + if (type == PCI_RES_BUS) + return (pci_domain_activate_bus(sc->ap_segment, child, rid, r)); + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +int +acpi_pcib_acpi_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + struct acpi_hpcib_softc *sc; + + sc = device_get_softc(dev); + if (type == PCI_RES_BUS) + return (pci_domain_deactivate_bus(sc->ap_segment, child, rid, + r)); + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} #endif #endif From nobody Thu Feb 27 18:58:32 2025 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 4Z3gbY1tcDz59PtQ; Thu, 27 Feb 2025 18:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3gbY1Fwvz3QV8; Thu, 27 Feb 2025 18:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682713; 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=f4+G13Xe9YAPGU1LlskTBsv5F4ErFOcQfjPCz3V16YU=; b=mFoRXFLhTFe+tkIwZxDgJmHZEFmu0n+6MDC/L0R05iNhq3D7ictOvkUCMORCTnGgL0f1BN 3fxYwiFNiPz7P22bBNxh5cVcfW0f44xEm0VP9eOzmDrGZlwZQHCcrNarIOb+dtn0ibFgIM vygiN/krlTO1DR/Q+oXpFgjmA1cUupEXCvgLIHWRuS9IwAsfrnrUHBUOKVd6NSNGNw0Ycm NAtz9k7nziOqJ4lV2RPxgK7zTS5PXrFA+hUyldzP92HEFatzEPDesck20DfjlNteNGKWyO 1/1Olq+m10sbfFt4q1SH89+X7buZdAVHJYe5rSWPZn6Ay+mUB8N7xvUgArDwwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740682713; a=rsa-sha256; cv=none; b=MjJ11UUSwekX+KJJNOiXgSh4iaOTcU8SF2boBdW8PirDkjabZKwvAHgsx3mtf515mxv8ZM QFfMDPUEqZJx8I1Zm1V6j8QWw0pUoDMU3ZrtR+/0X10Q/tNRwktn2D3pw/diaZ+dkkLdht 8ujGZqHLz+E0pORhEWeFLUojBMFl4ctd3UxgjNsDoZ3TJXxsYrDPanGqcXiPd0BoHj6HDf FRJQRU9HrZb/WiJHG9aSYnYB/QQduoQZFbMwJIfQN3DI/14GlST2n9BO9Z22oH/ympALqy Qt6AJUSl1q+LqMQ2J2gHx/zJexcnXqLDiNNViWpWCd0dmEzbaVU2old4aQ1lfg== 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=1740682713; 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=f4+G13Xe9YAPGU1LlskTBsv5F4ErFOcQfjPCz3V16YU=; b=uX+UulHOMu7WEdpo3q1RNkqwZHpQ27dwAqLHjCJZAa3Hul0eYMSSatCd/PaBd/x7PyyjOY U/5/XC2rlvcza/DFRj+cVIBME/2ddRxEkZ1Q6l8dhY42q/YFLjp8Fnh9yTmZVCkelFbs7j I2sDz/lBdP/HfO0/v/TGH1rvFSNRjpUguoe4oim0Kwexda63sjFiKUN4KcEYUc4bv+g4vq eKR5QhYn4gcGWxO0WgtXrjC4EZgZoTbb8Y7m1unN71oCxfxBQqK6Yw+3IvSLviO7WUboE1 DVJUuvZUESfZ00mejK4LzkUI03UpVdjQe61q/fjODE9uPuDE1/RatbplR5Q1NA== 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 4Z3gbY0MTZzvgl; Thu, 27 Feb 2025 18:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RIwWAC042743; Thu, 27 Feb 2025 18:58:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RIwWsF042740; Thu, 27 Feb 2025 18:58:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 18:58:32 GMT Message-Id: <202502271858.51RIwWsF042740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a424624f2775 - stable/14 - .cirrus: Add manual amd64 and aarch64 jobs using GCC 14 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a424624f27758ab87f72ffd86018329681288ac7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a424624f27758ab87f72ffd86018329681288ac7 commit a424624f27758ab87f72ffd86018329681288ac7 Author: John Baldwin AuthorDate: 2025-01-03 15:44:33 +0000 Commit: John Baldwin CommitDate: 2025-02-27 18:53:56 +0000 .cirrus: Add manual amd64 and aarch64 jobs using GCC 14 Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48290 (cherry picked from commit 40ed89ffc32353bf50f832635ef767aeb432c0fd) --- .cirrus.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 2a1a8b6cbf3b..ae83c7d4cd9b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -95,6 +95,15 @@ task: TOOLCHAIN: amd64-gcc13 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s + - name: amd64-gcc14 World and kernel build and boot smoke test (manual) + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' + trigger_type: manual + env: + TARGET: amd64 + TARGET_ARCH: amd64 + TOOLCHAIN: amd64-gcc14 + TOOLCHAIN_PKG: ${TOOLCHAIN} + EXTRA_MAKE_FLAGS: -s - name: aarch64-gcc12 World and kernel build and boot smoke test (manual) only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual @@ -113,6 +122,15 @@ task: TOOLCHAIN: aarch64-gcc13 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s + - name: aarch64-gcc14 World and kernel build and boot smoke test (manual) + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' + trigger_type: manual + env: + TARGET: arm64 + TARGET_ARCH: aarch64 + TOOLCHAIN: aarch64-gcc14 + TOOLCHAIN_PKG: ${TOOLCHAIN} + EXTRA_MAKE_FLAGS: -s - name: amd64-gcc12 World and kernel build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' && $CIRRUS_BRANCH =~ 'pull/.*' env: From nobody Thu Feb 27 14:16:33 2025 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 4Z3YL94rK7z5qG9f; Thu, 27 Feb 2025 14:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL949Zkz3wx4; Thu, 27 Feb 2025 14:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665793; 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=kcypdrBxlprMdll+pfzwIlrM3y/Jv6EI2PB7JCScsLY=; b=c9YML9kF+3PwSIZNglzX2kGm1el0mF7+M6ongjLm7RI9NBv14oLT0sIT1c4NYyjg2UlFZZ VPlpkXq3qNyfipriiaKeoLqcZMswW1WEhJfARCk4tErS5X3rveqev/LJMcyqXVV4zt6tiC T6cQupxSkb1EZ98aJe8AoD0Gv0rHcRjbe/EAMxWTSvQEeEI0KzEwT3NKk3Yy5qD9VhMNil 1ncBlNYsmXLo8HyuH+HSUO63cMkFWHM/NmWCHI/i8Bodf2P1eSm3jgdsVS6WpAkrtjJNQI fB8Z5oJZolN6UglcT8dYFqG88K8MK3j8a/do2/DEQqp/wmkAwX+2eZ9U8FHA9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665793; a=rsa-sha256; cv=none; b=ZjyxgOaWhkGLuO97LpE2mxV69ZsvUmFWWMUP2Cdg7Db577f+k5oxMo9NSEXYpXPPgXl1+A lUn3jFrDzbq/QRZnT+m3+VO19plm8zh9SpRj8aamwNEbySJ1FndfnhDxaoAk2f/WCO7IE/ NyxSvbE8jcOh4yxKNBOvSfxYreeFvUxHfkclfOmk1Jch2h2ntg7sa3e00G6vJ7z4d3JITO 1f9ls6nkzi7dJVkgd2uy2N2YEA0WENJzPgeMR3KS8Vasyc50l2UQQrXaSX6v0FUAS/4kGO TB+BjnpW4656MPnt2hUf/+1mWcC9JJcrhhQhsX2E5bka+USvtZMHv35bb4eWag== 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=1740665793; 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=kcypdrBxlprMdll+pfzwIlrM3y/Jv6EI2PB7JCScsLY=; b=JbVqzOZNxaladVyD1k+kAC/Xl4m5XNwz9weyIq4N/YsibsMDh0Ic6Lulz31WR31XA1TAEF p9iFus197uIy/uDZyO8Y5vgiXEZzNAGglvYFg7SYvP72hvlEkDiOPmkxJ6qhK9cmxLc8ax vwPgIwgYInPHPhaviOAlCxV9KEP2kcDrekREUzzJPPFQQRKjNas0jKgvmChBRfo6Nrimd5 kiwLqPckR5L37ZiSqD8JF94iZ0eSwpMmIZzdVIeEGkes1a5w+kBG9j4f0i/FkC9LbfetnI WjDqDVTHdqExe623KNa/Bq//boN5qadMIhqLYNXic98QrR8g5OxwL8kaPuWS1Q== 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 4Z3YL93jXszm7J; Thu, 27 Feb 2025 14:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGX40015692; Thu, 27 Feb 2025 14:16:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGXWi015689; Thu, 27 Feb 2025 14:16:33 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:33 GMT Message-Id: <202502271416.51REGXWi015689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f645d34fbbce - stable/14 - powerpc ps3bus: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f645d34fbbce7b106319a2c4b10cb3ff21a5bf9c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f645d34fbbce7b106319a2c4b10cb3ff21a5bf9c commit f645d34fbbce7b106319a2c4b10cb3ff21a5bf9c Author: John Baldwin AuthorDate: 2024-01-23 17:36:12 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc ps3bus: Use bus_generic_rman_* - Split out part of ps3bus_activate_resource into a ps3bus_map_resource method. - Implement ps3bus_unmap_resource via pmap_unmapdev. - Use bus_generic_rman_* to add bus_adjust_resource, bus_deactivate_resource, and bus_release_resource methods. Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43432 (cherry picked from commit 3dd55df98282293c41bb0d98fa54312a9cf2aba5) --- sys/powerpc/ps3/ps3bus.c | 130 +++++++++++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 56 deletions(-) diff --git a/sys/powerpc/ps3/ps3bus.c b/sys/powerpc/ps3/ps3bus.c index 90374c168cf3..81a5efe01fed 100644 --- a/sys/powerpc/ps3/ps3bus.c +++ b/sys/powerpc/ps3/ps3bus.c @@ -58,13 +58,18 @@ static int ps3bus_attach(device_t); static int ps3bus_print_child(device_t dev, device_t child); static int ps3bus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result); +static struct rman *ps3bus_get_rman(device_t bus, int type, u_int flags); static struct resource *ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); -static int ps3bus_activate_resource(device_t bus, device_t child, int type, - int rid, struct resource *res); +static int ps3bus_map_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map); +static int ps3bus_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map); static bus_dma_tag_t ps3bus_get_dma_tag(device_t dev, device_t child); -static int ps3_iommu_map(device_t dev, bus_dma_segment_t *segs, int *nsegs, bus_addr_t min, bus_addr_t max, bus_size_t alignment, +static int ps3_iommu_map(device_t dev, bus_dma_segment_t *segs, int *nsegs, + bus_addr_t min, bus_addr_t max, bus_size_t alignment, bus_addr_t boundary, void *cookie); static int ps3_iommu_unmap(device_t dev, bus_dma_segment_t *segs, int nsegs, void *cookie); @@ -110,8 +115,14 @@ static device_method_t ps3bus_methods[] = { DEVMETHOD(bus_get_dma_tag, ps3bus_get_dma_tag), DEVMETHOD(bus_print_child, ps3bus_print_child), DEVMETHOD(bus_read_ivar, ps3bus_read_ivar), + DEVMETHOD(bus_get_rman, ps3bus_get_rman), DEVMETHOD(bus_alloc_resource, ps3bus_alloc_resource), - DEVMETHOD(bus_activate_resource, ps3bus_activate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_rman_adjust_resource), + DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), + DEVMETHOD(bus_map_resource, ps3bus_map_resource), + DEVMETHOD(bus_unmap_resource, ps3bus_unmap_resource), + DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -520,22 +531,31 @@ ps3bus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) return (0); } +static struct rman * +ps3bus_get_rman(device_t bus, int type, u_int flags) +{ + struct ps3bus_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + return (&sc->sc_mem_rman); + case SYS_RES_IRQ: + return (&sc->sc_intr_rman); + default: + return (NULL); + } +} + static struct resource * ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct ps3bus_devinfo *dinfo; - struct ps3bus_softc *sc; - int needactivate; - struct resource *rv; - struct rman *rm; rman_res_t adjstart, adjend, adjcount; struct resource_list_entry *rle; - sc = device_get_softc(bus); dinfo = device_get_ivars(child); - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; switch (type) { case SYS_RES_MEMORY: @@ -562,13 +582,10 @@ ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, adjend = end; adjcount = adjend - adjstart; - - rm = &sc->sc_mem_rman; break; case SYS_RES_IRQ: rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, *rid); - rm = &sc->sc_intr_rman; adjstart = rle->start; adjcount = ulmax(count, rle->count); adjend = ulmax(rle->end, rle->start + adjcount - 1); @@ -579,58 +596,59 @@ ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid, return (NULL); } - rv = rman_reserve_resource(rm, adjstart, adjend, adjcount, flags, - child); - if (rv == NULL) { - device_printf(bus, - "failed to reserve resource %#lx - %#lx (%#lx)" - " for %s\n", adjstart, adjend, adjcount, - device_get_nameunit(child)); - return (NULL); - } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); + return (bus_generic_rman_alloc_resource(bus, child, type, rid, adjstart, + adjend, adjcount, flags)); } static int -ps3bus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +ps3bus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) { - void *p; + struct resource_map_request args; + rman_res_t length, start; + int error; - if (type == SYS_RES_IRQ) - return (bus_activate_resource(bus, type, rid, res)); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); - if (type == SYS_RES_MEMORY) { - vm_offset_t start; + /* Mappings are only supported on memory resources. */ + switch (type) { + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } - start = (vm_offset_t) rman_get_start(res); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); - if (bootverbose) - printf("ps3 mapdev: start %zx, len %ld\n", start, - rman_get_size(res)); + if (bootverbose) + printf("ps3 mapdev: start %jx, len %jd\n", start, length); - p = pmap_mapdev(start, (vm_size_t) rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_be_tag); - rman_set_bushandle(res, (rman_res_t)p); - } + map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = &bs_be_tag; + map->r_bushandle = (vm_offset_t)map->r_vaddr; + map->r_size = length; + return (0); +} + +static int +ps3bus_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map) +{ - return (rman_activate_resource(res)); + switch (type) { + case SYS_RES_MEMORY: + pmap_unmapdev(map->r_vaddr, map->r_size); + return (0); + default: + return (EINVAL); + } } static bus_dma_tag_t From nobody Thu Feb 27 14:16:45 2025 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 4Z3YLP704Hz5qG25; Thu, 27 Feb 2025 14:16:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLP6Gflz3xJ4; Thu, 27 Feb 2025 14:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665805; 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=3gUgE+7Y6seLd2p/X3RhT+WdF08qwLGyPuvz8wlBwc4=; b=dRK/EHEw88MScUK8p2vEw6TbdwtLpvH9ERbLmJ1zC3PhTIH74s23VBIx7S026ONzx0BOUL xgZDbIHeVFxZObyZlS6nvYrm4zfdNlnZdZI5noLpUwPfqqxXUOxbZQsfuDEpkUlJeZcqB6 RlFeERrLki/E9g2paMqP6WWOthYp25S/mOrSky1sCU51IaGCsnYA81OhB7B69kxd427URU ALg17yyadvpIZKHD4o2ZwTLd6iGMKnj9z57tndEVUnL8+Al8l97Nb1ZA3RW46mZRX04rNr e0gpLh3kZjcrivcQ0ozqVvdCjmqHmGNc0bV4zhKOxW69EBXpb1nuTq2Rg4dYRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665805; a=rsa-sha256; cv=none; b=yfg/Yv0z2Hi4NuXHZWsVCxIvGJlRFRSrxmlUDLRHefRDCq1VI3zo/N7M7W/VdpDsHwNFdU yejKpS4CVGzyG+zdUyo/WpoXQTBf/QhZvlyPUqUFaVYE6IxzRFViE75iCdK4yTcjY6HvFe atJzdKvfJjQZ/HaEX6GlVo4MMIub6zt4EpzNMu+AU2UI0voL3mWPtYdShj3x3UdbvbvzS2 7SG/VX3InX31sOeZKW9yBm0laOL2EktWoah2FeoZzke789lU3w00HxbhTgm5/Liuqyq7/p iax6aFxNtRx42LFnFzx4GKmULNiD0L2UIAltCwVbXMJ5xX06AGlIWGT5ZRxVeg== 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=1740665805; 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=3gUgE+7Y6seLd2p/X3RhT+WdF08qwLGyPuvz8wlBwc4=; b=D18CvxGhnLwlPflQw120Jr+bk6rMxKlpgP5SoiPDqYT69K2akh2w6Ez7R/os9lc/Tc6vh8 egx2BJPcdl5X9EHrA+WDj5YEhRAsORXzAxX7D18bRGHJqgmG4dNn5nm/rrDGwdFYvK0Ax0 Md3v6lrSm4iX859dP7P3fjiy2ibqA0c+dE/6ITIHUCc15WtdVt4rd07UhxoNY3Sv8sPduu S/E1QZfsfRpy2jV9Qg1fKB/QUTmajiyNhvx4JhO7UUxJcIVDkEmWBaB2aStbYviurFvvSU UJ7a7bF4sx+e9NY/YtRyGUWbwCx94QNCMshqfPNyyms8UP4mSH6W4hFyqQfbQQ== 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 4Z3YLP5s3mzmbW; Thu, 27 Feb 2025 14:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGj8R016094; Thu, 27 Feb 2025 14:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGjtd016091; Thu, 27 Feb 2025 14:16:45 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:45 GMT Message-Id: <202502271416.51REGjtd016091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 672a0a76ed4a - stable/14 - simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 672a0a76ed4ab2fbcad7bc668b1f2dd1a8f09766 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=672a0a76ed4ab2fbcad7bc668b1f2dd1a8f09766 commit 672a0a76ed4ab2fbcad7bc668b1f2dd1a8f09766 Author: John Baldwin AuthorDate: 2024-01-23 17:38:25 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43442 (cherry picked from commit 3cf553288b968106e40882bb73b30da652614ba0) --- sys/dev/fdt/simplebus.c | 90 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 7 deletions(-) diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index db357b190d9e..273e77abd642 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -47,6 +47,19 @@ static int simplebus_probe(device_t dev); static struct resource *simplebus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int simplebus_adjust_resource(device_t bus, device_t child, + int type, struct resource *r, rman_res_t start, rman_res_t end); +static int simplebus_release_resource(device_t bus, device_t child, + int type, int rid, struct resource *r); +static int simplebus_activate_resource(device_t bus, + device_t child, int type, int rid, struct resource *r); +static int simplebus_deactivate_resource(device_t bus, + device_t child, int type, int rid, struct resource *r); +static int simplebus_map_resource(device_t bus, device_t child, + int type, struct resource *r, struct resource_map_request *args, + struct resource_map *map); +static int simplebus_unmap_resource(device_t bus, device_t child, + int type, struct resource *r, struct resource_map *map); static void simplebus_probe_nomatch(device_t bus, device_t child); static int simplebus_print_child(device_t bus, device_t child); static device_t simplebus_add_child(device_t dev, u_int order, @@ -84,10 +97,12 @@ static device_method_t simplebus_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, simplebus_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_release_resource, simplebus_release_resource), + DEVMETHOD(bus_activate_resource, simplebus_activate_resource), + DEVMETHOD(bus_deactivate_resource, simplebus_deactivate_resource), + DEVMETHOD(bus_adjust_resource, simplebus_adjust_resource), + DEVMETHOD(bus_map_resource, simplebus_map_resource), + DEVMETHOD(bus_unmap_resource, simplebus_unmap_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), @@ -433,6 +448,9 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, sc = device_get_softc(bus); + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + /* * Request for the default allocation with a given rid: use resource * list stored in the local device info. @@ -441,9 +459,6 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, if ((di = device_get_ivars(child)) == NULL) return (NULL); - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - rle = resource_list_find(&di->rl, type, *rid); if (rle == NULL) { if (bootverbose) @@ -481,6 +496,67 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, count, flags)); } +static int +simplebus_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_adjust_resource(bus, child, type, r, start, end)); +} + +static int +simplebus_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_release_resource(bus, child, type, rid, r)); +} + +static int +simplebus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_activate_resource(bus, child, type, rid, r)); +} + +static int +simplebus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_deactivate_resource(bus, child, type, rid, r)); +} + +static int +simplebus_map_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map_request *args, + struct resource_map *map) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_map_resource(bus, child, type, r, args, map)); +} + +static int +simplebus_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + return (bus_generic_unmap_resource(bus, child, type, r, map)); +} + static int simplebus_print_res(struct simplebus_devinfo *di) { From nobody Thu Feb 27 14:17:28 2025 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 4Z3YMD52ttz5qG2P; Thu, 27 Feb 2025 14:17:28 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMD4cCvz3xK0; Thu, 27 Feb 2025 14:17:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665848; 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=WJ7ta0+92bzUKcleG8yPLOrjskquxU+muF24B3pNXk4=; b=eo2pBRAssAe0WSe0yAfnPuCVLgBs/zhhOmfM4QyGg8XoZ4KxyyqB3elZUJB5eB00wdusS4 8lHy5MD+9SKGQGAQS0TrEv13KpKQgSaILP73RLzPrW4M3W5iN1ym8Q8DWf7yGXQv5lp3ZV raIIto0TRkewCQ2sWM+rSZPz6FdB9Fgh9ZGppAEjgZFLDni+bmiETbphzpmXjHeaTBWlDf oL8NO+a8tuDFTQvrLf5vobjT/fHXNJXRhSGNc0+iRplacvQiEaVXU/d74JChm+9PaU1JSR gEB/WXR8oKtTv6yMWDsNfVwVKgIoD2oDBm48e4PMMvaeHal/xGSk+4weP9EWew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665848; a=rsa-sha256; cv=none; b=l67tdmb/EqBhfanoH/rRFFUdFsc3C4CW8Fggva9foHVirvkoUvwebICxlH2n5AP8Xdatq9 7e8bkrlRI4xrH7l6qc+X61Vc07icS858tlqD+Q48PHy1mOnHijWW9DZQ0iLo3Anw1kQTe9 AEsiYsYcEYfDZCC+GUJq1K0LCDf2TUrz4gOPS4OM4R6VB4Y+PWmTdmR9nV/JsltIGMH4es SlOHqgzXPGiTVO6WM00RtizQrRMq+NjowfEbniBvWYCHlyg0m0d+XtLlcdLOnh2DF0k0KH JoW7BYM/Y1e9r0TJHz719jRBa9VruHgy2R6PXdQarp6fJJZWfGXhdEhJBRH9Ug== 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=1740665848; 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=WJ7ta0+92bzUKcleG8yPLOrjskquxU+muF24B3pNXk4=; b=oeO7MuKtx2J9gURrKddqxlGCsguS6oj6Gu6ZM+iMju/MAvjyUROerFLTjXEWnfxmazviQ2 iOHjvUQ4ncf3EFvYdpTZMCL4Fqh1MITq8Djs/2ey4ur6Jscz2g9ykZrGA2b6iSmOBlRsv6 Q04JESEmZkttOOoQPNehU/ROLNo/GYYkGbAEteL1aOQSN6qwSWSvWU98iQQxtdxodMmjzr iq+UQeaatRNcM26XRBE4sI+K3JubVrOwB/5UvIZDD3ZoF6LGRwymvHCEOjxb97ieqzyEBP BsEfcWvJQUf/LSQDegS8mbMQWejqo7JDHxyzObbywenzykqV9jRDnMyWh9J2+w== 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 4Z3YMD45GxzmQJ; Thu, 27 Feb 2025 14:17:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHSmg017433; Thu, 27 Feb 2025 14:17:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHSl1017430; Thu, 27 Feb 2025 14:17:28 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:28 GMT Message-Id: <202502271417.51REHSl1017430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1c3996e87f09 - stable/14 - acpi/pci/vmd: Fix a nit with nested resource mapping requests 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c3996e87f09a5e67ebbd4e7e73a38848127c99e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1c3996e87f09a5e67ebbd4e7e73a38848127c99e commit 1c3996e87f09a5e67ebbd4e7e73a38848127c99e Author: John Baldwin AuthorDate: 2024-06-04 23:50:56 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 acpi/pci/vmd: Fix a nit with nested resource mapping requests Some bus drivers use rmans to suballocate resources to child devices. When the driver for a child device requests a mapping for a suballocated resource, the bus driver translates this into a mapping request for a suitable subrange of the original resource the bus driver allocated from its parent. This nested mapping request should look like any other resource mapping request being made by the bus device (i.e. as if the bus device had called bus_map_resource() or bus_alloc_resource() with RF_ACTIVE). I had slightly flubbed this last bit though since the direct use of bus_generic_map/unmap_resource passed up the original child device (second argument to the underlying kobj interface). While this is currently harmless, it is not strictly correct as the resource being mapped is owned by the bus device, not the child and can break for other bus drivers in the future. Instead, use bus_map/unmap_resource for the nested request where the requesting device is now the bus device that owns the parent resource. Reviewed by: imp Fixes: 0e1246e33461 acpi: Cleanup handling of suballocated resources Fixes: b377ff8110e3 pcib: Refine handling of resources allocated from bridge windows Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Fixes: d714e73f7895 vmd: Use bus_generic_rman_* for PCI bus and memory resources Differential Revision: https://reviews.freebsd.org/D45433 (cherry picked from commit 98056127ddfa36720bcf46edc09843c867784bcb) --- sys/dev/acpica/acpi.c | 17 ++++++++++------- sys/dev/pci/pci_host_generic.c | 17 ++++++++--------- sys/dev/pci/pci_pci.c | 16 +++++++++------- sys/dev/vmd/vmd.c | 9 +++++---- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index de6520331644..2ba2b2c8c642 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1671,19 +1671,22 @@ acpi_map_resource(device_t bus, device_t child, int type, struct resource *r, args.offset = start - rman_get_start(sysres); args.length = length; - return (bus_generic_map_resource(bus, child, type, sysres, &args, map)); + return (bus_map_resource(bus, sysres, &args, map)); } static int acpi_unmap_resource(device_t bus, device_t child, int type, struct resource *r, struct resource_map *map) { - if (acpi_is_resource_managed(bus, r)) { - r = acpi_managed_resource(bus, type, r); - if (r == NULL) - return (ENOENT); - } - return (bus_generic_unmap_resource(bus, child, type, r, map)); + struct resource *sysres; + + if (!acpi_is_resource_managed(bus, r)) + return (bus_generic_unmap_resource(bus, child, type, r, map)); + + sysres = acpi_managed_resource(bus, type, r); + if (sysres == NULL) + return (ENOENT); + return (bus_unmap_resource(bus, sysres, map)); } /* Allocate an IO port or memory resource, given its GAS. */ diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 4b7a1cb8ab39..4fd8c3b42250 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -654,8 +654,7 @@ generic_pcie_map_resource(device_t dev, device_t child, int type, args.offset = start - range->pci_base; args.length = length; - return (bus_generic_map_resource(dev, child, type, range->res, &args, - map)); + return (bus_map_resource(dev, range->res, &args, map)); } static int @@ -671,16 +670,16 @@ generic_pcie_unmap_resource(device_t dev, device_t child, int type, #endif case SYS_RES_IOPORT: case SYS_RES_MEMORY: - range = generic_pcie_containing_range(dev, type, - rman_get_start(r), rman_get_end(r)); - if (range == NULL || range->res == NULL) - return (ENOENT); - r = range->res; break; default: - break; + return (bus_generic_unmap_resource(dev, child, type, r, argsp, map)); } - return (bus_generic_unmap_resource(dev, child, type, r, map)); + + range = generic_pcie_containing_range(dev, type, rman_get_start(r), + rman_get_end(r)); + if (range == NULL || range->res == NULL) + return (ENOENT); + return (bus_unmap_resource(dev, range->res, map)); } static bus_dma_tag_t diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index da09a917b9bc..06e8c2bc8433 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -2553,7 +2553,7 @@ pcib_map_resource(device_t dev, device_t child, int type, struct resource *r, args.offset = start - rman_get_start(pres); args.length = length; - return (bus_generic_map_resource(dev, child, type, pres, &args, map)); + return (bus_map_resource(dev, pres, &args, map)); } static int @@ -2562,14 +2562,16 @@ pcib_unmap_resource(device_t dev, device_t child, int type, struct resource *r, { struct pcib_softc *sc = device_get_softc(dev); struct pcib_window *w; + struct resource *pres; w = pcib_get_resource_window(sc, r); - if (w != NULL) { - r = pcib_find_parent_resource(w, r); - if (r == NULL) - return (ENOENT); - } - return (bus_generic_unmap_resource(dev, child, type, r, map)); + if (w == NULL) + return (bus_generic_unmap_resource(dev, child, type, r, map)); + + pres = pcib_find_parent_resource(w, r); + if (pres == NULL) + return (ENOENT); + return (bus_unmap_resource(dev, pres, map)); } #else /* diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index d513d3ea5a5a..b5a77cd5ad4e 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -552,7 +552,7 @@ vmd_map_resource(device_t dev, device_t child, int type, struct resource *r, args.offset = start - rman_get_start(pres); args.length = length; - return (bus_generic_map_resource(dev, child, type, pres, &args, map)); + return (bus_map_resource(dev, pres, &args, map)); } static int @@ -560,11 +560,12 @@ vmd_unmap_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map *map) { struct vmd_softc *sc = device_get_softc(dev); + struct resource *pres; - r = vmd_find_parent_resource(sc, r); - if (r == NULL) + pres = vmd_find_parent_resource(sc, r); + if (pres == NULL) return (ENOENT); - return (bus_generic_unmap_resource(dev, child, type, r, map)); + return (bus_unmap_resource(dev, pres, map)); } static int From nobody Thu Feb 27 14:17:18 2025 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 4Z3YM24hcFz5qG9t; Thu, 27 Feb 2025 14:17:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM24Ht2z3xBP; Thu, 27 Feb 2025 14:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665838; 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=YzL2x8rGvCCpI1PTazPvqS5qt/qs2GDw1050wu1xiQA=; b=iWzGjwbMsfSUck4uy9bPUH3CmVKijlUY0t+Sg2dvE+IMsbIqRs7GHchQPFPczX2wPPsqsn HgG/wUEa2mT+utd892F8tHfFy7KG315dDAoQW77AnXujuyPBFLMH+GVBri1257Ja98mZ09 nAmstG2DkvKwsXbSqYuQyWqCp+ZAOsbif5I+UX34XYHRUpAbNeFx8WtdcJeBSIAGTY+lPl Ss43db3S2Q3XhiOlNo0yG/cSqTFYkPTsAY4u+LVXrDwzukgZw+B7vn08G9iGF7Pj8yc35y Mfz1csdMJwFDWuWZCkpjuVBA2sRw3sOkN2TiTJTY7lO/uYRpP4LWxN2eWFQxOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665838; a=rsa-sha256; cv=none; b=O9nDI45dFa06GUPD5+6SfwAo92k3lOZPGRict6yYk4+hORM4rVg9aaExQ9eoTM37pretPp TuRCzxQUIVKW3OvgbEZU7BiKxYz55iqAYEiG7rSRcndGYEEjuPmZp6ApgIqNooWuLioizj onKlMxsWcVOqrJjc647oS90dRV9SaiL3eeJKmbBxJvNPjb1C2xNk1iFQk6VfB/5qNj2d4/ Puj82+dCY1MXIWIpnxDpcJYQwcXNo/wRTMbs37HoD3wewXwkUiuUbDZy8aYeGXvpabk+/r yYNVeOTeSRoPA10l1omrAr8fW/EfO9m/rSVptCDJ5FIYLVRvFzwthMsk8w3/EQ== 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=1740665838; 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=YzL2x8rGvCCpI1PTazPvqS5qt/qs2GDw1050wu1xiQA=; b=bhr+TEQJM1rFGqWzGvlXlagqhfhdDeYAWs0WGUwNq8xRuR2w6f0F5yht1xArEzjYl3uoNk t9h7/wvMnHSYuvudl65zNDJyW5gG899vfHdO8pWp0kq2RVitCvO7TMUpFYY2mLghhf8SmN uugxAuHLyyeIeytbc6TdPbRbKYilwZSQAERP8Exicp6+KzV/pkgKN1Ld3LPnqg/a4BhnD6 wPr9W+f7rPAFREn/3djP89YtmwiR3UmWPEJx0p33CR779jaL336tb5ejLR8p/Nhj6eYPRo A5X2JKSEZFPVx5OqlQ/FfA8NpjNKutaENNrD3mRIBV2Vk/o3wAaQzn4gZYXjSQ== 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 4Z3YM23sPNzmdy; Thu, 27 Feb 2025 14:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHIuM017119; Thu, 27 Feb 2025 14:17:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHI9s017115; Thu, 27 Feb 2025 14:17:18 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:18 GMT Message-Id: <202502271417.51REHI9s017115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a69089343057 - stable/14 - sys: Set the type of allocated bus resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a69089343057c837c9fd6f7ae6e67a73c2f91983 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a69089343057c837c9fd6f7ae6e67a73c2f91983 commit a69089343057c837c9fd6f7ae6e67a73c2f91983 Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 sys: Set the type of allocated bus resources Use rman_set_type to set the type of allocated resources everywhere rman_set_rid is currently called. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44123 (cherry picked from commit 1b9bcffff39a817b77401d1b975f374781adfaf8) --- sys/dev/bhnd/bhndb/bhndb.c | 1 + sys/dev/dpaa/fman.c | 1 + sys/dev/pci/pci_iov.c | 1 + sys/dev/pci/pci_pci.c | 2 ++ sys/dev/pci/pci_subr.c | 1 + sys/kern/subr_bus.c | 1 + 6 files changed, 7 insertions(+) diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c index 4e631f85b3b6..978ad9c3e62b 100644 --- a/sys/dev/bhnd/bhndb/bhndb.c +++ b/sys/dev/bhnd/bhndb/bhndb.c @@ -1005,6 +1005,7 @@ bhndb_alloc_resource(device_t dev, device_t child, int type, return (NULL); rman_set_rid(rv, *rid); + rman_set_type(rv, type); /* Activate */ if (flags & RF_ACTIVE) { diff --git a/sys/dev/dpaa/fman.c b/sys/dev/dpaa/fman.c index 7b82a0fbc1fd..f14ca45e1fc1 100644 --- a/sys/dev/dpaa/fman.c +++ b/sys/dev/dpaa/fman.c @@ -192,6 +192,7 @@ fman_alloc_resource(device_t bus, device_t child, int type, int *rid, if (res == NULL) return (NULL); rman_set_rid(res, *rid); + rman_set_type(res, type); if ((flags & RF_ACTIVE) != 0 && bus_activate_resource( child, type, *rid, res) != 0) { rman_release_resource(res); diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 60325e8cd491..ee1387966b00 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -1050,6 +1050,7 @@ pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid, } rman_set_rid(res, *rid); + rman_set_type(res, SYS_RES_MEMORY); if (flags & RF_ACTIVE) { error = bus_activate_resource(child, SYS_RES_MEMORY, *rid, res); diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index cda1597ac76e..68eab2a6633b 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -727,6 +727,7 @@ pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid, rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); rman_set_rid(res, *rid); + rman_set_type(res, PCI_RES_BUS); return (res); } @@ -1930,6 +1931,7 @@ pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w, w->name, rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); rman_set_rid(res, *rid); + rman_set_type(res, type); if (flags & RF_ACTIVE) { if (bus_activate_resource(child, type, *rid, res) != 0) { diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c index d0f6c9500b17..e2583a75e303 100644 --- a/sys/dev/pci/pci_subr.c +++ b/sys/dev/pci/pci_subr.c @@ -344,6 +344,7 @@ pci_domain_alloc_bus(int domain, device_t dev, int *rid, rman_res_t start, return (NULL); rman_set_rid(res, *rid); + rman_set_type(res, PCI_RES_BUS); return (res); } diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index bd54977cc6f1..ffad54c34925 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4305,6 +4305,7 @@ bus_generic_rman_alloc_resource(device_t dev, device_t child, int type, if (r == NULL) return (NULL); rman_set_rid(r, *rid); + rman_set_type(r, type); if (flags & RF_ACTIVE) { if (bus_activate_resource(child, type, *rid, r) != 0) { From nobody Thu Feb 27 21:04:23 2025 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 4Z3kNl52FBz59VvH; Thu, 27 Feb 2025 21:04:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kNl4W96z43kB; Thu, 27 Feb 2025 21:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690263; 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=LddyQsiXfCsAbcVSpJwSY78u4nURqawyoEcam+Qwg+Y=; b=u+J7pUoAZHwce6IU0CajTIs68pmaZlwDgaahdyr5/FhrktC6sqfccV0dX9p+TPQ2eVrqit 5PCOXmZr8YO1Zv/7OpwD1SSIuHywvSMu5Ue62SmIb+KtgBRsQj7LsGnOPmaDOsPkRqnZbV wXgp7dinKQ7ZWYVYljucylqu1P/JhG7/rGfH23QPlE1moxgW5UyZSU8ZrukYbGHUSJhVpb z7+/vz8O3E2AoAsIiTYXiIGjTkOexaDnPTCWCxCVQe8KcCJTTyOq/D11OmB/4Hca0SV6Jr SJgMCsYGPggrDq8fDG5JJq2fI6eakjAKIq+uvLwAbPh0ihV+n1KPvJ/p9SZobg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690263; a=rsa-sha256; cv=none; b=AvizbR5R5VNJwvDCq+wrDZF7nPZQTkIBxomXLDEPkZmsltNSVbb6BvaSeMNiVoxT+CJ1n7 NqC6HLSB2Ywt0dR/N7FoPSLbFEzIMq4x5ZZ/FCm+H7KPUZ0XbyHcWU+wJ9JAUtk8WL+Ghs p7A8K3zBVQCBDI0Rz2T6uLzr501KfqherdD74e/EpWGurXSlz7eWtIKlfTDI0biQtRkYh9 mVd/7rUjmkMOkqPi+xK85niaiFOjSp71+Mu2w69xzcoRJq/ciC11gOSPOKl7pMs3Av1I2+ BWyp/F5U+MSKWA1a2CbgqEqO90DMot9WmxOCN1pqdrQ5LF9mMuSTDzAtKpwUEg== 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=1740690263; 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=LddyQsiXfCsAbcVSpJwSY78u4nURqawyoEcam+Qwg+Y=; b=MF3lpj2O3cyRrgc476vEZwJoTn3x1SPhAzWGN+p8eVUi9fwoI8jalr9JJNvgJu8MdYzMRD RUrlTNw1bThzNssZoeBbL3bczuMItUKp9Zouvh7YIaUBVmZSCtBU5nXjC+ZZsh/pV3QgqM WqHLpjmhpiS32kELcJ3QULnoIBe8Aj2i4/4xSi9ay7SsTlfOKZYHNTQ2HeUpcW6ZQHL/3/ WTB94ck1ouxh0o/Sv541SU4KAhVangB45pvGSuqAAweqiLanflraRWQj4HO7iBpY+eIV/N PTnCSPUqBHqIDVpFo5/miTXPNCEvFWFPHvTr3RT3cMB1jjyQe1NO6RQ3LqwjYw== 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 4Z3kNl3nChz102M; Thu, 27 Feb 2025 21:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL4NPf085547; Thu, 27 Feb 2025 21:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL4Nrv085544; Thu, 27 Feb 2025 21:04:23 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:04:23 GMT Message-Id: <202502272104.51RL4Nrv085544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 63c197298957 - stable/14 - LinuxKPI: 802.11: compile in VHT compat code by default 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 63c197298957c89fe3e7bd0c3392da74ed72a24b Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=63c197298957c89fe3e7bd0c3392da74ed72a24b commit 63c197298957c89fe3e7bd0c3392da74ed72a24b Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 02:27:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-27 21:03:21 +0000 LinuxKPI: 802.11: compile in VHT compat code by default Compile in the VHT compat code by default even though no one will make use of it yet. Sponsored by: The FreeBSD Foundation Tested with: iwlwifi AX210 (NOHT, HT20, HT40, VHT20, VHT40, VHT80) (cherry picked from commit 2c44f1ff6935e93f7774e526f2f1ab0a2812eab5) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b684bd76bacf..88bbc9fa52a7 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -80,7 +80,7 @@ #define LKPI_80211_WME #define LKPI_80211_HW_CRYPTO #define LKPI_80211_HT -/* #define LKPI_80211_VHT */ +#define LKPI_80211_VHT #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) #define LKPI_80211_HT From nobody Thu Feb 27 19:45:50 2025 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 4Z3hf64g6nz59Ryq; Thu, 27 Feb 2025 19:45:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3hf63p2Dz3dcx; Thu, 27 Feb 2025 19:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740685550; 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=xjmf0EcewgID0csO6vdnBMABE8rDjcL8GN8OipRNq8Y=; b=GPde1yRctB5LeXaL/nsUolxCcSbjYirCG1e5z5esVi20cqk5hKtOCQXVwNOqwWtV36RRAY sI//bfc6h4LpbbFPj0pjflrM6DgY2G0wTm/YKl7LTnX99wIvIDlx/LhEg2SPugLvIdybcY kUNxmJEPfCEze2t9p9YSI0DP0gCBLEFRKu3734XxG4yukopewp5EfJhd5hO5GLtvpyLPzq nlnyFQVSRb1Ys+rmFGPp0t6VDPh5tL/YdvABXxopF/qUL1H5ht3GmJzWDl8xDWL9qyyUyN OwS+YB6ia1Z7wcxcQImqlDMqkmGscDIg7EesSrDgbrHRfZs/6+zayZZcVJsqPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740685550; a=rsa-sha256; cv=none; b=va48OKF2Mt9ZJz3W4GkrF3Wonscj1ikHS9TRqsOqRdc9Yw2uJwLjPVzI+eyqxYEdKvOPBD WA9IOQLnDjXQgNBXEZOn7T9LHsFqylCMI7ldY7sZkp+dLG7U4K7U7R2HKwxz7/dnT2LvPA YqMg2vCdJWERhj1vQS0blqhLW/LsBkWott6f4MQ++qz4BAaiCkBJ5luy9gYGaUrjg4Z03W dAyObHzuX8p6CBS3+unevGI+0eZ4n2qFTPLGXJGogPNfTI4rA+tR5CK5JAecvmT1LYENf/ +poVZuPvanJAC3AixkPDY2322bPsosA03feEMEafCmmUOe794oQtyyVKBSoStA== 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=1740685550; 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=xjmf0EcewgID0csO6vdnBMABE8rDjcL8GN8OipRNq8Y=; b=rqKvkd2PVjW+1AvJKGQ0PGPDk573uAMkQ1PMK7IV/GTY//UHcbNV+PNNYmPUbhk0K36Gj5 ZWZ62J0Cc3SWg8tJvlbYZX4jD2GQYpZHsL14HihamdJccxM90qqHGkxF1PPoaE07rJ8+fw R0Ua20d1KwPHLEzGKzeL+V/8wFVrt3cRRmZ02ml16qXQae9xDQvNpviSSJ1SlKqzsGWbwW qxdBM7CuK8PXCyHD1aHy+o9WdPR/qqTTd6JDhDKuSWjK1jN3ZGjCsvI/z4dDaXGAQkxJ/g zeYMK8wPd01Mss4qV9w22Y310ZFl20Q9f7+ZJZiWLuvYAqb+u3TDb4BQibX6iA== 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 4Z3hf62y4tzvlw; Thu, 27 Feb 2025 19:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RJjo1t035058; Thu, 27 Feb 2025 19:45:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RJjoG9035055; Thu, 27 Feb 2025 19:45:50 GMT (envelope-from git) Date: Thu, 27 Feb 2025 19:45:50 GMT Message-Id: <202502271945.51RJjoG9035055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f183965bb8f5 - stable/14 - pkgbase: fix inclusion of tests in ssh, bsnmp, clibs-dev 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f183965bb8f5cf68edbd60a7c39e20ad211d6bd5 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f183965bb8f5cf68edbd60a7c39e20ad211d6bd5 commit f183965bb8f5cf68edbd60a7c39e20ad211d6bd5 Author: Isaac Freund AuthorDate: 2024-12-23 21:54:29 +0000 Commit: Ed Maste CommitDate: 2025-02-27 19:45:40 +0000 pkgbase: fix inclusion of tests in ssh, bsnmp, clibs-dev Currently, files that belong in the tests package are included in the ssh, bsnmp, and clibs-dev packages: ssh.plist 24:@dir(root,wheel,0755,) /usr/tests/secure/libexec 25:@(root,wheel,0444,) /usr/tests/secure/libexec/Kyuafile bsnmp.plist 82:@dir(root,wheel,0755,) /usr/tests/lib/libbsnmp 83:@(root,wheel,0444,) /usr/tests/lib/libbsnmp/Kyuafile 84:@(root,wheel,0555,) /usr/tests/lib/libbsnmp/bsnmpd_test clibs-dev.plist 2518:@dir(root,wheel,0755,) /usr/tests/lib/csu 2519:@(root,wheel,0444,) /usr/tests/lib/csu/Kyuafile This is caused by the PACKAGE=foo assignment in foo/Makefile.inc which overrides the default PACKAGE?=tests in bsd.test.mk. To fix this, instead use PACKAGE?=foo in foo/Makefile.inc and set PACKAGE=tests in foo/tests/Makefile. PR: 249144 Reviewed by: bapt, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47025 (cherry picked from commit 3a56015a2f5d630910177fa79a522bb95511ccf7) --- lib/csu/Makefile.inc | 2 +- lib/csu/tests/Makefile | 1 + lib/libbsnmp/Makefile.inc | 2 +- lib/libbsnmp/tests/Makefile | 2 ++ secure/libexec/Makefile.inc | 2 +- secure/libexec/tests/Makefile | 1 + 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc index 1509a1ece2c3..1c9d3853b0d4 100644 --- a/lib/csu/Makefile.inc +++ b/lib/csu/Makefile.inc @@ -1,4 +1,4 @@ -PACKAGE= clibs-dev +PACKAGE?= clibs-dev NO_WMISSING_VARIABLE_DECLARATIONS= # Can't instrument these files since that breaks non-sanitized programs. diff --git a/lib/csu/tests/Makefile b/lib/csu/tests/Makefile index 3f95193420ea..c9a0e6eff5da 100644 --- a/lib/csu/tests/Makefile +++ b/lib/csu/tests/Makefile @@ -1,3 +1,4 @@ +PACKAGE= tests SUBDIR= dso TESTS_SUBDIRS= dynamic diff --git a/lib/libbsnmp/Makefile.inc b/lib/libbsnmp/Makefile.inc index 80478f392410..d9ae6f7deb8c 100644 --- a/lib/libbsnmp/Makefile.inc +++ b/lib/libbsnmp/Makefile.inc @@ -1,5 +1,5 @@ INCSDIR= ${INCLUDEDIR}/bsnmp -PACKAGE= bsnmp +PACKAGE?= bsnmp .include "../Makefile.inc" diff --git a/lib/libbsnmp/tests/Makefile b/lib/libbsnmp/tests/Makefile index 529622104449..ca8bcda8401f 100644 --- a/lib/libbsnmp/tests/Makefile +++ b/lib/libbsnmp/tests/Makefile @@ -1,6 +1,8 @@ .include +PACKAGE= tests + ATF_TESTS_C+= bsnmpd_test SRCS.bsmpd_test= bsnmpd_test.c diff --git a/secure/libexec/Makefile.inc b/secure/libexec/Makefile.inc index e5beeed87cac..6cb7a9096b7b 100644 --- a/secure/libexec/Makefile.inc +++ b/secure/libexec/Makefile.inc @@ -1,5 +1,5 @@ BINDIR?= /usr/libexec -PACKAGE= ssh +PACKAGE?= ssh .include "../Makefile.inc" diff --git a/secure/libexec/tests/Makefile b/secure/libexec/tests/Makefile index b8996030aafc..b8e8a3828b9c 100644 --- a/secure/libexec/tests/Makefile +++ b/secure/libexec/tests/Makefile @@ -1,5 +1,6 @@ .PATH: ${SRCTOP}/tests KYUAFILE= yes +PACKAGE= tests .include From nobody Thu Feb 27 18:58:34 2025 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 4Z3gbZ54PNz59PxC; Thu, 27 Feb 2025 18:58:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3gbZ4Gdhz3QZC; Thu, 27 Feb 2025 18:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682714; 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=XwXP5imPNbbCRNZIsBE01D0z8xYblnX4q2bT862EG3w=; b=FJm5bkbA9P5s9U6sc/5SymX4XERwvwG7opkxWYTGakEkO1JvlOOiZNkvM9DmF15RMkxaAW fq0f58qL1pUmaghn7QfcgcNbZSgYT2RmEV4ag44RdCaQ3FNY929NM2RN9IvP1muQk8doXe Ma8dpmwcA1uBF9UG9eu3wg6UrYWyPAdmyXUmiaSL70ZVn66oQEcut8DkTlqhVXk0/nTwg7 tNOLzsPLCJrFFQeRGLDNhY8ZCtKI+qKtAyRid3Ra4g7uj42YpJYa5LZjFNOrb2IRAfzBaV pih1oo9e3hEdh5uwo9vrkSEzfUWgcFpk+kIhf/xb+bXWDHpvYvm49WoGAH/lyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740682714; a=rsa-sha256; cv=none; b=PQPmmmM1rlEEUvYRjlrkjcvHnH8bgNUEdJ+3e5ROau9++/XBa+azCFXA1BwhYSJcx+Fh82 MEyAjEZN3TTm9zDWLc2aAsYWNcVZuhAkQGuU/C1ts3q3F+n9dm1Kxgzw9wHdYG/NUe6qEX BzXAUEYKgA3lYgnWoLgw8J/+H/+zcUqWMnnzX7YBAhNex0+LoAhLWSY7vBqwyYF+3qOx4q 5Edmq/j9VZBwk/IGMiRoOPRjA3eoTifQBtUkLSbfwCpDhBCEAswy1UDnsQy7zz+bSZjQgc Pxq/4RGI3xCStBUonIOCccysHr7CCqObp85dTvBvzW6OeDnHHYBln894Hi2J1w== 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=1740682714; 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=XwXP5imPNbbCRNZIsBE01D0z8xYblnX4q2bT862EG3w=; b=vPgkUDM4pq9TY7vkBF8o5LoeTzlnSE0h7WWIg8dsUdAJ148qpOZ49bbnfPyZbY6+MnGgpZ ObmTvK4WCF4N8xT2TPElr0DAK3DCnM5XzTx3J3AjCgN9mw7qth2tlqU8LSUmCAEVljByx4 kKr8ztLt2+i+hi90AK8iSrawaQlsxoM2QLaolfmjkEIxrGKbmu7Zt/N49zSGpfHOX9vlqi 55riVlup/wStX+7fx3FDHCb9us2+zKeDyJszhftwuUG3bbq5YmSb+HLEUduafUu/bJRzBW gpirA8xJ8h4LjMrrQYcdB55eAPvsYNMvZrvBB+rp06AGf6HwYsuRs+D2niZSbQ== 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 4Z3gbZ1476zvmL; Thu, 27 Feb 2025 18:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RIwYg0042777; Thu, 27 Feb 2025 18:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RIwYTk042774; Thu, 27 Feb 2025 18:58:34 GMT (envelope-from git) Date: Thu, 27 Feb 2025 18:58:34 GMT Message-Id: <202502271858.51RIwYTk042774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 00df1242ecb0 - stable/14 - .cirrus-ci: Update the non-manual GCC build job to GCC 13 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00df1242ecb0de7b2b789a398e534907c5194efc Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=00df1242ecb0de7b2b789a398e534907c5194efc commit 00df1242ecb0de7b2b789a398e534907c5194efc Author: John Baldwin AuthorDate: 2025-01-03 15:44:44 +0000 Commit: John Baldwin CommitDate: 2025-02-27 18:54:00 +0000 .cirrus-ci: Update the non-manual GCC build job to GCC 13 Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48291 (cherry picked from commit f586d52599499f254f0dd6053c811df4031514ca) --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ae83c7d4cd9b..8daaef148ca7 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -131,12 +131,12 @@ task: TOOLCHAIN: aarch64-gcc14 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s - - name: amd64-gcc12 World and kernel build and boot smoke test (FreeBSD repo) + - name: amd64-gcc13 World and kernel build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' && $CIRRUS_BRANCH =~ 'pull/.*' env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN: amd64-gcc12 + TOOLCHAIN: amd64-gcc13 TOOLCHAIN_PKG: ${TOOLCHAIN} EXTRA_MAKE_FLAGS: -s timeout_in: 120m From nobody Thu Feb 27 14:16:51 2025 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 4Z3YLW4ftfz5qGJs; Thu, 27 Feb 2025 14:16:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLW44f0z3xP4; Thu, 27 Feb 2025 14:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665811; 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=74q+D3gW5myxB2ffB4WItcGOkJaklBSZ72t1uxTyOjE=; b=rEEVZsebaNsxQOC3zcqRlFj/5t50u/MQNz7Y8tiXeQyZwCN3Zc00PVw4FQiixab3pcp4dU h8DisZYqYqRs7jnxVDDRMIGS4d3S07Jl4YEGvdFYfr/uVOUCPa3Nfyj4tOk7Vra9k+j6yf M0TD6NkAPhK8i+SFxImY1t195BYL4QZgjQwEN7RZzl8mSSjCb3cwft8ZdXihaF2/Z5I/9i PIgN7f5+TemmhG/hlZJqXe9H7ba3UvrUEZ6gEA3ID1TWkz+oY2nbxl79hsWzG8ezyGVmPT 70nb5xNlP7besCM+HsBDZYqA6cGwodmFvfp5LATf1EL4XnSvdPtGPZ+9qJQa2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665811; a=rsa-sha256; cv=none; b=vM4gmnFfaj4nEU6XZQcE7ewkYOTrmkJ3Jk1ydI7PWLLUxFuDpTSFmXEtoW6eNvRf4gIEtT NQvJktdDg+pyg9mt9ov6L9Q3S975w+OcI30/Fz5jca+TzcICqFYZKW4pybrfEOcgGrVI1e HTxWNsotxw5ZBk+xvMeSTd7Fu0FfT1NusoOQY67lEjOzrousckc9h620RycBxPTvNx0nfV AnvCbulC1MhU0ghSs97K/0MWnr2OzeNlVVngDhfOMb5auvtBg1BU/3YlCYo6qQgvDBFRcR ygzqCrjMUX61bU8Sy47GYJNlqnwe8TUgyIHgSNZ9t73A9QD296rSRLFugQeiaA== 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=1740665811; 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=74q+D3gW5myxB2ffB4WItcGOkJaklBSZ72t1uxTyOjE=; b=JlS0M64iiUIjlrUNKE9aIPHTHx+g0XdX8eMgH9UYFwlMcfmX6iA35xJtQenquz8k6OzwD6 yaRet4WO5tq9EGmz7DRor5wNmmtRUHc57wJ5ZEeXkiqKtkW0ggKDall6x4cQcZeYo/XR/5 a5jCeHSqGI65BWWZrNfHYIpFs6D/KDuSHdNwtvnj9ShEynG2H7TYtIFIWh62Tmthze7sxh 5/QeW4NTMQA2HekBCpNkmc7B/KCxRWZq/jcWue0trJflwOT5CEVJECkzpNNqTBWSIy8wIs 4c/M3I52yTMSMuMkp0Ci3qgn9rBLQ6ffG81QVZYXvGcRYz6yAHhYQ6Fystig/Q== 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 4Z3YLW3gjXzmpY; Thu, 27 Feb 2025 14:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGpfR016275; Thu, 27 Feb 2025 14:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGpQ8016272; Thu, 27 Feb 2025 14:16:51 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:51 GMT Message-Id: <202502271416.51REGpQ8016272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a818e65ec2bd - stable/14 - gpiobus: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a818e65ec2bda220f163c3a041710ef1533918b9 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a818e65ec2bda220f163c3a041710ef1533918b9 commit a818e65ec2bda220f163c3a041710ef1533918b9 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 gpiobus: Use bus_generic_rman_* Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43887 (cherry picked from commit 5bda26333a8ebf34190e3a9124895e6a18e58e93) --- sys/dev/gpio/gpiobus.c | 57 +++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index db18703606aa..18129c32133d 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -805,20 +805,29 @@ gpiobus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) return (0); } +static struct rman * +gpiobus_get_rman(device_t bus, int type, u_int flags) +{ + struct gpiobus_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_IRQ: + return (&sc->sc_intr_rman); + default: + return (NULL); + } +} + static struct resource * gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct gpiobus_softc *sc; - struct resource *rv; struct resource_list *rl; struct resource_list_entry *rle; int isdefault; - if (type != SYS_RES_IRQ) - return (NULL); isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); - rle = NULL; if (isdefault) { rl = BUS_GET_RESOURCE_LIST(bus, child); if (rl == NULL) @@ -826,40 +835,12 @@ gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, rle = resource_list_find(rl, type, *rid); if (rle == NULL) return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); start = rle->start; count = rle->count; end = rle->end; } - sc = device_get_softc(bus); - rv = rman_reserve_resource(&sc->sc_intr_rman, start, end, count, flags, - child); - if (rv == NULL) - return (NULL); - rman_set_rid(rv, *rid); - if ((flags & RF_ACTIVE) != 0 && - bus_activate_resource(child, type, *rid, rv) != 0) { - rman_release_resource(rv); - return (NULL); - } - - return (rv); -} - -static int -gpiobus_release_resource(device_t bus __unused, device_t child, int type, - int rid, struct resource *r) -{ - int error; - - if (rman_get_flags(r) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); - } - - return (rman_release_resource(r)); + return (bus_generic_rman_alloc_resource(bus, child, type, rid, start, + end, count, flags)); } static struct resource_list * @@ -1056,9 +1037,9 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_alloc_resource, gpiobus_alloc_resource), - DEVMETHOD(bus_release_resource, gpiobus_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list), DEVMETHOD(bus_add_child, gpiobus_add_child), DEVMETHOD(bus_child_deleted, gpiobus_child_deleted), From nobody Thu Feb 27 14:17:22 2025 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 4Z3YM71kyLz5qFxC; Thu, 27 Feb 2025 14:17:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM717mdz3xBf; Thu, 27 Feb 2025 14:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665843; 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=wkhK1BPH84nMllfwGmc0dnU8ctHJn0RND7aJcUJFVnw=; b=fc4YWA6gWbU/bY2wBSYTTKnwuwlzBWEaoaq8aNZcmAzrodz8Y/pI0N/B0nEpc2bEQh+2ds V60xk1FJnEuwUJTdb0W8zbpamyLJDa+OEYWhskg9HSp+c8A+yHx7yoNSehWRhbfJwL9wX1 DMiBiBE+DiuZjONdHWd565S7/91NGEGQ1ACDpPPNCtZ8fGHxHdm2VEKCPDE31vxrengg65 1I06e/VNcmIKANBMRIIvO0VhXA/b5owl8TPgcY6sHgm/c3q5DBGzWACSomk4Ro3CEWYCdy pBGJQhhkPEYxsAHuXn7wfsrxFecHG595H51539+fajP3Sble1Ks4IK4iDwUMBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665843; a=rsa-sha256; cv=none; b=mnRwvNO9d3/X+M7A/jpTEjjQVOiPBRqUnpq51AeJTKFWE/v5PT0GsTcqWXsLyDfGNOKAEf BZ+DmR3hXMmyb3ssBXuf3hcbawO8nkWT7t0pH8IUfquElvH1h3n7DE32dBJ4DeVpzgPbx1 jZs34Dx9VmACKbhTmrZn9nYHNQL+XFB3w5jyjUuKEsT6SiHUSdw1sG4ZiRxbjYJtbrI3UE QHQ2IISPnqqwBy0TGRnn5FcSykl5jIn49zcD/b3VKSq+kGl/R5iwTwHx2zGTDCtHEzqbTd eePtSSRQS6UWGXeVGQfY+f51Z9wx6KlfTpkSAksovqVdt7wvwu1S7Vwv3QXspg== 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=1740665843; 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=wkhK1BPH84nMllfwGmc0dnU8ctHJn0RND7aJcUJFVnw=; b=e6kJKK3iQvDSLChZE0gB/oWihh9xYcJFXY4L9XExOgf+Y6TFMth3vegYn13iCXWMljwd+V ere3ikrTycLSudNfgxH5/79L3Rea5jMkhQgo7gFcd4H/rkW2U8II1i4NU63LNRMjGBkn4A MaHPoaefXNR/b3lzspJX9fkOjXAzH0wACKa8q6brK9rGSEykhSZtYNF4ku6Oj/zt5zbRz6 mad2K7cvaz+EtmSlJqm4XjVFnOltQtmqiW3Pe1wewM/4sAgMG43JiuV0H6nEMZdpM69h94 qUAhL4KLuowHllc2zW8/yiNLk6ydWhdT/XtRbyf48oBslBrZL5mLc3w7LRtIWw== 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 4Z3YM70l13zmf1; Thu, 27 Feb 2025 14:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHNdd017258; Thu, 27 Feb 2025 14:17:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHMs1017255; Thu, 27 Feb 2025 14:17:22 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:22 GMT Message-Id: <202502271417.51REHMs1017255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 385ad72523fe - stable/14 - pcib: Use rman_get_type in internal functions 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 385ad72523febc812f5f7b8b9b2ca167e7df6914 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=385ad72523febc812f5f7b8b9b2ca167e7df6914 commit 385ad72523febc812f5f7b8b9b2ca167e7df6914 Author: John Baldwin AuthorDate: 2024-03-13 22:05:54 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pcib: Use rman_get_type in internal functions Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44127 (cherry picked from commit 582b84cd252d56f06556134b1103da3a0425fdbd) --- sys/dev/pci/pci_pci.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 68eab2a6633b..da09a917b9bc 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -164,9 +164,9 @@ SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, * sub-allocated from one of our window resource managers. */ static struct pcib_window * -pcib_get_resource_window(struct pcib_softc *sc, int type, struct resource *r) +pcib_get_resource_window(struct pcib_softc *sc, struct resource *r) { - switch (type) { + switch (rman_get_type(r)) { case SYS_RES_IOPORT: if (rman_is_region_manager(r, &sc->io.rman)) return (&sc->io); @@ -188,14 +188,14 @@ pcib_get_resource_window(struct pcib_softc *sc, int type, struct resource *r) * resource managers? */ static int -pcib_is_resource_managed(struct pcib_softc *sc, int type, struct resource *r) +pcib_is_resource_managed(struct pcib_softc *sc, struct resource *r) { #ifdef PCI_RES_BUS - if (type == PCI_RES_BUS) + if (rman_get_type(r) == PCI_RES_BUS) return (rman_is_region_manager(r, &sc->bus.rman)); #endif - return (pcib_get_resource_window(sc, type, r) != NULL); + return (pcib_get_resource_window(sc, r) != NULL); } static int @@ -2386,7 +2386,7 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, * If the resource wasn't sub-allocated from one of our region * managers then just pass the request up. */ - if (!pcib_is_resource_managed(sc, type, r)) + if (!pcib_is_resource_managed(sc, r)) return (bus_generic_adjust_resource(bus, child, type, r, start, end)); @@ -2411,7 +2411,7 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, * Resource is managed and not a secondary bus number, must * be from one of our windows. */ - w = pcib_get_resource_window(sc, type, r); + w = pcib_get_resource_window(sc, r); KASSERT(w != NULL, ("%s: no window for resource (%#jx-%#jx) type %d", __func__, rman_get_start(r), rman_get_end(r), type)); @@ -2447,7 +2447,7 @@ pcib_release_resource(device_t dev, device_t child, int type, int rid, int error; sc = device_get_softc(dev); - if (pcib_is_resource_managed(sc, type, r)) { + if (pcib_is_resource_managed(sc, r)) { if (rman_get_flags(r) & RF_ACTIVE) { error = bus_deactivate_resource(child, type, rid, r); if (error) @@ -2466,7 +2466,7 @@ pcib_activate_resource(device_t dev, device_t child, int type, int rid, struct resource_map map; int error; - if (!pcib_is_resource_managed(sc, type, r)) + if (!pcib_is_resource_managed(sc, r)) return (bus_generic_activate_resource(dev, child, type, rid, r)); @@ -2495,7 +2495,7 @@ pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource_map map; int error; - if (!pcib_is_resource_managed(sc, type, r)) + if (!pcib_is_resource_managed(sc, r)) return (bus_generic_deactivate_resource(dev, child, type, rid, r)); @@ -2533,7 +2533,7 @@ pcib_map_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t length, start; int error; - w = pcib_get_resource_window(sc, type, r); + w = pcib_get_resource_window(sc, r); if (w == NULL) return (bus_generic_map_resource(dev, child, type, r, argsp, map)); @@ -2563,7 +2563,7 @@ pcib_unmap_resource(device_t dev, device_t child, int type, struct resource *r, struct pcib_softc *sc = device_get_softc(dev); struct pcib_window *w; - w = pcib_get_resource_window(sc, type, r); + w = pcib_get_resource_window(sc, r); if (w != NULL) { r = pcib_find_parent_resource(w, r); if (r == NULL) From nobody Thu Feb 27 14:16:55 2025 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 4Z3YLc1Qk4z5qG2F; Thu, 27 Feb 2025 14:16:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLc0wmpz3x07; Thu, 27 Feb 2025 14:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665816; 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=3z8AtzWYFJVv6/UM0gN7cZSEH4NjmfLowLhVFlGwf88=; b=TR8o8Ges0TnWPcWf1q3RbFWWu3Sw70NDkZXDvBalDRwrCbgDdIXAnNJgnFzRZPGEt9rMK7 e/7Pzb218WlWpkg9JjHeNuPiwXmCOBt2U4167I32FHtELHDly+erBVt0K1Y448MkD74zwi UL+p8IlOZmZ8ev0O3LIjNLOoP0LbxQT/rENHJHBizmAJ1DBa/RMk+wo+xuCpXucyMUA9Cs +ptop2UHV+zykQWsWuknBcKez3Eo9yhQU7Oh4tM00bajQNyDD/gUW2eAvnt1uBeXMRHHMO 9i1fCg1S24uL1trpvEumk0Cqrtn+Dym7v8/ON6Gz/rUjaa5nfVYxTbFQt4PlHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665816; a=rsa-sha256; cv=none; b=yNvk/J2cek06Ptzx5dUhSbIqvqU0KrGJkfeQ7zfY7+kgwdysP/Sr/GFJmWkFZyC67ngCnt J2c4dg5cr4HIDHhwStJZ2JFGicii0Yd2ypoMc0JndZffxqDdcaCl1GxUq7LMQIlSB0PNZu i4GCZyCaNxoOpUqe41DeGjQbAJPvklqVReFVrOFLprl4rYhkIaOMh7gwiFV2j4LMUsbAAH BUGY3wU/QFXohesOtjv1AtflmDk4kU9Eult/Pkb+iCPbIFwHeTwWqdSKBtSVJZEDd8qbYM uZIF7F403yevCQp7F2A0O61HhekJYP8du67+r4C9cl4cxEIOm7nLUCunnexS7A== 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=1740665816; 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=3z8AtzWYFJVv6/UM0gN7cZSEH4NjmfLowLhVFlGwf88=; b=eYDoKZe93zlEndKnMPVURID8gz1Rr57k5n6GvAowPA3PtdfJ0/2gcgaDu696pzOKjVmy8t 9ufKD/QIbyDUW95AFnaZMbMOhgc1LAFqNq3eEqZUk/TtC9ZcC5VeVaQEAaVIQM/Bxp8SOX XgCt2H24J9CNJ6swI9MjMxw9mRJl4xwxjFHMQg3fQufrNBROa5C+dgpARfCH4k9J32L8xs /6XdwoeULLenpu08xryeYg6WqtxEhj76D/OjofhQDPyEi1nP0awWhujG4rJqdkPot+Vu4v mk5xx6Figm9R817Ui738jYsa2uoSYlWZQjD4RhWxzb/FjWSZ3M8lj4Yeusd1cQ== 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 4Z3YLc05vyzmpb; Thu, 27 Feb 2025 14:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGtt3016420; Thu, 27 Feb 2025 14:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGt0n016417; Thu, 27 Feb 2025 14:16:55 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:55 GMT Message-Id: <202502271416.51REGt0n016417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e5936d602858 - stable/14 - vmd: Use bus_generic_rman_* for PCI bus and memory resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e5936d602858378e649b49fdef8b909b3a20695b Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e5936d602858378e649b49fdef8b909b3a20695b commit e5936d602858378e649b49fdef8b909b3a20695b Author: John Baldwin AuthorDate: 2024-02-15 20:26:40 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 vmd: Use bus_generic_rman_* for PCI bus and memory resources While here, add custom bus_map/unmap_resource methods to request mappings via the window memory resources allocated from the parent bus. Tested by: emaste Differential Revision: https://reviews.freebsd.org/D43886 (cherry picked from commit d714e73f789515963a22fe64417bf3883cdb599c) --- sys/dev/vmd/vmd.c | 133 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 108 insertions(+), 25 deletions(-) diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index 7fc045032dc6..d513d3ea5a5a 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -419,47 +419,53 @@ vmd_get_dma_tag(device_t dev, device_t child) return (sc->vmd_dma_tag); } +static struct rman * +vmd_get_rman(device_t dev, int type, u_int flags) +{ + struct vmd_softc *sc = device_get_softc(dev); + + switch (type) { + case SYS_RES_MEMORY: + return (&sc->psc.mem.rman); + case PCI_RES_BUS: + return (&sc->psc.bus.rman); + default: + /* VMD hardware does not support I/O ports. */ + return (NULL); + } +} + static struct resource * vmd_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct vmd_softc *sc = device_get_softc(dev); struct resource *res; - switch (type) { - case SYS_RES_IRQ: + if (type == SYS_RES_IRQ) { /* VMD hardware does not support legacy interrupts. */ if (*rid == 0) return (NULL); return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags | RF_SHAREABLE)); - case SYS_RES_MEMORY: - res = rman_reserve_resource(&sc->psc.mem.rman, start, end, - count, flags, child); - if (res == NULL) - return (NULL); - if (bootverbose) + } + res = bus_generic_rman_alloc_resource(dev, child, type, rid, start, + end, count, flags); + if (bootverbose && res != NULL) { + switch (type) { + case SYS_RES_MEMORY: device_printf(dev, "allocated memory range (%#jx-%#jx) for rid %d of %s\n", rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); - break; - case PCI_RES_BUS: - res = rman_reserve_resource(&sc->psc.bus.rman, start, end, - count, flags, child); - if (res == NULL) - return (NULL); - if (bootverbose) + break; + case PCI_RES_BUS: device_printf(dev, "allocated bus range (%ju-%ju) for rid %d of %s\n", rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); - break; - default: - /* VMD hardware does not support I/O ports. */ - return (NULL); + break; + } } - rman_set_rid(res, *rid); return (res); } @@ -472,7 +478,8 @@ vmd_adjust_resource(device_t dev, device_t child, int type, return (bus_generic_adjust_resource(dev, child, type, r, start, end)); } - return (rman_adjust_resource(r, start, end)); + return (bus_generic_rman_adjust_resource(dev, child, type, r, start, + end)); } static int @@ -484,7 +491,80 @@ vmd_release_resource(device_t dev, device_t child, int type, int rid, return (bus_generic_release_resource(dev, child, type, rid, r)); } - return (rman_release_resource(r)); + return (bus_generic_rman_release_resource(dev, child, type, rid, r)); +} + +static int +vmd_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == SYS_RES_IRQ) { + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + } + return (bus_generic_rman_activate_resource(dev, child, type, rid, r)); +} + +static int +vmd_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == SYS_RES_IRQ) { + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + } + return (bus_generic_rman_deactivate_resource(dev, child, type, rid, r)); +} + +static struct resource * +vmd_find_parent_resource(struct vmd_softc *sc, struct resource *r) +{ + for (int i = 1; i < 3; i++) { + if (rman_get_start(sc->vmd_regs_res[i]) <= rman_get_start(r) && + rman_get_end(sc->vmd_regs_res[i]) >= rman_get_end(r)) + return (sc->vmd_regs_res[i]); + } + return (NULL); +} + +static int +vmd_map_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct vmd_softc *sc = device_get_softc(dev); + struct resource_map_request args; + struct resource *pres; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + pres = vmd_find_parent_resource(sc, r); + if (pres == NULL) + return (ENOENT); + + args.offset = start - rman_get_start(pres); + args.length = length; + return (bus_generic_map_resource(dev, child, type, pres, &args, map)); +} + +static int +vmd_unmap_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + struct vmd_softc *sc = device_get_softc(dev); + + r = vmd_find_parent_resource(sc, r); + if (r == NULL) + return (ENOENT); + return (bus_generic_unmap_resource(dev, child, type, r, map)); } static int @@ -648,13 +728,16 @@ static device_method_t vmd_pci_methods[] = { /* Bus interface */ DEVMETHOD(bus_get_dma_tag, vmd_get_dma_tag), + DEVMETHOD(bus_get_rman, vmd_get_rman), DEVMETHOD(bus_read_ivar, pcib_read_ivar), DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, vmd_alloc_resource), DEVMETHOD(bus_adjust_resource, vmd_adjust_resource), DEVMETHOD(bus_release_resource, vmd_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_activate_resource, vmd_activate_resource), + DEVMETHOD(bus_deactivate_resource, vmd_deactivate_resource), + DEVMETHOD(bus_map_resource, vmd_map_resource), + DEVMETHOD(bus_unmap_resource, vmd_unmap_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From nobody Thu Feb 27 14:16:48 2025 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 4Z3YLS1dRtz5qFXw; Thu, 27 Feb 2025 14:16:48 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLS1Qv0z3xRP; Thu, 27 Feb 2025 14:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665808; 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=Y+ngnPAMVZDydp3i+uvWqKEqilcqHIicCaidhq1xH5E=; b=I6Pfho7ZL8SrxrEmfj9sWaimeQdIQqUaIkVucRbvxnGGqD//iGGxByqAyPrMh+KX8Npyrb t15eVPaL/acgj8xFniz5ipuavPxJQSj/LljVbr8OyfSXX683yFv0fy/cmrYknAgz3fEt+V 8E598YIdOT4limSoo/VpSlyMiUqJTEQSnd14c9IG2KFtIxMnnzzOaoZCd+SToiB7wUg3pL Abvn1NDE0MIZe1U39lanIaU6RBiI3x8NbME0lG8UbTuKPpZbpv8wDNoFPx0UFCNNpfDu1i /+DRicnXF+yUN2La4f6s0f9BCS/Jodfx6UHsAsNH1W/IJVRkGrLxBphZWJzv4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665808; a=rsa-sha256; cv=none; b=TzjHHiCf0tH/EHHUrXkbvJoCx/KVTBJlPU/PT/pdDg47KYqHU7iMaN30toycIxczwZhYhF MgzIErtTG9yTF/8bnB66dBHLF1U0qzUJkMGCcumDUjZG8v4SEwlUgyAC0/hZrL8GRKMMdm V9ksxWjlUtNXx5wUWhNzGYzkNGoK2THVVNNSyd+OuD7AfsS+SFhe+MqXdesAhlfZNPY3x5 yaYsF5bXJJ/jXJbXf/xNSyu6wbgfOrqRrm96Db1XsS80PS8vQ+NyWqt0myCNRrBUHU8tia bV0yVKn3smlQh2fj8iNHedRif6oJCtb0Kaj7MwPL1dOStOcrSUToUDBPm+BOzw== 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=1740665808; 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=Y+ngnPAMVZDydp3i+uvWqKEqilcqHIicCaidhq1xH5E=; b=XwuOKopDinO7u3KlyJ5a2N5BuwrpfckWQumkIoMpXOawAIbJU139L9fGDQR9QsC13Sp99N YedYauVvlWgLQnLWjCVpM8fsYsb4cDQaclummReuGuSovTs+QL98LdJQPz6/RLkkgq+26l 2N/oGxL87UfWfezsAxd4Mm+ykcpHYn+DkLeuAmkWsW9iWF/br1cf/7tgJSpU5MPaQLO8LG 6FXAKtYfiZltuQoKwk3VPCEK+QNda/YolnD/XfuLGioXyHI3Uj4mOPVvXpi63rCu95U4wB hEugH3CL5oWLTGHvT+qQN0pISHP8OfYb4nf7QUPQ4Y/8I8m+AUcdWC1d+M3/7Q== 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 4Z3YLS10VLzm7M; Thu, 27 Feb 2025 14:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGmf0016160; Thu, 27 Feb 2025 14:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGmqp016157; Thu, 27 Feb 2025 14:16:48 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:48 GMT Message-Id: <202502271416.51REGmqp016157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 57f378aacdc1 - stable/14 - acpi: Cleanup handling of suballocated resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57f378aacdc129c20479543617cf670626766919 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=57f378aacdc129c20479543617cf670626766919 commit 57f378aacdc129c20479543617cf670626766919 Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 acpi: Cleanup handling of suballocated resources For resources suballocated from the system resource rmans, handle those in the ACPI bus driver without passing them up to the parent. This means using bus_generic_rman_* for several bus methods for operations on suballocated resources. For bus_map/unmap_resource, find the system resource allocated from the parent bus (nexus) that contains the range being mapped and request a mapping of that parent resource. This avoids a layering violation where nexus drivers were previously asked to manage the activation and mapping of resources created belonging to the ACPI resource managers. Note that this does require passing RF_ACTIVE (with RF_UNMAPPED) when allocating system resources from the parent. While here, don't assume that the parent bus (nexus) provides a resource list that sysres resources are placed on. Instead, create a dedicated resource_list in the ACPI bus driver's softc to hold sysres resources. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43687 (cherry picked from commit 0e1246e3346107b56b52d605a10f763c307e0889) --- sys/dev/acpica/acpi.c | 198 +++++++++++++++++++++++++---------------- sys/dev/acpica/acpi_resource.c | 8 +- sys/dev/acpica/acpivar.h | 6 +- 3 files changed, 130 insertions(+), 82 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index cbb454a52099..ee2494debae7 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -127,11 +127,16 @@ static bus_child_deleted_t acpi_child_deleted; static bus_read_ivar_t acpi_read_ivar; static bus_write_ivar_t acpi_write_ivar; static bus_get_resource_list_t acpi_get_rlist; +static bus_get_rman_t acpi_get_rman; static bus_set_resource_t acpi_set_resource; static bus_alloc_resource_t acpi_alloc_resource; static bus_adjust_resource_t acpi_adjust_resource; static bus_release_resource_t acpi_release_resource; static bus_delete_resource_t acpi_delete_resource; +static bus_activate_resource_t acpi_activate_resource; +static bus_deactivate_resource_t acpi_deactivate_resource; +static bus_map_resource_t acpi_map_resource; +static bus_unmap_resource_t acpi_unmap_resource; static bus_child_pnpinfo_t acpi_child_pnpinfo_method; static bus_child_location_t acpi_child_location_method; static bus_hint_device_unit_t acpi_hint_device_unit; @@ -198,16 +203,19 @@ static device_method_t acpi_methods[] = { DEVMETHOD(bus_read_ivar, acpi_read_ivar), DEVMETHOD(bus_write_ivar, acpi_write_ivar), DEVMETHOD(bus_get_resource_list, acpi_get_rlist), + DEVMETHOD(bus_get_rman, acpi_get_rman), DEVMETHOD(bus_set_resource, acpi_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_alloc_resource, acpi_alloc_resource), DEVMETHOD(bus_adjust_resource, acpi_adjust_resource), DEVMETHOD(bus_release_resource, acpi_release_resource), DEVMETHOD(bus_delete_resource, acpi_delete_resource), + DEVMETHOD(bus_activate_resource, acpi_activate_resource), + DEVMETHOD(bus_deactivate_resource, acpi_deactivate_resource), + DEVMETHOD(bus_map_resource, acpi_map_resource), + DEVMETHOD(bus_unmap_resource, acpi_unmap_resource), DEVMETHOD(bus_child_pnpinfo, acpi_child_pnpinfo_method), DEVMETHOD(bus_child_location, acpi_child_location_method), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_hint_device_unit, acpi_hint_device_unit), @@ -485,6 +493,8 @@ acpi_attach(device_t dev) if (rman_init(&acpi_rman_mem) != 0) panic("acpi rman_init memory failed"); + resource_list_init(&sc->sysres_rl); + /* Initialise the ACPI mutex */ mtx_init(&acpi_mutex, "ACPI global lock", NULL, MTX_DEF); @@ -1307,6 +1317,20 @@ acpi_get_domain_method(device_t dev, device_t child, int *domain) return (ENOENT); } +static struct rman * +acpi_get_rman(device_t bus, int type, u_int flags) +{ + /* Only memory and IO resources are managed. */ + switch (type) { + case SYS_RES_IOPORT: + return (&acpi_rman_io); + case SYS_RES_MEMORY: + return (&acpi_rman_mem); + default: + return (NULL); + } +} + /* * Pre-allocate/manage all memory and IO resources. Since rman can't handle * duplicates, we merge any in the sysresource attach routine. @@ -1314,8 +1338,8 @@ acpi_get_domain_method(device_t dev, device_t child, int *domain) static int acpi_sysres_alloc(device_t dev) { + struct acpi_softc *sc = device_get_softc(dev); struct resource *res; - struct resource_list *rl; struct resource_list_entry *rle; struct rman *rm; device_t *children; @@ -1333,28 +1357,21 @@ acpi_sysres_alloc(device_t dev) } free(children, M_TEMP); - rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); - STAILQ_FOREACH(rle, rl, link) { + STAILQ_FOREACH(rle, &sc->sysres_rl, link) { if (rle->res != NULL) { device_printf(dev, "duplicate resource for %jx\n", rle->start); continue; } /* Only memory and IO resources are valid here. */ - switch (rle->type) { - case SYS_RES_IOPORT: - rm = &acpi_rman_io; - break; - case SYS_RES_MEMORY: - rm = &acpi_rman_mem; - break; - default: + rm = acpi_get_rman(dev, rle->type, 0); + if (rm == NULL) continue; - } /* Pre-allocate resource and add to our rman pool. */ - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, rle->type, - &rle->rid, rle->start, rle->start + rle->count - 1, rle->count, 0); + res = bus_alloc_resource(dev, rle->type, + &rle->rid, rle->start, rle->start + rle->count - 1, rle->count, + RF_ACTIVE | RF_UNMAPPED); if (res != NULL) { rman_manage_region(rm, rman_get_start(res), rman_get_end(res)); rle->res = res; @@ -1531,63 +1548,39 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, * from our system resource regions. */ if (res == NULL && start + count - 1 == end) - res = acpi_alloc_sysres(child, type, rid, start, end, count, flags); + res = bus_generic_rman_alloc_resource(bus, child, type, rid, start, end, + count, flags); return (res); } -/* - * Attempt to allocate a specific resource range from the system - * resource ranges. Note that we only handle memory and I/O port - * system resources. - */ -struct resource * -acpi_alloc_sysres(device_t child, int type, int *rid, rman_res_t start, - rman_res_t end, rman_res_t count, u_int flags) +static bool +acpi_is_resource_managed(device_t bus, int type, struct resource *r) { - struct rman *rm; - struct resource *res; - - switch (type) { - case SYS_RES_IOPORT: - rm = &acpi_rman_io; - break; - case SYS_RES_MEMORY: - rm = &acpi_rman_mem; - break; - default: - return (NULL); - } + struct rman *rm; - KASSERT(start + count - 1 == end, ("wildcard resource range")); - res = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, - child); - if (res == NULL) - return (NULL); - - rman_set_rid(res, *rid); - - /* If requested, activate the resource using the parent's method. */ - if (flags & RF_ACTIVE) - if (bus_activate_resource(child, type, *rid, res) != 0) { - rman_release_resource(res); - return (NULL); - } - - return (res); + rm = acpi_get_rman(bus, type, 0); + if (rm == NULL) + return (false); + return (rman_is_region_manager(r, rm)); } -static int -acpi_is_resource_managed(int type, struct resource *r) +static struct resource * +acpi_managed_resource(device_t bus, int type, struct resource *r) { + struct acpi_softc *sc = device_get_softc(bus); + struct resource_list_entry *rle; - /* We only handle memory and IO resources through rman. */ - switch (type) { - case SYS_RES_IOPORT: - return (rman_is_region_manager(r, &acpi_rman_io)); - case SYS_RES_MEMORY: - return (rman_is_region_manager(r, &acpi_rman_mem)); - } - return (0); + KASSERT(acpi_is_resource_managed(bus, type, r), + ("resource %p is not suballocated", r)); + + STAILQ_FOREACH(rle, &sc->sysres_rl, link) { + if (rle->type != type || rle->res == NULL) + continue; + if (rman_get_start(r) >= rman_get_start(rle->res) && + rman_get_end(r) <= rman_get_end(rle->res)) + return (rle->res); + } + return (NULL); } static int @@ -1595,7 +1588,7 @@ acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { - if (acpi_is_resource_managed(type, r)) + if (acpi_is_resource_managed(bus, type, r)) return (rman_adjust_resource(r, start, end)); return (bus_generic_adjust_resource(bus, child, type, r, start, end)); } @@ -1604,20 +1597,12 @@ static int acpi_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - int ret; - /* * If this resource belongs to one of our internal managers, * deactivate it and release it to the local pool. */ - if (acpi_is_resource_managed(type, r)) { - if (rman_get_flags(r) & RF_ACTIVE) { - ret = bus_deactivate_resource(child, type, rid, r); - if (ret != 0) - return (ret); - } - return (rman_release_resource(r)); - } + if (acpi_is_resource_managed(bus, type, r)) + return (bus_generic_rman_release_resource(bus, child, type, rid, r)); return (bus_generic_rl_release_resource(bus, child, type, rid, r)); } @@ -1638,6 +1623,69 @@ acpi_delete_resource(device_t bus, device_t child, int type, int rid) resource_list_delete(rl, type, rid); } +static int +acpi_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + if (acpi_is_resource_managed(bus, type, r)) + return (bus_generic_rman_activate_resource(bus, child, type, + rid, r)); + return (bus_generic_activate_resource(bus, child, type, rid, r)); +} + +static int +acpi_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + if (acpi_is_resource_managed(bus, type, r)) + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, r)); + return (bus_generic_deactivate_resource(bus, child, type, rid, r)); +} + +static int +acpi_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + struct resource *sysres; + rman_res_t length, start; + int error; + + if (!acpi_is_resource_managed(bus, type, r)) + return (bus_generic_map_resource(bus, child, type, r, argsp, + map)); + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + sysres = acpi_managed_resource(bus, type, r); + if (sysres == NULL) + return (ENOENT); + + args.offset = start - rman_get_start(sysres); + args.length = length; + return (bus_generic_map_resource(bus, child, type, sysres, &args, map)); +} + +static int +acpi_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + if (acpi_is_resource_managed(bus, type, r)) { + r = acpi_managed_resource(bus, type, r); + if (r == NULL) + return (ENOENT); + } + return (bus_generic_unmap_resource(bus, child, type, r, map)); +} + /* Allocate an IO port or memory resource, given its GAS. */ int acpi_bus_alloc_gas(device_t dev, int *type, int *rid, ACPI_GENERIC_ADDRESS *gas, diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index 8d81d61989a8..eec7d32bf276 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -792,8 +792,6 @@ acpi_res_set_end_dependent(device_t dev, void *context) * private rman. */ -static int acpi_sysres_rid = 100; - static int acpi_sysres_probe(device_t dev); static int acpi_sysres_attach(device_t dev); @@ -835,6 +833,7 @@ static int acpi_sysres_attach(device_t dev) { device_t bus; + struct acpi_softc *bus_sc; struct resource_list_entry *bus_rle, *dev_rle; struct resource_list *bus_rl, *dev_rl; int done, type; @@ -849,7 +848,8 @@ acpi_sysres_attach(device_t dev) */ bus = device_get_parent(dev); dev_rl = BUS_GET_RESOURCE_LIST(bus, dev); - bus_rl = BUS_GET_RESOURCE_LIST(device_get_parent(bus), bus); + bus_sc = acpi_device_get_parent_softc(dev); + bus_rl = &bus_sc->sysres_rl; STAILQ_FOREACH(dev_rle, dev_rl, link) { if (dev_rle->type != SYS_RES_IOPORT && dev_rle->type != SYS_RES_MEMORY) continue; @@ -889,7 +889,7 @@ acpi_sysres_attach(device_t dev) /* If we didn't merge with anything, add this resource. */ if (bus_rle == NULL) - bus_set_resource(bus, type, acpi_sysres_rid++, start, count); + resource_list_add_next(bus_rl, type, start, end, count); } /* After merging/moving resources to the parent, free the list. */ diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 80ea18e782ac..668d0b51a1f3 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -78,6 +78,9 @@ struct acpi_softc { struct apm_clone_data *acpi_clone; /* Pseudo-dev for devd(8). */ STAILQ_HEAD(,apm_clone_data) apm_cdevs; /* All apm/apmctl/acpi cdevs. */ struct callout susp_force_to; /* Force suspend if no acks. */ + + /* System Resources */ + struct resource_list sysres_rl; }; struct acpi_device { @@ -461,9 +464,6 @@ ACPI_STATUS acpi_lookup_irq_resource(device_t dev, int rid, struct resource *res, ACPI_RESOURCE *acpi_res); ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resource_set *set, void *arg); -struct resource *acpi_alloc_sysres(device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, - u_int flags); /* ACPI event handling */ UINT32 acpi_event_power_button_sleep(void *context); From nobody Thu Feb 27 21:04:19 2025 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 4Z3kNh1ZyPz59X13; Thu, 27 Feb 2025 21:04:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kNh0vg5z43Xr; Thu, 27 Feb 2025 21:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690260; 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=oHNptMEzykBwA7dR8uc45FetKWAsdZe5/MkYVOji5FA=; b=OPteFxgqrvUEHuKrfypKOZBZqXJrBNmu1jgmn0SIBzh0oinyDrREmRCSTUrMP7+IH833rv vA79A9Mv8HjBVVYpFZRGIvBKBckMPL2Xtqdl/0Cw/wHI/GFNvnzLWOYVH7G0HfZoYnX1t3 ioG5BbH0mh2Qyd6losrg8ia1DJLxMDDJv8M1F2AXZfjhbSElAmYHLIta+GV9G8Av0lrvQf uks+UoaM6WNzVk5GaoIPKlfGqXo489wBNWd5QiYLs/HoEHZMhJ61K4CqJq0g8yWG8e0Ekj NMrcEV2sidUG0YjQLDdtuTtDN42VCQENwh2P4ti63Tq2CpMSzY2Z6X9Bi0OOtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690260; a=rsa-sha256; cv=none; b=lPAB7zNvbm3Xpv7FqI5ugTJtNnBwXWvK62AziBNGCGkdL4+3f8tTX3yxJmL16yrshc69HZ GI3ccUT5LbHPcMqi2YXYLvhAhRt9/Eb4RRmGnas4l2L+6qGGqCwioTyYt8du2pnrQQ3Ucg 2+hposfsN7a1HOzfVnN+a4Ks/7CIz9FaL1lePbNSE0+nHEPNAQG/s5SymFhY/jmduU6d4W NCpS5JqXDekzOCKZcVGYF/NfZlNb7xWVaqymAVL+n2Cv93661q5DtpbyKlU7Oxk3ruwyl3 W97gIQqHKyvTMg5FZwm8pemHOqqhqddpfrLa8DirXPE3rfUxWEbKLlIz5pYvgg== 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=1740690260; 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=oHNptMEzykBwA7dR8uc45FetKWAsdZe5/MkYVOji5FA=; b=aLchttryzvZUL1Jek0FQix4r6WUO3AaKWzOWot0iOdRnQOieEUhVrgB6MC3Iam8Gsq/mL9 TU6Timxgiw4BhQt3uC8gtLVlAJIl6eGnjHoVe66QUSnztM8/mjZcioLmGhwg8GmkDJ4AJ5 WNufI/6Tp2kGWYWX5ToYz73p/iIo4fxDFXdJ8tucQ4FAXwxJ3HtK1Ghik8ukiTLN/pN2Hy asOvBa9wnIsjdKDabaUQk4aksPSuecvbL75/KYaxqNDd7LmPm/8GrjwhOR7Pnkhev6nxCm qOpvHaZh3tYjxtUCNbxfb4W8mdUmjHawbJ+9m3GdT2wyI49xvtM3teLPhp+kNQ== 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 4Z3kNh0JMQzyVm; Thu, 27 Feb 2025 21:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL4JwN085439; Thu, 27 Feb 2025 21:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL4Jf3085436; Thu, 27 Feb 2025 21:04:19 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:04:19 GMT Message-Id: <202502272104.51RL4Jf3085436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8e406d580ceb - stable/14 - iwlwifi: bring in some of the rs code 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e406d580ceb4e19b00039d39918e38abc0366c0 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8e406d580ceb4e19b00039d39918e38abc0366c0 commit 8e406d580ceb4e19b00039d39918e38abc0366c0 Author: Bjoern A. Zeeb AuthorDate: 2025-01-25 11:00:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-27 21:03:21 +0000 iwlwifi: bring in some of the rs code Bring in code to call into rs-fw.c functionality for firmware supported rate select. Anything before AX200 (firmware matching iwlwiif-[0-9]*.ucode) will still need further implementation, and so does iwl_mvm_rs_tx_status(). These bits marked with compat.linuxkpi.80211.debug TODO()s for now. Implement some lindebugfs bits to gather more statistical information. Sponsored by: The FreeBSD Foundation (cherry picked from commit 3f8cfb8a3a3b9fbe6d4aebde81aee80f8e89e2ea) --- sys/contrib/dev/iwlwifi/mvm/rs.c | 133 +++++++++++++++++++++++++++++++++++---- sys/contrib/dev/iwlwifi/mvm/rs.h | 9 ++- 2 files changed, 128 insertions(+), 14 deletions(-) diff --git a/sys/contrib/dev/iwlwifi/mvm/rs.c b/sys/contrib/dev/iwlwifi/mvm/rs.c index 981686e66920..f460624871ee 100644 --- a/sys/contrib/dev/iwlwifi/mvm/rs.c +++ b/sys/contrib/dev/iwlwifi/mvm/rs.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2021 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -33,42 +33,123 @@ * This file is left as a wrapper to make mvm compile and we will only * deal with it on a need basis. Most newer chipsets do this in firmware. */ +#include +#include /* LinuxKPI 802.11 TODO() calls. */ -#include - +#include "rs.h" #include "mvm.h" #ifdef CONFIG_IWLWIFI_DEBUGFS +/* + * Fill struct iwl_mvm_frame_stats. + * Deal with various RATE_MCS_*_MSK. See rx.c, fw/api/rs.h, et al. + * XXX-BZ consider calling iwl_new_rate_from_v1() in rx.c so we can also + * use this in rxmq.c. + */ void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg) { - + uint8_t nss; + + spin_lock_bh(&mvm->drv_stats_lock); + mvm->drv_rx_stats.success_frames++; + + if (rate & RATE_MCS_HT_MSK_V1) { + mvm->drv_rx_stats.ht_frames++; + nss = 1 + ((rate & RATE_HT_MCS_NSS_MSK_V1) >> RATE_HT_MCS_NSS_POS_V1); + } else if (rate & RATE_MCS_VHT_MSK_V1) { + mvm->drv_rx_stats.vht_frames++; + nss = 1 + FIELD_GET(RATE_MCS_NSS_MSK, rate); + } else { + mvm->drv_rx_stats.legacy_frames++; + nss = 0; + } + + switch (rate & RATE_MCS_CHAN_WIDTH_MSK_V1) { + case RATE_MCS_CHAN_WIDTH_20: + mvm->drv_rx_stats.bw_20_frames++; + break; + case RATE_MCS_CHAN_WIDTH_40: + mvm->drv_rx_stats.bw_40_frames++; + break; + case RATE_MCS_CHAN_WIDTH_80: + mvm->drv_rx_stats.bw_80_frames++; + break; + case RATE_MCS_CHAN_WIDTH_160: + mvm->drv_rx_stats.bw_160_frames++; + break; + } + + if ((rate & RATE_MCS_CCK_MSK_V1) == 0 && + (rate & RATE_MCS_SGI_MSK_V1) != 0) + mvm->drv_rx_stats.sgi_frames++; + else + mvm->drv_rx_stats.ngi_frames++; + + switch (nss) { + case 1: + mvm->drv_rx_stats.siso_frames++; + break; + case 2: + mvm->drv_rx_stats.mimo2_frames++; + break; + } + + if (agg) + mvm->drv_rx_stats.agg_frames++; + + /* ampdu_count? */ + /* fail_frames? */ + + mvm->drv_rx_stats.last_rates[mvm->drv_rx_stats.last_frame_idx] = rate; + mvm->drv_rx_stats.last_frame_idx++; + mvm->drv_rx_stats.last_frame_idx %= + ARRAY_SIZE(mvm->drv_rx_stats.last_rates); + + spin_unlock_bh(&mvm->drv_stats_lock); } void iwl_mvm_reset_frame_stats(struct iwl_mvm *mvm) { - + /* Apply same locking rx.c does; debugfs seems to read unloked? */ + spin_lock_bh(&mvm->drv_stats_lock); + memset(&mvm->drv_rx_stats, 0, sizeof(mvm->drv_rx_stats)); + spin_unlock_bh(&mvm->drv_stats_lock); } #endif int iwl_mvm_rate_control_register(void) { - + TODO("This likely has to call into net80211 unless we gain compat code in LinuxKPI"); return (0); } -int -iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *sta, bool enable) +void +iwl_mvm_rate_control_unregister(void) { + TODO("This likely has to call into net80211 unless we gain compat code in LinuxKPI"); +} - return (0); +int +iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, bool enable) +{ + if (iwl_mvm_has_tlc_offload(mvm)) + return (rs_fw_tx_protection(mvm, mvmsta, enable)); + else { + TODO(); + return (0); + } } -void -iwl_mvm_rate_control_unregister(void) +static void +iwl_mvm_rs_sw_rate_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ieee80211_bss_conf *link_conf, struct ieee80211_link_sta *link_sta, + enum nl80211_band band) { + TODO(); } void @@ -77,18 +158,28 @@ iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_bss_conf *link_conf, struct ieee80211_link_sta *link_sta, enum nl80211_band band) { + if (iwl_mvm_has_tlc_offload(mvm)) + iwl_mvm_rs_fw_rate_init(mvm, vif, sta, link_conf, link_sta, band); + else + iwl_mvm_rs_sw_rate_init(mvm, vif, sta, link_conf, link_sta, band); } void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, int tid, struct ieee80211_tx_info *ba_info, bool t) { + TODO(); } void -rs_update_last_rssi(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, +rs_update_last_rssi(struct iwl_mvm *mvm __unused, struct iwl_mvm_sta *mvmsta, struct ieee80211_rx_status *rx_status) { + struct iwl_lq_sta *lq_sta; + int i; + + if (mvmsta == NULL || rx_status == NULL) + return; /* * Assumption based on mvm/sta.h is that this should update @@ -96,12 +187,28 @@ rs_update_last_rssi(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, * access in that struct so nowhere to put rssi information. * So the only thing would be if this is required internally * to functions in this file. + * The "FW" version accesses more fields. We assume they + * are the same for now. */ + + lq_sta = &mvmsta->deflink.lq_sta.rs_drv; + + lq_sta->pers.last_rssi = S8_MIN; + lq_sta->pers.chains = rx_status->chains; + + for (i = 0; i < nitems(lq_sta->pers.chain_signal); i++) { + if ((rx_status->chains & BIT(i)) == 0) + continue; + + lq_sta->pers.chain_signal[i] = rx_status->chain_signal[i]; + if (rx_status->chain_signal[i] > lq_sta->pers.last_rssi) + lq_sta->pers.last_rssi = rx_status->chain_signal[i]; + } } int rs_pretty_print_rate_v1(char *buf, int bufsz, const u32 rate) { - + TODO(); return (0); } diff --git a/sys/contrib/dev/iwlwifi/mvm/rs.h b/sys/contrib/dev/iwlwifi/mvm/rs.h index a9b10b841f95..71c0744f017c 100644 --- a/sys/contrib/dev/iwlwifi/mvm/rs.h +++ b/sys/contrib/dev/iwlwifi/mvm/rs.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2021 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -69,6 +69,13 @@ struct iwl_lq_sta { struct { spinlock_t lock; uint16_t max_agg_bufsize; + /* + * Based on the assumption that these are in "FW" too and + * there is a f() to set last_rssi add them here too. + */ + uint8_t chains; + uint8_t chain_signal[IEEE80211_MAX_CHAINS]; + uint8_t last_rssi; } pers; }; From nobody Thu Feb 27 18:53:43 2025 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 4Z3gV01lQBz59PSl; Thu, 27 Feb 2025 18:53:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3gV0110yz3Nmp; Thu, 27 Feb 2025 18:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682424; 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=8XedvfhyPcC/dUXTv8vfMc8rpcejCnFn5d0ZWi4PVaQ=; b=Tq1Uu/4vgWCkZRrOGRIA1Udgx9rJh/WR9ZRhaimeQ4rb23T/kXqZR+04KvpLu+6BGaiG9X XNBeUPOvhRnk2lYzbGvoOXVAkfQ39YbBoXbnwG2UM9me5qvBAKe6Nh4NS+3TqRhnwiiQG+ fGFeqOEtqWBPXQaCI/Bmd5mOfMdEHzqR7VBgnGRalKoRWLzBYlnc6m8XO1E5E6Q3UWPExI V4p/Do54FkwoW+rfO/ZvcomHJFRtx8w27xQcPGAYSuTHkAxPloQg6SNpeoB0yelvQjmqDR jiVPNAs5YLVoqvOky0zE/9DeV2XXyFuqoQWy1waPwIF7eUZ8MnDoZrbupFlJZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740682424; a=rsa-sha256; cv=none; b=ZwKbOrvUYfdWjUQh8akA+dspb+wMGh1mi/FoxBPQkJw3W5I6uslP77Dyf+WtJvTFY/xqfu K7rdSNVIEqW9NGmsECkzNaFr/VRo/kCiDI57tJaodPPJQx5CJedMii7rirUiV4eFv8TUTm khE5iKYNQZeaK64440CoEwjVPGqSIGl28OJWqb8Yspnc48tJKBz9SuPfCVmB+CXTYj8qiS rrgT/v/3HwuXicHBwoB499RKHIZ9aYkuTQQ5qkorNNJyXQvJydGDicS1ODKjY6zH1YIpBb 06BwMbGC7c4mADppTghtM6BnXenpG24oUHynlWrhRGmoXs1y3ozRYJjlEkzXzQ== 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=1740682424; 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=8XedvfhyPcC/dUXTv8vfMc8rpcejCnFn5d0ZWi4PVaQ=; b=AYxDD5wETFdkxE2sKGD0MMRoiFUv/NDUApDBL8w+VyZELkvv9h44MK6+vda4pKTWa2giBp X3TUkWRSW+9pNuU9/f43e8KaCHiuIVOb6LXM4ONLgtO05zhEhibpXfBDnAZqavNAtJl2Ot aTGgEPrLddIxEPf/x/QdQQIaF7km5EFJLWoBm7bW1WE+ciYSoMxkw+gcS4kznvgnTIwyyu WJNdsgF2kvCmryMdCV9j3uprUr2piRAsT0MnCLx/6hogofjevMqqzIO6sQQsE5dp471Dj0 838t2zUgWqQK6H/q7K4h92LnadlpMn4vkBE/GECZGNgaA3XRGv1UDu9DKYnr0A== 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 4Z3gV00YCRzw1k; Thu, 27 Feb 2025 18:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RIrhIe041146; Thu, 27 Feb 2025 18:53:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RIrhnu041143; Thu, 27 Feb 2025 18:53:43 GMT (envelope-from git) Date: Thu, 27 Feb 2025 18:53:43 GMT Message-Id: <202502271853.51RIrhnu041143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 067de34b8e10 - stable/14 - pmcannotate: Add a '-m' mode option to control per-line annotations. 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 067de34b8e10448307fa402db6e83ff413f95e78 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=067de34b8e10448307fa402db6e83ff413f95e78 commit 067de34b8e10448307fa402db6e83ff413f95e78 Author: John Baldwin AuthorDate: 2025-01-14 15:39:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:19:26 +0000 pmcannotate: Add a '-m' mode option to control per-line annotations. - "block" (the default mode) displays per-block percentages in front of each annotated line. - "global" displays a global percentage in front of each line. - "raw" displays the raw count of sample hits in front of each line. Reviewed by: Pau Amma , mav Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D35401 (cherry picked from commit de11299323e0a647ae2164f74ca966862e7c4dd8) --- usr.sbin/pmcannotate/pmcannotate.8 | 15 ++++++++++- usr.sbin/pmcannotate/pmcannotate.c | 54 ++++++++++++++++++++++++++++++++------ 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/usr.sbin/pmcannotate/pmcannotate.8 b/usr.sbin/pmcannotate/pmcannotate.8 index 9a89c40db1e7..e2fae0a7a7e0 100644 --- a/usr.sbin/pmcannotate/pmcannotate.8 +++ b/usr.sbin/pmcannotate/pmcannotate.8 @@ -25,7 +25,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.Dd November 20, 2008 +.Dd January 14, 2025 .Dt PMCANNOTATE 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Op Fl h .Op Fl k Ar pathname .Op Fl l Ar level +.Op Fl m Ar mode .Ar pmcout.out binaryobj .Sh DESCRIPTION The @@ -84,6 +85,18 @@ This directory specifies where should look for the kernel and its modules. The default is .Pa /boot/kernel . +.It Fl m Ar mode +Format to use when annotating source or assembly lines. +One of: +.Bl -tag -width indent +.It Cm block +Display percentage of matching samples relative to samples +falling in the current block. +.It Cm global +Display percentage of matching samples relative to all samples. +.It Cm raw +Display the raw count of matching samples. +.El .El .Sh LIMITATIONS As long as diff --git a/usr.sbin/pmcannotate/pmcannotate.c b/usr.sbin/pmcannotate/pmcannotate.c index 32138aa6c3a7..c00e4b2a33bc 100644 --- a/usr.sbin/pmcannotate/pmcannotate.c +++ b/usr.sbin/pmcannotate/pmcannotate.c @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -59,7 +60,7 @@ exit(EXIT_FAILURE); \ } while (0) -#define PERCSAMP(x) ((x) * 100 / totalsamples) +#define PERCSAMP(x) ((float)(x) * 100 / totalsamples) struct entry { TAILQ_ENTRY(entry) en_iter; @@ -109,7 +110,9 @@ static TAILQ_HEAD(, aggent) fqueue = TAILQ_HEAD_INITIALIZER(fqueue); * Use a float value in order to automatically promote operations * to return a float value rather than use casts. */ -static float totalsamples; +static u_int totalsamples; + +static enum { RAW, BLOCK_PERCENT, GLOBAL_PERCENT } print_mode; /* * Identifies a string cointaining objdump's assembly printout. @@ -501,6 +504,30 @@ general_insertent(struct entry *entry) TAILQ_INSERT_TAIL(&mainlst, entry, en_iter); } +/* + * Return a string either holding a percentage or the raw count value. + */ +static const char * +print_count(u_int nsamples, u_int totsamples) +{ + static char buf[16]; + + switch (print_mode) { + case RAW: + snprintf(buf, sizeof(buf), "%u", nsamples); + break; + case BLOCK_PERCENT: + snprintf(buf, sizeof(buf), "%.2f%%", (float)nsamples * 100 / + totsamples); + break; + case GLOBAL_PERCENT: + snprintf(buf, sizeof(buf), "%.2f%%", (float)nsamples * 100 / + totalsamples); + break; + } + return (buf); +} + /* * Printout the body of an "objdump -d" assembly function. * It does simply stops when a new function is encountered, @@ -529,8 +556,8 @@ general_printasm(FILE *fp, struct aggent *agg) if (obj == NULL) printf("\t| %s", buffer); else - printf("%.2f%%\t| %s", - (float)obj->en_nsamples * 100 / agg->ag_nsamples, + printf("%7s | %s", + print_count(obj->en_nsamples, agg->ag_nsamples), buffer); } } @@ -623,8 +650,8 @@ printblock(FILE *fp, struct aggent *agg) printf("\t| %s", buffer); else { done = 1; - printf("%.2f%%\t| %s", - (float)tnsamples * 100 / agg->ag_nsamples, buffer); + printf("%7s | %s", + print_count(tnsamples, agg->ag_nsamples), buffer); } } @@ -657,7 +684,7 @@ usage(const char *progname) { fprintf(stderr, - "usage: %s [-a] [-h] [-k kfile] [-l lb] pmcraw.out binary\n", + "usage: %s [-a] [-h] [-k kfile] [-l lb] [-m mode] pmcraw.out binary\n", progname); exit(EXIT_SUCCESS); } @@ -682,7 +709,8 @@ main(int argc, char *argv[]) kfile = NULL; asmsrc = 0; limit = 0.5; - while ((cget = getopt(argc, argv, "ahl:k:")) != -1) + print_mode = BLOCK_PERCENT; + while ((cget = getopt(argc, argv, "ahl:m:k:")) != -1) switch(cget) { case 'a': asmsrc = 1; @@ -693,6 +721,16 @@ main(int argc, char *argv[]) case 'l': limit = (float)atof(optarg); break; + case 'm': + if (strcasecmp(optarg, "raw") == 0) + print_mode = RAW; + else if (strcasecmp(optarg, "global") == 0) + print_mode = GLOBAL_PERCENT; + else if (strcasecmp(optarg, "block") == 0) + print_mode = BLOCK_PERCENT; + else + errx(1, "Invalid mode %s", optarg); + break; case 'h': case '?': default: From nobody Thu Feb 27 14:17:32 2025 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 4Z3YMK1RWTz5qGFW; Thu, 27 Feb 2025 14:17: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMK0mfMz3xNG; Thu, 27 Feb 2025 14:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665853; 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=Ev9fEKAzgXv8MQZNY/U3XGHknOPtJ13fRPeBFA3v0R4=; b=gDrmAngIsC0I5wkvFdmkz24MJSOMCEJyr0m3OQ7G6C2UlQ23ZAyArjh5wWr4CXIB72oa98 LCAJCDXWD//Qb9D7Rpl/Rim+nHheIqe3Nso7vfFPB4rksp5o4I17+MAZredFTR5LH1RZQZ N/GG9nz7h4Pbd/VcGTecH1ZYAlxLFgGvG/JYlqK+3UJRdOrm5QloQzF9GkzHXt47w06rwL Bu/xzUFvmo8LHQY0a4eJPhNpGygvGxhAi6UIWfZbuBvK/ZnVbqeRC7ym1Yh3q9p0BHcKPv zprqu8gKkaqUXqdWP8U2yoAZWo84NihPOD/XJvSDYbVJim77oJZK9oQ+OQJGPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665853; a=rsa-sha256; cv=none; b=RPmV3sG6xwYppSaPBqknX32mI65Xpzbo7i1pJjYA+N0hd7MjFcIPxUMB1BfSrXH1cw+e1w ELR8aZoRd0x5QBuCF+2UQiD/2vhoWaBy7vX5gf+FiRiwjl/3DXVFnfY7dshLghbf8nThEQ wPXje2ts8RdZ2P9P0QGqlE8GN1n9KQrjL4Ccjp1d/X76/hGNtI2jOn8oSbBJTd9hvqQ16M pn7dT1Lm5hZfj3jtsBcmSk7MWUa8cs2o/oWmfLxlmT1nHZm2uHtvpx61N7zniQNWxHrg+8 f45ThQcFWsU4TFxmLM8QL/0MnCE7+Ck2bZPfn0dVON5/tZjfmLrbFWuAtbuAOw== 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=1740665853; 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=Ev9fEKAzgXv8MQZNY/U3XGHknOPtJ13fRPeBFA3v0R4=; b=TaypuihtIssC9rXGepBAIiCTR2cxWfq5JORdNctt5T19EorDORo9zuP72foL+6HDAR8C+0 KXO3o+6JMLkBErp73+2HAiD+YdIe7ek3AzFsYRfkU2+gBniyzWsCzdELAJaYNOnOKPVjml BdeJkkC5su8OrND1d3HQ0s8ytSn/neZoI+RbrtVhDcomuW8brH8SSlq7Iu2CvC7KsCKDfG 6IJq3MKr1VAw33pRoz9Rrj2JmkPAeTjEmc3l2QfJyhmDs/MRJaLYzkQcKFOKRqW5XrSN0S KrakdltM+C0Th77cI5B3GvqZHOZDqZxY3Lm00kO4zpMXEoN8iGzqdTqy+p9zBA== 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 4Z3YMK0NZXzmf2; Thu, 27 Feb 2025 14:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHWQh017573; Thu, 27 Feb 2025 14:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHWrI017570; Thu, 27 Feb 2025 14:17:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:32 GMT Message-Id: <202502271417.51REHWrI017570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a27c361e0503 - stable/14 - pci: Narrow the scope of recently-added PCI_IOV #ifdefs 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a27c361e050331cd50d5fc1a7230fce62eee536c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a27c361e050331cd50d5fc1a7230fce62eee536c commit a27c361e050331cd50d5fc1a7230fce62eee536c Author: John Baldwin AuthorDate: 2024-08-08 19:05:23 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:24 +0000 pci: Narrow the scope of recently-added PCI_IOV #ifdefs Push the #ifdefs down into the function body instead of defining functions conditionally for ease of readability. These aren't critical paths, so one extra branch in the !PCI_IOV case is not a big deal. Requested by: jrtc27 Differential Revision: https://reviews.freebsd.org/D45877 (cherry picked from commit 971c9f57d7e6b55161fecc008e19f00ccaba8060) --- sys/dev/pci/pci.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 4be3210840fc..b40a352a4818 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -164,18 +164,12 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_delete_resource, pci_delete_resource), DEVMETHOD(bus_alloc_resource, pci_alloc_resource), -#ifdef PCI_IOV DEVMETHOD(bus_adjust_resource, pci_adjust_resource), -#else - DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), -#endif DEVMETHOD(bus_release_resource, pci_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), -#ifdef PCI_IOV DEVMETHOD(bus_map_resource, pci_map_resource), DEVMETHOD(bus_unmap_resource, pci_unmap_resource), -#endif DEVMETHOD(bus_child_deleted, pci_child_deleted), DEVMETHOD(bus_child_detached, pci_child_detached), DEVMETHOD(bus_child_pnpinfo, pci_child_pnpinfo_method), @@ -5784,11 +5778,11 @@ pci_deactivate_resource(device_t dev, device_t child, int type, return (0); } -#ifdef PCI_IOV int pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5808,6 +5802,7 @@ pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_adjust_resource(dev, child, type, r, start, end)); } @@ -5816,6 +5811,7 @@ int pci_map_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map_request *argsp, struct resource_map *map) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5835,6 +5831,7 @@ pci_map_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_map_resource(dev, child, type, r, argsp, map)); } @@ -5843,6 +5840,7 @@ int pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, struct resource_map *map) { +#ifdef PCI_IOV struct pci_devinfo *dinfo; if (device_get_parent(child) != dev) @@ -5860,10 +5858,10 @@ pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, /* Fall through for other types of resource allocations. */ } +#endif return (bus_generic_unmap_resource(dev, child, type, r, map)); } -#endif void pci_child_deleted(device_t dev, device_t child) From nobody Thu Feb 27 14:17:00 2025 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 4Z3YLh4cSbz5qFrP; Thu, 27 Feb 2025 14:17:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLh40wPz3xPJ; Thu, 27 Feb 2025 14:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665820; 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=/kv/rreLgajWkXqvR25Ui+NGxtXosQ7u3Fr6f9HcRps=; b=Fku0anIY+xGzYp4jOY+ASTloVAJ+nzRBJ+1owjLFonO85eXBwqx4K4kbVYUtme+/sheG1i lpt9hFO8SSzyic7FX1ATyda0r67wt2VYs2iX9sSEHs+TpPSQ5jkvF7/AuqZ35/DxrqkX8w lb9NDjPAlWuHNREIxqDqoo1yrq7eh83IISNn9U4T11f9N0LC4jz7RLFFuY8ldvESW9k7VX A3r2YeH3aBwZFIwDS22ZxzZ0E1sJ22ooeFZSTUYDkXgFYRdnglowdKVv9tuEjbfUco2yCW eLyRN1mv4PPCcWyC/UtJlkaQrkev4XkMhwvifL7F0wCMYJ80XrdtqhT2A8xvog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665820; a=rsa-sha256; cv=none; b=jte6D/SeImr+UkIEqSCO8FsOxvOO7X0BvfeIEWbzLtvbcJrbqLEGL+09bWWzoiRw2Ia8bN D4dqWYyTQ1D2ITfooNMN/t1MIcEbqDfeGiHK1oh+aMmEqYnhJA8IV0nJByprzGb44I2ndt Ng7P52szITYTCh/TrjuIrBJjtiVY+mT1o3g4apJx5Auuk4TRDoB0XzSA9UVet5P0VTKdSa 44E59eLkZhelWN4wGk2gqft/k/aHyorauhbUb3nvCT0oTtDGWCi/vRHpwSVVkYJucda06h 0Yb4xeCdlQ1PHlObsBQUsN8i3rFUT/EDdJ+o0/5RIpVOT0KW6Wjvh+fpoJgy+Q== 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=1740665820; 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=/kv/rreLgajWkXqvR25Ui+NGxtXosQ7u3Fr6f9HcRps=; b=hGbJUER+qIDdBU5D2uH40KjcXjbJ5rOf/5loMdHXc1hZxIB7lCYu1DxSyDwmIVdP49I7l5 t53nWRgisQ1ucBjRMXGtpS2qdrGx0UISmqiMv51LLAHSO9UgyuMWBzzEuOHBWCSNfGH88n 5m7Or0XVcFObwQuagKouc6EJKZUFE1eAlg+yS20p1T3uBWvTlyyCwnnz5ri45T1+AggKC+ BV/LerRrxdmfaP6mMrkTko4sOJb2DHkznDZo1McSbiLqM2v4k4v1dc7zUC6jHGbQuNwtb/ n9HW4zIGwPy/JrI1aofDMOAD1u+ObLflKxbEv68wPP/zCYKlxzt9Q+Q5NFt3xw== 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 4Z3YLh3cXvzmZS; Thu, 27 Feb 2025 14:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH020016567; Thu, 27 Feb 2025 14:17:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH02i016564; Thu, 27 Feb 2025 14:17:00 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:00 GMT Message-Id: <202502271417.51REH02i016564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c8e37e38080d - stable/14 - pci_host_generic: Set a valid error if allocating a range resource fails 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c8e37e38080dac3287578ab05d4d8e28046a2493 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c8e37e38080dac3287578ab05d4d8e28046a2493 commit c8e37e38080dac3287578ab05d4d8e28046a2493 Author: John Baldwin AuthorDate: 2024-02-16 00:05:09 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_host_generic: Set a valid error if allocating a range resource fails Previously pci_host_generic_attach was returning 0 (success) incorrectly if allocating a range failed. The error value was 0 from the previously successful call to bus_set_resource in this case. Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation (cherry picked from commit 992f5b16afa73d0ea63c8a886a78ad2eda928e37) --- sys/dev/pci/pci_host_generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 45a478634d20..ca384d9a1483 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -216,6 +216,7 @@ pci_host_generic_core_attach(device_t dev) if (sc->ranges[tuple].res == NULL) { device_printf(dev, "failed to allocate resource for range %d\n", tuple); + error = ENXIO; goto err_rman_manage; } } From nobody Thu Feb 27 16:55:51 2025 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 4Z3csz4Ygbz5qNdC; Thu, 27 Feb 2025 16:55:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3csz3mfZz45wm; Thu, 27 Feb 2025 16:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675351; 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=zljk37+rKd1B3nI71W6ANQTt3Q09/nBHVvaMPm9MOWM=; b=l6L3FtGUxmLVja1yz6B28coGeTydkrjniCIAcTEszDnDCA2i8lGFC7kYPD1zblXKkq9CxM TEgzuGPvHWwTAp3LFHf37um8y3rUNKvu3hVrBAstG0mtPUS3NNqjlnYgPgOeGPFrU5ikiI cdAeyCxl0ehuzoyl9+eIrqPl0E5w01xLZ40vs9UyuGE+4uoIZ4j+gB/EmFuwdkt86BqshE YelohQ73CTujIWZe50e0+kx8WuotWk+koDgvc+a/LmebVMq8oHrYZ/r6A3k35WBuVMc5b7 JPantLh8wXP2iKDj4mALctUYye80xCWP/3vuL5SIatjRxC+fTmMgrQsOfn1HxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675351; a=rsa-sha256; cv=none; b=muHxVVLGLvCMId4uXnficsYR89A7AvtFm4MhUUraOt4CnBisNHmX6ZsJhSECVw6yuMVcBc RspcWbBg8meYQd8oGy1UHk9zRzt6Ft8FQpuhKaCvkxcfsUAWz02GIN9cChM9o0dY3LXk4X YaADoY5dPJ8xHRATuwBtpQHqhLEg+uW6WvwQpZpe3O4DuQWDtJLCdGSPE9Hq7Os5ASjrKb z8CuQHpVT7bREkG9B7Gr654RMkqMz81i4WhVKxZBeM//8vGbnZtozC3ysHy/hwbS5jh23s LemZpNm7+CFDWo0xHAhjPj5odehfWaVagse2am8qr+oURcuODVV5HaIOxMUvLA== 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=1740675351; 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=zljk37+rKd1B3nI71W6ANQTt3Q09/nBHVvaMPm9MOWM=; b=K7n5KN6XYnbwMpLv2wZW6805cG5Hyt79f+KpH4ZHOWbkKTmgPG/oWVnyWbIa4uFBVlIlDA kJQncXIaPvOFw6ZFCMyIP27Qe2sKWv0/xnnzW0ZwmoRTELgB1Yyfcftf3B7v5scCOqcZwx PynV8qb+hsZDd0xSA+9e92kYn6YydYhXN13mzCLW36AaGx7p6ZyNUiJ2Sxctf2j/35YOPB LsHessm7Lg2CyDN6170bSr/JGZj6ecJyuUY4PUXLWq7Lz8+/NPmMZZu46rAu+RtDEIm6Ps 538tT/xyDfmkA8k7jr0FBnRE/JWbjHIsPqTAvNYTGvPlO28fpjCLthJHca+7PQ== 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 4Z3csz3CPkzrGm; Thu, 27 Feb 2025 16:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtpvq016917; Thu, 27 Feb 2025 16:55:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtpY9016914; Thu, 27 Feb 2025 16:55:51 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:51 GMT Message-Id: <202502271655.51RGtpY9016914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7a88ac783b97 - stable/14 - dpaa2_mc: Check for error the first time bus_generic_detach is called 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a88ac783b97acf59209a96eae49f367b0afefad Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7a88ac783b97acf59209a96eae49f367b0afefad commit 7a88ac783b97acf59209a96eae49f367b0afefad Author: John Baldwin AuthorDate: 2024-11-05 01:30:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:17:57 +0000 dpaa2_mc: Check for error the first time bus_generic_detach is called This removes the need for the second call. Reviewed by: dsl Differential Revision: https://reviews.freebsd.org/D47388 (cherry picked from commit 24d5a8e6eec2b9eed9591971f223d79b8d7044c9) --- sys/dev/dpaa2/dpaa2_mc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c index a6b56be10432..792745a535b3 100644 --- a/sys/dev/dpaa2/dpaa2_mc.c +++ b/sys/dev/dpaa2/dpaa2_mc.c @@ -281,7 +281,9 @@ dpaa2_mc_detach(device_t dev) struct dpaa2_devinfo *dinfo = NULL; int error; - bus_generic_detach(dev); + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->rcdev) @@ -292,10 +294,6 @@ dpaa2_mc_detach(device_t dev) if (dinfo) free(dinfo, M_DPAA2_MC); - error = bus_generic_detach(dev); - if (error != 0) - return (error); - return (device_delete_children(dev)); } From nobody Thu Feb 27 14:16:31 2025 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 4Z3YL73Wv5z5qFx4; Thu, 27 Feb 2025 14:16:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL72hBFz3x99; Thu, 27 Feb 2025 14:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665791; 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=SHKh8uYdlXjAEVPiBgccxPW0jGILV307YUInqI7OXuI=; b=Vgs7QbshnSzZiX8j0bPdRLE3oSO3Zn002qPTtM+xPm/6jA/NekMo2EzGw63vwMjD5yBqzj u5Lyg/9bZEktyM//N/Fn9FyATEqDtN4mJe6ck5RL9/i8/khG5zsGo/4MMXgRnfqxEJpmMI yTT0qwfoYagv3P9Uqrnj0R2tdVvud7Ah2Rvm4iSP77tJiL0lC8ihdWSrifsj357FOt4D9t 7AKlEsmEU8MLrg5QhtUZsMED55oP39nChaEZHvzJQHFRhalVZ5iMzRCBAIZu9OiVcxSjMB hGhPkmjjCnVQKkUzwhRlLSsb/BelTzJ8i9TT78cLTnv3KOeMvaFyx9j5yyD+wA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665791; a=rsa-sha256; cv=none; b=YtYPsnJeaNdsfb4YxJv5LcAhzr7oXU72e1eg4JmreHqEWrIDntP7M6LmtxgU+/FCfpo7k0 Vh5jtX86EMYdRqVQ9ymv+pHLjJohQZouVXLBDpe9uFU1ocOp+6aOpNz8aiyiCBMDIF424g gkdHZTrz9DOgB2qAyf5zUHRc8DrA1I4raGIljiLTbnKAd569LExM6qQHUIJL2/uNmEXqoS WEVv7mQ+ehV5Ju87XtFPGOX9bkzHe0ijWMBmtOWjomPo3GkcajXdN42mGX7VfEziRhb2IR u2U58m7g8Sd9mC6+1iAILIHjgPo6lyVIE+NbkfpuAmpCvCdxDFtf+qVedH/zyQ== 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=1740665791; 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=SHKh8uYdlXjAEVPiBgccxPW0jGILV307YUInqI7OXuI=; b=Ef/VmohYQzOMJ4Q/ePBH23x6El6+0TQgaX7pd7moPqCZ1kX9+NeaLKkYxBj0iOijA4rZr4 X6utePr00gRpe1yB66xRDi/A/pt1i9eGBwjCXTxhHwF0rSgS2XGh6JLbB9QGz5AFnN9Era rXS/V21GUcvHw16WB2N3ApmGufquGp9697yZjQS52pfuH+a6npIvwSthGCGPR/W1pAX+JN 4oSbo8gV//sm2s3NIgHvkDHSgJCA/32ToTmr0mW/XF5uyQWqp0t2nv6CbBMfSBjjSOI2HD TKGfU+J8lghv4YOnfbaLxbGYlMiY3ntrTIO1hEZSKuCkMFaagby82via3ZCGdg== 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 4Z3YL72DcvzlsR; Thu, 27 Feb 2025 14:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGVsY015617; Thu, 27 Feb 2025 14:16:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGVA6015614; Thu, 27 Feb 2025 14:16:31 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:31 GMT Message-Id: <202502271416.51REGVA6015614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7007ee0b58e1 - stable/14 - x86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7007ee0b58e13cbc9ed6d3c044ffca022ce2200e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7007ee0b58e13cbc9ed6d3c044ffca022ce2200e commit 7007ee0b58e13cbc9ed6d3c044ffca022ce2200e Author: John Baldwin AuthorDate: 2024-01-23 17:35:47 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 x86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43430 (cherry picked from commit 31e15e531c51be35c6907bbb6b1a5ab125f08a0d) --- sys/x86/include/legacyvar.h | 4 ++++ sys/x86/pci/pci_bus.c | 22 +++++++++++++++++++++- sys/x86/pci/qpi.c | 4 +++- sys/x86/x86/mptable_pci.c | 4 +++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/x86/include/legacyvar.h b/sys/x86/include/legacyvar.h index 2c9cf1391934..5627e9b90306 100644 --- a/sys/x86/include/legacyvar.h +++ b/sys/x86/include/legacyvar.h @@ -62,6 +62,10 @@ int legacy_pcib_adjust_resource(device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end); int legacy_pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +int legacy_pcib_activate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); +int legacy_pcib_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); int legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); int legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq); diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c index ecca10dd2606..cdb9c770b847 100644 --- a/sys/x86/pci/pci_bus.c +++ b/sys/x86/pci/pci_bus.c @@ -625,6 +625,24 @@ legacy_pcib_release_resource(device_t dev, device_t child, int type, int rid, return (pci_domain_release_bus(0, child, rid, r)); return (bus_generic_release_resource(dev, child, type, rid, r)); } + +int +legacy_pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == PCI_RES_BUS) + return (pci_domain_activate_bus(0, child, rid, r)); + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +int +legacy_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type == PCI_RES_BUS) + return (pci_domain_deactivate_bus(0, child, rid, r)); + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} #endif static device_method_t legacy_pcib_methods[] = { @@ -643,12 +661,14 @@ static device_method_t legacy_pcib_methods[] = { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource), DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c index 6aea8992a420..237ed315e53a 100644 --- a/sys/x86/pci/qpi.c +++ b/sys/x86/pci/qpi.c @@ -285,12 +285,14 @@ static device_method_t qpi_pcib_methods[] = { DEVMETHOD(bus_alloc_resource, qpi_pcib_alloc_resource), DEVMETHOD(bus_adjust_resource, legacy_pcib_adjust_resource), DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), diff --git a/sys/x86/x86/mptable_pci.c b/sys/x86/x86/mptable_pci.c index 80cc7af948dd..a1b93a927c8d 100644 --- a/sys/x86/x86/mptable_pci.c +++ b/sys/x86/x86/mptable_pci.c @@ -175,11 +175,13 @@ static device_method_t mptable_hostb_methods[] = { #endif #if defined(NEW_PCIB) && defined(PCI_RES_BUS) DEVMETHOD(bus_release_resource, legacy_pcib_release_resource), + DEVMETHOD(bus_activate_resource, legacy_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, legacy_pcib_deactivate_resource), #else DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From nobody Thu Feb 27 14:16:59 2025 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 4Z3YLg3frPz5qG2G; Thu, 27 Feb 2025 14:16:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLg37BGz3xMG; Thu, 27 Feb 2025 14:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665819; 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=f8V/ijkAOSN0CezVXAmbSDBhcG1ZzmR63eoHSkv/430=; b=Hr+O2zBRvu9YmAfU1Fu1wXRrhnmCdMaiEgQj3S0KYavdUPRPcvV02ha1ihCBQF0gm52w/L eCB9TGYF+4T2KHjiRJS3UKZN3QqSy+7njFbPxTeTs0uFpVVOrUIIA6aoAp2BIEdKz1oK4F /rv1qnv5W/9sNUFHMWaO1qUFjtHs1tHhfHcSlJUbekoAyfAP5KGcGbHTgigzd+WDTdLa/H WPvz9F9aLN+1V3CMwz1lU5kadc85zw3W1J9NzU11uNiYSBmWo/QSIm8vF+4iIjLxaKztH9 uM22T4EyEELf3cX9JOWnalE9Kw3IlBpQxYITH9cHCQf6vmJocak7jpvcmOONZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665819; a=rsa-sha256; cv=none; b=Rc+hv87LCRmF/ZXsbdhdVCjBU2RlxZzPNfkPzRXfWOMAH6evdu/0ewSuF4ygPbO6Ao05ix vu79vNyl3AENjGwXSoIMZNRz5ZdlJ0KeQNCN4eyYSuX3CnKrVNmkcm/HWaEJwTErvnSmNh 9NBQLPjQxN08rWvMw12UjqEtatHAtWE1ytBAZYHrPJiikl0/h2r/52MMJqxnfFJORVTVVL HN/Azwl35VmGpz2OHNzj9JK5UXQ7FrtviZWrXjpWa7pM8HeQSOawbWKNNumoNmjBNEpTzU SpiThV1WYDlxCyfDh8RifeUQAKTs9MzN2m4/kHEWrypO0qdUfN7om9+AVjRNpg== 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=1740665819; 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=f8V/ijkAOSN0CezVXAmbSDBhcG1ZzmR63eoHSkv/430=; b=UOqDytlFiYUzo9fzTuf0GsM2zJJy0Nea4QBgyw2qt41N9E0yvCfMk1cLojmFpwxO68Oey8 FeoZKPCrdHV121PAOcDwoddv7mefQ4k5oxztwZ0I6Nd00ytx+u7l9+T5L1gh26uaIo/4cy M2BRiZuS4rmo22qr7LkMpeNqnEuVtw/0DKyVtdz2VI4KYIktZzOm3CqqCCdhhXQ/DDx3zK ApAFGIojvkrzuEDJm078OBDbejYYRJAeomrYJiYykck/oym1c16W0UqJw7KaBZSUWDilJQ Fcro+LkNNvUI5PW2CkmN8cZyHLQdewEFlbvimC2qse6rhxzSX4Se+vhjbH2vCg== 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 4Z3YLg2h6pzmQG; Thu, 27 Feb 2025 14:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGx2M016526; Thu, 27 Feb 2025 14:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGxle016523; Thu, 27 Feb 2025 14:16:59 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:59 GMT Message-Id: <202502271416.51REGxle016523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a18502645663 - stable/14 - simplebus: Implement bus_delete_resource 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a185026456636915d727465ae87a70697cc8deaa Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a185026456636915d727465ae87a70697cc8deaa commit a185026456636915d727465ae87a70697cc8deaa Author: John Baldwin AuthorDate: 2024-02-16 00:05:00 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 simplebus: Implement bus_delete_resource (cherry picked from commit e89d0785ff1332d234ae4382a849f3c23e23573a) --- sys/dev/fdt/simplebus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index 854494eb4899..4c6f5921b713 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -105,6 +105,7 @@ static device_method_t simplebus_methods[] = { DEVMETHOD(bus_unmap_resource, simplebus_unmap_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list), DEVMETHOD(bus_get_property, simplebus_get_property), From nobody Thu Feb 27 14:17:09 2025 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 4Z3YLs4YrZz5qG2L; Thu, 27 Feb 2025 14:17:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLs3vNPz3xH5; Thu, 27 Feb 2025 14:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665829; 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=b021BCpLlT95Oh4krmjiBb2JbDJQlC3bxtOpDTbSeCo=; b=gFq8DFJrxlf82YozbaNVUnVx4P0i6VJ+GNHLAfUcn8I140nGhSIzsWBtN/wO4exH6+2tOl M1ftAs8ujQ6lFBBNtRKeVYMwcaozbrRrjtg/8lzUz0eGZkyrEtsjY8eKQR+iICbIG607yt 65Yj7TdrsMUUunwHGMncJdV/xv+rVW1iRz/7MFa0NmDt4ZZrUfYpH4WWQtiCYL/kUTzOHP RvsTXDeHTD8eo43eYcdZUGVo0NqpDZpkjxWhDa+Kife0t5Sa2toUaHN+er5jwt966QWrZJ y1aqMK4JzCh8qdI0BDFiF6HFOHOqtV7fErD2YJVIsZiBBFYWA85enwbAALG5og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665829; a=rsa-sha256; cv=none; b=JqRS5f7fWq+iCXjF6hxo9KmfSA2xygayaKXyMtLS5VC4HS2WFZAzM5EgOoyilHoTOXvvKR dd4HNR7NrK7arWioF0/1NNxWKIP+OaCNDJZ3PwULAkrCzj/IEL9AhJ0r7pszqz+MQPpAs5 OaSbyxT/ERBX3Mpt5Ub4/EV1XNt90seWRUQui+8KiY3de2xxqPhu2tuY7LwvaUe0L1Muzs fVFEeqf3ZT47u0G/cjUTsah2Z4khEiV2LA8oBD5u2BV2mh1wZmKD1jOcmps/MZu6RPTXV0 UF8fAti8Zo8Jo2WAVLusOtErIckrgLMA8etiK2k7UZUaK7gU3V0JtgDCpuDbAg== 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=1740665829; 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=b021BCpLlT95Oh4krmjiBb2JbDJQlC3bxtOpDTbSeCo=; b=bTZ9QB/tnNSz4yjg2nxOzxRhnaRJ1yfS52R2DQLMgWcldASgAV/9rgyEJ9PHZbYBEYkiMT Xql9ET+C3mv5Dj5jhXtjAP4xkCiR0fu86qswwYqmqTVE3BGMuuyuMz8gBkps6XuomFx6no 5tA+L9sNg/rtyFHUOaJhalCoPE+tafSL3BOpxMt1VP5i7baELfuatYoS0EgWxhs89iEYV6 FtBdwE1ioHQvYkLsb5tRgS9tP7XnRnfpBl5Xg2lAK6JitMeJT1igek+HT+OYOoIm4N1FZw S3TV+XnZca0NbFe/8PEC7/3x0reYRWlW6BR7aBb7shOLGQhHOWw+XJqlni0IgQ== 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 4Z3YLs3WM7zmZV; Thu, 27 Feb 2025 14:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH9YW016852; Thu, 27 Feb 2025 14:17:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH9lA016849; Thu, 27 Feb 2025 14:17:09 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:09 GMT Message-Id: <202502271417.51REH9lA016849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3ebdf18d5a75 - stable/14 - dpaa2: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3ebdf18d5a75f6b878cb2f29befc312380b9d68f Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3ebdf18d5a75f6b878cb2f29befc312380b9d68f commit 3ebdf18d5a75f6b878cb2f29befc312380b9d68f Author: John Baldwin AuthorDate: 2024-02-27 19:43:50 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 dpaa2: Use bus_generic_rman_* Reviewed by: dsl Differential Revision: https://reviews.freebsd.org/D43937 (cherry picked from commit 9b619f0e9082b8f97f0e20ec5176fe40ba8565f8) --- sys/dev/dpaa2/dpaa2_mc.c | 76 +++++++++++++++++-------------------------- sys/dev/dpaa2/dpaa2_mc.h | 1 + sys/dev/dpaa2/dpaa2_mc_acpi.c | 1 + sys/dev/dpaa2/dpaa2_mc_fdt.c | 1 + 4 files changed, 33 insertions(+), 46 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c index 02470a3efd6e..a6b56be10432 100644 --- a/sys/dev/dpaa2/dpaa2_mc.c +++ b/sys/dev/dpaa2/dpaa2_mc.c @@ -115,7 +115,6 @@ static struct resource_spec dpaa2_mc_spec[] = { static u_int dpaa2_mc_get_xref(device_t, device_t); static u_int dpaa2_mc_map_id(device_t, device_t, uintptr_t *); -static struct rman *dpaa2_mc_rman(device_t, int); static int dpaa2_mc_alloc_msi_impl(device_t, device_t, int, int, int *); static int dpaa2_mc_release_msi_impl(device_t, device_t, int, int *); @@ -312,10 +311,10 @@ dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid, struct rman *rm; int error; - rm = dpaa2_mc_rman(mcdev, type); - if (!rm) - return (BUS_ALLOC_RESOURCE(device_get_parent(mcdev), child, - type, rid, start, end, count, flags)); + rm = dpaa2_mc_rman(mcdev, type, flags); + if (rm == NULL) + return (bus_generic_alloc_resource(mcdev, child, type, rid, + start, end, count, flags)); /* * Skip managing DPAA2-specific resource. It must be provided to MC by @@ -331,24 +330,10 @@ dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid, } } - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (!res) { - device_printf(mcdev, "rman_reserve_resource() failed: " - "start=%#jx, end=%#jx, count=%#jx\n", start, end, count); + res = bus_generic_rman_alloc_resource(mcdev, child, type, rid, start, + end, count, flags); + if (res == NULL) goto fail; - } - - rman_set_rid(res, *rid); - - if (flags & RF_ACTIVE) { - if (bus_activate_resource(child, type, *rid, res)) { - device_printf(mcdev, "bus_activate_resource() failed: " - "rid=%d, res=%#jx\n", *rid, (uintmax_t) res); - rman_release_resource(res); - goto fail; - } - } - return (res); fail: device_printf(mcdev, "%s() failed: type=%d, rid=%d, start=%#jx, " @@ -363,9 +348,10 @@ dpaa2_mc_adjust_resource(device_t mcdev, device_t child, int type, { struct rman *rm; - rm = dpaa2_mc_rman(mcdev, type); + rm = dpaa2_mc_rman(mcdev, type, rman_get_flags(r)); if (rm) - return (rman_adjust_resource(r, start, end)); + return (bus_generic_rman_adjust_resource(mcdev, child, type, r, + start, end)); return (bus_generic_adjust_resource(mcdev, child, type, r, start, end)); } @@ -375,12 +361,10 @@ dpaa2_mc_release_resource(device_t mcdev, device_t child, int type, int rid, { struct rman *rm; - rm = dpaa2_mc_rman(mcdev, type); - if (rm) { - KASSERT(rman_is_region_manager(r, rm), ("rman mismatch")); - rman_release_resource(r); - } - + rm = dpaa2_mc_rman(mcdev, type, rman_get_flags(r)); + if (rm) + return (bus_generic_rman_release_resource(mcdev, child, type, + rid, r)); return (bus_generic_release_resource(mcdev, child, type, rid, r)); } @@ -388,26 +372,26 @@ int dpaa2_mc_activate_resource(device_t mcdev, device_t child, int type, int rid, struct resource *r) { - int rc; - - if ((rc = rman_activate_resource(r)) != 0) - return (rc); + struct rman *rm; - return (BUS_ACTIVATE_RESOURCE(device_get_parent(mcdev), child, type, - rid, r)); + rm = dpaa2_mc_rman(mcdev, type, rman_get_flags(r)); + if (rm) + return (bus_generic_rman_activate_resource(mcdev, child, type, + rid, r)); + return (bus_generic_activate_resource(mcdev, child, type, rid, r)); } int dpaa2_mc_deactivate_resource(device_t mcdev, device_t child, int type, int rid, struct resource *r) { - int rc; - - if ((rc = rman_deactivate_resource(r)) != 0) - return (rc); + struct rman *rm; - return (BUS_DEACTIVATE_RESOURCE(device_get_parent(mcdev), child, type, - rid, r)); + rm = dpaa2_mc_rman(mcdev, type, rman_get_flags(r)); + if (rm) + return (bus_generic_rman_deactivate_resource(mcdev, child, type, + rid, r)); + return (bus_generic_deactivate_resource(mcdev, child, type, rid, r)); } /* @@ -496,7 +480,7 @@ dpaa2_mc_manage_dev(device_t mcdev, device_t dpaa2_dev, uint32_t flags) if (flags & DPAA2_MC_DEV_ALLOCATABLE) { /* Select rman based on a type of the DPAA2 device. */ - rm = dpaa2_mc_rman(mcdev, dinfo->dtype); + rm = dpaa2_mc_rman(mcdev, dinfo->dtype, 0); if (!rm) return (ENOENT); /* Manage DPAA2 device as an allocatable resource. */ @@ -521,7 +505,7 @@ dpaa2_mc_get_free_dev(device_t mcdev, device_t *dpaa2_dev, return (EINVAL); /* Select resource manager based on a type of the DPAA2 device. */ - rm = dpaa2_mc_rman(mcdev, devtype); + rm = dpaa2_mc_rman(mcdev, devtype, 0); if (!rm) return (ENOENT); /* Find first free DPAA2 device of the given type. */ @@ -747,8 +731,8 @@ dpaa2_mc_map_id(device_t mcdev, device_t child, uintptr_t *id) * @internal * @brief Obtain a resource manager based on the given type of the resource. */ -static struct rman * -dpaa2_mc_rman(device_t mcdev, int type) +struct rman * +dpaa2_mc_rman(device_t mcdev, int type, u_int flags) { struct dpaa2_mc_softc *sc; diff --git a/sys/dev/dpaa2/dpaa2_mc.h b/sys/dev/dpaa2/dpaa2_mc.h index 9a21c9724b82..40b318c4c9e7 100644 --- a/sys/dev/dpaa2/dpaa2_mc.h +++ b/sys/dev/dpaa2/dpaa2_mc.h @@ -179,6 +179,7 @@ int dpaa2_mc_detach(device_t dev); /* For bus interface. */ +struct rman *dpaa2_mc_rman(device_t mcdev, int type, u_int flags); struct resource * dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); diff --git a/sys/dev/dpaa2/dpaa2_mc_acpi.c b/sys/dev/dpaa2/dpaa2_mc_acpi.c index 75cbfcb0791f..1042ea56d8cf 100644 --- a/sys/dev/dpaa2/dpaa2_mc_acpi.c +++ b/sys/dev/dpaa2/dpaa2_mc_acpi.c @@ -356,6 +356,7 @@ static device_method_t dpaa2_mc_acpi_methods[] = { DEVMETHOD(device_detach, dpaa2_mc_detach), /* Bus interface */ + DEVMETHOD(bus_get_rman, dpaa2_mc_rman), DEVMETHOD(bus_alloc_resource, dpaa2_mc_alloc_resource), DEVMETHOD(bus_adjust_resource, dpaa2_mc_adjust_resource), DEVMETHOD(bus_release_resource, dpaa2_mc_release_resource), diff --git a/sys/dev/dpaa2/dpaa2_mc_fdt.c b/sys/dev/dpaa2/dpaa2_mc_fdt.c index 8e9ab10dec9d..a6babfc89ca9 100644 --- a/sys/dev/dpaa2/dpaa2_mc_fdt.c +++ b/sys/dev/dpaa2/dpaa2_mc_fdt.c @@ -355,6 +355,7 @@ static device_method_t dpaa2_mc_fdt_methods[] = { DEVMETHOD(device_detach, dpaa2_mc_detach), /* Bus interface */ + DEVMETHOD(bus_get_rman, dpaa2_mc_rman), DEVMETHOD(bus_alloc_resource, dpaa2_mc_alloc_resource), DEVMETHOD(bus_adjust_resource, dpaa2_mc_adjust_resource), DEVMETHOD(bus_release_resource, dpaa2_mc_release_resource), From nobody Thu Feb 27 17:19:20 2025 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 4Z3dP43KxNz59JmS; Thu, 27 Feb 2025 17:19:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3dP42YFyz46nQ; Thu, 27 Feb 2025 17:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740676760; 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=r4qZeAC7IdAfAy0Q0KRkoojlhn5VxatjbzOdNJKB6mI=; b=Py0k19wDYiChQKXCC/Ed5sSTPXO2dPc0IN06j4SOmiXkrJQV6sbDoTt5IIoNQoi8MRBgxf Q6Qon/G5X33VWN0RGHm6QlRy7br3ffnosY0J+OmUgHdmBoX038n34ermuTR48JOlAXQe+o AAoKzzE3GVdrq8DdDBBOLEw45ppNIhnsgrlNb7Cpl86kxYpF10plMn7qbHCzb65LWakaU2 KZlzb6jytlIFv9eKeAU/Kmua2ROejLdFj4YmXx2OUAQA+5K+VpfzGbrnArt636ENx30yE4 ovtdUPB7agcyAtYZg1mh6XRTSaGK2XM2IJvmypdbSPl9DgZWfx40gO/zCw14lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740676760; a=rsa-sha256; cv=none; b=WQQUQKOa43drt90qkfXTp/hP5BzD28OH9GTbfTVXql9wh6tide2NiQ3lRVet8msGoQ9V44 W6rY7+wQhGj2n2xngsYge8kDrjVJHY7/H/+BUpj2ya27GLR1Tn0+wwRnvD0TTNTKFRKOeH b3t0+Yw+G8KfAoSUTklaHogM4NPnbIsSaCfkE0Q+B+xl7CHSTcuTE/m1YZ3p5bF1KX9pLG UUB1x7O4kUQE2m2R5E12ChTZB0ZOrbRimfMp9hdRpDgPN8XTKm67i3d4Nz52m9g5RwXNdz 3QMO5ay0ItfJ5Ey6BP0smRpq5nFJT4p9ASxXluLQQlhXRa+LOnIaEqfpx/ypgA== 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=1740676760; 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=r4qZeAC7IdAfAy0Q0KRkoojlhn5VxatjbzOdNJKB6mI=; b=sHg4CfWV1pDo4rMP8qTqWgi5FR/OTRj3t2NN/sp/uK5qKVibNhICG6hwpBnECxXUUihKT7 MxCBEXglChTExb4kgxbm6xc68iQiaKYQlFzyz1Qa5FqjtLNoEqYz5kESuZgsHbXvuH6UkJ tjcOQv4inGDpRPwanjf4wNmQSOjbCk6RRZhH3R9f4nkvqXtXWAledmSxKYCTclWb5wdMVh wSuEtHkLOjnRVOFjTUx2JdUNtX8eh1hmXomeL8oq3th9bjgbH3fngAopamumtbY3h1ivaz zA8TPpZ4J+1Nbla3qxUXapphxOrrvU2+gTVeFYVfT4PCtFsQpcAoIbMTf2z6Rw== 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 4Z3dP421S3zs0Q; Thu, 27 Feb 2025 17:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RHJKg5056813; Thu, 27 Feb 2025 17:19:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RHJKGC056810; Thu, 27 Feb 2025 17:19:20 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:19:20 GMT Message-Id: <202502271719.51RHJKGC056810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 08f22bb41f08 - stable/14 - cxgbe tom: Make t4_push_frames static to t4_cpl_io.c 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 08f22bb41f08b8f8344eb92ac4c44bf085ae6187 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=08f22bb41f08b8f8344eb92ac4c44bf085ae6187 commit 08f22bb41f08b8f8344eb92ac4c44bf085ae6187 Author: John Baldwin AuthorDate: 2025-01-14 15:34:45 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:17:51 +0000 cxgbe tom: Make t4_push_frames static to t4_cpl_io.c This function is not used outside of this file. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47760 (cherry picked from commit c2cd12b7ae28a34e551d1b96906620249a860bc0) --- sys/dev/cxgbe/tom/t4_cpl_io.c | 2 +- sys/dev/cxgbe/tom/t4_tom.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 0a40bbda3f3f..836d32360b1e 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -633,7 +633,7 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbuf *stop, int nsegs, int n) * stalls). When drop is set this function MUST drop the bytes and wake up any * writers. */ -void +static void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) { struct mbuf *sndptr, *m, *sb_sndptr; diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 1f97dd81a0bc..6295a3484b9f 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -525,7 +525,6 @@ int t4_send_fin(struct toedev *, struct tcpcb *); int t4_send_rst(struct toedev *, struct tcpcb *); void t4_set_tcb_field(struct adapter *, struct sge_wrq *, struct toepcb *, uint16_t, uint64_t, uint64_t, int, int); -void t4_push_frames(struct adapter *, struct toepcb *, int); void t4_push_pdus(struct adapter *, struct toepcb *, int); /* t4_ddp.c */ From nobody Thu Feb 27 15:05:08 2025 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 4Z3ZQD3Y1cz5qJ2c; Thu, 27 Feb 2025 15:05:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ZQD2KKRz41K0; Thu, 27 Feb 2025 15:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740668708; 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=d7xvxFzzZVLbxG2O8fiWgfOcsjryP85FMbIbEBbbVDQ=; b=QNtfLDvevWwkEp4u3yrf7DUbWPpPg+WGPyt5j0lSte6lrylQFlK7tEILuH5kfF6anXQqq4 aOAm8f/xoHpnt15Etx8+QRt99de3bRFhsBvM9OelbCYVUKtjxDkrztksU5VRQLar8NsJbg sMWChkMIbmeeqt/QcjhjpkzPqUbbJuFW2iCmYzigTwAkhKl1P/h8bpAMrIkFwZ/rXCDm/o +A9GFTWCMR3KLgnosgJamfBdDWmyFGlr1QOPPGzD9Dwvea9+oter5guC8y9ZYe55XS+Na0 gQNHaX0VN6Daz+ATgOhXt7g35VfHQDhjPAtQtFYc8dTUit0uFRyjuy+sBzu6hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740668708; a=rsa-sha256; cv=none; b=n0A1mMlM3hkrD8fGJ4X8WCPWT5zsR1IlBRKM88DBcv47vpd3+jpk1YXrVED2O6WOQtPDPo pgPntKCmGu9cHfeRIGlo8O/bbHK/gr2+cBSUHU1f4+E1B5NfiOqKCOwK//ZJXSx40bQVNA 4D1kmpVyU4Fd7gR17WVTfyLAonmxLJhPUGsLOLsfnSqZy2CqJ/PXSJCnPpYqNWIrlU6oi4 9lcGCAkDhKd1QPYx7oGsg1DiJG7YHBvqL67nQvTk37qyT9lyeVmzCXYHTFAJ9hWpCcMcDP g5a4xZCBj8MujYdXYz6ZJGAw/FBM7tfT3zYFEoqXcQiTHHum1+cw1ae7WSJpHw== 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=1740668708; 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=d7xvxFzzZVLbxG2O8fiWgfOcsjryP85FMbIbEBbbVDQ=; b=cVV5Hfd0zk49SRqG1IQjfyGE++fapt6B7Ey4q4/9DYtZ6Zc5qZjT2CZVQ9iqkL14i4Iwm5 z/oaZx2CsCYj1ILXHVxYeE5XE+krnvlB/fbqBJvxIsav2Eh88bGTlzMh1OQcQJlJs9P3Ff t2EKDLBKZBJ8jnVS++GABTG9w0I4mVgood4mqecl1Cta/ht7uurRnsxy2XJ1SzeElgUFeG 7rhWWXsVYHvpgjN8Bjv/591wfmdyFCpBuym2bf5qtfITIjZNuQBkUlciYTyncfCn6ik9sg avGhh1BHlXaH6Hn5tvvvGgRLRWdmG2jetrq4UHI7KqTT2CX4XrEb+qqATRoM3Q== 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 4Z3ZQD1b8Mzp8v; Thu, 27 Feb 2025 15:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RF58Ap010381; Thu, 27 Feb 2025 15:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RF58VP010378; Thu, 27 Feb 2025 15:05:08 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:05:08 GMT Message-Id: <202502271505.51RF58VP010378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e75ef6dece8d - stable/14 - twe.4: Remove manpage for previously-removed driver 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e75ef6dece8db52fc85765e76a460c0556199bdf Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e75ef6dece8db52fc85765e76a460c0556199bdf commit e75ef6dece8db52fc85765e76a460c0556199bdf Author: John Baldwin AuthorDate: 2025-01-10 02:09:52 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:04:59 +0000 twe.4: Remove manpage for previously-removed driver Reviewed by: ziaee, imp Fixes: 062a7b918fac twe: Remove driver Differential Revision: https://reviews.freebsd.org/D48403 (cherry picked from commit ed49d3b31d425a0add04aff6eb721a474937b7da) --- ObsoleteFiles.inc | 3 + share/man/man4/Makefile | 1 - share/man/man4/twe.4 | 278 ------------------------------------------------ 3 files changed, 3 insertions(+), 279 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 8eec739cd89c..244089fd2d4f 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -1921,6 +1921,9 @@ OLD_FILES+=usr/share/certs/trusted/TrustCor_ECA-1.pem OLD_FILES+=usr/share/certs/trusted/TrustCor_RootCert_CA-1.pem OLD_FILES+=usr/share/certs/trusted/TrustCor_RootCert_CA-2.pem +# 20230510: twe(4) driver removed +OLD_FILES+=usr/share/man/man4/twe.4.gz + # 20230505: md5 tests are now self-contained OLD_FILES+=usr/tests/sbin/md5/1.inp OLD_FILES+=usr/tests/sbin/md5/1.sha512-p.chk diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5bbf718911d7..979dc37d7db4 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -563,7 +563,6 @@ MAN= aac.4 \ tslog.4 \ tty.4 \ tun.4 \ - twe.4 \ tws.4 \ udp.4 \ udplite.4 \ diff --git a/share/man/man4/twe.4 b/share/man/man4/twe.4 deleted file mode 100644 index 03a51b7b6a50..000000000000 --- a/share/man/man4/twe.4 +++ /dev/null @@ -1,278 +0,0 @@ -.\" -.\" Copyright (c) 2000 Michael Smith -.\" Copyright (c) 2000 BSDi -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.Dd May 7, 2023 -.Dt TWE 4 -.Os -.Sh NAME -.Nm twe -.Nd 3ware 5000/6000/7000/8000 series PATA/SATA RAID adapter driver -.Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device pci" -.Cd "device twe" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -twe_load="YES" -.Ed -.Sh DEPRECATION NOTICE -The -.Nm -driver is not present in -.Fx 14.0 . -.Sh DESCRIPTION -The -.Nm -driver provides support for AMCC's 3ware 5000/6000/7000/8000 series -PATA/SATA RAID adapters. -These adapters were formerly known as -.Dq 3ware Escalade . -.Pp -These devices support 2, 4, 8, or 12 ATA disk drives -and provide RAID0 (striping) and RAID1 (mirroring) functionality. -.Sh HARDWARE -The -.Nm -driver supports the following PATA/SATA RAID -controllers: -.Pp -.Bl -bullet -compact -.It -AMCC's 3ware 5000 series -.It -AMCC's 3ware 6000 series -.It -AMCC's 3ware 7000-2 -.It -AMCC's 3ware 7006-2 -.It -AMCC's 3ware 7500-4LP -.It -AMCC's 3ware 7500-8 -.It -AMCC's 3ware 7500-12 -.It -AMCC's 3ware 7506-4LP -.It -AMCC's 3ware 7506-8 -.It -AMCC's 3ware 7506-12 -.It -AMCC's 3ware 8006-2LP -.It -AMCC's 3ware 8500-4LP -.It -AMCC's 3ware 8500-8 -.It -AMCC's 3ware 8500-12 -.It -AMCC's 3ware 8506-4LP -.It -AMCC's 3ware 8506-8 -.It -AMCC's 3ware 8506-8MI -.It -AMCC's 3ware 8506-12 -.It -AMCC's 3ware 8506-12MI -.El -.Sh DIAGNOSTICS -.Ss Controller initialisation phase -.Bl -diag -.It twe%d: microcontroller not ready -.Pp -The controller's onboard CPU is not reporting that it is ready; -this may be due to either a board or system failure. -Initialisation has failed. -.It twe%d: no attention interrupt -.It twe%d: can't drain AEN queue -.It twe%d: reset not reported -.It twe%d: controller errors detected -.It twe%d: can't drain response queue -.It twe%d: reset %d failed, trying again -.Pp -The controller is not responding correctly to -the driver's attempts to reset and initialise it. -This process is retried several times. -.It twe%d: can't initialise controller, giving up -.Pp -Several attempts to reset and initialise the controller have failed; -initialisation has failed -and the driver will not attach to this controller. -.El -.Ss Driver initialisation/shutdown phase -.Bl -diag -.It twe%d: register window not available -.It twe%d: can't allocate register window -.It twe%d: can't allocate parent DMA tag -.It twe%d: can't allocate interrupt -.It twe%d: can't set up interrupt -.It twe%d: can't establish configuration hook -.Pp -A resource allocation error occurred while initialising the driver; -initialisation has failed -and the driver will not attach to this controller. -.It twe%d: can't detect attached units -.Pp -Fetching the list of attached units failed; initialisation has failed. -.It twe%d: error fetching capacity for unit %d -.It twe%d: error fetching state for unit %d -.It twe%d: error fetching descriptor size for unit %d -.It twe%d: error fetching descriptor for unit %d -.It twe%d: device_add_child failed -.It twe%d: bus_generic_attach returned %d -.Pp -Creation of the disk devices failed, either due to communication -problems with the adapter or due to resource shortage; -attachment of one or more units may have been aborted. -.El -.Ss Operational phase -.Bl -diag -.It twe%d: command completed - %s -.El -.Pp -A command was reported completed with a warning by the controller. -The warning may be one of: -.Bl -diag -.It redundant/inconsequential request ignored -.It failed to write zeroes to LBA 0 -.It failed to profile TwinStor zones -.El -.Bl -diag -.It twe%d: command failed - %s -.El -.Pp -A command was reported as failed by the controller. -The failure message may be one of: -.Bl -diag -.It aborted due to system command or reconfiguration -.It aborted -.It access error -.It access violation -.It device failure -.It controller error -.It timed out -.It invalid unit number -.It unit not available -.It undefined opcode -.It request incompatible with unit -.It invalid request -.It firmware error, reset requested -.Pp -The command will be returned to the operating system after a -fatal error. -.El -.Bl -diag -.It twe%d: command failed submission - controller wedged -.Pp -A command could not be delivered to the controller because -the controller is unresponsive. -.It twe%d: AEN: <%s> -.El -.Pp -The controller has reported a change in status using an AEN -(Asynchronous Event Notification). -The following AENs may be reported: -.Bl -diag -.It queue empty -.It soft reset -.It degraded mirror -.It controller error -.It rebuild fail -.It rebuild done -.It incomplete unit -.It initialisation done -.It unclean shutdown detected -.It drive timeout -.It drive error -.It rebuild started -.It aen queue full -.Pp -AENs are also queued internally for use by management tools. -.El -.Bl -diag -.It twe%d: error polling for signalled AENs -.Pp -The controller has reported -that one or more status messages are ready for the driver, -but attempting to fetch one of these has returned an error. -.It twe%d: AEN queue overflow, lost AEN <%s> -.Pp -A status message was retrieved from the controller, -but there is no more room to queue it in the driver. -The message is lost (but will be printed to the console). -.It twe%d: missing expected status bits %s -.It twe%d: unexpected status bits %s -.Pp -A check of the controller's status bits -indicates an unexpected condition. -.It twe%d: host interrupt -.Pp -The controller has signalled a host interrupt. -This serves an unknown purpose and is ignored. -.It twe%d: command interrupt -.Pp -The controller has signalled a command interrupt. -This is not used, and will be disabled. -.It twe%d: controller reset in progress... -.Pp -The controller is being reset by the driver. -Typically this is done when the driver has determined that the -controller is in an unrecoverable state. -.It twe%d: can't reset controller, giving up -.Pp -The driver has given up on resetting the controller. -No further I/O will be handled. -.It controller reset done, %d commands restarted -.Pp -The controller was successfully reset, -and outstanding commands were restarted. -.El -.Sh AUTHORS -.An -nosplit -The -.Nm -driver and manual page were written by -.An Michael Smith Aq Mt msmith@FreeBSD.org . -.Pp -Extensive work done on the driver by -.An Vinod Kashyap Aq Mt vkashyap@FreeBSD.org -and -.An Paul Saab Aq Mt ps@FreeBSD.org . -.Sh BUGS -The controller cannot handle I/O transfers -that are not aligned to a 512-byte boundary. -In order to support raw device access from user-space, -the driver will perform alignment fixup on non-aligned data. -This process is inefficient, -and thus in order to obtain best performance -user-space applications accessing the device -should do so with aligned buffers. From nobody Thu Feb 27 14:17:17 2025 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 4Z3YM13j3dz5qGFn; Thu, 27 Feb 2025 14:17:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM13GGDz3xHK; Thu, 27 Feb 2025 14:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665837; 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=V7juZ/A3c+p6WOOdjFpKMdzsnMZi/TqV2ju86j3Y/6k=; b=LdQzuVDMWCRmy/4mqOJGdcZoZLS577VQQfaauqNH8/FeUWgn6TOl9X0bSbOcJ1MqPIyGye cQBHojUTGIca51/dSwy4GHZQIfLxSVEfg+7k+oH28rczSlsSX7UvX1oc5SeXceSbqzszVF LGCj3b7TZuYQ4pfMZPtgqedfTYSBCtdWxD+9IuiWFJpE1kalvYghvW+sTgedIxhsIT/m+H Ba4LBcI7G9Ra5MXEFN8fThLFMcBIaEZC46tU6h1O2TK2wo6vbRWge+KHjPFP0G3z3uo61W QQpo1LDisl3IF7l2UH7zQtRWz/4o4opdhdd2zJ5dEPjr+8EsnUxcnfNnE/ue9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665837; a=rsa-sha256; cv=none; b=rLCCNSqn39FvHgQuCxFh7AeHXeXtac3vqZ7M1ifNSO3d5Bs2fsx2DKlLI4xgj1Y145fRmk aY9/PSsTuhi7pj+ZBNCI1Fb578FT3Vxd8t0YRV+aZIL1U9vILkeDKmMqaWIBuDTTd7zCqM HdqDhHzwR9DByr7JknaVVr/Yvwd9PS0f87xCNppmOYaE6r6bfDWy6j30pPUlZxV3hbawAe owT+iAuLT5MaENuXEMjmXCWJg6E65QxoBTtrTvP5StrwcbpSr8g/hVMxynpPeSgWKItecd oJcl3GomFhduOcCHDN1Y3hJPItIcCYMoyqpijuzrRAVWsI8S1ns+SXDD3p6t2g== 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=1740665837; 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=V7juZ/A3c+p6WOOdjFpKMdzsnMZi/TqV2ju86j3Y/6k=; b=px6dQLlUWjrhdy3rFU1nj8xVLvMIE+ToNuXqywUsl8iUyDPP8mfeD3rDN73iUJdmI2FXkz HRRWu5fgnb4sS/FxDe879upZzhZv77DOD5hkwy9AY3IWECAhBvGenlAi08l6QpPDV0YHU5 EeKD4SOGUIdMUyu9OzvqnplhPhd9YbdTVNwh31cAfcKsA/Z7s1UawVQbxh5D5dPv5fQKDM QQSCFDGyanXmzn07++Tal7HrGSs7fxKMas51lz/tjHraLhnEeWu2KpJWHleUI1xxVLx5+0 hZVDNOOhaZb8JLKcVt3TgNAVzQl7Ogur3qNNbUvBM7rqdeExhwq0CR+pIKM25g== 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 4Z3YM12q5tzm7Q; Thu, 27 Feb 2025 14:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHHle017082; Thu, 27 Feb 2025 14:17:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHHGE017079; Thu, 27 Feb 2025 14:17:17 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:17 GMT Message-Id: <202502271417.51REHHGE017079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f3a90481145e - stable/14 - rman: Add rman_get/set_type 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f3a90481145e531a56363b6f2193aa9221aac0a5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f3a90481145e531a56363b6f2193aa9221aac0a5 commit f3a90481145e531a56363b6f2193aa9221aac0a5 Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 rman: Add rman_get/set_type This permits associating a resource type (e.g. SYS_RES_MEMORY) with a struct resource. I considered adding a new field to struct rman to store the type and only providing rman_get_type as an accessor. However, changing 'struct rman' is an ABI breakage. I might revisit this in main, but the current approach is MFC'able. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44122 (cherry picked from commit b30a80b65587fb9fd4a5f012d606dbd0c6239a46) --- share/man/man9/Makefile | 2 ++ share/man/man9/rman.9 | 18 ++++++++++++++++-- sys/kern/subr_rman.c | 13 +++++++++++++ sys/sys/rman.h | 2 ++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index c2e145eaeb08..abf7ba82e6b3 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1874,6 +1874,7 @@ MLINKS+=rman.9 rman_activate_resource.9 \ rman.9 rman_get_rid.9 \ rman.9 rman_get_size.9 \ rman.9 rman_get_start.9 \ + rman.9 rman_get_type.9 \ rman.9 rman_get_virtual.9 \ rman.9 rman_init.9 \ rman.9 rman_init_from_resource.9 \ @@ -1888,6 +1889,7 @@ MLINKS+=rman.9 rman_activate_resource.9 \ rman.9 rman_set_bustag.9 \ rman.9 rman_set_mapping.9 \ rman.9 rman_set_rid.9 \ + rman.9 rman_set_type.9 \ rman.9 rman_set_virtual.9 MLINKS+=rmlock.9 rm_assert.9 \ rmlock.9 rm_destroy.9 \ diff --git a/share/man/man9/rman.9 b/share/man/man9/rman.9 index 095cd2760b8c..35a2d176233c 100644 --- a/share/man/man9/rman.9 +++ b/share/man/man9/rman.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 20, 2016 +.Dd March 13, 2024 .Dt RMAN 9 .Os .Sh NAME @@ -56,7 +56,9 @@ .Nm rman_set_bushandle , .Nm rman_get_bushandle , .Nm rman_set_rid , -.Nm rman_get_rid +.Nm rman_get_rid , +.Nm rman_set_type , +.Nm rman_get_type .Nd resource management functions .Sh SYNOPSIS .In sys/types.h @@ -125,6 +127,10 @@ .Fn rman_set_rid "struct resource *r" "int rid" .Ft int .Fn rman_get_rid "struct resource *r" +.Ft void +.Fn rman_set_type "struct resource *r" "int type" +.Ft int +.Fn rman_get_type "struct resource *r" .Sh DESCRIPTION The .Nm @@ -457,6 +463,14 @@ The function retrieves this RID. .Pp The +.Fn rman_set_type +function associates a resource type with a resource +.Fa r . +The +.Fn rman_get_type +function retrieves this type. +.Pp +The .Fn rman_get_device function returns a pointer to the device which reserved the resource .Fa r . diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 3e91fc40150a..f5a782a00dce 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -92,6 +92,7 @@ struct resource_i { device_t r_dev; /* device which has allocated this resource */ struct rman *r_rm; /* resource manager from whence this came */ int r_rid; /* optional rid for this resource. */ + int r_type; /* optional type for this resource. */ }; static int rman_debug = 0; @@ -942,6 +943,18 @@ rman_get_rid(struct resource *r) return (r->__r_i->r_rid); } +void +rman_set_type(struct resource *r, int type) +{ + r->__r_i->r_type = type; +} + +int +rman_get_type(struct resource *r) +{ + return (r->__r_i->r_type); +} + void rman_set_device(struct resource *r, device_t dev) { diff --git a/sys/sys/rman.h b/sys/sys/rman.h index bb63c4dfb100..e116ff5ed1c3 100644 --- a/sys/sys/rman.h +++ b/sys/sys/rman.h @@ -134,6 +134,7 @@ void rman_get_mapping(struct resource *, struct resource_map *); int rman_get_rid(struct resource *); rman_res_t rman_get_size(struct resource *); rman_res_t rman_get_start(struct resource *); +int rman_get_type(struct resource *); void *rman_get_virtual(struct resource *); int rman_deactivate_resource(struct resource *r); int rman_fini(struct rman *rm); @@ -158,6 +159,7 @@ void rman_set_irq_cookie(struct resource *_r, void *_c); void rman_set_mapping(struct resource *, struct resource_map *); void rman_set_rid(struct resource *_r, int _rid); void rman_set_start(struct resource *_r, rman_res_t _start); +void rman_set_type(struct resource *_r, int _type); void rman_set_virtual(struct resource *_r, void *_v); extern struct rman_head rman_head; From nobody Thu Feb 27 14:16:49 2025 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 4Z3YLT3QvVz5qFrM; Thu, 27 Feb 2025 14:16:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLT2ltgz3x9Z; Thu, 27 Feb 2025 14:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665809; 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=BOQu/7inv7eHloO7QgUqS2kHVvV1v9ihzLkeTpI8cvQ=; b=qnxp1k5Rld1AosUu/ultVxNM3nVDmZfrxuTJRkwM0ss4mELD2yQStVSnck1cc9hhU9yO3k bNx+E6a090z7h025dAJtmBpuHP8l+gSujYKP6Ys+kmEiy7ktsZJw3iflDPpFy0EHwEw2Wo aW/9RXKfTDWDF80SfgWZKnwWIepG5UXXGUIzcGohm+87tq9AUKy/t1yXDKnnlo9Sn5eYQf sL7DZRmsfQ1nBYHLpsCIcMlefSkVLTwTddhm96uj1OzgwXzXzefX8ijkemECgEcobvnvQV 5Uvr6jRl7Ne/7a8uxMN7UZ68fMSccG4At0NhlnlWmqsA7ve02mflaEUI8X7hQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665809; a=rsa-sha256; cv=none; b=WKGVlaMEcadmk4DeWgzJqGuYYFgiM1g7xkOgQsPffdWOnx/fcfGZERwXu52z2HuI4hAcdx xDCosJ2iF6M0xZU7SVwlSbVrOxgQ85Nq6r+utCluPxsX6LhCX4bgizYyi7tv2EMahfr1VT 4japDZGZepVqRNQ/kf+tgyoEf0so+nCFroZ7isRkfdFw0aPufBeTjutXrmfWfI7j+4Hnqe 6PF1fwsuiOt8ThO5EYvTYjQrLhUmApEZcgdPCr3qT5oPGbMdkpjm6T4cZjCaQodseaK3bb Y3ksVLk70EnPTZQPo/SvMGPSqIIriKbHcYv2xV4i30VEuRDMHp6Aipj2D4e+6A== 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=1740665809; 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=BOQu/7inv7eHloO7QgUqS2kHVvV1v9ihzLkeTpI8cvQ=; b=RRBszEUwy3Oy1JioGfuVf2e0/g7W7LeRElyr5C47wa9TDYAevpgtbvqCriYcry+F8tN52c VYUb40MPir3rhmdkQk0sOUO6MpZUOd8m+6ntzEcblpIxvOVHIKG3se73pW6v9m12NSLxMZ qx3L+1cmh6tPXQi6RjH8U8YUwI/tEJDHp6/4Kq10XbnrMhy3QYL7ce1OqXnbXaGA/z3hFO mn2l5uaF//sMQoGBQUEWb6ULanA7oIPcbTeSZNRLjpti77N8s6CiThoZvZX4Bdsj4EJOul eOR1D0EsIFiaqFWG9gDeESD+2W5kvuVprObr0QFUQsO1re122W/EgPp8yZTaBQ== 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 4Z3YLT24zlzlsS; Thu, 27 Feb 2025 14:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGnjx016193; Thu, 27 Feb 2025 14:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGnLk016190; Thu, 27 Feb 2025 14:16:49 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:49 GMT Message-Id: <202502271416.51REGnLk016190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: df96f1db4a20 - stable/14 - pcib: Allocate PCI_RES_BUS resources with RF_ACTIVE 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: df96f1db4a201ccf97d6655b6f3b3254190c5311 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=df96f1db4a201ccf97d6655b6f3b3254190c5311 commit df96f1db4a201ccf97d6655b6f3b3254190c5311 Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pcib: Allocate PCI_RES_BUS resources with RF_ACTIVE The allocated bus numbers are in use so should be activated when allocated. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43689 (cherry picked from commit 36efc64a6bc6318eefd9baf88cbf511e91db80c8) --- sys/dev/pci/pci_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 2659e64f364d..5286d4e82e53 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -654,14 +654,14 @@ pcib_setup_secbus(device_t dev, struct pcib_secbus *bus, int min_count) */ rid = 0; bus->res = bus_alloc_resource_anywhere(dev, PCI_RES_BUS, &rid, - min_count, 0); + min_count, RF_ACTIVE); if (bus->res == NULL) { /* * Fall back to just allocating a range of a single bus * number. */ bus->res = bus_alloc_resource_anywhere(dev, PCI_RES_BUS, &rid, - 1, 0); + 1, RF_ACTIVE); } else if (rman_get_size(bus->res) < min_count) /* * Attempt to grow the existing range to satisfy the From nobody Thu Feb 27 18:58:35 2025 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 4Z3gbb3PN2z59PtS; Thu, 27 Feb 2025 18:58:35 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3gbb2dm4z3QZH; Thu, 27 Feb 2025 18:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740682715; 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=J5uuuTcbiLzvUo7yS2CCkuusAIzCLhWDbPbpsm5eDrE=; b=q+G56jPLyeiPXmqyaiV4z9zelI7VQA1rTf0JUHiMcdevnp9r91bJ48qnEGNGY6dAJm24jg F7h2n2Rf3pVa67BeghxbEsHEJfiDgeHY6e2qvpT/eCChTRUtNZVH3h1dIZ9HQK4Nv81AWF q2mo/z7tqx9/1tqxIyEc6f+TmQUeahx4Merlt791YE4jkG+JPVtKm90LPFG1Jqe+tzvG9q IcMZex8ZwUBEiwTOLQl04H/ZpcpIYcBZQEeQCbjUURbRGgcje6aGeibV4TlO8HDVpbCbjx Dt/bG4yUR0T2is4Mpj6rcC+aOfOQquK2Nk8zUXNpuPri+3WixR1xQC66ka65pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740682715; a=rsa-sha256; cv=none; b=s6Tls+AxyhitkIzRLznxUIupH5ox1qxqOYUNn5JjusY7+5UTOI6CAGQqoq554pOCkf7bBU G7CTCq82dHHPmvDuGIJUfSUk1Iv7uJC0RUA08tQ7kWrwvAhjnstIe3Ir9rA0MqyZrf3SUI WYuMoIkHcgsZ+7bF2/rBXCpAV6qxVsymFlyKmj15rQFK+ClLO/WE7Fb85kr2DRkaEjuhIn /FHnSzR8xG/Hcvd+4zwNXS7VPJDPBjciY4BrqkFJ8NX93gSAUhXekKawDV7Psx+mFJryAB gGrq6XaFHZhTyWR3X0PdGuAeEjHojUyBlTOaVaM4N/8gcUTll0VymyZ1OXYtMg== 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=1740682715; 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=J5uuuTcbiLzvUo7yS2CCkuusAIzCLhWDbPbpsm5eDrE=; b=rxXWKOQdPzROyXKP5EPFJcEtTaLav0Bjr6ZxH6NB2Lc0SAr/NrqnJojJBQjGXUwdCUGpME axeWnFwSHMdFIlMK/4XxJ/70ahOfrUNyvp+/nWXZpOTMDo+CzhJIqjvtWBxvqUUgoklcPz C9flC4L6gtnWtAEQer+yN2PQTAzT+HmgJIpHx8+KrcB2fGK7KTpXKyMV7/7aLO4IGcE5HO eyuQKHMiL7SnR52RLAVWjDiOO3CWoFBqcUzXuNDx8y/fmDQeCl/DXAsaWKfAythYn1OhaQ WXtg9KsMYeaZEv2IEiYCUdz1vwFWtmUYFuOBNhDwc2JiW2MO0i3q8ENeaufI/g== 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 4Z3gbb1h3Fzw0n; Thu, 27 Feb 2025 18:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RIwZAq042817; Thu, 27 Feb 2025 18:58:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RIwZrN042814; Thu, 27 Feb 2025 18:58:35 GMT (envelope-from git) Date: Thu, 27 Feb 2025 18:58:35 GMT Message-Id: <202502271858.51RIwZrN042814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: dd48b36aa295 - stable/14 - universe: Permit requesting a specific version of GCC 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dd48b36aa295a81cffe55095c9e404f7471728f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dd48b36aa295a81cffe55095c9e404f7471728f7 commit dd48b36aa295a81cffe55095c9e404f7471728f7 Author: John Baldwin AuthorDate: 2025-01-11 03:49:59 +0000 Commit: John Baldwin CommitDate: 2025-02-27 18:57:03 +0000 universe: Permit requesting a specific version of GCC If USE_GCC_TOOLCHAINS is set to a value matching the pattern 'gcc*', use that as the GCC version. For example, USE_GCC_TOOLCHAINS=gcc16 would use amd64-gcc16 for amd64, etc. If the variable is set to a value that doesn't match that pattern, use the default version. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48418 (cherry picked from commit 550137eab24ab6bdf05bfbb986927004b9f2f34e) --- Makefile | 18 ++++++++++-------- share/man/man7/build.7 | 7 ++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 60639f908b98..5880347e1261 100644 --- a/Makefile +++ b/Makefile @@ -551,14 +551,16 @@ TARGET_ARCHES_${target}= ${MACHINE_ARCH_LIST_${target}} .endfor .if defined(USE_GCC_TOOLCHAINS) -TOOLCHAINS_amd64= amd64-gcc12 -TOOLCHAINS_arm= armv6-gcc12 armv7-gcc12 -TOOLCHAIN_armv7= armv7-gcc12 -TOOLCHAINS_arm64= aarch64-gcc12 -TOOLCHAINS_i386= i386-gcc12 -TOOLCHAINS_powerpc= powerpc-gcc12 powerpc64-gcc12 -TOOLCHAIN_powerpc64= powerpc64-gcc12 -TOOLCHAINS_riscv= riscv64-gcc12 +_DEFAULT_GCC_VERSION= gcc12 +_GCC_VERSION= ${"${USE_GCC_TOOLCHAINS:Mgcc*}" != "":?${USE_GCC_TOOLCHAINS}:${_DEFAULT_GCC_VERSION}} +TOOLCHAINS_amd64= amd64-${_GCC_VERSION} +TOOLCHAINS_arm= armv6-${_GCC_VERSION} armv7-${_GCC_VERSION} +TOOLCHAIN_armv7= armv7-${_GCC_VERSION} +TOOLCHAINS_arm64= aarch64-${_GCC_VERSION} +TOOLCHAINS_i386= i386-${_GCC_VERSION} +TOOLCHAINS_powerpc= powerpc-${_GCC_VERSION} powerpc64-${_GCC_VERSION} +TOOLCHAIN_powerpc64= powerpc64-${_GCC_VERSION} +TOOLCHAINS_riscv= riscv64-${_GCC_VERSION} .endif # If a target is using an external toolchain, set MAKE_PARAMS to enable use diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 4bff6164dd56..a1da9dce4bec 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 13, 2024 +.Dd January 10, 2025 .Dt BUILD 7 .Os .Sh NAME @@ -879,6 +879,11 @@ This variable implies Use external GCC toolchains to build the requested targets. If the required toolchain package for a supported architecture is not installed, the build for that architecture is skipped. +.Pp +A specific version of GCC can be used by setting the value of this variable +to the desired version +.Pq for example, Dq gcc14 ; +otherwise a default version of GCC is used. .It Va TARGETS Only build the listed targets instead of each supported architecture. .It Va EXTRA_TARGETS From nobody Thu Feb 27 14:16:40 2025 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 4Z3YLJ3JWVz5qFXt; Thu, 27 Feb 2025 14:16:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLJ1ZN0z3x9N; Thu, 27 Feb 2025 14:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665800; 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=B0MCZGAK/fh3evAkGMx01yoZdj4k7PUaMez+BetqgDI=; b=Ye0YGc2UB8S+/ETbzcuOuZJRoz+OTi1YQ5ums3mXaruGvlC3LLjTnOVzSbK5qF32AsDv51 weEL2RsP0DOjQeTuPTWDn4luEOf3DvCJj8drEs/ncurHRircDMnQpB1LnMe+7VBAP99AN3 3jzDMuEHSqiOzl2i2YjOXftTTnVDpdLCN2EIY2+XVIZhYsSqjDAD07mz0ogWXvi4KlpPoi +rkC1WivXQhdnDUXxN6kC0MOzro5IuESrLYQ7QtNHQangERZkDArkWcCIzq5H5+lFRjSZf sf8CJ79w+zYlsk/McZys71Vd0u5PSpWSTaJtGQx/5fGj+ekvC4Fv8DeaMO3Z9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665800; a=rsa-sha256; cv=none; b=Lz49TV1timyg2PNSQT/WCc+F+C1fkPaVGyAeIR2/QnsZG/nEICQWzsmb41pk/iLh1W11Lw HvvgaO//Ft8qJM3QMklWz6CQ3lEJXNjF0Bft84x+mvfEAPqLqoNM+I6pkqqh5UgE6EB9oG Qrqv3TEijCJYK84MwvJdDYyGbNnnN1MWSIcZ92hezeVgbVcGp94ZKbCk3nOfjDv9IWFqHI esRGjfcZbC4UJBTTtoUdWxIGfr2qqhkC3tZBc3iq7p9hrjOkBrJyt/1mc6yx3YpBHmG1jN aYRQVnMsdxGnFbn3qdppmopiziB4Oba833ydvsvtONqNQ01vkskXIX4SMr4Pwg== 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=1740665800; 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=B0MCZGAK/fh3evAkGMx01yoZdj4k7PUaMez+BetqgDI=; b=hLitzjRYajV6RLCK4k3H5EtqbtJo9nCpUGYTq5KW63LRhEYsUoAi3Os53kxikYRSV2zSaL SJcghtCeHie1CRAyFjAZOGTUMgPsWkopq6OhXKLKFcdzU7k0fSopd8T1NGkcfJVvvPOkkV 1jOyt9ywtfhyxq6NoFKFMbYp9/pPgHvU3rjPZkJm46Mzb+NuGu/ByNKA6JRPMzMgv/12iU UTbjoiA0bXXdZ0j9YgUK4bST6ro49Pq4v7J0XBZUTUOgf/0DfULPXEb/xv1Yr4aIN/x20p fGfEySktndGgvg2KzfrPFzX4NL0XZAPjEIvf/oreNphF7zaCIMyuXz5BajFokQ== 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 4Z3YLJ17J9zm7K; Thu, 27 Feb 2025 14:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGefC015913; Thu, 27 Feb 2025 14:16:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGe8Q015910; Thu, 27 Feb 2025 14:16:40 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:40 GMT Message-Id: <202502271416.51REGe8Q015910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a7febc75da2f - stable/14 - arm nexus: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a7febc75da2f84c03d991c9c8c4562438803e5e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a7febc75da2f84c03d991c9c8c4562438803e5e0 commit a7febc75da2f84c03d991c9c8c4562438803e5e0 Author: John Baldwin AuthorDate: 2024-01-23 17:37:13 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 arm nexus: Use bus_generic_rman_* - Implement bus_get_rman pulling bits from nexus_alloc_resource. - Implement bus_map/unmap_resource pulling bits from nexus_activate/deactivate_resource. - Use bus_generic_rman_* for bus_alloc/adjust/activate/deactivate/release_resource except for custom interrupt activate/deactivate logic still in nexus_activate/deactivate_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43437 (cherry picked from commit faeb273e7a8ec57d87de8d4337598fb11ae305c3) --- sys/arm/arm/nexus.c | 220 +++++++++++++++++++++++----------------------------- 1 file changed, 97 insertions(+), 123 deletions(-) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index 108771db6301..0d37aa07f342 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -84,10 +84,10 @@ static bus_add_child_t nexus_add_child; static bus_print_child_t nexus_print_child; static bus_activate_resource_t nexus_activate_resource; -static bus_adjust_resource_t nexus_adjust_resource; -static bus_alloc_resource_t nexus_alloc_resource; static bus_deactivate_resource_t nexus_deactivate_resource; -static bus_release_resource_t nexus_release_resource; +static bus_get_rman_t nexus_get_rman; +static bus_map_resource_t nexus_map_resource; +static bus_unmap_resource_t nexus_unmap_resource; #ifdef SMP static bus_bind_intr_t nexus_bind_intr; @@ -120,10 +120,13 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_rman_adjust_resource), + DEVMETHOD(bus_alloc_resource, bus_generic_rman_alloc_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), + DEVMETHOD(bus_get_rman, nexus_get_rman), + DEVMETHOD(bus_map_resource, nexus_map_resource), + DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), + DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif @@ -217,83 +220,18 @@ nexus_add_child(device_t bus, u_int order, const char *name, int unit) return (child); } -/* - * Allocate a resource on behalf of child. NB: child is usually going to be a - * child of one of our descendants, not a direct child of nexus0. - */ -static struct resource * -nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +static struct rman * +nexus_get_rman(device_t bus, int type, u_int flags) { - struct resource *rv; - struct rman *rm; - int needactivate = flags & RF_ACTIVE; - - flags &= ~RF_ACTIVE; - switch (type) { case SYS_RES_IRQ: - rm = &irq_rman; - break; - + return (&irq_rman); case SYS_RES_MEMORY: case SYS_RES_IOPORT: - rm = &mem_rman; - break; - + return (&mem_rman); default: return (NULL); } - - rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == NULL) - return (NULL); - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv)) { - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); -} - -static int -nexus_adjust_resource(device_t bus __unused, device_t child __unused, int type, - struct resource *r, rman_res_t start, rman_res_t end) -{ - struct rman *rm; - - switch (type) { - case SYS_RES_IRQ: - rm = &irq_rman; - break; - case SYS_RES_MEMORY: - rm = &mem_rman; - break; - default: - return (EINVAL); - } - if (rman_is_region_manager(r, rm) == 0) - return (EINVAL); - return (rman_adjust_resource(r, start, end)); -} - -static int -nexus_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - int error; - - if (rman_get_flags(res) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, res); - if (error) - return (error); - } - return (rman_release_resource(res)); } static bus_space_tag_t @@ -372,73 +310,109 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { int err; - bus_addr_t paddr; - bus_size_t psize; - bus_space_handle_t vaddr; - - if ((err = rman_activate_resource(r)) != 0) - return (err); - /* - * If this is a memory resource, map it into the kernel. - */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - paddr = (bus_addr_t)rman_get_start(r); - psize = (bus_size_t)rman_get_size(r); -#ifdef FDT - err = bus_space_map(fdtbus_bs_tag, paddr, psize, 0, &vaddr); - if (err != 0) { - rman_deactivate_resource(r); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, r)); + case SYS_RES_IRQ: + err = rman_activate_resource(r); + if (err != 0) return (err); - } - rman_set_bustag(r, fdtbus_bs_tag); -#else - vaddr = (bus_space_handle_t)pmap_mapdev((vm_paddr_t)paddr, - (vm_size_t)psize); - if (vaddr == 0) { - rman_deactivate_resource(r); - return (ENOMEM); - } - rman_set_bustag(r, (void *)1); -#endif - rman_set_virtual(r, (void *)vaddr); - rman_set_bushandle(r, vaddr); - return (0); - } else if (type == SYS_RES_IRQ) { err = intr_activate_irq(child, r); if (err != 0) { rman_deactivate_resource(r); return (err); } + return (0); + default: + return (EINVAL); } - return (0); } static int -nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) +nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) { - bus_size_t psize; - bus_space_handle_t vaddr; + struct resource_map_request args; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + break; + default: + return (EINVAL); + } - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); - if (vaddr != 0) { #ifdef FDT - bus_space_unmap(fdtbus_bs_tag, vaddr, psize); + error = bus_space_map(fdtbus_bs_tag, start, length, 0, + &map->r_bushandle); + if (error) + return (error); + map->r_bustag = fdtbus_bs_tag; + map->r_vaddr = (void *)map->r_bushandle; #else - pmap_unmapdev((void *)vaddr, (vm_size_t)psize); + map->r_vaddr = pmap_mapdev(start, length); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = (void *)1; + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; #endif - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); - } - } else if (type == SYS_RES_IRQ) { - intr_deactivate_irq(child, r); + map->r_size = length; + return (0); +} + +static int +nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: +#ifdef FDT + bus_space_unmap(map->r_bustag, map->r_bushandle, map->r_size); +#else + pmap_unmapdev(map->r_vaddr, map->r_size); +#endif + return (0); + default: + return (EINVAL); } +} + +static int +nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + int error; - return (rman_deactivate_resource(r)); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, r)); + case SYS_RES_IRQ: + error = rman_deactivate_resource(r); + if (error) + return (error); + intr_deactivate_irq(child, r); + return (0); + default: + return (EINVAL); + } } #ifdef FDT From nobody Thu Feb 27 14:17:08 2025 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 4Z3YLr3R2gz5qG2K; Thu, 27 Feb 2025 14:17:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLr2z5qz3xRl; Thu, 27 Feb 2025 14:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665828; 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=Z3yfyAX47SE60UfLQ6Auh5dz7Reh4GTNzlm5HYtIiu8=; b=R+4ScDPucovCurfQ6gS73W1xkwfz74VYCESh1/rLEzR9KwH4dnMRZzzarmbgD8xF+Tyye+ uvAqLIRbg6N4a9k/sc/Qhlmh1YuREXCCLM3HEBfBVWcZ75lSbsSeDvETxUQ7uuUKCilv84 9E+6adbyrBVSSBz6YhvfpcVrfdFyJKcwFOy5Ln6ZGeSRHDCkochKGc0fftDFlQrbxsE4ko Jr3nWMS5NsHZZECF4VsvHDRuT/WB47l8JpZ9DGTBfkrQhibKOGmfMyj53x9TxFPnLfU0HL j21/LHzt3Tt/7iAOuDeBdiCBCpCvbTNG4aoXIAU6u3S/sXEZVCKPiQY9oIN6JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665828; a=rsa-sha256; cv=none; b=y3XQeZthO3eb8CbdlQDsyd88rSkcYJMH3oX7kjWEBOhO55Xhl3M5jDCOvNdDgbNPSyz2LI ceIz3PwADM07hTAGdg98AXMAOtYew6NCE1gc7HmmO2KWt9oXLnVCFra3KUo0VmBvPjc+uB pN4dHB8l0/c+4Z5CcF1sIMm8Ngio6JimMMZ5rnYckRfikcTS/UNBzClIc/rSH4upbqDcHJ nPqRPPP/LgQc5IfcQX4pYFiWAp4kzl14hWWqQM/pBqIifnXeVM8R1HqVURMxXzV/3ltkdP 8vDxofGjFTYXEeobEAr4BHqpc+NHWNwPOtapHrG7eR7IWe6m5pPl9RdulgNquw== 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=1740665828; 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=Z3yfyAX47SE60UfLQ6Auh5dz7Reh4GTNzlm5HYtIiu8=; b=O7WgGnz+MHqJoWquEN/c2w2Sfk8U5eBFwwcM67766NH/sWTIFKuPMqZ/uLVEur/Q8hMF35 gsQCLFN3MA8MUfFxbbEBPkLe5NxuPY5KS5Pk7jO+Uvve8ESe+rc/mCI4S0Ynid8bM1j8LT dTY+LrG8AFV0bH27z3/MbRPmYQcFPoTLF+reSevxYe3+KxSxPdnPP+3jAwx7D98uxKTkuF rijGF8adv9MgPJVx8NBuySM8Z6TQCCfuop6/iTrANgqCUtrFMo2bMqxEIT41trmhdVY66V WuvHnIyikaqGVww40jN+71XnadvQQFECELcmEkFieQ9utLRPC5s00xA9r4i66w== 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 4Z3YLr2W81zmqR; Thu, 27 Feb 2025 14:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH8DU016818; Thu, 27 Feb 2025 14:17:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH8YX016815; Thu, 27 Feb 2025 14:17:08 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:08 GMT Message-Id: <202502271417.51REH8YX016815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b53a0db0cb41 - stable/14 - gpiobus: Add missing DEVMETHOD for bus_get_rman 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b53a0db0cb41678330685c620facb828941ed237 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b53a0db0cb41678330685c620facb828941ed237 commit b53a0db0cb41678330685c620facb828941ed237 Author: John Baldwin AuthorDate: 2024-02-23 00:14:58 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 gpiobus: Add missing DEVMETHOD for bus_get_rman Reported by: andrew Fixes: 5bda26333a8e gpiobus: Use bus_generic_rman_* (cherry picked from commit 04eca69323111986b262eef3135d804361b60d17) --- sys/dev/gpio/gpiobus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 18129c32133d..a8dd8a753676 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -1041,6 +1041,7 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list), + DEVMETHOD(bus_get_rman, gpiobus_get_rman), DEVMETHOD(bus_add_child, gpiobus_add_child), DEVMETHOD(bus_child_deleted, gpiobus_child_deleted), DEVMETHOD(bus_rescan, gpiobus_rescan), From nobody Thu Feb 27 14:17:02 2025 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 4Z3YLk6b3Bz5qFrQ; Thu, 27 Feb 2025 14:17:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLk5vk0z3x9n; Thu, 27 Feb 2025 14:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665822; 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=h7Wd3oeJn3BJr6+ayToR04QQRUmSq/NV9s4mMpucBJ0=; b=PdCsRe+NIP0iS/Fsnbfq49tI9gUL4qsJivssJQLAzRN0jtFt+JeyY3Uv0LwK0utMzVI+TW NPM7eKinSshXZxxY7T98vmB9lj3G+a+/Fhc2sBUhu+il1Z+U2sVuQCDMrbKfDgHaJ/Guw0 4t9HrEJwszsTBveOT0Tbdsw3/O/1dx6QhA1ZlTKMBo9zDTtpr41Tig4A5jzZoD4YIb1LZz 8DXLrrvy+OFHQ5Unx3IllC5FGz07ZrPM6nY1E7KhYkdmLe65XeJ/3Vj1DkwHBLaSSuc05z P1JBVmuescXDkUe02T5dCkF6pEKvf2c5SboItouyZiwBt7GLfDJ2rcfswxV/SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665822; a=rsa-sha256; cv=none; b=hlvRAoBuYchgM96/74sd01QN+LXNBVHgLQJ4+lDsvzEHE2HYJWn7dlLZ/uS8vuMHXJlKKO JEr1dlzSAtKlXDv49FykxlZu/X2fWf1vdem+a0+8nkwLT2eCmFqo122AgmSaombUdXdM4C ToxCzmHprLwaurTcTwmFyAgXcE3EeRizFpWMK/5L9ImOuDyuUn5yEMiflzN2Hws+rb2ji/ nX/pIYp7dtBT4v3pGC6lIOH0Tsvnsxgh4cHNclbHEgKQhAxnnCNAhYPYA96NSoKTyVVdE7 tEfd/IHMcdiCeCeD/fvlOQws26VuFT6rqfb69H9Jp+BLDsqC1HRzLPyCQ3lADw== 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=1740665822; 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=h7Wd3oeJn3BJr6+ayToR04QQRUmSq/NV9s4mMpucBJ0=; b=diZOX5yNYgwz3BbDc6Ftokw1f6rLFlx2lWGMaIpCirqXoNtXUrOM+vA18Lvq4iCUKs3HGO TPuTuFCTfaBOIzOo0/VotJ6fDe65QspCQjrsYPFIE/SkeLsk2qA8zK534v/T5yZl/y/EGg cgc34qBeu8RxdfBE9MVNlWbySi6+FaQR5bLw2r0UKP1ID/3NLBi90zeOhvq8RYJMz+nrqE QSgowlXG5mNsnlXEcnV7V0pSqb3R6ZJ0eKD4kQSBW+0uI1ABt4Efh3Ov9Z3qyXsasoDO1m 6+n5PLgAb/vx2fszd7k+XwnUMREnWcII3NfowoMrCqfgbo7KeDcnXcCkrlZvZQ== 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 4Z3YLk5WGZzmQH; Thu, 27 Feb 2025 14:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH2vv016641; Thu, 27 Feb 2025 14:17:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH23f016638; Thu, 27 Feb 2025 14:17:02 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:02 GMT Message-Id: <202502271417.51REH23f016638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4a0f4ccf6ae7 - stable/14 - powerpc mpc85xx: Fix infinite recursion in bus_adjust_resource method 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4a0f4ccf6ae7b0428da5015cc35eeafe01a5442d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4a0f4ccf6ae7b0428da5015cc35eeafe01a5442d commit 4a0f4ccf6ae7b0428da5015cc35eeafe01a5442d Author: John Baldwin AuthorDate: 2024-02-16 17:40:34 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 powerpc mpc85xx: Fix infinite recursion in bus_adjust_resource method The default case needs to call bus_generic_adjust_resource to pass the request up the tree, not bus_adjust_resource which will just call this method again. Fixes: 5a7e717fb790 powerpc mpc85xx: Use bus_generic_rman_* (cherry picked from commit 68a3ff041129208ea98a3bd5142061176ab4165e) --- sys/powerpc/mpc85xx/lbc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c index 52e28a5fb1cb..1e17d613438a 100644 --- a/sys/powerpc/mpc85xx/lbc.c +++ b/sys/powerpc/mpc85xx/lbc.c @@ -774,7 +774,8 @@ lbc_adjust_resource(device_t dev, device_t child, int type, struct resource *r, return (bus_generic_rman_adjust_resource(dev, child, type, r, start, end)); case SYS_RES_IRQ: - return (bus_adjust_resource(dev, type, r, start, end)); + return (bus_generic_adjust_resource(dev, child, type, r, start, + end)); default: return (EINVAL); } From nobody Thu Feb 27 14:16:36 2025 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 4Z3YLD6vP3z5qGFM; Thu, 27 Feb 2025 14:16:36 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLD6hgpz3x9J; Thu, 27 Feb 2025 14:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665796; 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=ra+VPyIqgaCH3BWP++UH4I1aUfTGatnh+1wZDmfoGz4=; b=bX+Y0E5NNinSxSiazmqcORwGO3jHn0Gr3bwxL7K0CHc0RaYsRb8+PeabTZbZmeXH9fvTk+ 6ZWTtXdhWDBMxzlCLmKXDNXtVYVYNLdhVcoE9zek6jiKH0Mtm3cf6vuefVzfNnRePrWnQQ UaTnrKcOOzMHiVjUAPRhp28JNA5n+OqctfFc5MJPCdaD4l/nrz8ZYr8UPzChLQMpJHBDqv o+WEZcPLoSvGbObXMIXbiPl/AEmhVN9XtBIZn0sZN0ieZ0tUbT6kQ1jMFGYDmKaSGJsbLy RurUuBO0ip1C+Xg25zsasctnw9tw5XmlJDJu07abfde/R4BrwJbk+NM5cZXyIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665796; a=rsa-sha256; cv=none; b=fluh7kIZ7pnsx5nzmXWsDL6FRD5I2zaQStkvmRgV0HfT3XNuXnAcxSXkqD7XViQBRFs6/e OJ+a1GCIvDtURHgkCLMz+RCUe2DXbIOVhCbDINLsWeppqh+J4+iwpM8xrVb98hGSQS50v1 jc6osji0dhbbUCLFvPnQ7GphTfVwnGDzaW5G24ff1AFcWTr35em0xx3mdl4+bt3wmKpGW9 hHphwx5MQJzkI47jFxLUL42gjJIIHdR0R1vb61HW805WP4NQgVqsDs1XuP75eOfHCWOU8J inXYFEdvVPnY8mEFtGcPnobDGcIEhUdbSGoSAp1zbXdOknnBnBGPBYE2PEOhAg== 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=1740665796; 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=ra+VPyIqgaCH3BWP++UH4I1aUfTGatnh+1wZDmfoGz4=; b=gJFMIGTJ3EcQqsrXevQyRXmHAX24f9bxrgpWm9ca78YXQtBNe6dZjnr2Et+tVMwGO7CstO QUffNTpMjYcA/1elTB7vFdwe8Bfdxb6qpV1dnJVSmf8zN+mK6loW2V69fzin9tL1Qb1QTy ssxhk7mayOlRACJZQ0cIgp+JozaUwGH8/cFiB9MB5spf3UTAbtDxfGOThoKycVcenP+/qw fFji/Y+i0L/YEof+IdN3Gzsi+zsGpXVjYvockVAb7t4PMFF9/IiwVFBjRDp3ctt1elkmoS fo/lwQ353D22nE0zYdEAMhgw3iXUZm0hgyj6NKVlcH7qhq/V9CGbMVeKeYApZw== 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 4Z3YLD6DwdzmZM; Thu, 27 Feb 2025 14:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGaUf015799; Thu, 27 Feb 2025 14:16:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGaix015796; Thu, 27 Feb 2025 14:16:36 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:36 GMT Message-Id: <202502271416.51REGaix015796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 387c7a712264 - stable/14 - powerpc powermac: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 387c7a712264a764d85d94d0b87f464f6bcf4945 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=387c7a712264a764d85d94d0b87f464f6bcf4945 commit 387c7a712264a764d85d94d0b87f464f6bcf4945 Author: John Baldwin AuthorDate: 2024-01-23 17:36:49 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc powermac: Use bus_generic_rman_* Implement bus_map/unmap_resource and add bus_get_rman for use by bus_generic_rman_*. Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43435 (cherry picked from commit af081ec6f7cf4b764a1b417135440cf05cf1a174) --- sys/powerpc/powermac/macio.c | 197 ++++++++++++++++++++++++++------------- sys/powerpc/powermac/uninorth.c | 200 ++++++++++++++++++++++++++-------------- 2 files changed, 264 insertions(+), 133 deletions(-) diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c index 76ae844e50fe..f6ad815064e8 100644 --- a/sys/powerpc/powermac/macio.c +++ b/sys/powerpc/powermac/macio.c @@ -80,15 +80,23 @@ static int macio_probe(device_t); static int macio_attach(device_t); static int macio_print_child(device_t dev, device_t child); static void macio_probe_nomatch(device_t, device_t); +static struct rman *macio_get_rman(device_t, int, u_int); static struct resource *macio_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int macio_adjust_resource(device_t, device_t, int, struct resource *, + rman_res_t, rman_res_t); static int macio_activate_resource(device_t, device_t, int, int, struct resource *); static int macio_deactivate_resource(device_t, device_t, int, int, struct resource *); static int macio_release_resource(device_t, device_t, int, int, struct resource *); +static int macio_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, + struct resource_map *); +static int macio_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static struct resource_list *macio_get_resource_list (device_t, device_t); static ofw_bus_get_devinfo_t macio_get_devinfo; #if !defined(__powerpc64__) && defined(SMP) @@ -113,10 +121,14 @@ static device_method_t macio_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_rman, macio_get_rman), DEVMETHOD(bus_alloc_resource, macio_alloc_resource), + DEVMETHOD(bus_adjust_resource, macio_adjust_resource), DEVMETHOD(bus_release_resource, macio_release_resource), DEVMETHOD(bus_activate_resource, macio_activate_resource), DEVMETHOD(bus_deactivate_resource, macio_deactivate_resource), + DEVMETHOD(bus_map_resource, macio_map_resource), + DEVMETHOD(bus_unmap_resource, macio_unmap_resource), DEVMETHOD(bus_get_resource_list, macio_get_resource_list), DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), @@ -495,25 +507,32 @@ macio_probe_nomatch(device_t dev, device_t child) } } +static struct rman * +macio_get_rman(device_t bus, int type, u_int flags) +{ + struct macio_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} + static struct resource * macio_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct macio_softc *sc; - int needactivate; - struct resource *rv; - struct rman *rm; - u_long adjstart, adjend, adjcount; + rman_res_t adjstart, adjend, adjcount; struct macio_devinfo *dinfo; struct resource_list_entry *rle; - sc = device_get_softc(bus); dinfo = device_get_ivars(child); - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - switch (type) { case SYS_RES_MEMORY: case SYS_RES_IOPORT: @@ -541,8 +560,8 @@ macio_alloc_resource(device_t bus, device_t child, int type, int *rid, adjcount = adjend - adjstart; - rm = &sc->sc_mem_rman; - break; + return (bus_generic_rman_alloc_resource(bus, child, type, rid, + adjstart, adjend, adjcount, flags)); case SYS_RES_IRQ: /* Check for passthrough from subattachments like macgpio */ @@ -574,84 +593,134 @@ macio_alloc_resource(device_t bus, device_t child, int type, int *rid, device_get_nameunit(child)); return (NULL); } +} - rv = rman_reserve_resource(rm, adjstart, adjend, adjcount, flags, - child); - if (rv == NULL) { - device_printf(bus, - "failed to reserve resource %#lx - %#lx (%#lx) for %s\n", - adjstart, adjend, adjcount, device_get_nameunit(child)); - return (NULL); +static int +macio_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(bus, child, type, r, + start, end)); + case SYS_RES_IRQ: + return (bus_generic_adjust_resource(bus, child, type, r, start, + end)); + default: + return (EINVAL); } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); } static int macio_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - if (rman_get_flags(res) & RF_ACTIVE) { - int error = bus_deactivate_resource(child, type, rid, res); - if (error) - return error; + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(bus, child, type, rid, + res)); + case SYS_RES_IRQ: + return (bus_generic_rl_release_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); } - - return (rman_release_resource(res)); } static int macio_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - struct macio_softc *sc; - void *p; - - sc = device_get_softc(bus); - - if (type == SYS_RES_IRQ) - return (bus_activate_resource(bus, type, rid, res)); - - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - p = pmap_mapdev((vm_paddr_t)rman_get_start(res) + sc->sc_base, - (vm_size_t)rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_le_tag); - rman_set_bushandle(res, (u_long)p); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_generic_activate_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); } - - return (rman_activate_resource(res)); } static int macio_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - u_int32_t psize; + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_generic_deactivate_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); + } +} + +static int +macio_map_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + struct macio_softc *sc; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); - psize = rman_get_size(res); - pmap_unmapdev(rman_get_virtual(res), psize); + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); } - return (rman_deactivate_resource(res)); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + if (bootverbose) + printf("nexus mapdev: start %jx, len %jd\n", + (uintmax_t)start, (uintmax_t)length); + + sc = device_get_softc(bus); + map->r_vaddr = pmap_mapdev_attr((vm_paddr_t)start + sc->sc_base, + length, args.memattr); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = &bs_le_tag; + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; + return (0); +} + +static int +macio_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + /* + * If this is a memory resource, unmap it. + */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + pmap_unmapdev(map->r_vaddr, map->r_size); + break; + default: + return (EINVAL); + } + return (0); } static struct resource_list * diff --git a/sys/powerpc/powermac/uninorth.c b/sys/powerpc/powermac/uninorth.c index 1e22e0f92855..b64bbc8ade62 100644 --- a/sys/powerpc/powermac/uninorth.c +++ b/sys/powerpc/powermac/uninorth.c @@ -71,13 +71,22 @@ static int unin_chip_attach(device_t); */ static int unin_chip_print_child(device_t dev, device_t child); static void unin_chip_probe_nomatch(device_t, device_t); +static struct rman *unin_chip_get_rman(device_t, int, u_int); static struct resource *unin_chip_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int unin_chip_adjust_resource(device_t, device_t, int, + struct resource *, rman_res_t, + rman_res_t); static int unin_chip_activate_resource(device_t, device_t, int, int, struct resource *); static int unin_chip_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int unin_chip_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, + struct resource_map *); +static int unin_chip_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static int unin_chip_release_resource(device_t, device_t, int, int, struct resource *); static struct resource_list *unin_chip_get_resource_list (device_t, device_t); @@ -109,10 +118,14 @@ static device_method_t unin_chip_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_rman, unin_chip_get_rman), DEVMETHOD(bus_alloc_resource, unin_chip_alloc_resource), + DEVMETHOD(bus_adjust_resource, unin_chip_adjust_resource), DEVMETHOD(bus_release_resource, unin_chip_release_resource), DEVMETHOD(bus_activate_resource, unin_chip_activate_resource), DEVMETHOD(bus_deactivate_resource, unin_chip_deactivate_resource), + DEVMETHOD(bus_map_resource, unin_chip_map_resource), + DEVMETHOD(bus_unmap_resource, unin_chip_unmap_resource), DEVMETHOD(bus_get_resource_list, unin_chip_get_resource_list), DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), @@ -449,25 +462,32 @@ unin_chip_probe_nomatch(device_t dev, device_t child) } } +static struct rman * +unin_chip_get_rman(device_t bus, int type, u_int flags) +{ + struct unin_chip_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} + static struct resource * unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct unin_chip_softc *sc; - int needactivate; - struct resource *rv; - struct rman *rm; - u_long adjstart, adjend, adjcount; + rman_res_t adjstart, adjend, adjcount; struct unin_chip_devinfo *dinfo; struct resource_list_entry *rle; - sc = device_get_softc(bus); dinfo = device_get_ivars(child); - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - switch (type) { case SYS_RES_MEMORY: case SYS_RES_IOPORT: @@ -497,9 +517,8 @@ unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid, adjcount = adjend - adjstart; - rm = &sc->sc_mem_rman; - break; - + return (bus_generic_rman_alloc_resource(bus, child, + SYS_RES_MEMORY, rid, adjstart, adjend, adjcount, flags)); case SYS_RES_IRQ: /* Check for passthrough from subattachments. */ if (device_get_parent(child) != bus) @@ -532,89 +551,132 @@ unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid, device_get_nameunit(child)); return (NULL); } +} - rv = rman_reserve_resource(rm, adjstart, adjend, adjcount, flags, - child); - if (rv == NULL) { - device_printf(bus, - "failed to reserve resource %#lx - %#lx (%#lx)" - " for %s\n", adjstart, adjend, adjcount, - device_get_nameunit(child)); - return (NULL); +static int +unin_chip_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(bus, child, type, r, + start, end)); + case SYS_RES_IRQ: + return (bus_generic_adjust_resource(bus, child, type, r, start, + end)); + default: + return (EINVAL); } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); } static int unin_chip_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - if (rman_get_flags(res) & RF_ACTIVE) { - int error = bus_deactivate_resource(child, type, rid, res); - if (error) - return error; + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(bus, child, type, rid, + res)); + case SYS_RES_IRQ: + return (bus_generic_rl_release_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); } - - return (rman_release_resource(res)); } static int unin_chip_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - void *p; - - if (type == SYS_RES_IRQ) - return (bus_activate_resource(bus, type, rid, res)); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_generic_activate_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); + } +} - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - vm_offset_t start; +static int +unin_chip_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_generic_deactivate_resource(bus, child, type, rid, + res)); + default: + return (EINVAL); + } +} - start = (vm_offset_t) rman_get_start(res); +static int +unin_chip_map_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t length, start; + int error; - if (bootverbose) - printf("unin mapdev: start %zx, len %jd\n", start, - rman_get_size(res)); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); - p = pmap_mapdev(start, (vm_size_t) rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_be_tag); - rman_set_bushandle(res, (u_long)p); + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); } - return (rman_activate_resource(res)); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + if (bootverbose) + printf("nexus mapdev: start %jx, len %jd\n", + (uintmax_t)start, (uintmax_t)length); + + map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = &bs_be_tag; + map->r_size = length; + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; + return (0); } static int -unin_chip_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +unin_chip_unmap_resource(device_t bus, device_t child, int type, + struct resource *r, struct resource_map *map) { - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - u_int32_t psize; - - psize = rman_get_size(res); - pmap_unmapdev(rman_get_virtual(res), psize); + /* + * If this is a memory resource, unmap it. + */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + pmap_unmapdev(map->r_vaddr, map->r_size); + break; + default: + return (EINVAL); } - - return (rman_deactivate_resource(res)); + return (0); } static struct resource_list * From nobody Thu Feb 27 14:16:53 2025 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 4Z3YLY6XwQz5qG2D; Thu, 27 Feb 2025 14:16:53 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLY61Rdz3xJJ; Thu, 27 Feb 2025 14:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665813; 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=jkzlIoJOQkbn/PnHWN4S0Zf10ZhLrngl872L5Cuu0yQ=; b=H5nw92MR2iWPIr4A62XyZZ8depojSQXNwRFgFaTI0xRMWsa5g2zkXfQDO7ho+FbTpQqKtt l3XY+d0biKHZb17wYEtVxk8eLVPJDmyxeJPWl0bPoRAJ8UvGAj2RVgnVzJLmCtz/Jpc2Zn +MNaup9JMs83RptHo86denMu3qbajNDYvi10latQo5Npdccec2sjn8WZuiZbkvBxS5+JTl zI3MAAoQ4PYirvzuDBFGQ87e8GovEZzyBUKaYqxmrOm9eJHin+FwXIOUEWxlHlLeKNqkFq mhgQTYzLqjSHjcjVYv/tUMPzuyuOFNpUcK0a6c/6F70XdHIiDvWze4CidOqjAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665813; a=rsa-sha256; cv=none; b=jtEkb2tH6bYH8klbqKXvU7CzrKQ03yeCWJz4WKreGn597CxLFV/h8tHbPpVQyveot2YB+7 SbyLlP26Wq05dxIAkIUmC78rRKivYTLIkvngqT3UG4jkB9MO/035gR60mTy7TFwLjzB3J+ vIbeY5rkNR0e1GeZkHvWn+Wr1ACThoSfDSotZRvNKdQCsq6uQnCTYbTsLqyYEduM8T/0EQ oRfsD4Rq1wPgvHiegqSGIJWNWyasa5jFetlFLZK0HwIY7G4rOh4aolJRinEwt2YM+e2u6c OItWRyynHAZLJGPP8G4r+Vo4uCpf5upgCslTqbKqaOQ70iDbWSVyRAZqi2UNow== 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=1740665813; 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=jkzlIoJOQkbn/PnHWN4S0Zf10ZhLrngl872L5Cuu0yQ=; b=AYDAuw2KPdLOdR1LfCrgbQaydHLFQn32k5MCGqp2j2IImH0yBO7qSkckDMwU20HjTESPl9 VCmD7rVE96MeNnOermCW0+uSPd2TPEg40f6bFFz9aDFaOC/T19ZAmot94RSRyME7J+zF5j SRb8dYGX7pqtSNRJyijb93obb5D3RsGbFkQGQbnnNltEbKt9pYCBYhzwN9WKc20qz4AMfb C9vK/nbXo98SsP4jRq2tQhZ+JDrpZvIq955p7CqwrQOvQyDGr1J2/AOJBqjlM5scY+ESjt ya+A3Ju020pUeE4+vZYVoVk5aMlQQeilWYI3BKZpBwFwh1zwktIrB0e2A2Nctw== 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 4Z3YLY5cSNzmpZ; Thu, 27 Feb 2025 14:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGrLf016345; Thu, 27 Feb 2025 14:16:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGrgh016342; Thu, 27 Feb 2025 14:16:53 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:53 GMT Message-Id: <202502271416.51REGrgh016342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3756a1c62af2 - stable/14 - physmem ram: Don't reserve excluded regions 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3756a1c62af2f326419572d6fc5789c52567e32e Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3756a1c62af2f326419572d6fc5789c52567e32e commit 3756a1c62af2f326419572d6fc5789c52567e32e Author: John Baldwin AuthorDate: 2024-02-14 22:07:33 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 physmem ram: Don't reserve excluded regions These regions can conflict with I/O resources and prevent allocation of those regions by other drivers. It may make sense to reserve them after the boot-time probe of devices has concluded (or after an initial pass to reserve firmware-assigned resources before "wildcard" resources are allocated), but that would require additional changes. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43893 (cherry picked from commit add99c9c4bae2769cba14a88b83377ec9c04cad9) --- sys/kern/subr_physmem.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index e74a11f47c2c..51af2e896877 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -583,7 +583,6 @@ ram_attach(device_t dev) { vm_paddr_t avail_list[PHYS_AVAIL_COUNT]; rman_res_t start, end; - struct region *hwp; int rid, i; rid = 0; @@ -609,30 +608,6 @@ ram_attach(device_t dev) rid++; } - /* Now, reserve the excluded memory regions. */ - for (i = 0, hwp = exregions; i < excnt; i++, hwp++) { - start = hwp->addr; - end = hwp->addr + hwp->size; - - if (bootverbose) - device_printf(dev, - "reserving excluded region: %jx-%jx\n", - (uintmax_t)start, (uintmax_t)(end - 1)); - - /* - * Best-effort attempt to reserve the range. This may fail, as - * sometimes the excluded ranges provided by the device tree - * will cover or overlap some I/O range. - */ - if (bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, end, - end - start, 0) == NULL) { - if (bootverbose) - device_printf(dev, "failed to reserve region\n"); - continue; - } - rid++; - } - return (0); } From nobody Thu Feb 27 15:17:39 2025 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 4Z3Zhg6gbfz5qJkm; Thu, 27 Feb 2025 15:17:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Zhg5pNfz41t8; Thu, 27 Feb 2025 15:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740669459; 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=zFWZbPcpkKrWQBzwNBetpgCURWqNKMiOiv3e4uvBVtU=; b=u+7fSj91XuBXh041Ysm2K16TZjYnw/7E2CIZ5devkDzm3y28biU/5ZgVS17Wg4w4xIm9zO W7l07qbq7usrE9AGKIGUKDGrmmp55RrN8v42F6CHf8dJelSnBBzH886rSkcv3sYKA8B1+C TRlsMJzDbhm+7KvssjNOocWXwd3MwwzJUodSPiI1BAzGVnhHyut48Vh6PIsViPa7Lb7S2X n+Zw36acFK1/lEU/OfdnNSoZnRnktaKoUrT+NrYapB0DUz/0jrmKYRDx0+h4Eqv39CvWK5 ko7J3lOPuaujm+qysmDSiF4/R0DGG38zqy7RIr9ChyGXRAn/8vqjOaUgL/+Ovg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740669459; a=rsa-sha256; cv=none; b=Uc6ds1d3XgG1HszNdRtYF7w4f1OPsYscF+2xwSzcjgKPcpA2EdAZrPE+0Ka6bEaqp2W2oe Nbgn+CiE5HU/jVTQBrDOJ+QOXkrMDiaoNS/ZauzrRKwqB4Ew/xY3+qID5e8WlQDNrQk8Q5 1CskY/BrnBivTVwEi4Sm3ao1Mxua9oG58sV3/wXOWS5Ue49CtB8c3KtY22WlS4toinQz6R 3ZGajX+4sTfXbmG2W2OLJelUE2l2qwCK85fRD5d7mBGeDlDypT+nd59rN+4vb/oh7cvW6y fMhuINX3OfMJJaaDC7Ds55w5Eh3Z7MOVopy9gc/6Ts2yzsOL9APufFFCltqAnQ== 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=1740669459; 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=zFWZbPcpkKrWQBzwNBetpgCURWqNKMiOiv3e4uvBVtU=; b=kBerW5DLJlH6DKwUOakHt83CaFrpt3mTZmkEZzugzar1f/mfK3cpWm6DtYTKMTraMtiUKd PoJuiHbdmz9CSrybNXx+PdkaWwYWipqwIvjfa2bYo9Ozy4hovPZHWIwDhPk7KA1UawLHSf ROi9OfiuD7YzTJH3V87VUhfl42dHdMu/hF5TR0hAurTg5qizr6EwV1znZkvHd3f5Yo2bLs 10wY/9vUlfiBn/7g/29hbgM6yX4cm82ID8bm1LFbGPPx5wIk2BJsXqDIzGYEA2unQ31yuR sFYVKclYS56wCAbnXjbwjis5uxyhlhsDDwbtsMVkYXIy6+6Wkk47JRfYxTnqcw== 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 4Z3Zhg4rdMzp9K; Thu, 27 Feb 2025 15:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RFHdiN030133; Thu, 27 Feb 2025 15:17:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RFHd1k030130; Thu, 27 Feb 2025 15:17:39 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:17:39 GMT Message-Id: <202502271517.51RFHd1k030130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 38ed49b0f927 - stable/14 - sound: Use bus_child_deleted methods to free ivars for children 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38ed49b0f9276a349323f5fddebf02ec47b356ac Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=38ed49b0f9276a349323f5fddebf02ec47b356ac commit 38ed49b0f9276a349323f5fddebf02ec47b356ac Author: John Baldwin AuthorDate: 2024-11-01 14:09:11 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:16:56 +0000 sound: Use bus_child_deleted methods to free ivars for children Note that hdsp and hdspe were just leaking the ivars on detach previously. While here, use M_WAITOK to allocate ivars since attach routines are sleepable. hdsp and hdspe were using M_NOWAIT without checking the return value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47366 (cherry picked from commit a17a41ffde0d1c579dcd7cef7900c3b44be0ec81) hsdp(4) doesn't exist in stable/14 so is not patched --- sys/dev/sound/pci/csa.c | 26 +++------ sys/dev/sound/pci/emu10kx.c | 134 ++++++++++---------------------------------- sys/dev/sound/pci/hdspe.c | 9 ++- 3 files changed, 46 insertions(+), 123 deletions(-) diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index f293a8fc8af8..aa682bf43071 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -274,22 +274,14 @@ csa_attach(device_t dev) /* Attach the children. */ /* PCM Audio */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto err_teardown; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); func->varinfo = &scp->binfo; func->func = SCF_PCM; scp->pcm = device_add_child(dev, "pcm", -1); device_set_ivars(scp->pcm, func); /* Midi Interface */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto err_teardown; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); func->varinfo = &scp->binfo; func->func = SCF_MIDI; scp->midi = device_add_child(dev, "midi", -1); @@ -310,34 +302,33 @@ err_io: return (error); } +static void +csa_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static int csa_detach(device_t dev) { csa_res *resp; sc_p scp; - struct sndcard_func *func; int err; scp = device_get_softc(dev); resp = &scp->res; if (scp->midi != NULL) { - func = device_get_ivars(scp->midi); err = device_delete_child(dev, scp->midi); if (err != 0) return err; - if (func != NULL) - free(func, M_DEVBUF); scp->midi = NULL; } if (scp->pcm != NULL) { - func = device_get_ivars(scp->pcm); err = device_delete_child(dev, scp->pcm); if (err != 0) return err; - if (func != NULL) - free(func, M_DEVBUF); scp->pcm = NULL; } @@ -1062,6 +1053,7 @@ static device_method_t csa_methods[] = { DEVMETHOD(device_resume, csa_resume), /* Bus interface */ + DEVMETHOD(bus_child_deleted, csa_child_deleted), DEVMETHOD(bus_alloc_resource, csa_alloc_resource), DEVMETHOD(bus_release_resource, csa_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index 0f938597e06c..2cd5a881c653 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -3211,16 +3211,8 @@ emu_pci_attach(device_t dev) sc->pcm[i] = NULL; /* FRONT */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_FRONT; @@ -3231,16 +3223,8 @@ emu_pci_attach(device_t dev) if (!(sc->mch_disabled)) { /* REAR */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_REAR; @@ -3250,16 +3234,8 @@ emu_pci_attach(device_t dev) device_set_ivars(sc->pcm[RT_REAR], func); if (sc->has_51) { /* CENTER */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_CENTER; @@ -3268,16 +3244,8 @@ emu_pci_attach(device_t dev) sc->pcm[RT_CENTER] = device_add_child(dev, "pcm", -1); device_set_ivars(sc->pcm[RT_CENTER], func); /* SUB */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_SUB; @@ -3288,16 +3256,8 @@ emu_pci_attach(device_t dev) } if (sc->has_71) { /* SIDE */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_SIDE; @@ -3309,16 +3269,8 @@ emu_pci_attach(device_t dev) } /* mch_disabled */ if (sc->mch_rec) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_MCHRECORD; @@ -3335,16 +3287,8 @@ emu_pci_attach(device_t dev) #if 0 /* Midi Interface 1: Live!, Audigy, Audigy 2 */ if ((sc->is_emu10k1) || (sc->is_emu10k2) || (sc->is_ca0102)) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (midiinfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_WAITOK | M_ZERO); midiinfo->card = sc; if (sc->is_emu10k2 || (sc->is_ca0102)) { midiinfo->port = EMU_A_MUDATA1; @@ -3361,16 +3305,8 @@ emu_pci_attach(device_t dev) } /* Midi Interface 2: Audigy, Audigy 2 (on AudigyDrive) */ if (sc->is_emu10k2 || (sc->is_ca0102)) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (midiinfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_WAITOK | M_ZERO); midiinfo->card = sc; midiinfo->port = EMU_A_MUDATA2; @@ -3401,11 +3337,22 @@ bad: return (error); } +static void +emu_pci_child_deleted(device_t dev, device_t child) +{ + struct sndcard_func *func; + + func = device_get_ivars(child); + if (func != NULL) { + free(func->varinfo, M_DEVBUF); + free(func, M_DEVBUF); + } +} + static int emu_pci_detach(device_t dev) { struct emu_sc_info *sc; - struct sndcard_func *func; int devcount, i; device_t *childlist; int r = 0; @@ -3414,35 +3361,17 @@ emu_pci_detach(device_t dev) for (i = 0; i < RT_COUNT; i++) { if (sc->pcm[i] != NULL) { - func = device_get_ivars(sc->pcm[i]); - if (func != NULL && func->func == SCF_PCM) { - device_set_ivars(sc->pcm[i], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->pcm[i]); if (r) return (r); } } if (sc->midi[0] != NULL) { - func = device_get_ivars(sc->midi[0]); - if (func != NULL && func->func == SCF_MIDI) { - device_set_ivars(sc->midi[0], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->midi[0]); if (r) return (r); } if (sc->midi[1] != NULL) { - func = device_get_ivars(sc->midi[1]); - if (func != NULL && func->func == SCF_MIDI) { - device_set_ivars(sc->midi[1], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->midi[1]); if (r) return (r); } @@ -3450,12 +3379,6 @@ emu_pci_detach(device_t dev) if (device_get_children(dev, &childlist, &devcount) == 0) for (i = 0; i < devcount - 1; i++) { device_printf(dev, "removing stale child %d (unit %d)\n", i, device_get_unit(childlist[i])); - func = device_get_ivars(childlist[i]); - if (func != NULL && (func->func == SCF_MIDI || func->func == SCF_PCM)) { - device_set_ivars(childlist[i], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } device_delete_child(dev, childlist[i]); } if (childlist != NULL) @@ -3488,6 +3411,7 @@ static device_method_t emu_methods[] = { DEVMETHOD(device_attach, emu_pci_attach), DEVMETHOD(device_detach, emu_pci_detach), /* Bus methods */ + DEVMETHOD(bus_child_deleted, emu_pci_child_deleted), DEVMETHOD(bus_read_ivar, emu_read_ivar), DEVMETHOD(bus_write_ivar, emu_write_ivar), diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 0b378cc3d8f4..a9543cbfbebb 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -491,7 +491,7 @@ hdspe_attach(device_t dev) return (ENXIO); for (i = 0; i < HDSPE_MAX_CHANS && chan_map[i].descr != NULL; i++) { - scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); + scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); scp->hc = &chan_map[i]; scp->sc = sc; scp->dev = device_add_child(dev, "pcm", -1); @@ -527,6 +527,12 @@ hdspe_attach(device_t dev) return (bus_generic_attach(dev)); } +static void +hdspe_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static void hdspe_dmafree(struct sc_info *sc) { @@ -574,6 +580,7 @@ static device_method_t hdspe_methods[] = { DEVMETHOD(device_probe, hdspe_probe), DEVMETHOD(device_attach, hdspe_attach), DEVMETHOD(device_detach, hdspe_detach), + DEVMETHOD(bus_child_deleted, hdspe_child_deleted), { 0, 0 } }; From nobody Thu Feb 27 17:04:00 2025 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 4Z3d3N6fvgz5qNLk; Thu, 27 Feb 2025 17:04:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3d3N61Swz46G8; Thu, 27 Feb 2025 17:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675840; 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=CHhHUAX25fJ7ZZkEENM2sV4y5bRzczSGi2JIyBxyLi0=; b=H29PxnE7a3vfUokglF07dJ/oMRf6RiGAndXh1vIrFeXJqV/vuojM6hEIhqeQHTUsO7AFDh Tg5cMLTe0hl/4M24KDh1aqnXreUSMkTl9INRcruOdMnNAJ/L/yh/YFuBqb/wH8DRUCqpm7 YbAHOL0PbXpa14+fWBTvwR1rZpf3yL95pkMcE4Rl3X2pkiAHaBGZZUJM2jKKXBrUJnJdyt 6/AHv50VLMfZfwXh5GW5F4HtnXX40wiQA8BKlYqO2q9C8ixNnWk6/J1ptVx4okxJapiNiv wRd/sxMkN+UAbAALbkhjEWKo7Nzh6a4oTafgoe6GoPmLWQCIMjJcJhZFwTkIvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675840; a=rsa-sha256; cv=none; b=LoVRCYTd7Jb0Ig311NOIfcMXMFv0uAhoOW1/BjgIWNO5nMwkLbLGmPClsjIHS6lCO4y6JR +koZyn9LBVDK4eMzGL3GjJuL5pvqRNeCAoZcuELq4e6jmEyyZTi5qQmQ18NLvGkaEuKdWg w4wz35aKoDO9MY4NiB736ommRTq9DBONW/1XjuaR963kl4yu2ecWFYf5L/BprjM5gpsZCX IQDjG+0adJ1CIrHyCjkU24oOtYYrIO8NrGVTS6wI5LZ9ObkjUhd0k11aehElRrRpxOTnct HuaNB2NwI1uMP92cy4Ald6DveZ4WX8xq9GUzCRkmFlsSoHivn2rn38Ua1/0b9Q== 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=1740675840; 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=CHhHUAX25fJ7ZZkEENM2sV4y5bRzczSGi2JIyBxyLi0=; b=H2LaIFSHotUgWOlqqgQzFSvMyvgrLwRaIzABcBfzwE5DNU/Gnv00fmDruS7ds76v5ZeQel Y8aqayO4TF5zOhcoX3rTWFjxKgL4WTATeqtsYd6reFeaqvanby7TQ56JvTKaGgvhdZhp76 k36Jmog0ALBwSUA/wP+kruwdUWOy1BpkGcJg3y70P/U1jFvurEo65rDqSPRHbuCxO2L0+K PUxMNoIl6E1ATwiA1QBn3nYZ/RJSS304Nj8wxgJPRBB1CXdwOrlXmO5TJRQpCJSF8IOsZT hFP07THzgLX36saltbD9sLDvpKmS4chDsxrA7s8X0iITl6tOCT9LgxjHoxRayQ== 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 4Z3d3N5YbYzs9F; Thu, 27 Feb 2025 17:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RH40dQ037036; Thu, 27 Feb 2025 17:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RH404P037033; Thu, 27 Feb 2025 17:04:00 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:04:00 GMT Message-Id: <202502271704.51RH404P037033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 53662f9c6690 - stable/14 - cxgbetool.8: Consistently use .Cm for loader tunables 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 53662f9c66901d100c6e6ddd98da43ebadb49234 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=53662f9c66901d100c6e6ddd98da43ebadb49234 commit 53662f9c66901d100c6e6ddd98da43ebadb49234 Author: John Baldwin AuthorDate: 2024-12-10 20:34:10 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:03:27 +0000 cxgbetool.8: Consistently use .Cm for loader tunables Sponsored by: Chelsio Communications (cherry picked from commit 34fbc9e421e7fbb382a644d8d289311455681734) --- usr.sbin/cxgbetool/cxgbetool.8 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/cxgbetool/cxgbetool.8 b/usr.sbin/cxgbetool/cxgbetool.8 index 995a4146deb3..a5f345c6b781 100644 --- a/usr.sbin/cxgbetool/cxgbetool.8 +++ b/usr.sbin/cxgbetool/cxgbetool.8 @@ -531,7 +531,9 @@ List all filters programmed into the hardware. Install the firmware configuration file contained in .Ar fw-config.txt to the card. -Set hw.cxgbe.config_file="flash" in loader.conf to get +Set +.Cm hw.cxgbe.config_file="flash" +in loader.conf to get .Xr cxgbe 4 to use the on-flash configuration. .It Cm loadcfg Cm clear From nobody Thu Feb 27 14:17:12 2025 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 4Z3YLw6xSvz5qG9r; Thu, 27 Feb 2025 14:17:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLw6M1Zz3xD8; Thu, 27 Feb 2025 14:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665832; 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=KczNIMLtaWst/OfUCcQcFVbnMUoX5OjzPLDLCFEUFSo=; b=rdlPZyd4iDtf4U+O92WwAcl0tZ5uITbvJQBeBdsROmnImvUebWubSappqxe/hV13wG1qml cgUtwxqMJ+MC/55Eg7Hb+9K6j4N4FytNujJIta3PusyDWU2qemyYK94bP+gXS79LBGmONb jll6mHkMgauc9LVTiOMR1yGNC1cM8NLVBBUT8UzYBq70FRLJWCGoCYXi2Do5l7sNTyfjLE UNJqO4ioDXk0pRA6w4hJAT6Wr9GKpIqJlAmLto/uSwDGKxXcTBYpiCF+JMGMfkaiBYdabX 55laN3rVvnAEz+3FgE1bZYlYjFfoaAZH+iIfpt4wIa8eKlxYQ+/w6dR8aUfZPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665832; a=rsa-sha256; cv=none; b=ucQICvq6wAW9FJv7YoJAXZdc2OBodLxAbsWtK+ru/M1IlvZz64EX1cq/MjtbqDWM+LiAYd voBrMEDyFFEcur065aQA+Qdy3KqWF1ZUPQNsh3SbOxftGVNvjhIoLKp6rwEH5sw11vSiBl BaC7MYqZxCAY9jf6K8Tw1tOV4BRbXUH9pw4marLyHz09BPvuZEhYgf/nf9m0Y5yMGW/TTS sLKefGW9iYQ5jxnqWAtNNYyiZOjhUcRoNuw1UURSRmmnrT6Q8Ad+OT+tWVQFkLsbeU4l27 dTTlFdBQOK9hsJKBxk3dhOzvyXio6YDVkz4v7/MPW5C8Cavo5ib2v5D/BxvwLQ== 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=1740665832; 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=KczNIMLtaWst/OfUCcQcFVbnMUoX5OjzPLDLCFEUFSo=; b=iAOyBt78EBQRgver5gLcEHz7JvNgLPplsB9q2offmbbAoQ66RHunYYhX65X7EvOqbjHlRD 5WbtMkyh4hAqrV7ugiR5U3HFMRioUwz+9DxTAPdhOsgldeowvc3TB+yGFpcsPDi3Jw8tdR q1J0gKcp/XlrCMd2jfZ8z7NA5Nx6XD/xWWGfs1/QLL7xk7zbIMxBLZ7Jct0XS9ceHghdTv 7v3/jzWHkVtWGdUQlDev7IfjseYm68TqAutVrZntSqDjKP4jgt4R9hN673VqqFl1306VKB leX0luz/yZRmHyk7SW/D98lVnP8nMtjSzDUT/EvL6YC5baJ5sOF/7uncxgSVIg== 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 4Z3YLw5tnHzmpc; Thu, 27 Feb 2025 14:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHCRm016953; Thu, 27 Feb 2025 14:17:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHCcq016950; Thu, 27 Feb 2025 14:17:12 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:12 GMT Message-Id: <202502271417.51REHCcq016950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f3d53a9ecad4 - stable/14 - pci_host_generic: Enumerate resource ranges under bootverbose 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f3d53a9ecad45889524b2a224815744f0697536d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f3d53a9ecad45889524b2a224815744f0697536d commit f3d53a9ecad45889524b2a224815744f0697536d Author: John Baldwin AuthorDate: 2024-03-01 22:20:10 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 pci_host_generic: Enumerate resource ranges under bootverbose Previously ranges were only enumerated for the FDT attachment but not ACPI. This commit moves the enumeration to the shared attach routine so it is done for both. While here, don't list empty ranges but do include the resource type for each range. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D44132 (cherry picked from commit b28670018dbcc7d6ebc0d05584189d6d04aa079f) --- sys/dev/pci/pci_host_generic.c | 8 ++++++++ sys/dev/pci/pci_host_generic_fdt.c | 11 ----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 520462972a66..67b329b58685 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -83,6 +83,7 @@ pci_host_generic_core_attach(device_t dev) uint64_t phys_base; uint64_t pci_base; uint64_t size; + const char *range_descr; char buf[64]; int domain, error; int flags, rid, tuple, type; @@ -179,18 +180,21 @@ pci_host_generic_core_attach(device_t dev) switch (FLAG_TYPE(sc->ranges[tuple].flags)) { case FLAG_TYPE_PMEM: sc->has_pmem = true; + range_descr = "prefetch"; flags = RF_PREFETCHABLE; type = SYS_RES_MEMORY; error = rman_manage_region(&sc->pmem_rman, pci_base, pci_base + size - 1); break; case FLAG_TYPE_MEM: + range_descr = "memory"; flags = 0; type = SYS_RES_MEMORY; error = rman_manage_region(&sc->mem_rman, pci_base, pci_base + size - 1); break; case FLAG_TYPE_IO: + range_descr = "I/O port"; flags = 0; type = SYS_RES_IOPORT; error = rman_manage_region(&sc->io_rman, @@ -219,6 +223,10 @@ pci_host_generic_core_attach(device_t dev) error = ENXIO; goto err_rman_manage; } + if (bootverbose) + device_printf(dev, + "PCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx, Type: %s\n", + pci_base, phys_base, size, range_descr); } return (0); diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c index bcee6057ff3c..854ec0be8dfa 100644 --- a/sys/dev/pci/pci_host_generic_fdt.c +++ b/sys/dev/pci/pci_host_generic_fdt.c @@ -183,7 +183,6 @@ parse_pci_mem_ranges(device_t dev, struct generic_pcie_core_softc *sc) int nbase_ranges; phandle_t node; int i, j, k; - int tuple; node = ofw_bus_get_node(dev); @@ -239,16 +238,6 @@ parse_pci_mem_ranges(device_t dev, struct generic_pcie_core_softc *sc) sc->ranges[i].size = 0; } - if (bootverbose) { - for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { - device_printf(dev, - "\tPCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx\n", - sc->ranges[tuple].pci_base, - sc->ranges[tuple].phys_base, - sc->ranges[tuple].size); - } - } - free(base_ranges, M_DEVBUF); return (0); } From nobody Fri Feb 28 00:54:24 2025 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 4Z3qV86jL5z5Jtww; Fri, 28 Feb 2025 00:54: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3qV868Dvz3LtS; Fri, 28 Feb 2025 00:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740704064; 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=oR7p+2OMPDZViuZGRibUdQp8P0cyWBzs4SDyZoaLl1M=; b=CT4E/lEu83hY8b8IjFI/Ha001TDyN7E5txDbF6wL42k6+5GyacXkuYGyCBvcQ3d8daqQo4 zkEnRFjR4LK0jm8k4+6fDVzr8hVtDjnAi/tDUgfZ3KFkR/YgRKm7sUNe1zfz6x/Wjx0Tko drXeg+fUM1BHik9D94v5Q4Zc3qoa+HLZJjlJocQ9gVORNC0ruvW8WWt2gDKMs1IX8BC+rv WQ2T2Bq4yuOe4TZ9ot0gJ/aof7+jNA/z+GsOai21thraN6J5zurat9ZGV6sqTx1wAS2uRn ks84XD95JBdmnch0ERSAjHtb+iJScObZbVLF/lab7t2wJCV9ueAi1S5coXAcEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740704064; a=rsa-sha256; cv=none; b=dcf8V/0pkMj2xVIwOJkiWdqYVmhoLKDvhiEx5TBB+Nek8piLqrLJEsIQyKXEkfgWAgzV3c jNhoGozP1YNzjPZBq63Ocr1aChObW/6MBCg7TgrmJtGExc1+UBrwlHcWvDcUayfnDRO9Wk bIKrOa2RMppJDJGiX07rjtgZifXnGczNOWdHOQw6opOQ/OUuhVQiDeANjjYV5oreT+ZNW6 64kkZZWWXcSX2PEsJSile5ULYaqjbz8CaHqwdLT6Xp22m2OJ/nSGyMFQ5to0r2EbtGTDci ktzyi1eutTLG2pkvxoeV88XaGLzofvBCpxp+s9BOw4lXn2fh7AGzRz1im0L1/Q== 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=1740704064; 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=oR7p+2OMPDZViuZGRibUdQp8P0cyWBzs4SDyZoaLl1M=; b=nxJXZ/P+NE5Zzm7QffgADQxHXvDpmFHMO1zOX4bVcpM+x8T4sS09cw1fqeDkXOlaLJRF5p y3gHiUCMrYgUlZkCdPErfn/clSKmtbP5vXEGAX79gOvFiAmqzj0DUhbjyKP01VWfzcINYm svDrGTf9g+tMKj+22xzdGHmbMeqTlcahL4EUC01ErVGPLSdQnUCpy5nxebb6f9H8KXjPNl 2MhTs/0H1xT036rhEV68dFPnKGIC9WpGn7Cb3L7dXafN/OrWF3rnsPir3xSE9+FQSY539m d3xBaHPNRRR5nWnJCS41278dTolSCEX4HFWiTYDsPnu4fd0dvQ13KmLrnlBYzw== 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 4Z3qV85TT9z15vv; Fri, 28 Feb 2025 00:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S0sObW014976; Fri, 28 Feb 2025 00:54:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S0sOUm014973; Fri, 28 Feb 2025 00:54:24 GMT (envelope-from git) Date: Fri, 28 Feb 2025 00:54:24 GMT Message-Id: <202502280054.51S0sOUm014973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 956fb94dd608 - releng/13.5 - 13.5: Switch from "quarterly" to "release" pkgs 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: 956fb94dd608b252ac332bee27b4ab4fa7089494 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=956fb94dd608b252ac332bee27b4ab4fa7089494 commit 956fb94dd608b252ac332bee27b4ab4fa7089494 Author: Colin Percival AuthorDate: 2025-02-28 00:48:26 +0000 Commit: Colin Percival CommitDate: 2025-02-28 00:48:26 +0000 13.5: Switch from "quarterly" to "release" pkgs Approved by: re (implicit) Sponsored by: Amazon --- release/pkg_repos/release-dvd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index 600c309d5979..79f7c4c8dbca 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,5 +1,5 @@ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_4", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", From nobody Thu Feb 27 14:17:20 2025 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 4Z3YM46yywz5qG9v; Thu, 27 Feb 2025 14:17:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM46Pjgz3xHN; Thu, 27 Feb 2025 14:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665840; 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=yXNLwxipWw3Fl1j4eeSPRJMLkovSKlcdRb7CD9WDhsw=; b=Uaekajc/WAjnGJh+K0msjlqhB/VgrBQZUe07t8odz3c/pdd/Op1oIHwX4YL3gXfrkKfDFR 2zoD5Xv93hLYWWqg4kh8w1TRWixtc0Xm19M7m7aT1kPUFS6KoTTGlc7jAlXw59gjCnoz6a 7dmxQjbIs0nSNdoyYGQYKj5ltOYr12ZEBTvv6PVFLhLOWtFGfEbN0yerrYGjJPvhjyYxPw f58mLniS46R1MJKyJgCkB8+DGV6L5uuxur6EpoXr+MU0wn1jYbrvuGgLgzeXR3aYEX0OwA g2eA2yRdU6HzDpSvXyK4amNcGJCHaV4o5L86+z8TOKNptU5F92mr5umrOW6Xtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665840; a=rsa-sha256; cv=none; b=uN2Oilkn8iFjdUU5XnJDK1ZaDIbBFPIgqTT1JI8OweDKF1zTiI5Q256gpp4tpdtJgTfEfS k23JX8yM9l0mMAwpOZhlllsiTv6iFrbp2hkKbN/Zfl195bGxNEVI6mN+2Lbx54/v09bGdf d9tyV7cthjCaXF+7zRHUiSZMd8JbAIN4dvHRQSXfxKTtopk6+TBgGtFvXB2LgFX1ISzoZ5 glieZqe8nPFvNUcNPeakiA4ciiWUyv3lRL8A+DIanfmIXtucpU1MaiGklTT+8rYnEnB5BL T+Ft0mL1qMzV+7a3GXoFEtHBuh2xwEHVVNRgalBeg+pxxCl1s8TC3pxJSwGFIg== 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=1740665840; 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=yXNLwxipWw3Fl1j4eeSPRJMLkovSKlcdRb7CD9WDhsw=; b=uJZYShG/O9TaSoeMQ4ClkydQb8yGTNNMTvt/55Ymx9owNuCi53KHaF67dx+eKOYFFJ4f1S 0TZkfiO2p703oxFH0wGoALuIPkI7gGqdGbWY8O8wkgQPhMp7OENCFwvlQyOcqnsikbDYrb 6U9Qun3LamM5Nr03ycw96EM8vuyf8puPIVZ6k50I3akJ4Jybb6BWs7vyNvfejBv+U0+aRs I40UY7d2Oz4gPyPhBuCIfcXphi1chautBdn24a6fznooCnFuLdMpY5p8BBFHdsQLNB9vCW m43j7MJoeBVAoBGxNYxdc7H+F7qd+4UVmB5djPF1eEzKXnZ2P72WKNwE5OeyOA== 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 4Z3YM45sTDzmqV; Thu, 27 Feb 2025 14:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHKu7017189; Thu, 27 Feb 2025 14:17:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHKNS017186; Thu, 27 Feb 2025 14:17:20 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:20 GMT Message-Id: <202502271417.51REHKNS017186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 07b5d67777a7 - stable/14 - acpi: Use rman_get_type in acpi_is_resource_managed 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 07b5d67777a73867dddc2be850c367f209a12f37 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=07b5d67777a73867dddc2be850c367f209a12f37 commit 07b5d67777a73867dddc2be850c367f209a12f37 Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 acpi: Use rman_get_type in acpi_is_resource_managed Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44125 (cherry picked from commit 0ecee1602e195933a39da65d34440399129e19fb) --- sys/dev/acpica/acpi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index ee2494debae7..de6520331644 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1554,11 +1554,11 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, } static bool -acpi_is_resource_managed(device_t bus, int type, struct resource *r) +acpi_is_resource_managed(device_t bus, struct resource *r) { struct rman *rm; - rm = acpi_get_rman(bus, type, 0); + rm = acpi_get_rman(bus, rman_get_type(r), rman_get_flags(r)); if (rm == NULL) return (false); return (rman_is_region_manager(r, rm)); @@ -1570,7 +1570,7 @@ acpi_managed_resource(device_t bus, int type, struct resource *r) struct acpi_softc *sc = device_get_softc(bus); struct resource_list_entry *rle; - KASSERT(acpi_is_resource_managed(bus, type, r), + KASSERT(acpi_is_resource_managed(bus, r), ("resource %p is not suballocated", r)); STAILQ_FOREACH(rle, &sc->sysres_rl, link) { @@ -1588,7 +1588,7 @@ acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (rman_adjust_resource(r, start, end)); return (bus_generic_adjust_resource(bus, child, type, r, start, end)); } @@ -1601,7 +1601,7 @@ acpi_release_resource(device_t bus, device_t child, int type, int rid, * If this resource belongs to one of our internal managers, * deactivate it and release it to the local pool. */ - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_release_resource(bus, child, type, rid, r)); return (bus_generic_rl_release_resource(bus, child, type, rid, r)); @@ -1627,7 +1627,7 @@ static int acpi_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_activate_resource(bus, child, type, rid, r)); return (bus_generic_activate_resource(bus, child, type, rid, r)); @@ -1637,7 +1637,7 @@ static int acpi_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - if (acpi_is_resource_managed(bus, type, r)) + if (acpi_is_resource_managed(bus, r)) return (bus_generic_rman_deactivate_resource(bus, child, type, rid, r)); return (bus_generic_deactivate_resource(bus, child, type, rid, r)); @@ -1652,7 +1652,7 @@ acpi_map_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t length, start; int error; - if (!acpi_is_resource_managed(bus, type, r)) + if (!acpi_is_resource_managed(bus, r)) return (bus_generic_map_resource(bus, child, type, r, argsp, map)); @@ -1678,7 +1678,7 @@ static int acpi_unmap_resource(device_t bus, device_t child, int type, struct resource *r, struct resource_map *map) { - if (acpi_is_resource_managed(bus, type, r)) { + if (acpi_is_resource_managed(bus, r)) { r = acpi_managed_resource(bus, type, r); if (r == NULL) return (ENOENT); From nobody Thu Feb 27 16:55:52 2025 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 4Z3ct057B0z5qNdD; Thu, 27 Feb 2025 16:55:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct04ZBtz46DL; Thu, 27 Feb 2025 16:55:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675352; 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=icJlXbbqQ041QioJqLhJXqLdtLyzm1SgkROJF0K9dKs=; b=KYNq32mAyoTTDSLOaW7WOXWI6TM9T81cGzyUpXD1OC1WK1Umyt7K03nC3tt1hX9AmG8wgd BnctnAawk9bNikMRWVu74vjbU8B85TzMi0F4FIlYP0H/JhJ1lwj6T1H59W6A/9Wtp5eI0j mMQcAbs+/boqUqzUHCAbHWTTfIeSEhmiFit2UuvWkFmbjN/wWeWJCyU9ka097I7q4Q8UMS ENK9lki1ObuU2JRnVKZvpxpqmp3+Xg6hbeEsOa5I2b1fCiXs7UFOyu+HVXXXzDX9gD31U1 ATX3EDh1MexjY/1xFCi7hTAaXOQe4g51l8BlkO7x2dT7lc0jMIDqGoQACkDUYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675352; a=rsa-sha256; cv=none; b=jd86ZEvbKPPIocHD21vzTr6WkxxU5WkUwEtrJefRVRrEvhicFobCzlboS+GPE5mTazInAj wSNL+Hn6ADBG5etjnL7Ckdqv6q8sWt0RnPs2AhSLTpaGG2Gp9AEnStLyfGqTYplze0iJIf UaYD2a9pQ+gGR7HVvrtMbZN1NzYohfOvKqlZonmBpmRvCpIvd3ePTqGSXc2VxSLV9+jZRW pxCl9r7ikVPGkkBfXNZt/JJPTmYn8Ry7y2RQ6ChrbZF95yJtCx3bn70h1mw7Zc6guztQq8 at3SgCFYUrysW56eiIWHPT39kbk9kn+NaDaX+c8gcbk8bcDwDLjmKsGJgvZs7Q== 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=1740675352; 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=icJlXbbqQ041QioJqLhJXqLdtLyzm1SgkROJF0K9dKs=; b=Coi2utF2Qh3aiq8vFfbz86CzvErZCBT+UXQR7QhIWsdppEw/mr7VBf2HQMDt7lFcQsScCJ hUoZGUKdAFT75npwzPKugYaks3JjaFYnFKrwBDTNEKyCqLcWXxRxfWlrUOXRqVTdqfmHog 4Uh/4z2SD/ivde2Ei36GXygKh6mVQl0oGdp3K0xK25PbYa2V3K5MVUTG5vu9dpgCE3BaM8 055g8q2yjGWulEUyZdX9SBYnEgyJbi3Q1UX7399Ou8es/wcHljYxB53JGV+Y3swCY0BuRl UQifvs5HAl/k5/SNSadiFEBwwis6gq5KR9/xKczWvbD3ff4PGVvKN8VZcOthCA== 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 4Z3ct042jszrtr; Thu, 27 Feb 2025 16:55:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtqJT016952; Thu, 27 Feb 2025 16:55:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtqn3016949; Thu, 27 Feb 2025 16:55:52 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:52 GMT Message-Id: <202502271655.51RGtqn3016949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2266614d0714 - stable/14 - hifn/safe: Remove dummy calls to bus_generic_detach 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2266614d0714ae78b693b450832c48d73cfc0404 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2266614d0714ae78b693b450832c48d73cfc0404 commit 2266614d0714ae78b693b450832c48d73cfc0404 Author: John Baldwin AuthorDate: 2024-11-05 01:31:30 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:18:05 +0000 hifn/safe: Remove dummy calls to bus_generic_detach These drivers do not add child devices, so there's no need to try to detach children. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47390 (cherry picked from commit 8b54d874c70d9fb3ed2e059f65c91b3e0eaadbd7) --- sys/dev/hifn/hifn7751.c | 2 -- sys/dev/safe/safe.c | 1 - 2 files changed, 3 deletions(-) diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index 23cf019b93a6..2e7545779b09 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -637,8 +637,6 @@ hifn_detach(device_t dev) crypto_unregister_all(sc->sc_cid); - bus_generic_detach(dev); /*XXX should be no children, right? */ - bus_teardown_intr(dev, sc->sc_irq, sc->sc_intrhand); /* XXX don't store rid */ bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c index da2afbd38fad..c512f3fc62c0 100644 --- a/sys/dev/safe/safe.c +++ b/sys/dev/safe/safe.c @@ -464,7 +464,6 @@ safe_detach(device_t dev) mtx_destroy(&sc->sc_ringmtx); safe_dma_free(sc, &sc->sc_ringalloc); - bus_generic_detach(dev); bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); From nobody Thu Feb 27 14:16:52 2025 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 4Z3YLX5Lfcz5qFx9; Thu, 27 Feb 2025 14:16:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLX4rZ0z3xGY; Thu, 27 Feb 2025 14:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665812; 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=uV2eqzwiQglMMdxyGb+VSmz1NTHHD8EpCt+q2YKMJg0=; b=j+ErcnfMRwNOWv4bIX1gQJoWH/mFcafNGU6HtNAPPoR9JFF2rFIA/Qa363VWVPfV5mJle1 RGE+Udyo/7B2G55QV8Xt6k5Wc9w0XCVV+t6Aymq2qcGpCShCKrLzglThkyJFKudYJjczoz 3qM6uVB5ISshLo8TJy4+KF+brFtzYprNbUp8WKvBkKRfK4B8QOKAsLUaqyL5mG3SaPrAem jzb2wsBfUg7KgE6Q3TfW+9ffVfFfYnjrhlDNTRbpEUahPrcRI45pSMFzRUTaNVHPLELlCm SYKiqNBAyY449FCdJDrMxbr4P2ZQ+QfUEyjOt8jSOrq3h8YG2yUyjSegUFcU7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665812; a=rsa-sha256; cv=none; b=YcggwK90c49s72uXfNMSU7q1e8nNp0xBEOhY/Xu9NsOx1u/SZCD0StYxOCWNstjAm6qmWF zbk2TgcrUgXPlheMOfRtdnd/yOEWf0OkRjyMplDPPd8RNbmY1oHgoC5e7dgG0e339+0oag hds14tnULo9IhIIducuwmeGRhTo4/+XlxRuWpGm5px05mZDTIHFTnr++gxu2W3EqyOPjpF z8wShfEnaXpG0TbahOLsR/gnjZixz3LXEkXLpmjN1ATHGoTP9eDvWxFxF/Qk+oB1eCM2zq p0OnhfuRbzozdCui4mEvvdabg1SnOzzqoDhh0nwdSbdcbeFxIhAOIel5FSHLyQ== 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=1740665812; 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=uV2eqzwiQglMMdxyGb+VSmz1NTHHD8EpCt+q2YKMJg0=; b=DtfKFksT3TDpoI4AtQn4RiNbRyQ8Ft93CIoZPCY0HVcOP3tXMQt4I4ftSDqeE319PmZhT2 TZAgePMiIdsqA3NNqrFuulr4mI+7ibK2Legd/cTa5qWDGgX7ogzp2TXIKTafFpQQ4xnpqX DIjy4Fqe3t3uqSUB4qOmLd4RPmqqmeWUMQqezvbB0owrHG5dFF7XMwdZxJw/FUEseQJgfn ykqSvrsIm+ZVmRYhBnUwYsDKKtsWQJ4BcyRcfy4Y8jJiU5MvUoUaYz1ZgFTnlIBbylCsKP 4Bk3WuTBSqXCDdOJ0kolnxJZCZcI5OH1JnMY92Q7MVLMDQHlSE/hg9un+qIGTQ== 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 4Z3YLX4M8TzmQF; Thu, 27 Feb 2025 14:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGqmb016310; Thu, 27 Feb 2025 14:16:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGqR4016307; Thu, 27 Feb 2025 14:16:52 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:52 GMT Message-Id: <202502271416.51REGqR4016307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4b2667686f68 - stable/14 - pci_host_generic: Remove unused res1 field from softc 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4b2667686f68aa8d216b89803da38cc84ff997f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4b2667686f68aa8d216b89803da38cc84ff997f0 commit 4b2667686f68aa8d216b89803da38cc84ff997f0 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_host_generic: Remove unused res1 field from softc Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43889 (cherry picked from commit eac46b9dd7dd831d41645b734060fc8c039ff77b) --- sys/dev/pci/pci_host_generic.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic.h b/sys/dev/pci/pci_host_generic.h index a408ef9d56fd..8e72ac6e5cef 100644 --- a/sys/dev/pci/pci_host_generic.h +++ b/sys/dev/pci/pci_host_generic.h @@ -74,7 +74,6 @@ struct generic_pcie_core_softc { struct rman mem_rman; struct rman io_rman; struct resource *res; - struct resource *res1; int bus_start; int bus_end; int ecam; From nobody Thu Feb 27 15:14:02 2025 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 4Z3ZcV5ZlHz5qJ0H; Thu, 27 Feb 2025 15:14:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ZcV4wN7z41qW; Thu, 27 Feb 2025 15:14:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740669242; 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=ekxX2BCmQ9uQVvSOLHUb2IhLV0bsq41P8MWrqRW/+q8=; b=cottKsExjvcqaziIHwXvOijzFG8g9rdrVHRHhQ7xkB7j/Bt0DHF3Zq2xTUF7tUrSQKpGss oloK3pWcbAgGQgHhqMmzYwT6C6+LzPeTx7tvsxm/x9pkoOnakzXxsu2XMtA2Ni7865YY9d HbwyW9qvQmILJ2vR3alb9yRaHkIgJhTcbGxzAoYj9+r2rFH1gjlsbge+SRsUQjHbczTWqj nLdFQLQKNIoHPruTGauLN6QyQC3kFQGWDTJ9JElOeYiaEqMjeORqwmhsN26lPV3Bn8GbXH fA0jDobqa+vhB5opaWEP1gQFzn9EF9KXK2torEluk96KXGGXaXEQ7DFCtggkvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740669242; a=rsa-sha256; cv=none; b=ai5gsTOB2wcUYKuwoWqxOwGj8qbl6lFgMdTYfjKAM0mjR4bVETYkeCuVYNr97c0XmSfhw+ r4odf3k2VGUxSz4W4m35eR62YlnlPv3yPYTvY9jMooODC684TQkZUTMZT1uHtODhAdGmIy aBAbyKHg6bs4vEJhaZWeHNr3noSBoxrkSea5qnzIvNriQeD4p7vV2CAzoaDm+xQ17udRrZ bP0D8HgL45jBYlAvVpMtwMPwupS+FKg2urpcCOQZrU4UAk+MdC45FvcPuA3TRyIQcE/6es hNnF7jX03e7sK6Z7Ulnd2099l7jumEtkkeTUkZ81QkfYZRzTEN3EK/xXFvYHfw== 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=1740669242; 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=ekxX2BCmQ9uQVvSOLHUb2IhLV0bsq41P8MWrqRW/+q8=; b=ZP/rJpjao4SI9h7J29hBPf5R8FaBrBLzrQsE93NUqBvZEACOrJAO7l1fnWAjeQyNsf3kHi AICNSFhrrS1op0YK6D/LChfFHH8STwd3UXmRT4SCohcFD6PkDT3ZGUJw/bn36sJQspi0Ek +o84Ub+44OZeAg9YNav4Ou2orEP6Am4t47rl2yAmL/M4Lm7B3s2UdxSKEGD2uVCVur+hms OdyAq3wdY3xCjC1bop5VXG2uusbkaO2duXt6BG8nGciVqaHWjyVjoM9uEYg1MIVqgh3zdi VWTjfM+f1ct/aVM8Dv0l5eo3r2pKhm+lR4ILWGmk4NuronyOo2BGfwEw8/jJUA== 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 4Z3ZcV4Vxfzp7l; Thu, 27 Feb 2025 15:14:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RFE2aD029016; Thu, 27 Feb 2025 15:14:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RFE2Qs029013; Thu, 27 Feb 2025 15:14:02 GMT (envelope-from git) Date: Thu, 27 Feb 2025 15:14:02 GMT Message-Id: <202502271514.51RFE2Qs029013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 32de28db2327 - stable/14 - acpi_gpiobus: Fix cleanup on set flags failure 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 32de28db2327014b320d2f3b29b5438dcdfd928c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=32de28db2327014b320d2f3b29b5438dcdfd928c commit 32de28db2327014b320d2f3b29b5438dcdfd928c Author: Andrew Turner AuthorDate: 2024-12-09 15:14:13 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:10:09 +0000 acpi_gpiobus: Fix cleanup on set flags failure When GPIOBUS_PIN_SETFLAGS fails we called gpiobus_free_ivars to clean up the contents of the ivar, then would free the ivar. This lead to a use-after-free as the ivar had already been set on the child so gpiobus_child_deleted would try to free it again. Fix this by removing the early cleanup and letting gpiobus_child_deleted handle it. Fixes: c9e880c0ceef ("gpiobus: Use a bus_child_deleted method to free ivars for children") Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47670 (cherry picked from commit bb8c68b25333638a20838500ccffee23b4291427) --- sys/dev/gpio/acpi_gpiobus.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 14ded4539a5e..254bb951177d 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -201,8 +201,6 @@ acpi_gpiobus_enumerate_aei(ACPI_RESOURCE *res, void *context) for (int i = 0; i < devi->gpiobus.npins; i++) { if (GPIOBUS_PIN_SETFLAGS(bus, child, 0, devi->flags)) { - gpiobus_free_ivars(&devi->gpiobus); - free(devi, M_DEVBUF); device_delete_child(bus, child); return (AE_OK); } From nobody Thu Feb 27 14:17:10 2025 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 4Z3YLt5HBBz5qFrS; Thu, 27 Feb 2025 14:17:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLt4rQVz3xJc; Thu, 27 Feb 2025 14:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665830; 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=mLMgQieBten+24fwOwBjSkDjcNJ7hjdjbJxVZaXJ+Xs=; b=uyClX2qEGIyk4eFccfIl2kPelmwpdMiVUwF844+znVSCyLKhu0FVeiApgiK8kIynSbdiaG i6v3tj+B6+jCsWoVnznjP9I81grVHAqQhl4KEyJtd/k7IqTeDIJZss0oQA2kyC9xdAwqh8 BjE/OdRvf4NuvSMSRi1jqnJYhBCZEOOTpo+iaIVzWLznWqP8d7/DpRvHIELUc/odlTyU0F EOqDYn52tSX0uSgmEaGjHOaDQcGS/PpE7Zsyyfi16gyZNrSeeT6gyLZmc/OGWyc3nf1SL/ p3DHna/tWzTPwBSuAGn4E80by1bsN3xfz4HQS+psurkyMYT+D1AbXv4+uXm5Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665830; a=rsa-sha256; cv=none; b=u3WBcFGRSbBfJcPhgr/0jfuz4sDVyza9BgQjbWWKxcf0fvzCZ54tT0LoaanL5oCqnjpo1i veiHaEYO2+OdSQN4VvsZZHMJ4wlGjiFMJVJeCudleB2TDap3NCRpRZSidG7ScFQPhagi7c ySp3w1FIxRM+JVqo1JT+7hFhNyZgNYCjrecSN6UK+S3dtew47l4PObLIZcsDKfydUJOmBQ F4Z9PWg3HWKkqXZ0wjwezypeitwctoRYAVvGjJeS+ejKYBcmYiYEohKWkhOrhH572kGH3y NxjT40x1jD7H+4FUUev+y3CQ0uQy6IhYMJEDGQZ3/rdbhVGSEsC8cf/mTgCPPg== 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=1740665830; 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=mLMgQieBten+24fwOwBjSkDjcNJ7hjdjbJxVZaXJ+Xs=; b=OgtUcqozpLeaUDhylu3/WQPZiR48AQUOquNf3qI//FPW9nfhODqr9/4s+omStUB1+oIPjb EEWEXLuMif5I0walPpjX7v9Mrrhx1kSm3/SRw4Wc3Y+J3/MbSrK5pPPOVl+ZR6Uq5shnDT fjA50h2hQS1KGpuzz83VOQ3WOQGPl9dRuOAnFnUWC4uu7qZzwfXyl9NRpE4fh55O2pAkWl WmcFAyRH8c8fjJQMt+MbSm6Si+hMb258LRWLW1Z0gB4j+HLUuD29iO+y6J6Of7ixozrMOX i0+mR3Y7WRf0hfF5YwOONdBAgS+FN7RMuYDx8vM3RKYmy2m9UdaHmI4+TJSgFg== 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 4Z3YLt4RmVzmZW; Thu, 27 Feb 2025 14:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHA0g016884; Thu, 27 Feb 2025 14:17:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHAnr016881; Thu, 27 Feb 2025 14:17:10 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:10 GMT Message-Id: <202502271417.51REHAnr016881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 189d06c37731 - stable/14 - bhnd_usb: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 189d06c3773118f804b93f59f46dce9b1fb284b1 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=189d06c3773118f804b93f59f46dce9b1fb284b1 commit 189d06c3773118f804b93f59f46dce9b1fb284b1 Author: John Baldwin AuthorDate: 2024-02-27 19:44:03 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 bhnd_usb: Use bus_generic_rman_* For SYS_RES_MEMORY, use bus_generic_rman_* for activate/deactivate_resource methods as well as custom map/unmap_resource methods that request submappings of the sc_mem resource allocated from the parent bus. Differential Revision: https://reviews.freebsd.org/D43938 (cherry picked from commit b25f03a1a27256c8d638a7e82ac3f6248994d5f3) --- sys/dev/bhnd/cores/usb/bhnd_usb.c | 111 +++++++++++++++++++++++++++++--------- 1 file changed, 85 insertions(+), 26 deletions(-) diff --git a/sys/dev/bhnd/cores/usb/bhnd_usb.c b/sys/dev/bhnd/cores/usb/bhnd_usb.c index e3bcd8f40bf8..68701df14c50 100644 --- a/sys/dev/bhnd/cores/usb/bhnd_usb.c +++ b/sys/dev/bhnd/cores/usb/bhnd_usb.c @@ -234,6 +234,19 @@ bhnd_usb_attach(device_t dev) return (0); } +static struct rman * +bhnd_usb_get_rman(device_t bus, int type, u_int flags) +{ + struct bhnd_usb_softc *sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_MEMORY: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} + static struct resource * bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) @@ -241,12 +254,10 @@ bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid, struct resource *rv; struct resource_list *rl; struct resource_list_entry *rle; - int passthrough, isdefault, needactivate; - struct bhnd_usb_softc *sc = device_get_softc(bus); + int passthrough, isdefault; isdefault = RMAN_IS_DEFAULT_RANGE(start,end); passthrough = (device_get_parent(child) != bus); - needactivate = flags & RF_ACTIVE; rle = NULL; if (!passthrough && isdefault) { @@ -272,20 +283,11 @@ bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid, * attempt to satisfy the allocation ourselves. */ if (type == SYS_RES_MEMORY) { - rv = rman_reserve_resource(&sc->mem_rman, start, end, count, - flags, child); + rv = bus_generic_rman_alloc_resource(bus, child, type, rid, + start, end, count, flags); if (rv == NULL) { - BHND_ERROR_DEV(bus, "could not reserve resource"); - return (0); - } - - rman_set_rid(rv, *rid); - - if (needactivate && - bus_activate_resource(child, type, *rid, rv)) { - BHND_ERROR_DEV(bus, "could not activate resource"); - rman_release_resource(rv); - return (0); + BHND_ERROR_DEV(bus, "could not allocate resource"); + return (NULL); } return (rv); @@ -327,14 +329,8 @@ bhnd_usb_release_resource(device_t dev, device_t child, int type, r)); } - /* Deactivate resources */ - if (rman_get_flags(r) & RF_ACTIVE) { - error = BUS_DEACTIVATE_RESOURCE(dev, child, type, rid, r); - if (error) - return (error); - } - - if ((error = rman_release_resource(r))) + error = bus_generic_rman_release_resource(dev, child, type, rid, r); + if (error != 0) return (error); if (!passthrough) { @@ -348,6 +344,66 @@ bhnd_usb_release_resource(device_t dev, device_t child, int type, return (0); } +static int +bhnd_usb_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type != SYS_RES_MEMORY) + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + return (bus_generic_rman_activate_resource(dev, child, type, rid, r)); +} + +static int +bhnd_usb_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + if (type != SYS_RES_MEMORY) + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + return (bus_generic_rman_deactivate_resource(dev, child, type, rid, r)); +} + +static int +bhnd_usb_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct bhnd_usb_softc *sc = device_get_softc(dev); + struct resource_map_request args; + rman_res_t length, start; + int error; + + if (type != SYS_RES_MEMORY) + return (bus_generic_map_resource(dev, child, type, r, argsp, + map)); + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + args.offset = start - rman_get_start(sc->sc_mem); + args.length = length; + return (bus_generic_map_resource(dev, child, type, sc->sc_mem, &args, + map)); +} + +static int +bhnd_usb_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + struct bhnd_usb_softc *sc = device_get_softc(dev); + + if (type == SYS_RES_MEMORY) + r = sc->sc_mem; + return (bus_generic_unmap_resource(dev, child, type, r, map)); +} + static int bhnd_usb_print_all_resources(device_t dev) { @@ -478,11 +534,14 @@ static device_method_t bhnd_usb_methods[] = { DEVMETHOD(bus_child_deleted, bhnd_usb_child_deleted), DEVMETHOD(bus_alloc_resource, bhnd_usb_alloc_resource), DEVMETHOD(bus_get_resource_list, bhnd_usb_get_reslist), + DEVMETHOD(bus_get_rman, bhnd_usb_get_rman), DEVMETHOD(bus_print_child, bhnd_usb_print_child), DEVMETHOD(bus_release_resource, bhnd_usb_release_resource), + DEVMETHOD(bus_activate_resource, bhnd_usb_activate_resource), + DEVMETHOD(bus_deactivate_resource, bhnd_usb_deactivate_resource), + DEVMETHOD(bus_map_resource, bhnd_usb_map_resource), + DEVMETHOD(bus_unmap_resource, bhnd_usb_unmap_resource), /* Bus interface: generic part */ - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From nobody Thu Feb 27 14:16:43 2025 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 4Z3YLM56g4z5qFx6; Thu, 27 Feb 2025 14:16:43 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLM4SYnz3xNs; Thu, 27 Feb 2025 14:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665803; 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=7GD/6UoqZNmPjUUf3P+SutV49Orql6Vqe0pFmiqk5Tg=; b=fZWYKy2XKRqzVaVsq5BzNputUtWkpHhCHOLazp48u1a3LyQNuIs+/b8kDA3XzDN71Eeu0r aSvS1M1JwVqRpti/Chv2Uqv1oOhUrELftCb5DcAIntE+NVkaQA/k8Z3T5pqmhbwqn4UiyY oNq2qQ+x+VR1LUOMGsWsTwQ/ggg4g4VEhZlJ49KH81k/IaXcN0J9s1D9tsWR9iKFPmZzwu r2re3WJ7cnT26KLB62hyDhEWfPHja8yTidJZZJVrdvx/sn+wC+DV9kwqMyy8M6jg8e3JPX bYcKUe1TnxsHnnAVLihUlH0Zzko/4bYbAElwdlyfq6ZqWn9u66amJTE2KV9iXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665803; a=rsa-sha256; cv=none; b=iH6vHu+tS+i8QB7by8B7SAqaMf+qTEG4LaRLFvQiUrESZ8jrETpit30tRDVLCL/fKCQlbj Iy7mR2AWEhCfxrs7IC1ttZiNlrpFeiW+HJwswWEW27hBzuMtDD28V/Cqly77tYsXQA4sD5 lj1ITlMcaRg4j103XVWWf+rSVkhajJ39M9MrgzsDOl8b1BYukyuOmQ5Uv9uqCJ7JMXJk/Y gn7NSO+o7lRgCVLCmoYdIi1M/BmcTZ7GtB6Z3pyvHbJrmSaPOBvkQVUcsdoLdeuYQJcYzR aTZ/Qy49a6hauv7V1lPwENiVF5V3OBU+RfUvczzOiPcjV78S/x7UTdSqy3F/ZA== 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=1740665803; 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=7GD/6UoqZNmPjUUf3P+SutV49Orql6Vqe0pFmiqk5Tg=; b=dGMzks+dzYIqQMFlEwRQzpQs9W/TAzThBDuh/SMEVn/MHb67BH6WjW4+shmgL1xk8/I74M X+nnQuqrmR7A13tHpnGbfsqtHO6Ivl5hsSH8gRdmDuWMukU+BFK+aoXNCIsC6D+znoU3Cm NTuIb2fOMg7YaurIAG1Zqn7AgiL4qos9ywRzF3LxVu+q3upXZlaSweGBQkYzdVcBmNPpUP 0yAtmli5HPvwCV4xBRkO4wdVPRwUK02ym7nWqmCMSVFY87lkKtBhQKH+whIT8UFngEJ2ZF HJLajQh2c3ETTYTIwPFdF1upCfqbh5Ls9Sos4rP+ONmBsLBtuyEiS4Or89kUVw== 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 4Z3YLM3zQLzmqM; Thu, 27 Feb 2025 14:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGhj6016021; Thu, 27 Feb 2025 14:16:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGhi3016018; Thu, 27 Feb 2025 14:16:43 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:43 GMT Message-Id: <202502271416.51REGhi3016018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 782d09ad298b - stable/14 - powerpc: Fix bus_space_unmap 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 782d09ad298bb9d66099d3f7276cd160f5fcd738 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=782d09ad298bb9d66099d3f7276cd160f5fcd738 commit 782d09ad298bb9d66099d3f7276cd160f5fcd738 Author: John Baldwin AuthorDate: 2024-01-23 17:37:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc: Fix bus_space_unmap Previously it failed to compile since the macro passed too many arguments to the function. Fix by adding the bus handle to the function and adding an implementation that calls pmap_unmapdev. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D43440 (cherry picked from commit a3d6e0de1c89c145b40ed80fe54c6bad1abbf416) --- sys/powerpc/include/bus.h | 2 +- sys/powerpc/powerpc/bus_machdep.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/include/bus.h b/sys/powerpc/include/bus.h index 6e91900c236d..ddb4737d9b76 100644 --- a/sys/powerpc/include/bus.h +++ b/sys/powerpc/include/bus.h @@ -103,7 +103,7 @@ struct bus_space { /* mapping/unmapping */ int (*bs_map)(bus_addr_t, bus_size_t, int, bus_space_handle_t *); - void (*bs_unmap)(bus_size_t); + void (*bs_unmap)(bus_space_handle_t, bus_size_t); int (*bs_subregion)(bus_space_handle_t, bus_size_t, bus_size_t, bus_space_handle_t *); diff --git a/sys/powerpc/powerpc/bus_machdep.c b/sys/powerpc/powerpc/bus_machdep.c index 39096edfc1f7..e908750961d0 100644 --- a/sys/powerpc/powerpc/bus_machdep.c +++ b/sys/powerpc/powerpc/bus_machdep.c @@ -140,8 +140,13 @@ bs_remap_earlyboot(void) } static void -bs_gen_unmap(bus_size_t size __unused) +bs_gen_unmap(bus_space_handle_t bsh, bus_size_t size) { + + if (!pmap_bootstrapped) + return; + + pmap_unmapdev((void *)bsh, size); } static int From nobody Thu Feb 27 17:03:58 2025 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 4Z3d3L5Fyjz59JDT; Thu, 27 Feb 2025 17:03:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3d3L4R3xz46Lx; Thu, 27 Feb 2025 17:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675838; 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=Smhx0fBO8Q/ytuPEEAppdNK8C9lfGUvm1QoCH84se+8=; b=Cq+iFyWJqCO86CFzUD3JDu4etaET53OGU5q2QRgjV+CccrSKuDMJenADIfP8HJ2g7IQzZ2 zza8mXpCLjFnc4FrA8gPU9eGsmYL/YXLnEulYsCsD9w/G+zH0u/gOmRC5vFaQAMDYkUEot HR4BrG4GzInXJHe3y22hO5LPkuYS1vosTwhmGmYY3M4JjVc6FMhDUWgx9CM8oXsIUQizzP K6E/aXJo2RlQlHhMuJCynP0h48XK6vy+8WxM9CaAVF7nMw4e2NUhHcUWSw+pJex+cZnN6b nbz3fJyVF/JJXohVb7ozDRLgG7YhWYfI4/Fi5r5JdudAFUbZTzvayoTIohv5Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675838; a=rsa-sha256; cv=none; b=A95vHYvfjJfhwkQdnu3RjxcEP1sGk1lXSbrrTdmJMzV7IdXWRCFC7aqkMrpkBRWxwxYUF8 6hifDFe9jdPo4hrGp9iBFIRg3HQLesJB8aqoE3wkd3ypXEWUyiLsS8njRd+s4klqdBqAKh GGVovaIETF63mbUDmf5MZzBlqx0yPc6lsII8TZ+KHb/CUPl6MXxOhGsixaFS8v3iM4ccYp teiuqut5U1ApPLLp6nuxR90sSwpBy+FF6xf5YdJh6uNsg/kzRk2FTLSsg235tGmcyWX9Ax Ay8lbwSa8PK98s29hc1KwcGwoF8VCOL+yMFvGlBUR3X0JGJvXZNY0nRmXgQy5g== 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=1740675838; 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=Smhx0fBO8Q/ytuPEEAppdNK8C9lfGUvm1QoCH84se+8=; b=CnwOU7FCu3QB69LVbS2xcGKpCQMJ6k5Vzi8JGtz2HM5DOkocggYT9Xi+DYc4HES0WHLlNe P7spCjKrapFgv9sXtJ7qm3E/gwQzMeCcek8uCNulGNcqbw4gC3xRuCKU9OGkLJb+H3bDR5 lf6qtE+3cgVigHRswEytNN8a0dUyXBtD6PWKqgUNT0OUI55LE6d1QxZXyzM9dbWdGLZxhS ZuvDcOhJgUJ7ZxD6l1Ym1fYP6LhyI+2ph23RVf3DcuRfnUewYKn6XxdqBhB2lJ7guGgH2o 2jlKOLIiVU160oIicb3CeE/0cJZNBJlqR/SKNoFmYawyudIzrInu9b++WApKPQ== 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 4Z3d3L3zqczs9D; Thu, 27 Feb 2025 17:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RH3wu3036961; Thu, 27 Feb 2025 17:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RH3w0W036958; Thu, 27 Feb 2025 17:03:58 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:03:58 GMT Message-Id: <202502271703.51RH3w0W036958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d57dc2d6a06f - stable/14 - cxgbe tom: Enable TLS offload support by default 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d57dc2d6a06f8397645c6d4ed4e0791b41282db4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d57dc2d6a06f8397645c6d4ed4e0791b41282db4 commit d57dc2d6a06f8397645c6d4ed4e0791b41282db4 Author: John Baldwin AuthorDate: 2024-12-10 20:30:11 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:03:00 +0000 cxgbe tom: Enable TLS offload support by default Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47764 (cherry picked from commit 8b1788118a1af586ed056a00b32a287c41095e7a) --- sys/dev/cxgbe/t4_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9a163880220d..011978ce131b 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -7797,7 +7797,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive coalescing"); - sc->tt.tls = 0; + sc->tt.tls = 1; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sysctl_tls, "I", "Inline TLS allowed"); From nobody Thu Feb 27 14:17:01 2025 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 4Z3YLj5M0tz5qGFm; Thu, 27 Feb 2025 14:17:01 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLj4tjlz3xPL; Thu, 27 Feb 2025 14:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665821; 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=7g0eAH2548jDaa2CnNzwPUVSi7GnuvZEk0yT2gUlol4=; b=joPVJnoR8xh0L/0/XQTksAlSEAkOOPgmRjsV+eMoty2Nm2JCpjwLUTxDzE69M+RJHiu3TZ aGJi/FiUtx3AT+/tmFB7GJ6LCl4YoO+SPSVoxBAxhBe/e8w0IlMWZvdxkVZbQDN/2XFn9u P/iHvYW16e5X+7jg9gWMj8HWd9t7RJCZXPIdz0aAJ/L31HONTd0lfnMdm9smf7wixa+Rsx cdPuBMkMExDlsjjiyS35Y5xfGJfLtjREflu5oWUb+4UpnJdQPvVfMCh0tbmAW361gF/R9b aRzh7RQw2GHR1e1+OxZ8KQ4a/LLQubZdPzqDBW4q9nnWCWEx2kZDKHpaWmdaxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665821; a=rsa-sha256; cv=none; b=DM9nwZS7oxW8C+o2OCTrLdw0Eg+lmwtx7UqlWQJuxeS+eUnyct1oSro47/LQv8v76CBDRq QpC7CLerGE9/509NOdSmtXYcU3rGVoNZpDR3QG635ZQlWM6dbE5v4i/egno4Abe7BEVcMF oaarxb5IICDJAxXxLj5LDSYJ8M65fj+B5uvY21ao+BJlr/+qe4jBntS5PKQILFOodQjLzx qE4w3HMmGs65BmNnFelt4FykRIFMq5xmkZ3W7SB09gPQ4pOGJ2ZFdIfnAZEV0hdvfjH2OR NykP6yUZiSJyn5WjM5J457EbZYATMhFrPkBI7uCZKCLCeM7cTUt7wB+2QyHjpg== 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=1740665821; 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=7g0eAH2548jDaa2CnNzwPUVSi7GnuvZEk0yT2gUlol4=; b=kssuN90tcIJI++Y050klfo5vyfi34YLMnJ44RuFKe2/n34Z7zpqm2Ho9EYiqLyUQpEghYZ l74PhXgw+cIwc0BSPXZujoTif57SN0BItXLyapicWRNVMLWIZtM14p+AdWhFrkg0x9lCaA bbvdvlkaHzQI0kOsjeVQtYuuci2N752igtOSl4yttFiA2YZTPpgjZQUCkTCsRf3IRDFOMN QtXHicsbnK0MwHTUV5iHlk3fEBkTLh2KQRezyBA+c6gjQEoQLG3Ei1Zd2zm6VerDwrGuna fwxAU1BlA+0s8E2lt54Nd9Wp8uVkaX2J2pLLFTysxwa3+PlbvHXPL6SOVA5MgQ== 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 4Z3YLj4VP9zmZT; Thu, 27 Feb 2025 14:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH1Ti016607; Thu, 27 Feb 2025 14:17:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH15g016604; Thu, 27 Feb 2025 14:17:01 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:01 GMT Message-Id: <202502271417.51REH15g016604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2afea415b919 - stable/14 - pci_host_generic: Properly handle bus_release_resource of IRQ resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2afea415b91992f401b795dc6cbdd9539367d344 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2afea415b91992f401b795dc6cbdd9539367d344 commit 2afea415b91992f401b795dc6cbdd9539367d344 Author: John Baldwin AuthorDate: 2024-02-16 01:56:01 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_host_generic: Properly handle bus_release_resource of IRQ resources Unlike other bus methods updated to use bus_generic_rman_* in commit d79b6b8ec267, the bus_release_resource method was using bus_generic_rman_release_resource for all types other than PCI_RES_BUS. Instead, bus_generic_rman_* should only be used for memory and I/O port resources for this driver. Tested by: cperciva Reviewed by: cperciva Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Differential Revision: https://reviews.freebsd.org/D43925 (cherry picked from commit feefc3c71e33d8f97879c4889d5cf1ec82e98cd9) --- sys/dev/pci/pci_host_generic.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index ca384d9a1483..386b8411d29a 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -431,16 +431,24 @@ int pci_host_generic_core_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; sc = device_get_softc(dev); - +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { + case PCI_RES_BUS: return (pci_domain_release_bus(sc->ecam, child, rid, res)); - } #endif - return (bus_generic_rman_release_resource(dev, child, type, rid, res)); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(dev, child, type, rid, + res)); + default: + return (bus_generic_release_resource(dev, child, type, rid, + res)); + } } static struct pcie_range * From nobody Thu Feb 27 14:17:03 2025 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 4Z3YLm05mZz5qFrR; Thu, 27 Feb 2025 14:17:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLl6h2fz3xGt; Thu, 27 Feb 2025 14:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665823; 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=VtZGOSUPZfoM+NLdUFw2rdoC5kFkTfIEfHrCRHIRves=; b=RkzXx0wu9RC8Yq29WyVP+JQXp2EhW3+E5WSj9bBjLpumRjU3yB3wjzlfChULaoLxXRjhQm HGjg9/IQ9m3EgUuMQlxJSAikZv5a46HDiOlDslC7JiLw8p/46QBeohTmDws6u9pOPRSXp/ GG1sCsLGFgyH8Me4KHBcrRVfnXVGhkHJ55X7rmpTMjd/khS3+u3WG4zHpYysPo6JiPRrBu 6z4g+DJcNzE7XZDYdhayYZOEAmj1cI6sTGmZ+LuOE3g7Ljq4tn1yi8ZJnbyauYLPsbIrbV 2JH2Flbos4FDRsXZG7KAfpHRB0HeipLDh5vTxSlH5GxKzEMnPB0KoyLUCNvzZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665823; a=rsa-sha256; cv=none; b=DKDgN8opJpl+kxduplEF8flJdR788XPtTzZH4Yq+rjEWb2yX2GjwH1ThRl2UkKmueoYcoX WzVGMT12ewFnQuUMq6LxhNZOdQE9vW4LoseFnOEM4K4SBN/jntj0BsOnBzVSW6TZFDZe/c gTSu928kZ33gKQkGNnj0wBUIqXuSavNaHklhm11Fwy4C6JlN+jfAwld+sHGERaydHJrVJD TXfF0KtWYQCj3jI7uLmGIjLhxK/vbOwJ3VO5Xt3nQdGTrly91SxxKKhqrS5LdkEcweF+le 6DQvOd5/c6SLxqxQ4B9MxoLphFXoAPK0glu+sowbLQtRs/b7k90DJtpVxt0g6Q== 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=1740665823; 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=VtZGOSUPZfoM+NLdUFw2rdoC5kFkTfIEfHrCRHIRves=; b=ufXna5Ta782gXa9KGUJOXun0Yd/cJMmSh3Qu9U0eTeY5ii47DX3B0f1S5+H8f41oyd94vE 1Td5bxZHtVaqLlbjZ4ap6ocTkSQn1X8ZeMnl0cs/kBnJAsBBByo8YHHodmkr470RcFB6cN x/r6T/tMDW/VX3XGpv4QfSxYJRs34CarUX9zvOER8i4aAbtwqmUnk1Sz0y/Z2KiIHgnd6N WD/WEjqrDTk7k6QDkSPeAd26IqpLcGAjMgrkDed4qWU+adQi4qSxl1J8bLksuWX11qZOHI UOCCghLKC/8kLm193r/Rj391l5vUXF24sQPvrveGZstxPkhut+CSq3/RV3mqKw== 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 4Z3YLl6HGnzm7N; Thu, 27 Feb 2025 14:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH3jL016675; Thu, 27 Feb 2025 14:17:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH3eQ016672; Thu, 27 Feb 2025 14:17:03 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:03 GMT Message-Id: <202502271417.51REH3eQ016672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e7cab085e015 - stable/14 - powerpc psim: Fix infinite recursion in bus_adjust_resource method 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7cab085e015abce194a2fca2791cbe3d31d117a Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e7cab085e015abce194a2fca2791cbe3d31d117a commit e7cab085e015abce194a2fca2791cbe3d31d117a Author: John Baldwin AuthorDate: 2024-02-16 17:42:30 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 powerpc psim: Fix infinite recursion in bus_adjust_resource method The default case needs to call bus_generic_adjust_resource to pass the request up the tree, not bus_adjust_resource which will just call this method again. Fixes: d7c16b333455 powerpc psim: Use bus_generic_rman_* (cherry picked from commit ccb1b43e20f5a1a0795b14f3ef39d5c2e15b424d) --- sys/powerpc/psim/iobus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index 497ef42d82e6..c572a1fdc12b 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -352,7 +352,8 @@ iobus_adjust_resource(device_t bus, device_t child, int type, return (bus_generic_rman_adjust_resource(bus, child, type, r, start, end)); case SYS_RES_IRQ: - return (bus_adjust_resource(bus, type, r, start, end)); + return (bus_generic_adjust_resource(bus, child, type, r, start, + end)); default: return (EINVAL); } From nobody Thu Feb 27 14:17:30 2025 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 4Z3YMH08Dvz5qG2Q; Thu, 27 Feb 2025 14:17:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMG6Pkzz3xQ2; Thu, 27 Feb 2025 14:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665850; 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=paMZPKJ+jjnRZvy3hoV2aQDOQVhFcSF+4FXhsdFGXng=; b=tGUACg9KevAdDn1xQ/SquLwewiytdG5acglAv6BT/vugde5x+8cgMUl0vPgU83su73R7Ph a5pIVg1E6n40XeWJPtzcCQ1pYMkM6Y976iTBQttdC1lP169D5Bv1PSRJMU65pZKJ5gHDiK 76uAWee0lqr3m26E9tKLMtrR7rCArYXO1hOBYDV/0RgfQRZnGoBVtTiCAzxVx5uy1cLo28 511+kSgJlxbsIGAg0V1gC2P9xGIzwZh9ofIpiuI1a0JsGCoKTlB/wyZWpbOV1jYoUvcHy3 P8XQK5z4XkNEPItAxcDTgUZJRnv0LEzb28lUZrHDI8l1+n4/luEQvKTaxwk85g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665850; a=rsa-sha256; cv=none; b=Xr7S0c5x50xLBuMPX3v1tI19M5sxti6jF12wxkf9WXT2jTwdj2ROmYKHJmmkmdN/KcPD0s 9IKaJy+ys5kLIngLNuWSoSH4faDfUCazKdGjq6twvc1mnv0SJakleeXOn1whDkHMeUSXux YpmklBvdtTAuRE/8JdQ30cmPM5CkBm8OJF3JwmiyCA0O5safKbjfENu/xQgaPUZSVY7rrt LTe7qkxL88zcV4raKbNXCDU7dID95RqtdvLnGz1GeRxgQpzZFJN4ro8e1e4m2JfP78ZCpP JNkdmwmYWjN2MFjvwUewOZjpzV9tvbsBcoVv+SW3nTfr4YhwVQkg3WAvZJ7qFQ== 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=1740665850; 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=paMZPKJ+jjnRZvy3hoV2aQDOQVhFcSF+4FXhsdFGXng=; b=LPco3nWq8M1YV6I2QbN8VfdiC67fisBAGayKS45kmJbGuiBKYH4oZ0go+g30HWPgOIYOBV 1LD3UZ1QeMG2elYKlojQLenA9QW1JhZHNYMS2WQr43zOJZNLt1GfO6XwSliyIOfvuvxygT LDxHSYgYgvamH0LUdhpuLzH9xDpcg+N8NUA1BJbwhzRRxQZUV+I0foV3OykOtto7iovBal 0ZukcAzQFNSiQO5+m2rHJgckZe+aEETbKyqGUfNSU+qQDzHzdFNGH+2hhTWxo7DzG+MS9C frL3ylahN+G3C/I4Vk/wiLPgXbM1gln/qh8Z/tcA6a4XaTL450vkQRF2RK5scQ== 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 4Z3YMG5v6Rzmsd; Thu, 27 Feb 2025 14:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHUBd017505; Thu, 27 Feb 2025 14:17:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHUtI017502; Thu, 27 Feb 2025 14:17:30 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:30 GMT Message-Id: <202502271417.51REHUtI017502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9f54ed946430 - stable/14 - pci: Consistently use pci_vf_* for suballocated VF memory resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f54ed9464308593f130f7b36bd4052e34af8c35 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f54ed9464308593f130f7b36bd4052e34af8c35 commit 9f54ed9464308593f130f7b36bd4052e34af8c35 Author: John Baldwin AuthorDate: 2024-06-04 23:51:37 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci: Consistently use pci_vf_* for suballocated VF memory resources Some of the bus resource methods were passing these up to the parent which triggered rman mismatch assertions in INVARIANTS kernels. Reported by: kp Reviewed by: imp Tested by: kp (earlier version) Differential Revision: https://reviews.freebsd.org/D45406 (cherry picked from commit 871b33ad65baf07c92cce120a4fc1978c2ed7b3b) --- sys/dev/pci/pci.c | 121 ++++++++++++++++++++++++++++++++++-- sys/dev/pci/pci_iov.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/pci/pci_private.h | 19 ++++++ 3 files changed, 288 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 2c00b44d941a..8ff31beca696 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -164,10 +164,18 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_delete_resource, pci_delete_resource), DEVMETHOD(bus_alloc_resource, pci_alloc_resource), +#ifdef PCI_IOV + DEVMETHOD(bus_adjust_resource, pci_adjust_resource), +#else DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), +#endif DEVMETHOD(bus_release_resource, pci_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), +#ifdef PCI_IOV + DEVMETHOD(bus_map_resource, pci_map_resource), + DEVMETHOD(bus_unmap_resource, pci_unmap_resource), +#endif DEVMETHOD(bus_child_deleted, pci_child_deleted), DEVMETHOD(bus_child_detached, pci_child_detached), DEVMETHOD(bus_child_pnpinfo, pci_child_pnpinfo_method), @@ -5694,14 +5702,31 @@ pci_activate_resource(device_t dev, device_t child, int type, int rid, struct pci_devinfo *dinfo; int error; - error = bus_generic_activate_resource(dev, child, type, rid, r); + dinfo = device_get_ivars(child); +#ifdef PCI_IOV + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + error = EINVAL; + break; + case SYS_RES_MEMORY: + error = pci_vf_activate_mem_resource(dev, child, r); + break; + default: + error = bus_generic_activate_resource(dev, child, type, + rid, r); + break; + } + } else +#endif + error = bus_generic_activate_resource(dev, child, type, rid, r); if (error) return (error); /* Enable decoding in the command register when activating BARs. */ if (device_get_parent(child) == dev) { /* Device ROMs need their decoding explicitly enabled. */ - dinfo = device_get_ivars(child); if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) pci_write_bar(child, pci_find_bar(child, rid), rman_get_start(r) | PCIM_BIOS_ENABLE); @@ -5722,13 +5747,31 @@ pci_deactivate_resource(device_t dev, device_t child, int type, struct pci_devinfo *dinfo; int error; - error = bus_generic_deactivate_resource(dev, child, type, rid, r); + dinfo = device_get_ivars(child); +#ifdef PCI_IOV + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + error = EINVAL; + break; + case SYS_RES_MEMORY: + error = pci_vf_deactivate_mem_resource(dev, child, r); + break; + default: + error = bus_generic_deactivate_resource(dev, child, + type, rid, r); + break; + } + } else +#endif + error = bus_generic_deactivate_resource(dev, child, type, rid, + r); if (error) return (error); /* Disable decoding for device ROMs. */ if (device_get_parent(child) == dev) { - dinfo = device_get_ivars(child); if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) pci_write_bar(child, pci_find_bar(child, rid), rman_get_start(r)); @@ -5736,6 +5779,76 @@ pci_deactivate_resource(device_t dev, device_t child, int type, return (0); } +#ifdef PCI_IOV +int +pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, + rman_res_t start, rman_res_t end) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(child); + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + return (EINVAL); + case SYS_RES_MEMORY: + return (pci_vf_adjust_mem_resource(dev, child, r, + start, end)); + } + + /* Fall through for other types of resource allocations. */ + } + + return (bus_generic_adjust_resource(dev, child, type, r, start, end)); +} + +int +pci_map_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(child); + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + return (EINVAL); + case SYS_RES_MEMORY: + return (pci_vf_map_mem_resource(dev, child, r, argsp, + map)); + } + + /* Fall through for other types of resource allocations. */ + } + + return (bus_generic_map_resource(dev, child, type, r, argsp, map)); +} + +int +pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(child); + if (dinfo->cfg.flags & PCICFG_VF) { + switch (rman_get_type(r)) { + /* VFs can't have I/O BARs. */ + case SYS_RES_IOPORT: + return (EINVAL); + case SYS_RES_MEMORY: + return (pci_vf_unmap_mem_resource(dev, child, r, map)); + } + + /* Fall through for other types of resource allocations. */ + } + + return (bus_generic_unmap_resource(dev, child, type, r, map)); +} +#endif + void pci_child_deleted(device_t dev, device_t child) { diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index ee1387966b00..b9e22fafe103 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -1076,6 +1076,12 @@ pci_vf_release_mem_resource(device_t dev, device_t child, int rid, dinfo = device_get_ivars(child); + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &dinfo->cfg.iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + if (rman_get_flags(r) & RF_ACTIVE) { error = bus_deactivate_resource(child, SYS_RES_MEMORY, rid, r); if (error != 0) @@ -1091,3 +1097,149 @@ pci_vf_release_mem_resource(device_t dev, device_t child, int rid, return (rman_release_resource(r)); } + +int +pci_vf_activate_mem_resource(device_t dev, device_t child, struct resource *r) +{ +#ifdef INVARIANTS + struct pci_devinfo *dinfo = device_get_ivars(child); +#endif + struct resource_map map; + int error; + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &dinfo->cfg.iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + error = rman_activate_resource(r); + if (error != 0) + return (error); + + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + error = BUS_MAP_RESOURCE(dev, child, SYS_RES_MEMORY, r, NULL, + &map); + if (error != 0) { + rman_deactivate_resource(r); + return (error); + } + + rman_set_mapping(r, &map); + } + return (0); +} + +int +pci_vf_deactivate_mem_resource(device_t dev, device_t child, struct resource *r) +{ +#ifdef INVARIANTS + struct pci_devinfo *dinfo = device_get_ivars(child); +#endif + struct resource_map map; + int error; + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &dinfo->cfg.iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + error = rman_deactivate_resource(r); + if (error != 0) + return (error); + + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + rman_get_mapping(r, &map); + BUS_UNMAP_RESOURCE(dev, child, SYS_RES_MEMORY, r, &map); + } + return (0); +} + +int +pci_vf_adjust_mem_resource(device_t dev, device_t child, struct resource *r, + rman_res_t start, rman_res_t end) +{ +#ifdef INVARIANTS + struct pci_devinfo *dinfo = device_get_ivars(child); +#endif + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &dinfo->cfg.iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + return (rman_adjust_resource(r, start, end)); +} + +static struct resource * +pci_vf_find_parent_resource(struct pcicfg_iov *iov, struct resource *r) +{ + struct resource *pres; + + for (u_int i = 0; i <= PCIR_MAX_BAR_0; i++) { + pres = iov->iov_bar[i].res; + if (pres != NULL) { + if (rman_get_start(pres) <= rman_get_start(r) && + rman_get_end(pres) >= rman_get_end(r)) + return (pres); + } + } + return (NULL); +} + +int +pci_vf_map_mem_resource(device_t dev, device_t child, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_iov *iov = dinfo->cfg.iov; + struct resource_map_request args; + struct resource *pres; + rman_res_t length, start; + int error; + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + pres = pci_vf_find_parent_resource(dinfo->cfg.iov, r); + if (pres == NULL) + return (ENOENT); + + args.offset = start - rman_get_start(pres); + args.length = length; + return (bus_map_resource(iov->iov_pf, pres, &args, map)); +} + +int +pci_vf_unmap_mem_resource(device_t dev, device_t child, struct resource *r, + struct resource_map *map) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_iov *iov = dinfo->cfg.iov; + struct resource *pres; + + KASSERT(rman_get_type(r) == SYS_RES_MEMORY, + ("%s: invalid resource %p", __func__, r)); + KASSERT(rman_is_region_manager(r, &iov->rman), + ("%s: rman %p doesn't match for resource %p", __func__, + &dinfo->cfg.iov->rman, r)); + + pres = pci_vf_find_parent_resource(iov, r); + if (pres == NULL) + return (ENOENT); + return (bus_unmap_resource(iov->iov_pf, pres, map)); +} diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index ea0efc54c829..d3dd41abdb62 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -65,9 +65,16 @@ bus_get_dma_tag_t pci_get_dma_tag; bus_get_resource_list_t pci_get_resource_list; bus_delete_resource_t pci_delete_resource; bus_alloc_resource_t pci_alloc_resource; +#ifdef PCI_IOV +bus_adjust_resource_t pci_adjust_resource; +#endif bus_release_resource_t pci_release_resource; bus_activate_resource_t pci_activate_resource; bus_deactivate_resource_t pci_deactivate_resource; +#ifdef PCI_IOV +bus_map_resource_t pci_map_resource; +bus_unmap_resource_t pci_unmap_resource; +#endif bus_child_deleted_t pci_child_deleted; bus_child_detached_t pci_child_detached; bus_child_pnpinfo_t pci_child_pnpinfo_method; @@ -158,4 +165,16 @@ struct resource *pci_vf_alloc_mem_resource(device_t dev, device_t child, rman_res_t count, u_int flags); int pci_vf_release_mem_resource(device_t dev, device_t child, int rid, struct resource *r); +int pci_vf_activate_mem_resource(device_t dev, device_t child, + struct resource *r); +int pci_vf_deactivate_mem_resource(device_t dev, device_t child, + struct resource *r); +int pci_vf_adjust_mem_resource(device_t dev, device_t child, + struct resource *r, rman_res_t start, rman_res_t end); +int pci_vf_map_mem_resource(device_t dev, device_t child, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map); +int pci_vf_unmap_mem_resource(device_t dev, device_t child, + struct resource *r, struct resource_map *map); + #endif /* _PCI_PRIVATE_H_ */ From nobody Thu Feb 27 21:16:22 2025 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 4Z3kfb0696z59XY4; Thu, 27 Feb 2025 21:16:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kfZ6fnKz47gf; Thu, 27 Feb 2025 21:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690982; 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=8pe/0qsDJNAJbdlp2vZHp9kfpzwoxYcNoomLMsg9g/I=; b=Z8ez9cRbiSvRWwFqD6QsXBDLTHPgAVJbpPNvPOxML6kmLBC9ZEmp5hR6QKiZTrzwiVdXFU hYSL5pVOhcE9CTmfGm0p3+kjpCDG8l3iKhgsWoX1qGvkwBXYA/xMCT/AO1QDUAcA/11uJK 8hfUAKskeQjEgTTWnSPa/vDsYzUNyiDgUnxNbVvm15NNkkLJ8Y5bk/+ebReGITdcH0vPi8 tRvcqiWOOq1EGlILqPrM+06HxVpnM5V16tQuv2K8gtzfreTp6bRBg4eyuWaLq/QHa/kxVt TkUlUmXLGit6GBiECq6yhKcnzMIcbcoLx48Y5nbVFktt/+eqjOpvPBKcGL86xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690982; a=rsa-sha256; cv=none; b=hSE+xJp+HIXTRTrKAje/e2z4PkO9Kv9KLWXXuXd+9WE7gIAbFwm9nBDeBgwmvKKhD2wrNi dzReQs84hFJz037oXDIrBd59kyqy8CkBowQ9SMVgLp9HqcDCPlwUG+fMAKVqiJMKqVFn4+ /tgLTh+vinDy737XTMovtOWLxmAcjom0TNV3BZduU0FT1XVZKSul/NkxFKmjFdtG+Vwk32 LiphFfPRXcFSuexjY1z0Tah/6bWaGCmrs/FeR/qPG1aigYMLc8x+YKLSHZSUp8Us1T47w/ T5iOR7eQVySJiy0F54ZnHAygwFldq0FHlzKpcd2E2aMAPejp1+ee44FqhUHz3A== 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=1740690982; 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=8pe/0qsDJNAJbdlp2vZHp9kfpzwoxYcNoomLMsg9g/I=; b=BpSDRbb/2i9H3Q0mKIJpD+am4sdoOEQCcKjcq8N4X3tO33PNJG41bW1jPv/HmrmSKnWfW9 m7rqaF39KZ403XBVCkNDL7NpT0xX7YfTCF+kATQpz/huUXZU+PLv7oHmiqefs4IO1yVoCR LqUPhyr8O9JjiUxQ1bnSxEdfG7UDvVdofkvDd5R47yuFDGu4sUQKn4KxZ+Ho6KHe4zUn6H lrkMvZkBLcJCaM6+sDs18zOmBkXA6Z/5+xcQt3Gtsn4AY9zYdQ8IKKlE5+3CHlgmVOsS// uF7BKNuaBvKlrkbxO5jBa1kQWa0cbstN7+oYhLLcc4iiMubuQbCn4y54TlEEOA== 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 4Z3kfZ62QXz10Hj; Thu, 27 Feb 2025 21:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RLGME6005409; Thu, 27 Feb 2025 21:16:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RLGMpU005406; Thu, 27 Feb 2025 21:16:22 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:16:22 GMT Message-Id: <202502272116.51RLGMpU005406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 9e0ef670d8a8 - stable/14 - queue: Fix STAILQ_ASSERT_EMPTY() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9e0ef670d8a864d161a14cf374add713a659c3cd Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9e0ef670d8a864d161a14cf374add713a659c3cd commit 9e0ef670d8a864d161a14cf374add713a659c3cd Author: Olivier Certner AuthorDate: 2025-02-27 20:59:41 +0000 Commit: Olivier Certner CommitDate: 2025-02-27 21:15:40 +0000 queue: Fix STAILQ_ASSERT_EMPTY() The 'while' part corresponding to the 'do' was missing. Did not notice the problem as later commits using it have been stashed and never reworked up to now, and it is currently unused in the tree. While here, fix spacing after the '#define' in the !(_KERNEL && INVARIANS) part. Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") MFC after: 1 minute Sponsored by: The FreeBSD Foundation (cherry picked from commit d3c4b002d1fd54ac69c1714e208051867ee56dc4) --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index be862c7ce814..38c319704cc4 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -357,7 +357,7 @@ struct { \ #define STAILQ_ASSERT_EMPTY(head) do { \ if (!STAILQ_EMPTY((head))) \ panic("stailq %p is not empty", (head)); \ -} +} while (0) /* * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) @@ -371,7 +371,7 @@ struct { \ } while (0) #else #define QMD_STAILQ_CHECK_EMPTY(head) -#define STAILQ_ASSERT_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) #define QMD_STAILQ_CHECK_TAIL(head) #endif /* (_KERNEL && INVARIANTS) */ From nobody Thu Feb 27 16:55:54 2025 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 4Z3ct3006kz5qNVq; Thu, 27 Feb 2025 16:55:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct26NwKz46DR; Thu, 27 Feb 2025 16:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675354; 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=3fb6TDG4n14v6p+mJmuJo0giRTaKgJIdjaFAyCaO3sI=; b=hI/u/Q8EaCdESbB/xZAJXrJTisgglBkaYefgfenkQnCoYfJb7l37ArmyU+GSkPmtluGeCN LSz1tsJOJ//7PLixofVH+SGpVddE4bXPQ4s51SzxxRNgtbArv5bdF1p4A9TvVmpppRjGpU UwFIWkz6iRGdi7Zol1tWdTd99/GEVCeDB9osLSbpdJMN051sQxkwC5Ms+Z271k/LKKs+pC THivtJ/oRSEl2cBQkCc9S3zDlShE9MB/0E8TkHdbHQgy70cz49Mz94lNdz3Kkvfm6QxbPh 4fpWDODjkoVtdH3bay+A90bT9fGKMPslGVTvlTaiv0fHD9HboIn6kiXO+5fi3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675354; a=rsa-sha256; cv=none; b=SaGgMGZo/eXG4ZVNxRIQWlniw/chIlrsI+QQehXtzRqYceohf7GenH3g/D+JZQfC1lFRSC 5A0gwEJ6SE43cVGEFB8kqRbUYGdpHY2Qh+DsftM2TDHeqc/zxfG2nsSdpy7sA2tBCCP85Q 6wWqeQg3c3T40u87QEGxY+dW7e8CWzKJfqizDA4cQUHFDtS5Xa5l4HiVAbCUsXPqX5GA9C qcq5icyt7Hv3TgDS4OQQoE8LMYbyjZb7+HA5iw4Lu+NNlEskFp9HDoGutoK7z+qvADovDj vsaN8o6uYb+qK11Bzj2LFCizFvYFcADo/aWS+KFo2ZYhYXiHPPcvR/r0x3Hpzw== 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=1740675354; 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=3fb6TDG4n14v6p+mJmuJo0giRTaKgJIdjaFAyCaO3sI=; b=kExfjAiqYBw02/QyQOhUFJGkv9FpS3dJEe1i2MfhdAo5usnPzYZp/6O2NzcmCUyistLWJA WQgGhxMrnJjhQNYljmsc6bmSVe6plcr2ErbZef+RMZNuqlCA/b4nzbEwHMlWuz3kO4nC98 Fm/Zo8YgN10T8Uwkw8SjfCwtbT6wmxKgtNBAYH2LSiTvEV9BF+CK95qpjPt8vVtoXvN6EE y8LCt9SV4Sj+eNR8bgwKnByn9E/7lDwIhqE+y+FBtSguj8Q6X9IE+Cme6FOp7UJcPRw9ej 72Syh6X1aFXc/OTM20BBnK6vod5+pCPojf0D1psWw1OyYKLk2BFNMUSZee/seA== 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 4Z3ct25v5wzrGn; Thu, 27 Feb 2025 16:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtsqC017028; Thu, 27 Feb 2025 16:55:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtsW1017025; Thu, 27 Feb 2025 16:55:54 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:54 GMT Message-Id: <202502271655.51RGtsW1017025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: bc8f3704f1d8 - stable/14 - stand/kshim: Update for devclass being removed from DRIVER_MODULE 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bc8f3704f1d82fc8b6eb5f77b6f7fc062b5d30ba Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bc8f3704f1d82fc8b6eb5f77b6f7fc062b5d30ba commit bc8f3704f1d82fc8b6eb5f77b6f7fc062b5d30ba Author: John Baldwin AuthorDate: 2025-01-11 04:01:48 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:23:52 +0000 stand/kshim: Update for devclass being removed from DRIVER_MODULE The kshim code abused the devclass argument to DRIVER_MODULE in some odd ways. Instead, refactor the devclass handling to more closely mirror what new-bus does in the kernel by having a linked list of devclasses looked up by name and associate devices with a devclass. Devices are now only associated with a module while probing and attaching. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48409 (cherry picked from commit ee15875c01593b287e55147c482b914e3ab01152) --- stand/kshim/bsd_kernel.c | 140 ++++++++++++++++++--------------------- stand/kshim/bsd_kernel.h | 11 +-- stand/usb/storage/umass_common.c | 4 +- 3 files changed, 71 insertions(+), 84 deletions(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index ac552d86603f..abe81ccc6c1d 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -556,6 +556,8 @@ static const char unknown_string[] = { "unknown" }; static TAILQ_HEAD(, module_data) module_head = TAILQ_HEAD_INITIALIZER(module_head); +static TAILQ_HEAD(, devclass) devclasses = + TAILQ_HEAD_INITIALIZER(devclasses); static uint8_t devclass_equal(const char *a, const char *b) @@ -688,58 +690,50 @@ device_get_nameunit(device_t dev) return (unknown_string); } -static uint8_t -devclass_create(devclass_t *dc_pp) +static devclass_t +devclass_create(const char *classname) { - if (dc_pp == NULL) { - return (1); - } - if (dc_pp[0] == NULL) { - dc_pp[0] = malloc(sizeof(**(dc_pp)), - M_DEVBUF, M_WAITOK | M_ZERO); + devclass_t dc; - if (dc_pp[0] == NULL) { - return (1); - } + dc = malloc(sizeof(*dc), M_DEVBUF, M_WAITOK | M_ZERO); + if (dc == NULL) { + return (NULL); } - return (0); + dc->name = classname; + TAILQ_INSERT_TAIL(&devclasses, dc, link); + return (dc); } -static const struct module_data * +static devclass_t devclass_find_create(const char *classname) { - const struct module_data *mod; + devclass_t dc; - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->mod_name, classname)) { - if (devclass_create(mod->devclass_pp)) { - continue; - } - return (mod); - } - } - return (NULL); + dc = devclass_find(classname); + if (dc == NULL) + dc = devclass_create(classname); + return (dc); } static uint8_t -devclass_add_device(const struct module_data *mod, device_t dev) +devclass_add_device(devclass_t dc, device_t dev) { device_t *pp_dev; device_t *end; uint8_t unit; - pp_dev = mod->devclass_pp[0]->dev_list; + pp_dev = dc->dev_list; end = pp_dev + DEVCLASS_MAXUNIT; unit = 0; while (pp_dev != end) { if (*pp_dev == NULL) { *pp_dev = dev; + dev->dev_class = dc; dev->dev_unit = unit; - dev->dev_module = mod; snprintf(dev->dev_nameunit, sizeof(dev->dev_nameunit), - "%s%d", device_get_name(dev), unit); + "%s%d", dc->name, unit); return (0); } pp_dev++; @@ -750,26 +744,26 @@ devclass_add_device(const struct module_data *mod, device_t dev) } static void -devclass_delete_device(const struct module_data *mod, device_t dev) +devclass_delete_device(devclass_t dc, device_t dev) { - if (mod == NULL) { + if (dc == NULL) { return; } - mod->devclass_pp[0]->dev_list[dev->dev_unit] = NULL; - dev->dev_module = NULL; + dc->dev_list[dev->dev_unit] = NULL; + dev->dev_class = NULL; } static device_t make_device(device_t parent, const char *name) { device_t dev = NULL; - const struct module_data *mod = NULL; + devclass_t dc = NULL; if (name) { - mod = devclass_find_create(name); + dc = devclass_find_create(name); - if (!mod) { + if (!dc) { DPRINTF("%s:%d:%s: can't find device " "class %s\n", __FILE__, __LINE__, @@ -789,7 +783,7 @@ make_device(device_t parent, const char *name) if (name) { dev->dev_fixed_class = 1; - if (devclass_add_device(mod, dev)) { + if (devclass_add_device(dc, dev)) { goto error; } } @@ -845,7 +839,8 @@ device_delete_child(device_t dev, device_t child) } } - devclass_delete_device(child->dev_module, child); + if (child->dev_class != NULL) + devclass_delete_device(child->dev_class, child); if (dev != NULL) { /* remove child from parent */ @@ -913,7 +908,7 @@ device_get_method(device_t dev, const char *what) const char * device_get_name(device_t dev) { - if (dev == NULL) + if (dev == NULL || dev->dev_module == NULL) return (unknown_string); return (dev->dev_module->driver->name); @@ -944,16 +939,34 @@ device_probe_and_attach(device_t dev) { const struct module_data *mod; const char *bus_name_parent; - - bus_name_parent = device_get_name(device_get_parent(dev)); + devclass_t dc; if (dev->dev_attached) return (0); /* fail-safe */ - if (dev->dev_fixed_class) { + /* + * Find a module for our device, if any + */ + bus_name_parent = device_get_name(device_get_parent(dev)); + + TAILQ_FOREACH(mod, &module_head, entry) { + if (!devclass_equal(mod->bus_name, bus_name_parent)) + continue; + + dc = devclass_find(mod->mod_name); - mod = dev->dev_module; + /* Does this device need assigning to the new devclass? */ + if (dev->dev_class != dc) { + if (dev->dev_fixed_class) + continue; + if (dev->dev_class != NULL) + devclass_delete_device(dev->dev_class, dev); + if (devclass_add_device(dc, dev)) { + continue; + } + } + dev->dev_module = mod; if (DEVICE_PROBE(dev) <= 0) { if (device_allocate_softc(dev) == 0) { @@ -965,40 +978,11 @@ device_probe_and_attach(device_t dev) } } } - device_detach(dev); + /* else try next driver */ - goto error; - } - /* - * Else find a module for our device, if any - */ - - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->bus_name, bus_name_parent)) { - if (devclass_create(mod->devclass_pp)) { - continue; - } - if (devclass_add_device(mod, dev)) { - continue; - } - if (DEVICE_PROBE(dev) <= 0) { - - if (device_allocate_softc(dev) == 0) { - - if (DEVICE_ATTACH(dev) == 0) { - /* success */ - dev->dev_attached = 1; - return (0); - } - } - } - /* else try next driver */ - - device_detach(dev); - } + device_detach(dev); } -error: return (ENODEV); } @@ -1017,9 +1001,10 @@ device_detach(device_t dev) dev->dev_attached = 0; } device_set_softc(dev, NULL); + dev->dev_module = NULL; if (dev->dev_fixed_class == 0) - devclass_delete_device(mod, dev); + devclass_delete_device(dev->dev_class, dev); return (0); } @@ -1095,11 +1080,11 @@ devclass_get_device(devclass_t dc, int unit) devclass_t devclass_find(const char *classname) { - const struct module_data *mod; + devclass_t dc; - TAILQ_FOREACH(mod, &module_head, entry) { - if (devclass_equal(mod->driver->name, classname)) - return (mod->devclass_pp[0]); + TAILQ_FOREACH(dc, &devclasses, link) { + if (devclass_equal(dc->name, classname)) + return (dc); } return (NULL); } @@ -1110,6 +1095,7 @@ module_register(void *data) struct module_data *mdata = data; TAILQ_INSERT_TAIL(&module_head, mdata, entry); + (void)devclass_find_create(mdata->mod_name); } /*------------------------------------------------------------------------* diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h index 0608d32f21ec..8caee7950270 100644 --- a/stand/kshim/bsd_kernel.h +++ b/stand/kshim/bsd_kernel.h @@ -87,11 +87,11 @@ struct sysctl_req { #define MOD_UNLOAD 2 #define DEVMETHOD(what,func) { #what, (void *)&func } #define DEVMETHOD_END {0,0} -#define EARLY_DRIVER_MODULE(a, b, c, d, e, f, g) DRIVER_MODULE(a, b, c, d, e, f) -#define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \ +#define EARLY_DRIVER_MODULE(a, b, c, d, e, f) DRIVER_MODULE(a, b, c, d, e) +#define DRIVER_MODULE(name, busname, driver, evh, arg) \ static struct module_data bsd_##name##_##busname##_driver_mod = { \ evh, arg, #busname, #name, #busname "/" #name, \ - &driver, &devclass, { 0, 0 } }; \ + &driver, { 0, 0 } }; \ SYSINIT(bsd_##name##_##busname##_driver_mod, SI_SUB_DRIVERS, \ SI_ORDER_MIDDLE, module_register, \ &bsd_##name##_##busname##_driver_mod) @@ -135,6 +135,7 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \ #define cold 0 #define BUS_PROBE_GENERIC 0 #define BUS_PROBE_DEFAULT (-20) +#define DEVICE_UNIT_ANY -1 #define CALLOUT_RETURNUNLOCKED 0x1 #undef ffs #define ffs(x) __builtin_ffs(x) @@ -406,6 +407,7 @@ struct device { TAILQ_HEAD(device_list, device) dev_children; TAILQ_ENTRY(device) dev_link; + devclass_t dev_class; struct device *dev_parent; const struct module_data *dev_module; void *dev_sc; @@ -429,6 +431,8 @@ struct device { }; struct devclass { + TAILQ_ENTRY(devclass) link; + const char *name; device_t dev_list[DEVCLASS_MAXUNIT]; }; @@ -445,7 +449,6 @@ struct module_data { const char *mod_name; const char *long_name; const struct driver *driver; - struct devclass **devclass_pp; TAILQ_ENTRY(module_data) entry; }; diff --git a/stand/usb/storage/umass_common.c b/stand/usb/storage/umass_common.c index 639d70a7f7e6..b62412b13637 100644 --- a/stand/usb/storage/umass_common.c +++ b/stand/usb/storage/umass_common.c @@ -38,8 +38,6 @@ static device_probe_t umass_probe; static device_attach_t umass_attach; static device_detach_t umass_detach; -static devclass_t umass_devclass; - static device_method_t umass_methods[] = { /* Device interface */ DEVMETHOD(device_probe, umass_probe), @@ -54,7 +52,7 @@ static driver_t umass_driver = { .methods = umass_methods, }; -DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, NULL, 0); +DRIVER_MODULE(umass, uhub, umass_driver, NULL, 0); static int umass_probe(device_t dev) From nobody Thu Feb 27 23:34:53 2025 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 4Z3nkQ42r6z5JqDJ; Thu, 27 Feb 2025 23:34:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3nkP7194z45lY; Thu, 27 Feb 2025 23:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740699294; 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=SZkj+ufRR9pgRYCqXlyHz+hgGKpT8c/212P+ItlB7U0=; b=rEJEr/eSE9fSeba2D+tE6xOoF50lZi6XqEAKSvcMvPfAf5y+0M9TYfDEOhDyHvKwqrcGI9 aMZ9eGiW3XXNQ5YnkzLqoLmDTxPUAmfM1MQAx50a4DWp+G3RgKig6fOY1jQOMwfI1vi6M7 cLNId3lQ5itBgCvCmQS8dKbXgJR/P3rwJRFO27B+AKuZSaeH67kD4bZ3GNcx6vKR9tNGpu IJYxT3hrLXS9lVu0lSJkEqkkFONVyQqj3u6oAhyRCXdH6kP6s9ZPEqrh2QWzAwiNzyou9l m2m6xDlQV24VKIie0nN294CUuanueapN32e7d3+0ZIPHaVDX/8KOc32fasgyhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740699294; a=rsa-sha256; cv=none; b=qYIn9V1ucWewFMnT/u9jSrKs6/5nKT/dVRQmeQqTsaTjWzNBfZWkp9h/sd1YZ0r7tfHOQs 9z4fHt6atCTGVL43kpbtP5RwYnHG7E09X09PJ8Z/RgmHJwMUJTil3G7NAqO3dyhk5wukeH 10fsIPI6aNd8V+wyN0pssfMQnlC0vbaY5jEhsuHae6S5+HBUlgX51ypD1AYOLXfVfKgX1l MPjjnmaeJQmp/6HY65BFOqarfwNgOkCUZngTystInoeS028kLdrecvKCSM8OlCDVbQ3rgq w5xTNXWex7C5TwMPZXXIlj3sd1DEyJ5IwfI8Wm4lIgyIzSD6qZVrTxf3yYiR3Q== 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=1740699294; 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=SZkj+ufRR9pgRYCqXlyHz+hgGKpT8c/212P+ItlB7U0=; b=DFXTdsPQbkv9p82M+yDkeZO0e0bFjOCJSey5khmPlMvaw9iCj3xGdna9oY0xqVmlCw9f2P 2spC1ErxqCF5Q1Kl1L4HZ/vDSaA13DFdQ8nsferpBnRAwgJ71hECqaPWx7mBNc+104Ahb9 4rddce+a2kynlKOaMueeknpSy95aLV1t79tN4Q2PdOv73rXi+cfxDfNTiE37/9LXcJv6v5 FwTh59v1t58UALVNrADgL9glqDJZI/IT+IikBYdRBKPIyxKjV2N1xJUeEVC4+wC5dMcbbg 02BtIgY1DAOFh6YV9AAwzsjhR4prFl9QjJeAWGsp9qe1nbtQmymy9bbm03m//A== 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 4Z3nkP6VzJz13CK; Thu, 27 Feb 2025 23:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RNYrTj065887; Thu, 27 Feb 2025 23:34:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RNYrWL065884; Thu, 27 Feb 2025 23:34:53 GMT (envelope-from git) Date: Thu, 27 Feb 2025 23:34:53 GMT Message-Id: <202502272334.51RNYrWL065884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: cf411e5ed3a0 - releng/13.5 - queue: Fix STAILQ_ASSERT_EMPTY() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: cf411e5ed3a0fdb9fb58866b98802f7f6d3597f1 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cf411e5ed3a0fdb9fb58866b98802f7f6d3597f1 commit cf411e5ed3a0fdb9fb58866b98802f7f6d3597f1 Author: Olivier Certner AuthorDate: 2025-02-27 20:59:41 +0000 Commit: Olivier Certner CommitDate: 2025-02-27 23:33:27 +0000 queue: Fix STAILQ_ASSERT_EMPTY() The 'while' part corresponding to the 'do' was missing. Did not notice the problem as later commits using it have been stashed and never reworked up to now, and it is currently unused in the tree. While here, fix spacing after the '#define' in the !(_KERNEL && INVARIANS) part. Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") MFC after: 1 minute Sponsored by: The FreeBSD Foundation (cherry picked from commit d3c4b002d1fd54ac69c1714e208051867ee56dc4) (cherry picked from commit 4fd887f08b000173c196e954b510752025ff3fc0) Approved by: re (cperciva) --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 0b1e1f9fba55..31a220bcdcc0 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -356,7 +356,7 @@ struct { \ #define STAILQ_ASSERT_EMPTY(head) do { \ if (!STAILQ_EMPTY((head))) \ panic("stailq %p is not empty", (head)); \ -} +} while (0) /* * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) @@ -370,7 +370,7 @@ struct { \ } while (0) #else #define QMD_STAILQ_CHECK_EMPTY(head) -#define STAILQ_ASSERT_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) #define QMD_STAILQ_CHECK_TAIL(head) #endif /* (_KERNEL && INVARIANTS) */ From nobody Thu Feb 27 14:16:32 2025 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 4Z3YL83vbZz5qFrK; Thu, 27 Feb 2025 14:16:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL83HQ0z3xFv; Thu, 27 Feb 2025 14:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665792; 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=Iki9p/ojcXUO20vhyd1XGwOEY8QvaLkGpGtXz0BMy7Q=; b=NXJ6RSvzE+c4o8zHvGNWZwCAUUUFX1s6wE2m065/5yT7aTgbRd76s+TurM5eYmz2LQtPcN G3ZJ/LEAHSIBDZNGdkO+YxRQxxXDAc9yRwNSEpH5o7hjxaT3yB/TaanditdhO1hgKWnBzz Zbg4nkZd/XGrbJPed+WsXq+Vuw49jJcjR4wwjvGmgPC7o9a4e56glQN8DB9t/4pNJyY1G9 VDeC3bEl2iCYzMm7/+YVzoNMgATqxaca97MqfqhOXN+YuKiWWPQj8yfEe/66I23MHtIC78 4yM5inTG70OPk4TZuRwTAszlCp0Lx32B5+zTV4oJ/39lMsFDvoLe+np6OSPKRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665792; a=rsa-sha256; cv=none; b=ypFBSEMtSnpNJGT3boD18QOjHY/+bQQiNLxIfx+fMWHVxlM3kyUAW54El4qGMmO/E8Nu1E XRxuDmEo5/cxYpBmQukaDVhe1W5QdqEM/vIYIe/ACnGTwRalGTMj2MSd6smxzSp/6LLC44 BSnUeAyDY59DgZjFzH9JISt0rg/WpwUUcv7KvWvJDotqyU/Ri+4rGI+7zDkhnj5/jIZzrI 2y8IVHNyXmD+m7ST9uXhPyWKPk8dFp+lLagDRaxzlLVzH0QkNjo+sWl0KqA6YhV0XpT2jq 7KpLXscWKmu24kozTd7Yt0QkGdJ7j69BuNDCPG1BKw+AHMyiww33/yqVFsbc8Q== 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=1740665792; 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=Iki9p/ojcXUO20vhyd1XGwOEY8QvaLkGpGtXz0BMy7Q=; b=iDaF4/RuUhh0WtybB6G/XdzKXpHecTfFGOmloo009YpBcDdbCJSuKHvUf7Q7572aRiKu6Y 2jNidPkci1GCxvEvI2+onhwAx8TgvMRp9KqULpmBVWwqfFLhW1rxfi6tE06dHCdFU+8czM XEmuo1EaUvUnUtrChIn71+DfFM6UJJNGJVcFs4bILrlGEYynk5BYSK1xWwGCI9yj21ox0B VEQiy7qbcJuxMW/zCHaLCesSJOQvq4qK8phUrUWzpaiHIWZJbu/hfwjzMf+uzAxI2+2BQ1 S8vZ/BWB7Jt/XkRF/tTAgjp5lVb+Oe68qax47hRY1pOvsDQYsE1Gj7Y0ps5a8Q== 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 4Z3YL82nykzmpX; Thu, 27 Feb 2025 14:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGWls015652; Thu, 27 Feb 2025 14:16:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGW0o015649; Thu, 27 Feb 2025 14:16:32 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:32 GMT Message-Id: <202502271416.51REGW0o015649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d65f66c98337 - stable/14 - hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d65f66c983376223b2a832e0cae71b7ec4dd38d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d65f66c983376223b2a832e0cae71b7ec4dd38d5 commit d65f66c983376223b2a832e0cae71b7ec4dd38d5 Author: John Baldwin AuthorDate: 2024-01-23 17:35:58 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources Specifically for bus_activate/adjust/deactivate_bus methods. Differential Revision: https://reviews.freebsd.org/D43431 (cherry picked from commit 9c4effb1063d49748b4b7da4cc54f508ccad41fc) --- sys/dev/hyperv/pcib/vmbus_pcib.c | 41 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c index be66393a7ab4..03fc5f09be6c 100644 --- a/sys/dev/hyperv/pcib/vmbus_pcib.c +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c @@ -1712,6 +1712,18 @@ vmbus_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, return (res); } +static int +vmbus_pcib_adjust_resource(device_t dev, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_adjust_bus(sc->hbus->pci_domain, child, r, + start, end)); + return (bus_generic_adjust_resource(dev, child, type, r, start, end)); +} + static int vmbus_pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) @@ -1728,6 +1740,30 @@ vmbus_pcib_release_resource(device_t dev, device_t child, int type, int rid, return (bus_generic_release_resource(dev, child, type, rid, r)); } +static int +vmbus_pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_activate_bus(sc->hbus->pci_domain, child, + rid, r)); + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +static int +vmbus_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct vmbus_pcib_softc *sc = device_get_softc(dev); + + if (type == PCI_RES_BUS) + return (pci_domain_deactivate_bus(sc->hbus->pci_domain, child, + rid, r)); + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} + static int vmbus_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) @@ -1981,9 +2017,10 @@ static device_method_t vmbus_pcib_methods[] = { DEVMETHOD(bus_read_ivar, vmbus_pcib_read_ivar), DEVMETHOD(bus_write_ivar, vmbus_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, vmbus_pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, vmbus_pcib_adjust_resource), DEVMETHOD(bus_release_resource, vmbus_pcib_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_activate_resource, vmbus_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, vmbus_pcib_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_cpus, vmbus_pcib_get_cpus), From nobody Thu Feb 27 14:17:27 2025 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 4Z3YMC495Pz5qG9w; Thu, 27 Feb 2025 14:17:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMC40RCz3xS3; Thu, 27 Feb 2025 14:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665847; 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=3D5SNttyttCAwU6IPtpRD7B/WFaYFZncMNnAiQLtBvY=; b=Zhrk61ZQjjyHBmWp45w/Cc0FdJl7joMtpkdQmxUNwYfI8VImZsJ5sIMZl5UEz/JC1/32Aj YJj4nlSjcTTNZtuxpnf4aWD6u4SfajmfV9zr/hiE+IDw4v+XQG/cSb6ExH6Eo+y1PSFURw UHw3wXjcIPExPRSGJZ53odygSy9F9lPcnHZ+yisDwm+IqH9de6KrfZWpclyQatjUQXT7ic hRWPxPlCRZ692hBNkYCaWJ7zAjumch5oXLuzr5gviIdeaHPejCWq1TJOxwTMHRIdsY7E/+ kj3kBXWGCMNem9OP6lmtklEi72AxR3ZPPwOU2J7UGpGvN7LHhgkD2SeJiwJZrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665847; a=rsa-sha256; cv=none; b=cqCksa3KAwCKlrtXQamHATD3W2JfFnH2DWEyv6/JKm0dFYtlntqSU0i7Z5/MxN5pczk0lK M83yNz2i+o2YXqJzRpsdsAhYp5VXKYXK/vBdkykNdSbKQptZseaA5EdAnQGIJ44M9Fy/YP XqJb6M8KgF/5EXeCR3W9myXkBOK/TMPJ7oTPyeFcNF12i+DwaWlIfkb7O9mAH7bf5cus1W UndpCFaeZVrwBpZuZ+NrTO7gxMt3tWAhfQLatzEphcrGEQhwnccDe/WgG7T73wNrPX2jMY CNniz0YuXFlELzWfOwIqfwP4DB5AVnluIa6LxBgY/d+G6f4AN6fdcYz1Zk8MDw== 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=1740665847; 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=3D5SNttyttCAwU6IPtpRD7B/WFaYFZncMNnAiQLtBvY=; b=HQjsCCm++RB6LDZtPaS69TfWbiqzFZ6tHBonEu6HJJw9O0n35wVtAv7LvD+LwuzAZ2SmJZ 2ysrWCjSSiP+zK8Ij8SVheGUjW3rctocXPeGsTvNVjg4nauc+6T6pPmry1lhbxpxUwAgg2 YVAkm5sbho1Hol9uy6faEKncob0tFJRoeWTcjGNRGOg/p6mi2xAxZMDNa8coqnNMSCyM9X 0y+0lrjVBZT7q1JwWJVO5+EjVQdWIfenzyf5nNfocm92CxHhonMsbpfl9UTSVwHsIy7V6P AazV5/pdTXyJ1uhhMnw/xLLthqkbv0IXElGQ2ZNpbANqwuFyyjnTFIGYICAf7Q== 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 4Z3YMC3bQJzmqZ; Thu, 27 Feb 2025 14:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHRGa017400; Thu, 27 Feb 2025 14:17:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHRPc017397; Thu, 27 Feb 2025 14:17:27 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:27 GMT Message-Id: <202502271417.51REHRPc017397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ecd885d19639 - stable/14 - bhnd: Remove orphaned driver for the BHND USB core 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ecd885d196397ce0ea7c99720c5afb1e7fea6385 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ecd885d196397ce0ea7c99720c5afb1e7fea6385 commit ecd885d196397ce0ea7c99720c5afb1e7fea6385 Author: John Baldwin AuthorDate: 2024-06-01 20:25:12 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 bhnd: Remove orphaned driver for the BHND USB core This was only connected to the build for MIPS and has been disconnected from the build since MIPS was removed. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45432 (cherry picked from commit c7c037fad1862c18e3e9635b06194a4ca00ac3c1) --- sys/dev/bhnd/cores/usb/bhnd_ehci.c | 258 ---------------- sys/dev/bhnd/cores/usb/bhnd_ohci.c | 220 -------------- sys/dev/bhnd/cores/usb/bhnd_usb.c | 555 ----------------------------------- sys/dev/bhnd/cores/usb/bhnd_usbvar.h | 60 ---- 4 files changed, 1093 deletions(-) diff --git a/sys/dev/bhnd/cores/usb/bhnd_ehci.c b/sys/dev/bhnd/cores/usb/bhnd_ehci.c deleted file mode 100644 index 765d7eaaa144..000000000000 --- a/sys/dev/bhnd/cores/usb/bhnd_ehci.c +++ /dev/null @@ -1,258 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. - * Copyright (c) 2010, Aleksandr Rybalko - * All rights reserved. - * - * Developed by Semihalf. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of MARVELL nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -/* - * BHND attachment driver for the USB Enhanced Host Controller. - * Ported from ZRouter with insignificant adaptations for FreeBSD11. - */ - -#include "opt_bus.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#define EHCI_HC_DEVSTR "Broadcom EHCI" - -#define USB_BRIDGE_INTR_CAUSE 0x210 -#define USB_BRIDGE_INTR_MASK 0x214 - -static device_attach_t bhnd_ehci_attach; -static device_detach_t bhnd_ehci_detach; - -static int bhnd_ehci_probe(device_t self); -static void bhnd_ehci_post_reset(struct ehci_softc *ehci_softc); - -static int -bhnd_ehci_probe(device_t self) -{ - - device_set_desc(self, EHCI_HC_DEVSTR); - - return (BUS_PROBE_DEFAULT); -} - -static void -bhnd_ehci_post_reset(struct ehci_softc *ehci_softc) -{ - uint32_t usbmode; - - /* Force HOST mode */ - usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); - usbmode &= ~EHCI_UM_CM; - usbmode |= EHCI_UM_CM_HOST; - EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); -} - -static int -bhnd_ehci_attach(device_t self) -{ - ehci_softc_t *sc; - int err; - int rid; - - sc = device_get_softc(self); - /* initialise some bus fields */ - sc->sc_bus.parent = self; - sc->sc_bus.devices = sc->sc_devices; - sc->sc_bus.devices_max = EHCI_MAX_DEVICES; - sc->sc_bus.usbrev = USB_REV_2_0; - sc->sc_bus.dma_bits = 32; - - /* get all DMA memory */ - if ((err = usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), - &ehci_iterate_hw_softc)) != 0) { - BHND_ERROR_DEV(self, "can't allocate DMA memory: %d", err); - return (ENOMEM); - } - - rid = 0; - sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (!sc->sc_io_res) { - BHND_ERROR_DEV(self, "Could not map memory"); - goto error; - } - sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); - sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); - sc->sc_io_size = rman_get_size(sc->sc_io_res); - - rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - - if (sc->sc_irq_res == NULL) { - BHND_ERROR_DEV(self, "Could not allocate error irq"); - bhnd_ehci_detach(self); - return (ENXIO); - } - - sc->sc_bus.bdev = device_add_child(self, "usbus", -1); - if (!sc->sc_bus.bdev) { - BHND_ERROR_DEV(self, "Could not add USB device"); - goto error; - } - device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); - device_set_desc(sc->sc_bus.bdev, EHCI_HC_DEVSTR); - - sprintf(sc->sc_vendor, "Broadcom"); - - err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); - if (err) { - BHND_ERROR_DEV(self, "Could not setup irq, %d", err); - sc->sc_intr_hdl = NULL; - goto error; - } - - sc->sc_flags |= EHCI_SCFLG_LOSTINTRBUG; - sc->sc_vendor_post_reset = bhnd_ehci_post_reset; - - err = ehci_init(sc); - if (!err) { - err = device_probe_and_attach(sc->sc_bus.bdev); - } - if (err) { - BHND_ERROR_DEV(self, "USB init failed err=%d", err); - goto error; - } - return (0); - -error: - bhnd_ehci_detach(self); - return (ENXIO); -} - -static int -bhnd_ehci_detach(device_t self) -{ - ehci_softc_t *sc; - int err; - - sc = device_get_softc(self); - - /* during module unload there are lots of children leftover */ - device_delete_children(self); - - /* - * disable interrupts that might have been switched on in ehci_init - */ -#ifdef notyet - if (sc->sc_io_res) { - EWRITE4(sc, EHCI_USBINTR, 0); - EWRITE4(sc, USB_BRIDGE_INTR_MASK, 0); - } -#endif - if (sc->sc_irq_res && sc->sc_intr_hdl) { - /* - * only call ehci_detach() after ehci_init() - */ - ehci_detach(sc); - - err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); - - if (err) - /* XXX or should we panic? */ - BHND_ERROR_DEV(self, "Could not tear down irq, %d", err); - - sc->sc_intr_hdl = NULL; - } - if (sc->sc_irq_res) { - bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); - sc->sc_irq_res = NULL; - } - if (sc->sc_io_res) { - bus_release_resource(self, SYS_RES_MEMORY, 0, sc->sc_io_res); - sc->sc_io_res = NULL; - } - usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); - - return (0); -} - -static device_method_t ehci_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, bhnd_ehci_probe), - DEVMETHOD(device_attach, bhnd_ehci_attach), - DEVMETHOD(device_detach, bhnd_ehci_detach), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - {0, 0} -}; - -static driver_t ehci_driver = { - "ehci", - ehci_methods, - sizeof(ehci_softc_t), -}; - -DRIVER_MODULE(ehci, bhnd_usb, ehci_driver, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); diff --git a/sys/dev/bhnd/cores/usb/bhnd_ohci.c b/sys/dev/bhnd/cores/usb/bhnd_ohci.c deleted file mode 100644 index c72c50be4675..000000000000 --- a/sys/dev/bhnd/cores/usb/bhnd_ohci.c +++ /dev/null @@ -1,220 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * Copyright (c) 2010, Aleksandr Rybalko - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Lennart Augustsson (augustss@carlstedt.se) at - * Carlstedt Research & Technology. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -/* - * USB Open Host Controller driver. - * - * OHCI spec: http://www.intel.com/design/usb/ohci11d.pdf - */ - -/* The low level controller code for OHCI has been split into - * SIBA probes and OHCI specific code. This was done to facilitate the - * sharing of code between *BSD's - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -static device_probe_t bhnd_ohci_probe; -static device_attach_t bhnd_ohci_attach; -static device_detach_t bhnd_ohci_detach; - -static int -bhnd_ohci_probe(device_t self) -{ - device_set_desc(self, "Broadcom OHCI"); - return (0); -} - -static int -bhnd_ohci_attach(device_t self) -{ - ohci_softc_t *sc; - int rid; - int err; - - sc = device_get_softc(self); - /* initialise some bus fields */ - sc->sc_bus.parent = self; - sc->sc_bus.devices = sc->sc_devices; - sc->sc_bus.devices_max = OHCI_MAX_DEVICES; - sc->sc_bus.dma_bits = 32; - - /* get all DMA memory */ - if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), - &ohci_iterate_hw_softc)) { - return (ENOMEM); - } - sc->sc_dev = self; - - rid = 0; - sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (!sc->sc_io_res) { - device_printf(self, "Could not map memory\n"); - goto error; - } - sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); - sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); - sc->sc_io_size = rman_get_size(sc->sc_io_res); - - rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->sc_irq_res == NULL) { - device_printf(self, "Could not allocate irq\n"); - goto error; - } - sc->sc_bus.bdev = device_add_child(self, "usbus", -1); - if (!sc->sc_bus.bdev) { - device_printf(self, "Could not add USB device\n"); - goto error; - } - device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); - - strlcpy(sc->sc_vendor, "Broadcom", sizeof(sc->sc_vendor)); - - err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl); - - if (err) { - device_printf(self, "Could not setup irq, %d\n", err); - sc->sc_intr_hdl = NULL; - goto error; - } - err = ohci_init(sc); - if (!err) { - err = device_probe_and_attach(sc->sc_bus.bdev); - } - if (err) { - device_printf(self, "USB init failed\n"); - goto error; - } - return (0); - -error: - bhnd_ohci_detach(self); - return (ENXIO); -} - -static int -bhnd_ohci_detach(device_t self) -{ - ohci_softc_t *sc; - - sc = device_get_softc(self); - - /* during module unload there are lots of children leftover */ - device_delete_children(self); - - if (sc->sc_irq_res && sc->sc_intr_hdl) { - /* - * only call ohci_detach() after ohci_init() - */ - ohci_detach(sc); - - int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); - - if (err) { - /* XXX or should we panic? */ - device_printf(self, "Could not tear down irq, %d\n", - err); - } - sc->sc_intr_hdl = NULL; - } - if (sc->sc_irq_res) { - bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); - sc->sc_irq_res = NULL; - } - if (sc->sc_io_res) { - bus_release_resource(self, SYS_RES_MEMORY, 0, - sc->sc_io_res); - sc->sc_io_res = NULL; - } - usb_bus_mem_free_all(&sc->sc_bus, &ohci_iterate_hw_softc); - - return (0); -} - -static device_method_t bhnd_ohci_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, bhnd_ohci_probe), - DEVMETHOD(device_attach, bhnd_ohci_attach), - DEVMETHOD(device_detach, bhnd_ohci_detach), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - - DEVMETHOD_END -}; - -static driver_t ohci_driver = { - .name = "ohci", - .methods = bhnd_ohci_methods, - .size = sizeof(struct ohci_softc), -}; - -DRIVER_MODULE(ohci, bhnd_usb, ohci_driver, 0, 0); -MODULE_DEPEND(ohci, usb, 1, 1, 1); diff --git a/sys/dev/bhnd/cores/usb/bhnd_usb.c b/sys/dev/bhnd/cores/usb/bhnd_usb.c deleted file mode 100644 index 68701df14c50..000000000000 --- a/sys/dev/bhnd/cores/usb/bhnd_usb.c +++ /dev/null @@ -1,555 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2010, Aleksandr Rybalko - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice unmodified, this list of conditions, and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -/* - * Ported version of BroadCom USB core driver from ZRouter project - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -#include "bhnd_usbvar.h" - -/****************************** Variables ************************************/ -static const struct bhnd_device bhnd_usb_devs[] = { - BHND_DEVICE(BCM, USB20H, "USB2.0 Host core", NULL), - BHND_DEVICE_END -}; - -/****************************** Prototypes ***********************************/ - -static int bhnd_usb_attach(device_t); -static int bhnd_usb_probe(device_t); -static device_t bhnd_usb_add_child(device_t dev, u_int order, const char *name, - int unit); -static int bhnd_usb_print_all_resources(device_t dev); -static int bhnd_usb_print_child(device_t bus, device_t child); - -static struct resource * bhnd_usb_alloc_resource(device_t bus, - device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); -static int bhnd_usb_release_resource(device_t dev, - device_t child, int type, int rid, - struct resource *r); - -static struct resource_list * bhnd_usb_get_reslist(device_t dev, - device_t child); - -static int -bhnd_usb_probe(device_t dev) -{ - const struct bhnd_device *id; - - id = bhnd_device_lookup(dev, bhnd_usb_devs, sizeof(bhnd_usb_devs[0])); - if (id == NULL) - return (ENXIO); - - device_set_desc(dev, id->desc); - return (BUS_PROBE_DEFAULT); -} - -static int -bhnd_usb_attach(device_t dev) -{ - struct bhnd_usb_softc *sc; - int rid; - uint32_t tmp; - int tries, err; - - sc = device_get_softc(dev); - - bhnd_reset_hw(dev, 0, 0); - - /* - * Allocate the resources which the parent bus has already - * determined for us. - * XXX: There are few windows (usually 2), RID should be chip-specific - */ - rid = 0; - sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (sc->sc_mem == NULL) { - BHND_ERROR_DEV(dev, "unable to allocate memory"); - return (ENXIO); - } - - sc->sc_bt = rman_get_bustag(sc->sc_mem); - sc->sc_bh = rman_get_bushandle(sc->sc_mem); - sc->sc_maddr = rman_get_start(sc->sc_mem); - sc->sc_msize = rman_get_size(sc->sc_mem); - - rid = 0; - sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->sc_irq == NULL) { - BHND_ERROR_DEV(dev, "unable to allocate IRQ"); - return (ENXIO); - } - - sc->sc_irqn = rman_get_start(sc->sc_irq); - - sc->mem_rman.rm_start = sc->sc_maddr; - sc->mem_rman.rm_end = sc->sc_maddr + sc->sc_msize - 1; - sc->mem_rman.rm_type = RMAN_ARRAY; - sc->mem_rman.rm_descr = "BHND USB core I/O memory addresses"; - if (rman_init(&sc->mem_rman) != 0 || - rman_manage_region(&sc->mem_rman, sc->mem_rman.rm_start, - sc->mem_rman.rm_end) != 0) { - panic("%s: sc->mem_rman", __func__); - } - - /* TODO: macros for registers */ - bus_write_4(sc->sc_mem, 0x200, 0x7ff); - DELAY(100); - -#define OHCI_CONTROL 0x04 - bus_write_4(sc->sc_mem, OHCI_CONTROL, 0); - - if ( bhnd_get_device(dev) == BHND_COREID_USB20H) { - uint32_t rev = bhnd_get_hwrev(dev); - BHND_INFO_DEV(dev, "USB HOST 2.0 setup for rev %d", rev); - if (rev == 1/* ? == 2 */) { - /* SiBa code */ - - /* Change Flush control reg */ - tmp = bus_read_4(sc->sc_mem, 0x400) & ~0x8; - bus_write_4(sc->sc_mem, 0x400, tmp); - tmp = bus_read_4(sc->sc_mem, 0x400); - BHND_DEBUG_DEV(dev, "USB20H fcr: 0x%x", tmp); - - /* Change Shim control reg */ - tmp = bus_read_4(sc->sc_mem, 0x304) & ~0x100; - bus_write_4(sc->sc_mem, 0x304, tmp); - tmp = bus_read_4(sc->sc_mem, 0x304); - BHND_DEBUG_DEV(dev, "USB20H shim: 0x%x", tmp); - } else if (rev >= 5) { - /* BCMA code */ - err = bhnd_alloc_pmu(dev); - if(err) { - BHND_ERROR_DEV(dev, "can't alloc pmu: %d", err); - return (err); - } - - err = bhnd_request_ext_rsrc(dev, 1); - if(err) { - BHND_ERROR_DEV(dev, "can't req ext: %d", err); - return (err); - } - /* Take out of resets */ - bus_write_4(sc->sc_mem, 0x200, 0x4ff); - DELAY(25); - bus_write_4(sc->sc_mem, 0x200, 0x6ff); - DELAY(25); - - /* Make sure digital and AFE are locked in USB PHY */ - bus_write_4(sc->sc_mem, 0x524, 0x6b); - DELAY(50); - bus_read_4(sc->sc_mem, 0x524); - DELAY(50); - bus_write_4(sc->sc_mem, 0x524, 0xab); - DELAY(50); - bus_read_4(sc->sc_mem, 0x524); - DELAY(50); - bus_write_4(sc->sc_mem, 0x524, 0x2b); - DELAY(50); - bus_read_4(sc->sc_mem, 0x524); - DELAY(50); - bus_write_4(sc->sc_mem, 0x524, 0x10ab); - DELAY(50); - bus_read_4(sc->sc_mem, 0x524); - - tries = 10000; - for (;;) { - DELAY(10); - tmp = bus_read_4(sc->sc_mem, 0x528); - if (tmp & 0xc000) - break; - if (--tries != 0) - continue; - - tmp = bus_read_4(sc->sc_mem, 0x528); - BHND_ERROR_DEV(dev, "USB20H mdio_rddata 0x%08x", tmp); - } - - /* XXX: Puzzle code */ - bus_write_4(sc->sc_mem, 0x528, 0x80000000); - bus_read_4(sc->sc_mem, 0x314); - DELAY(265); - bus_write_4(sc->sc_mem, 0x200, 0x7ff); - DELAY(10); - - /* Take USB and HSIC out of non-driving modes */ - bus_write_4(sc->sc_mem, 0x510, 0); - } - } - - bus_generic_probe(dev); - - if (bhnd_get_device(dev) == BHND_COREID_USB20H && - ( bhnd_get_hwrev(dev) > 0)) - bhnd_usb_add_child(dev, 0, "ehci", -1); - bhnd_usb_add_child(dev, 1, "ohci", -1); - - bus_generic_attach(dev); - - return (0); -} - -static struct rman * -bhnd_usb_get_rman(device_t bus, int type, u_int flags) -{ - struct bhnd_usb_softc *sc = device_get_softc(bus); - - switch (type) { - case SYS_RES_MEMORY: - return (&sc->sc_mem_rman); - default: - return (NULL); - } -} - -static struct resource * -bhnd_usb_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct resource *rv; - struct resource_list *rl; - struct resource_list_entry *rle; - int passthrough, isdefault; - - isdefault = RMAN_IS_DEFAULT_RANGE(start,end); - passthrough = (device_get_parent(child) != bus); - rle = NULL; - - if (!passthrough && isdefault) { - BHND_INFO_DEV(bus, "trying allocate def %d - %d for %s", type, - *rid, device_get_nameunit(child) ); - - rl = BUS_GET_RESOURCE_LIST(bus, child); - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); - start = rle->start; - end = rle->end; - count = rle->count; - } else { - BHND_INFO_DEV(bus, "trying allocate %d - %d (%jx-%jx) for %s", type, - *rid, start, end, device_get_nameunit(child) ); - } - - /* - * If the request is for a resource which we manage, - * attempt to satisfy the allocation ourselves. - */ - if (type == SYS_RES_MEMORY) { - rv = bus_generic_rman_alloc_resource(bus, child, type, rid, - start, end, count, flags); - if (rv == NULL) { - BHND_ERROR_DEV(bus, "could not allocate resource"); - return (NULL); - } - - return (rv); - } - - /* - * Pass the request to the parent. - */ - return (bus_generic_rl_alloc_resource(bus, child, type, rid, start, end, - count, flags)); -} - -static struct resource_list * -bhnd_usb_get_reslist(device_t dev, device_t child) -{ - struct bhnd_usb_devinfo *sdi; - - sdi = device_get_ivars(child); - - return (&sdi->sdi_rl); -} - -static int -bhnd_usb_release_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - struct bhnd_usb_softc *sc; - struct resource_list_entry *rle; - bool passthrough; - int error; - - sc = device_get_softc(dev); - passthrough = (device_get_parent(child) != dev); - - /* Delegate to our parent device's bus if the requested resource type - * isn't handled locally. */ - if (type != SYS_RES_MEMORY) { - return (bus_generic_rl_release_resource(dev, child, type, rid, - r)); - } - - error = bus_generic_rman_release_resource(dev, child, type, rid, r); - if (error != 0) - return (error); - - if (!passthrough) { - /* Clean resource list entry */ - rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child), - type, rid); - if (rle != NULL) - rle->res = NULL; - } - - return (0); -} - -static int -bhnd_usb_activate_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) -{ - if (type != SYS_RES_MEMORY) - return (bus_generic_activate_resource(dev, child, type, rid, - r)); - return (bus_generic_rman_activate_resource(dev, child, type, rid, r)); -} - -static int -bhnd_usb_deactivate_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) -{ - if (type != SYS_RES_MEMORY) - return (bus_generic_deactivate_resource(dev, child, type, rid, - r)); - return (bus_generic_rman_deactivate_resource(dev, child, type, rid, r)); -} - -static int -bhnd_usb_map_resource(device_t dev, device_t child, int type, - struct resource *r, struct resource_map_request *argsp, - struct resource_map *map) -{ - struct bhnd_usb_softc *sc = device_get_softc(dev); - struct resource_map_request args; - rman_res_t length, start; - int error; - - if (type != SYS_RES_MEMORY) - return (bus_generic_map_resource(dev, child, type, r, argsp, - map)); - - /* Resources must be active to be mapped. */ - if (!(rman_get_flags(r) & RF_ACTIVE)) - return (ENXIO); - - resource_init_map_request(&args); - error = resource_validate_map_request(r, argsp, &args, &start, &length); - if (error) - return (error); - - args.offset = start - rman_get_start(sc->sc_mem); - args.length = length; - return (bus_generic_map_resource(dev, child, type, sc->sc_mem, &args, - map)); -} - -static int -bhnd_usb_unmap_resource(device_t dev, device_t child, int type, - struct resource *r, struct resource_map *map) -{ - struct bhnd_usb_softc *sc = device_get_softc(dev); - - if (type == SYS_RES_MEMORY) - r = sc->sc_mem; - return (bus_generic_unmap_resource(dev, child, type, r, map)); -} - -static int -bhnd_usb_print_all_resources(device_t dev) -{ - struct bhnd_usb_devinfo *sdi; - struct resource_list *rl; - int retval; - - retval = 0; - sdi = device_get_ivars(dev); - rl = &sdi->sdi_rl; - - if (STAILQ_FIRST(rl)) - retval += printf(" at"); - - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%jx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); - - return (retval); -} - -static int -bhnd_usb_print_child(device_t bus, device_t child) -{ - int retval = 0; - - retval += bus_print_child_header(bus, child); - retval += bhnd_usb_print_all_resources(child); - if (device_get_flags(child)) - retval += printf(" flags %#x", device_get_flags(child)); - retval += printf(" on %s\n", device_get_nameunit(bus)); - - return (retval); -} - -static device_t -bhnd_usb_add_child(device_t dev, u_int order, const char *name, int unit) -{ - struct bhnd_usb_softc *sc; - struct bhnd_usb_devinfo *sdi; - device_t child; - int error; - - sc = device_get_softc(dev); - - sdi = malloc(sizeof(struct bhnd_usb_devinfo), M_DEVBUF, M_NOWAIT|M_ZERO); - if (sdi == NULL) - return (NULL); - - resource_list_init(&sdi->sdi_rl); - sdi->sdi_irq_mapped = false; - - if (strncmp(name, "ohci", 4) == 0) - { - sdi->sdi_maddr = sc->sc_maddr + 0x000; - sdi->sdi_msize = 0x200; - } - else if (strncmp(name, "ehci", 4) == 0) - { *** 157 LINES SKIPPED *** From nobody Thu Feb 27 14:46:39 2025 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 4Z3Z0v3vM6z5qH59; Thu, 27 Feb 2025 14:46:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Z0v37LWz40N8; Thu, 27 Feb 2025 14:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740667599; 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=xr4iYwCSRANLb76EB8XspON/EXYR4X5RmXtXkeCT81E=; b=AjTMjLzGK32oQRcxzm2mH50/7/tPjisUFuQ5/CocJhJve1wkbxI33LxBGhmTmnucr05D+h O0aKwz9aHjugrkSdY38PqnRlk7jWfxCHUko3uUn4x9V6mLhDFup/o0RvDh0irhj50FKp51 uQISRoHHnt8T0rjJIqYzh6uTtHhjXKB4PTuXajHdGF9hPjYxuou2/ykl9HY5V5pcGz1kSM 2brKMhrZPll5DWA/B0WXT6xJR7p2Dtx8/E1eemR43unM+Et+JdTzGbFkJQQusnDfJS5qWB 8aFQr71e83ZHgoRc/uO1QePMlgXlKu/1S5ETZROGW+xED0HOtRg4a72MuBJ1Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740667599; a=rsa-sha256; cv=none; b=JN7TNCCUyyfcgeTsjLAzCR8uVUMb8pE56NMljNzvwJtqixV0jolk3HY+BJ/PmAqcimWCRf sas1woFyQjjJZD+Cxsm5uRRzD95KifSHTd0qvTYXEpCKNcGrncdk1+MkMqxw9YJoaMqSwJ vyS+muNg0Pk4OeW5AdLssh4xKobcTuSQSmpw62m+hCvw185BekU0ZKNOAyqL5DjNMTPMYr VWVMsEmHaKKeIsuL6471HC5NQIjrK+HJzxjvrjCN5pdTbspIjbfJkJjsE7FKbfdHTJTHHR 0GKy4dQODAz/ZmGDj/GfZFaIW60OLrr4lLMoqWrBzHx6wSr22zehUXpMmg3tFA== 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=1740667599; 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=xr4iYwCSRANLb76EB8XspON/EXYR4X5RmXtXkeCT81E=; b=r0cHvdotk33qZFqFOgYXzOgSQM9xKDZp9G52Bdmo3c5ZfUwWBHaM0A/JT0r389Kss2Mkdq 7bm/WvDAV8lluuY+2tyM2M90YevK/G6stswYdyeNQfm5ajI/wV3ZgdNvkPTw4FyeqzHLW8 bCJ3OjZpRuziPHvfQFTZpcPwPi67/sK/nfMVKXF3UANYoFqynaq53kAs95rRr4B78o2Jyw N8J9wsEtWPjtpjDsMJmokBLATOwaCZEESgMjKAht1Q1njPmmU394cXvQSFNz8YsjNdWpGY taPpwti7iSXDKwArI2SQbDIu6HyAJRLyVuICT8uhYjywdmWWnJ8Ih9xH0nPzQA== 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 4Z3Z0v26xpznNt; Thu, 27 Feb 2025 14:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REkdhC072905; Thu, 27 Feb 2025 14:46:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REkdI1072902; Thu, 27 Feb 2025 14:46:39 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:46:39 GMT Message-Id: <202502271446.51REkdI1072902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 96b62eae3c24 - stable/14 - netinet: Update a comment for in_localip() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 96b62eae3c24062b817d5f77521e8c28f430a393 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=96b62eae3c24062b817d5f77521e8c28f430a393 commit 96b62eae3c24062b817d5f77521e8c28f430a393 Author: Zhenlei Huang AuthorDate: 2025-02-24 10:14:39 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-27 14:45:47 +0000 netinet: Update a comment for in_localip() The function in_localip() was changed to return bool but the comment was left unchanged. Fixes: c8ee75f2315e Use network epoch to protect local IPv4 addresses hash MFC after: 3 days (cherry picked from commit a5e380e51cdba64a392846a4eeda000f948f42ce) --- sys/netinet/in.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 4ef1d9735658..de6224ad9ebc 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -149,7 +149,7 @@ in_localaddr(struct in_addr in) } /* - * Return 1 if an internet address is for the local host and configured + * Return true if an internet address is for the local host and configured * on one of its interfaces. */ bool From nobody Thu Feb 27 14:17:25 2025 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 4Z3YM93lY5z5qG2N; Thu, 27 Feb 2025 14:17:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM92zTdz3xJv; Thu, 27 Feb 2025 14:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665845; 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=Ptx2sE68wrphsPNQ/AZw/UG0U/I/4cp9qwjiwYCD77k=; b=IuX4XJrGW5Xm85hbIcKoxBYmwvd6UWDSBpfhaVyxLbRY0Juxjn3fK32vtuwsTUpj47n9OX /+NKwk4yMDtHr2e+oQ+mItiT7/6nXes5u/doS90Y5MBOWHPyX+4QdpkIZZnk4WFZFr3Wbr lLbLAiWdLCcZDU/4j+sRXMkRXN605z42lWmT5tnjC2BGbqnPAkguHdE/6v5IhVSQmOBRoj wNX361ERCD5AHfbaVo8dwZv53X7LeHG2BnwxRPR/g7YO41Y/1XQ7sLyaXgcYWdgdh8h1SX 5vkG4u9f5wnLhpBJTNp+pHa7htU+18EvX8tiCi1wwI+BtMoxWg1Nzz8JDYywUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665845; a=rsa-sha256; cv=none; b=hVg25ezeWOvnkHVmUySUn4YhYjRuLUpvmq976XTeix1MnI90CUsHnSzKoWAR5YVdAk8QN3 okx3AQIZVdCpnvJnR1QEVpbu64d6Txkl8YY2YQ7/SMzL1L2Ji5q74V/xv9ncFNYgZ9eP2h L2Rwo3S0RE71f7A+MWGiDNxe8kJipJimhLn/ri0KWqW2t/+eWuYmfOwIa9tF+YKKFW3kCQ /Q6tqogIt1gZFYg0Z24Iv5EdQakR/pnU1CHCZ4rqhcH98MOkDbyBFyo0HBUIzHI1p+TBzi ej81+fPgO4k0EZBiDLVT2tgT3zGhGCMrCpg27o6jZ1pxV8i+fk+hxqeVVwHvvw== 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=1740665845; 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=Ptx2sE68wrphsPNQ/AZw/UG0U/I/4cp9qwjiwYCD77k=; b=pcYmAUdWMDEUtIC8sM3c4RvQK3VFtdjjUPXyLeprEm9vLcsKy/+JRHeHfcl3yl0n2tLZT6 r3WcG0wnVVJva6bR2hOdxNAVdUYBMgzbslFfFHiaWDsGMA3F78+uYCLdTdv8bA7B+9U4Ou lsPkm8iCNtYsCJe3dOMUZAdro0IMqYeEZdhxlnsX2VgM8QHgFzgmxAo8aUz8pSuKYxjLQd kq+SUUBoAXiC3/imqRAR42mjANmqFBT414BVWQp9103PD03ptHGZwfkDvmd0WKXrkPGba0 zz4CynzS5aADu6RCf9fhntNh1M1NacX1JMcyxZLCMueHBdmqAM11nA3rWQ+dWA== 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 4Z3YM92LLWzmqX; Thu, 27 Feb 2025 14:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHPR1017334; Thu, 27 Feb 2025 14:17:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHPGo017331; Thu, 27 Feb 2025 14:17:25 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:25 GMT Message-Id: <202502271417.51REHPGo017331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 92e593668608 - stable/14 - pci_host_generic: Tolerate range resource allocation 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 92e593668608efde40dc1b6d97b60f01a9ce89fe Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=92e593668608efde40dc1b6d97b60f01a9ce89fe commit 92e593668608efde40dc1b6d97b60f01a9ce89fe Author: John Baldwin AuthorDate: 2024-04-09 21:55:40 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci_host_generic: Tolerate range resource allocation failures QEMU for armv7 includes a PCI memory range whose CPU address is greater than 4GB. This falls outside the range of armv7's global mem_rman used by the nexus driver. As a result, pcib0 fails to attach blocking all PCI devices. Instead, change the driver to be a bit more tolerant. If allocating a resource for a range fails, don't fail attaching the entire driver, but do skip adding the associated PCI range to the relevant rman in the pcib driver. This will prevent child devices from using BARs that allocate from this range. In the case of QEMU on armv7 devices can still allocate from an earlier PCI memory range that is within the 32-bit address space (and in fact none of the firmware-assigned memory BARs use addresses from the upper range). While here, reorder the operations on I/O ranges a bit: 1) print the range under bootverbose first (rather than last) so that the range is printed before any relevant errors for the range, 2) move rman_manage_region last after the parent resource has been set and allocated. Reported by: markj, Jenkins Reviewed by: markj Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Differential Revision: https://reviews.freebsd.org/D44698 (cherry picked from commit 03713f805a91749eabcfb2e23e86489b2d4034df) --- sys/dev/pci/pci_host_generic.c | 55 ++++++++++++------------------------------ 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index da49edcf91f5..4b7a1cb8ab39 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -80,6 +80,7 @@ pci_host_generic_core_attach(device_t dev) struct resource_map map; #endif struct generic_pcie_core_softc *sc; + struct rman *rm; uint64_t phys_base; uint64_t pci_base; uint64_t size; @@ -183,75 +184,51 @@ pci_host_generic_core_attach(device_t dev) range_descr = "prefetch"; flags = RF_PREFETCHABLE; type = SYS_RES_MEMORY; - error = rman_manage_region(&sc->pmem_rman, - pci_base, pci_base + size - 1); + rm = &sc->pmem_rman; break; case FLAG_TYPE_MEM: range_descr = "memory"; flags = 0; type = SYS_RES_MEMORY; - error = rman_manage_region(&sc->mem_rman, - pci_base, pci_base + size - 1); + rm = &sc->mem_rman; break; case FLAG_TYPE_IO: range_descr = "I/O port"; flags = 0; type = SYS_RES_IOPORT; - error = rman_manage_region(&sc->io_rman, - pci_base, pci_base + size - 1); + rm = &sc->io_rman; break; default: continue; } - if (error) { - device_printf(dev, "rman_manage_region() failed." - "error = %d\n", error); - goto err_rman_manage; - } + if (bootverbose) + device_printf(dev, + "PCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx, Type: %s\n", + pci_base, phys_base, size, range_descr); error = bus_set_resource(dev, type, rid, phys_base, size); if (error != 0) { device_printf(dev, "failed to set resource for range %d: %d\n", tuple, error); - goto err_rman_manage; + continue; } sc->ranges[tuple].res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE | RF_UNMAPPED | flags); if (sc->ranges[tuple].res == NULL) { device_printf(dev, "failed to allocate resource for range %d\n", tuple); - error = ENXIO; - goto err_rman_manage; + continue; + } + error = rman_manage_region(rm, pci_base, pci_base + size - 1); + if (error) { + device_printf(dev, "rman_manage_region() failed." + "error = %d\n", error); + continue; } - if (bootverbose) - device_printf(dev, - "PCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx, Type: %s\n", - pci_base, phys_base, size, range_descr); } return (0); -err_rman_manage: - for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { - if (sc->ranges[tuple].size == 0) - continue; /* empty range element */ - switch (FLAG_TYPE(sc->ranges[tuple].flags)) { - case FLAG_TYPE_PMEM: - case FLAG_TYPE_MEM: - type = SYS_RES_MEMORY; - break; - case FLAG_TYPE_IO: - type = SYS_RES_IOPORT; - break; - default: - continue; - } - if (sc->ranges[tuple].res != NULL) - bus_release_resource(dev, type, tuple + 1, - sc->ranges[tuple].res); - bus_delete_resource(dev, type, tuple + 1); - } - rman_fini(&sc->io_rman); err_io_rman: rman_fini(&sc->mem_rman); err_mem_rman: From nobody Thu Feb 27 21:04:22 2025 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 4Z3kNk3nP0z59WyP; Thu, 27 Feb 2025 21:04:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kNk3J9Rz43Xt; Thu, 27 Feb 2025 21:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690262; 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=p5Y6O+Tk72CGxB46NNIIVWiOn9pqwiihDF1K3oMTncI=; b=cw0Xc5YBE0xMEdST7WuUD1UB9eJuHg9j2/ClpoIMs0tmVdjzpztXiRE+nhJ+/VVjf43U22 bhsSsuCf4G1/sb2nPHVQ3bo8frdF2Nwgvf54VLKJXw3gWBYmqv6zQ5/4FNLdDi83a9l0YL VnwlSenDOUZTZ+dx8ulip97LhaUMxDb0/cWVjvR6RD8ZKsX2HiJlm/eqcdIJUzheIvOLc9 Q6GKh1bGPETgr0py76Dcf72aIbAHJp/hRyUtNVusLkoTQW+7lhvUWhxi5zeEvuFK5sqV5Y INeurA40KvFeAHH4lM4hhNzvU1A03VCwytfKBnP4KNyL63LywyVxWLmfmYcBIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690262; a=rsa-sha256; cv=none; b=QEZu8NMjc9TMiNC20rHZ4A5572qGuoXPqhUf3jRuK6M/vOfMsTLEZuzUvaw6tjzpPAXYlB z3LHQT1b8J4h28AFyevExrcKEAPonG70Y+dMMdQdT0Fmb2DXpS7ZpUaovddfm4eH94MqFA lmM1NACWAfxXDlPQeboGr3Vmq0xNh7RO+NQFaZ7cFiEh5Tflatb0jehT8/o2EgpOXyZIeS awURiVQeRdc7XQ6jTXuL1gF/NnB+oXVDanjPwWLx5iy4egmGxksxJdWpI4OIDc0udJVtER vcXU9kwVqeN5qQgJDazyQRsLZGpMN22hMnMo4EK7ESDUBVCqZtPUu/4t1RknDQ== 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=1740690262; 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=p5Y6O+Tk72CGxB46NNIIVWiOn9pqwiihDF1K3oMTncI=; b=P49reEqSMnXH5EZ+BOJIMOkb50eUWR+Y7vrz9KJT4ZG1ItQNtS6SFiEbEq8YdjoxMvwPHm 3cqc04tUHUhva88pi2+GD4oU8EbJ6NGfH8n6BrnAFg3/r3egLVxIHnuCeObeuQ4nR0ZeNO rU2Gk+BN3bLGbWkhMKux960vUVtWtpFTqZIciBsswPQ+PZnoijX8t6G2R9TDehWAHvf83z 8hL1DtfORlBQEbzgTCCZ+XcRlmyaKG+15O9+iOrDdbgJ8BN7ZF9MrV2gK/0GiLY9S64K3B O8JumCVwZeaKIouzebCKEBV228yt3dqeoHBwxmsOVFF+o5kwZTMvx3JR05sZvA== 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 4Z3kNk2X48zybn; Thu, 27 Feb 2025 21:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL4MAN085511; Thu, 27 Feb 2025 21:04:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL4Miq085508; Thu, 27 Feb 2025 21:04:22 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:04:22 GMT Message-Id: <202502272104.51RL4Miq085508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b2e5cbc82bff - stable/14 - LinuxKPI: 802.11: compile in HT compat code by default 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: b2e5cbc82bffb3884162dd2df928d06a49c3cc67 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b2e5cbc82bffb3884162dd2df928d06a49c3cc67 commit b2e5cbc82bffb3884162dd2df928d06a49c3cc67 Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 01:12:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-27 21:03:21 +0000 LinuxKPI: 802.11: compile in HT compat code by default Compile in the HT compat code by default even though no one will make use of it yet. Sponsored by: The FreeBSD Foundation Tested with: iwlwifi AX210 (NOHT, HT20 and HT40) (cherry picked from commit 75d23d882389e1bb011bda37022aaa17c068cbf8) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 5db1512394cc..b684bd76bacf 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -79,7 +79,7 @@ #define LKPI_80211_WME #define LKPI_80211_HW_CRYPTO -/* #define LKPI_80211_HT */ +#define LKPI_80211_HT /* #define LKPI_80211_VHT */ #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) From nobody Thu Feb 27 14:17:26 2025 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 4Z3YMB42z2z5qFY2; Thu, 27 Feb 2025 14:17:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMB3YCjz3xPq; Thu, 27 Feb 2025 14:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665846; 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=W8GJSZv7yUsymZdfqXk22sT9omQ3CZH05iAviB9TumU=; b=Rl/uA1RL/zVZuXdtNggWOV+BhvOO5lMhLlYKnqgXu/v+JENcwAkla4IOGTBdLFkiekPT74 0rnRhPdQstr/5OvqmFPkjqPVyJ3JSycOpN17kLQQqGn4Nezrv7UW7G42ls1q1uZYRjd2LZ VFnk7aBjNOFxBcUglBnaklD9uDvekTBYfGnNpf2sl+Gg0d0zq36V4iP76LxEDcCO3xOdRA REDOlnzmlvya5tyf2NFZOfWVVjOc83lOH5Fq0tysG8sNObzirS0uFbEo6A4FM3r3IUAGhJ hv1Mv544WUijJ4gA4iAuoApGXA3nZsk2BHK2KRZmHhsFUqXTfF6nV4bXl5p+2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665846; a=rsa-sha256; cv=none; b=UXPItAw+iWfjl/6xUandKVU5cbIvYS+vWcEtUE8Be8reWUidfj4UOra5DWCt/Zodqj4FG7 bz+m0gejk+DYVxvCi6Hesf+R3SgPVA0b+T03BoTKgJGHXztZ66VANj3Bd1CRBH2SrqbHbS SMHFOOyATvoHLrYi43oiXmxgQercxm39s+anSrzrouotjuAtSi0aXoAeSbQExuwENpdBIg 6DBmd4OJSogzTH6ISM32UsyAL7f3Iqdul1oMWjr7H5yLaSna9GqJxYfLjxIQDEFydNvnKZ ANCt5ejMseCsAvMhjdiqCbAPGf5shhw215YJZ1bSGK6HhHn2sPvRb0uGKE9Mbw== 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=1740665846; 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=W8GJSZv7yUsymZdfqXk22sT9omQ3CZH05iAviB9TumU=; b=mTO7GDqnduCwcXqGpYENIgHGCJ8YLUhsrUJOaKWPNpPYMG+dfdgoddblCLAhu4SWgwincF +ji0/fYpLoCcz1ukovTsX3gCPCtTtQHVgq5aeSD7Ggr8/zARHLigD3Vx930+YKePXkSn8z xtyvTc0Hf/IoAWj3RETVnpH0t93T9HV+ED5xnJN6w/Pm3I5MwNgcxcVqENIejVCmio1h+k 1KL3tLAiXxyvqsS/Kl7pwLRoXe/NfSDVUsM4J6UZDgrXeFeR6S/8HCcjFfBpO5f0P0G/RL TMGOrbxAT6hs9RZwkgI+Whc+kGofgFwaKImTU3z7rjWEEo51EcCya+XFtf1K9A== 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 4Z3YMB38QPzmqY; Thu, 27 Feb 2025 14:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHQL7017367; Thu, 27 Feb 2025 14:17:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHQLR017364; Thu, 27 Feb 2025 14:17:26 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:26 GMT Message-Id: <202502271417.51REHQLR017364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1e5d162165e2 - stable/14 - pci: Use kobj typedefs for new-bus method prototypes 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e5d162165e283feb34551c379ee22dfb108c106 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1e5d162165e283feb34551c379ee22dfb108c106 commit 1e5d162165e283feb34551c379ee22dfb108c106 Author: John Baldwin AuthorDate: 2024-06-01 20:24:29 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci: Use kobj typedefs for new-bus method prototypes Reviewed by: kp, imp Differential Revision: https://reviews.freebsd.org/D45405 (cherry picked from commit 0f1d148cfd1503eb5c4bcc4c4689c4219dbb605f) --- sys/dev/pci/pci.c | 22 +++---- sys/dev/pci/pci_private.h | 156 +++++++++++++++++++--------------------------- 2 files changed, 75 insertions(+), 103 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 1a415f676ff7..2c00b44d941a 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -88,6 +88,16 @@ (((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \ ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1)) +static device_probe_t pci_probe; + +static bus_reset_post_t pci_reset_post; +static bus_reset_prepare_t pci_reset_prepare; +static bus_reset_child_t pci_reset_child; +static bus_hint_device_unit_t pci_hint_device_unit; +static bus_remap_intr_t pci_remap_intr_method; + +static pci_get_id_t pci_get_id_method; + static int pci_has_quirk(uint32_t devid, int quirk); static pci_addr_t pci_mapbase(uint64_t mapreg); static const char *pci_maptype(uint64_t mapreg); @@ -103,7 +113,6 @@ static void pci_assign_interrupt(device_t bus, device_t dev, int force_route); static int pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl, int force, int prefetch); -static int pci_probe(device_t dev); static void pci_load_vendor_data(void); static int pci_describe_parse_line(char **ptr, int *vendor, int *device, char **desc); @@ -125,17 +134,6 @@ static int pci_msi_blacklisted(void); static int pci_msix_blacklisted(void); static void pci_resume_msi(device_t dev); static void pci_resume_msix(device_t dev); -static int pci_remap_intr_method(device_t bus, device_t dev, - u_int irq); -static void pci_hint_device_unit(device_t acdev, device_t child, - const char *name, int *unitp); -static int pci_reset_post(device_t dev, device_t child); -static int pci_reset_prepare(device_t dev, device_t child); -static int pci_reset_child(device_t dev, device_t child, - int flags); - -static int pci_get_id_method(device_t dev, device_t child, - enum pci_id_type type, uintptr_t *rid); static struct pci_devinfo * pci_fill_devinfo(device_t pcib, device_t bus, int d, int b, int s, int f, uint16_t vid, uint16_t did); diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index b634c7b61260..ea0efc54c829 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -48,6 +48,71 @@ struct pci_softc { extern int pci_do_power_resume; extern int pci_do_power_suspend; + +device_attach_t pci_attach; +device_detach_t pci_detach; +device_resume_t pci_resume; + +bus_print_child_t pci_print_child; +bus_probe_nomatch_t pci_probe_nomatch; +bus_read_ivar_t pci_read_ivar; +bus_write_ivar_t pci_write_ivar; +bus_driver_added_t pci_driver_added; +bus_setup_intr_t pci_setup_intr; +bus_teardown_intr_t pci_teardown_intr; + +bus_get_dma_tag_t pci_get_dma_tag; +bus_get_resource_list_t pci_get_resource_list; +bus_delete_resource_t pci_delete_resource; +bus_alloc_resource_t pci_alloc_resource; +bus_release_resource_t pci_release_resource; +bus_activate_resource_t pci_activate_resource; +bus_deactivate_resource_t pci_deactivate_resource; +bus_child_deleted_t pci_child_deleted; +bus_child_detached_t pci_child_detached; +bus_child_pnpinfo_t pci_child_pnpinfo_method; +bus_child_location_t pci_child_location_method; +bus_get_device_path_t pci_get_device_path_method; +bus_suspend_child_t pci_suspend_child; +bus_resume_child_t pci_resume_child; +bus_rescan_t pci_rescan_method; + +pci_read_config_t pci_read_config_method; +pci_write_config_t pci_write_config_method; +pci_enable_busmaster_t pci_enable_busmaster_method; +pci_disable_busmaster_t pci_disable_busmaster_method; +pci_enable_io_t pci_enable_io_method; +pci_disable_io_t pci_disable_io_method; +pci_get_vpd_ident_t pci_get_vpd_ident_method; +pci_get_vpd_readonly_t pci_get_vpd_readonly_method; +pci_get_powerstate_t pci_get_powerstate_method; +pci_set_powerstate_t pci_set_powerstate_method; +pci_assign_interrupt_t pci_assign_interrupt_method; +pci_find_cap_t pci_find_cap_method; +pci_find_next_cap_t pci_find_next_cap_method; +pci_find_extcap_t pci_find_extcap_method; +pci_find_next_extcap_t pci_find_next_extcap_method; +pci_find_htcap_t pci_find_htcap_method; +pci_find_next_htcap_t pci_find_next_htcap_method; +pci_alloc_msi_t pci_alloc_msi_method; +pci_alloc_msix_t pci_alloc_msix_method; +pci_enable_msi_t pci_enable_msi_method; +pci_enable_msix_t pci_enable_msix_method; +pci_disable_msi_t pci_disable_msi_method; +pci_remap_msix_t pci_remap_msix_method; +pci_release_msi_t pci_release_msi_method; +pci_msi_count_t pci_msi_count_method; +pci_msix_count_t pci_msix_count_method; +pci_msix_pba_bar_t pci_msix_pba_bar_method; +pci_msix_table_bar_t pci_msix_table_bar_method; +pci_alloc_devinfo_t pci_alloc_devinfo_method; +pci_child_added_t pci_child_added_method; +#ifdef PCI_IOV +pci_iov_attach_t pci_iov_attach_method; +pci_iov_detach_t pci_iov_detach_method; +pci_create_iov_child_t pci_create_iov_child_method; +#endif + void pci_add_children(device_t dev, int domain, int busno); void pci_add_child(device_t bus, struct pci_devinfo *dinfo); device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, @@ -55,95 +120,12 @@ device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask); void pci_add_resources_ea(device_t bus, device_t dev, int alloc_iov); -struct pci_devinfo *pci_alloc_devinfo_method(device_t dev); -int pci_attach(device_t dev); int pci_attach_common(device_t dev); -int pci_detach(device_t dev); -int pci_rescan_method(device_t dev); -void pci_driver_added(device_t dev, driver_t *driver); int pci_ea_is_enabled(device_t dev, int rid); -int pci_print_child(device_t dev, device_t child); -void pci_probe_nomatch(device_t dev, device_t child); -int pci_read_ivar(device_t dev, device_t child, int which, - uintptr_t *result); -int pci_write_ivar(device_t dev, device_t child, int which, - uintptr_t value); -int pci_setup_intr(device_t dev, device_t child, - struct resource *irq, int flags, driver_filter_t *filter, - driver_intr_t *intr, void *arg, void **cookiep); -int pci_teardown_intr(device_t dev, device_t child, - struct resource *irq, void *cookie); -int pci_get_vpd_ident_method(device_t dev, device_t child, - const char **identptr); -int pci_get_vpd_readonly_method(device_t dev, device_t child, - const char *kw, const char **vptr); -int pci_set_powerstate_method(device_t dev, device_t child, - int state); -int pci_get_powerstate_method(device_t dev, device_t child); -uint32_t pci_read_config_method(device_t dev, device_t child, - int reg, int width); -void pci_write_config_method(device_t dev, device_t child, - int reg, uint32_t val, int width); -int pci_enable_busmaster_method(device_t dev, device_t child); -int pci_disable_busmaster_method(device_t dev, device_t child); -int pci_enable_io_method(device_t dev, device_t child, int space); -int pci_disable_io_method(device_t dev, device_t child, int space); -int pci_find_cap_method(device_t dev, device_t child, - int capability, int *capreg); -int pci_find_next_cap_method(device_t dev, device_t child, - int capability, int start, int *capreg); -int pci_find_extcap_method(device_t dev, device_t child, - int capability, int *capreg); -int pci_find_next_extcap_method(device_t dev, device_t child, - int capability, int start, int *capreg); -int pci_find_htcap_method(device_t dev, device_t child, - int capability, int *capreg); -int pci_find_next_htcap_method(device_t dev, device_t child, - int capability, int start, int *capreg); -int pci_alloc_msi_method(device_t dev, device_t child, int *count); -int pci_alloc_msix_method(device_t dev, device_t child, int *count); -void pci_enable_msi_method(device_t dev, device_t child, - uint64_t address, uint16_t data); -void pci_enable_msix_method(device_t dev, device_t child, - u_int index, uint64_t address, uint32_t data); -void pci_disable_msi_method(device_t dev, device_t child); -int pci_remap_msix_method(device_t dev, device_t child, - int count, const u_int *vectors); -int pci_release_msi_method(device_t dev, device_t child); -int pci_msi_count_method(device_t dev, device_t child); -int pci_msix_count_method(device_t dev, device_t child); -int pci_msix_pba_bar_method(device_t dev, device_t child); -int pci_msix_table_bar_method(device_t dev, device_t child); -struct resource *pci_alloc_resource(device_t dev, device_t child, - int type, int *rid, rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); -int pci_release_resource(device_t dev, device_t child, int type, - int rid, struct resource *r); -int pci_activate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r); -int pci_deactivate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r); -void pci_delete_resource(device_t dev, device_t child, - int type, int rid); -struct resource_list *pci_get_resource_list (device_t dev, device_t child); struct pci_devinfo *pci_read_device(device_t pcib, device_t bus, int d, int b, int s, int f); void pci_print_verbose(struct pci_devinfo *dinfo); int pci_freecfg(struct pci_devinfo *dinfo); -void pci_child_deleted(device_t dev, device_t child); -void pci_child_detached(device_t dev, device_t child); -int pci_child_location_method(device_t cbdev, device_t child, - struct sbuf *sb); -int pci_child_pnpinfo_method(device_t cbdev, device_t child, - struct sbuf *sb); -int pci_get_device_path_method(device_t dev, device_t child, - const char *locator, struct sbuf *sb); -int pci_assign_interrupt_method(device_t dev, device_t child); -int pci_resume(device_t dev); -int pci_resume_child(device_t dev, device_t child); -int pci_suspend_child(device_t dev, device_t child); -bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); -void pci_child_added_method(device_t dev, device_t child); /** Restore the config register state. The state must be previously * saved with pci_cfg_save. However, the pci bus driver takes care of @@ -171,14 +153,6 @@ struct resource *pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_long num, u_int flags); -int pci_iov_attach_method(device_t bus, device_t dev, - struct nvlist *pf_schema, struct nvlist *vf_schema, - const char *name); -int pci_iov_detach_method(device_t bus, device_t dev); - -device_t pci_create_iov_child_method(device_t bus, device_t pf, - uint16_t rid, uint16_t vid, uint16_t did); - struct resource *pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); From nobody Thu Feb 27 14:16:42 2025 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 4Z3YLL3z88z5qG9g; Thu, 27 Feb 2025 14:16:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLL3W0kz3xRK; Thu, 27 Feb 2025 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665802; 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=giywZKC9LzjzP/IiwLaayeqkyCDVM/BsiVqg31cnw18=; b=n2N8Rxk4Hk+Hj/BLY2QAdqeZcBRYicoRJdi5dJp4YPW9L9rvGL9H8fO88Mlm4M4nMV2KFR pVA20kkYmBh7uhK70Ryryn5cwNImaRodOXMPF2H4wGVrBwtJHMXPFg2CYDGmhmAvZh+6E8 iS5kORPoxvne2PJl2AEGj7XZSh5TWkLAEkN9vmAxl3JXt+fXFwpZXOmHP6lGatZWT8e+Ab hoMjYlMtCMR+YJvR4PDUTobKrenMY5axAnJOsAIGkU74P4GSQjYOb+cmTsvXJZFO2Qbl5s zbMFOmX9Y/M5oNkg4HpGdBB04WLKuTc7Gaefqx8mqlmHAPkhAVe29rcm+/CImQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665802; a=rsa-sha256; cv=none; b=cOgt1RJp3Of1eaRW5WZ2Exv2rrx0eZTyBBXtDcXoObkL5LITgPuqzNgpkccKTfKEBIS6S+ VG2N+zWaFYvuqyPgrXQNVHKKruDcf+ury1meJ2Nh9HFCXE5kSQakrep8LlMwnYHOtW+5k3 CttmWbtCpNphe+x+UNC9RWXGDa+HJofhHHCMhxI/75i/RhFNXhcm4W8DV3FTvNYSQ06Ofr zngxExlrvQ8rj38f5+wwMwC1x+NL7xj2rFogmWaGRVK9KPgBaZ+AoU0tMJR3FakurmJ+Tw qMXUlfLixHCKfsy/cc4FstofAnph6NfEvp+KLkEVzuMvPUJwaG5O3lIc6Vz3Lw== 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=1740665802; 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=giywZKC9LzjzP/IiwLaayeqkyCDVM/BsiVqg31cnw18=; b=yGlhSfvuwuazFSFsfm5/IfsYF7QpGpuJg57WjTKbRCuqBz2/EfBTHU0StMz7HFXYwj2+qj +owR8SpZvDPKQcEDx0L/XSzzYpJM+doroFqgnPhTTKYnvEA9sv0RX7xU1dJ2CuwrmOkNKp j5rbAltCgEJQpAaOYvLJkHRdaslVRlPbnLbZXxCYmvGFMh2k8aXPjq9kJ22kf5RopNrDgF RpiQTE/g5wykaoYCQKpMKYcKXIotwUruMlmIUG+SdZ4S8vHSEDHIGOrNq9B0lu89Cj5FnF srv3h4FPi4DJQ8PdBkJHDN3GhbMKcZicLzQvj1ekv5qepFrljQzVZ1pOPWBLFg== 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 4Z3YLL35tdzm7L; Thu, 27 Feb 2025 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGg6a015985; Thu, 27 Feb 2025 14:16:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGgAe015982; Thu, 27 Feb 2025 14:16:42 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:42 GMT Message-Id: <202502271416.51REGgAe015982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cae52eb91f15 - stable/14 - arm64 thunder: Use bus_generic_rman_* in the pcie_pem driver 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cae52eb91f15e04d0b3b949f9f9d5c10498835a2 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cae52eb91f15e04d0b3b949f9f9d5c10498835a2 commit cae52eb91f15e04d0b3b949f9f9d5c10498835a2 Author: John Baldwin AuthorDate: 2024-01-23 17:37:41 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 arm64 thunder: Use bus_generic_rman_* in the pcie_pem driver - Implement bus_map/unmap_resource pulling bits from the previous thunder_pem_activate/deactivate_resource. - Use bus_generic_rman_* in various routines for memory and I/O port resources. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43439 (cherry picked from commit e5c6dbd576140c423b73ef6c908ffef6178cff9b) --- sys/arm64/cavium/thunder_pcie_pem.c | 206 ++++++++++++++++++++++-------------- 1 file changed, 124 insertions(+), 82 deletions(-) diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c index 2841486c1442..29dc84de6aaf 100644 --- a/sys/arm64/cavium/thunder_pcie_pem.c +++ b/sys/arm64/cavium/thunder_pcie_pem.c @@ -136,6 +136,10 @@ static int thunder_pem_get_id(device_t, device_t, enum pci_id_type, static int thunder_pem_attach(device_t); static int thunder_pem_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int thunder_pem_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); +static int thunder_pem_unmap_resource(device_t, device_t, int, + struct resource *, struct resource_map *); static bus_dma_tag_t thunder_pem_get_dma_tag(device_t, device_t); static int thunder_pem_detach(device_t); static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int); @@ -148,7 +152,7 @@ static int thunder_pem_read_ivar(device_t, device_t, int, uintptr_t *); static void thunder_pem_release_all(device_t); static int thunder_pem_release_resource(device_t, device_t, int, int, struct resource *); -static struct rman * thunder_pem_rman(struct thunder_pem_softc *, int); +static struct rman * thunder_pem_get_rman(device_t, int, u_int); static void thunder_pem_slix_s2m_regx_acc_modify(struct thunder_pem_softc *, int, int); static void thunder_pem_write_config(device_t, u_int, u_int, u_int, u_int, @@ -168,11 +172,14 @@ static device_method_t thunder_pem_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, thunder_pem_read_ivar), DEVMETHOD(bus_write_ivar, thunder_pem_write_ivar), + DEVMETHOD(bus_get_rman, thunder_pem_get_rman), DEVMETHOD(bus_alloc_resource, thunder_pem_alloc_resource), DEVMETHOD(bus_release_resource, thunder_pem_release_resource), DEVMETHOD(bus_adjust_resource, thunder_pem_adjust_resource), DEVMETHOD(bus_activate_resource, thunder_pem_activate_resource), DEVMETHOD(bus_deactivate_resource, thunder_pem_deactivate_resource), + DEVMETHOD(bus_map_resource, thunder_pem_map_resource), + DEVMETHOD(bus_unmap_resource, thunder_pem_unmap_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -250,86 +257,125 @@ static int thunder_pem_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { - int err; - bus_addr_t paddr; - bus_size_t psize; - bus_space_handle_t vaddr; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct thunder_pem_softc *sc; - if ((err = rman_activate_resource(r)) != 0) - return (err); + sc = device_get_softc(dev); +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_activate_bus(sc->id, child, rid, r)); +#endif + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_activate_resource(dev, child, type, + rid, r)); + default: + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + } +} + +static int +thunder_pem_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct thunder_pem_softc *sc; sc = device_get_softc(dev); +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_deactivate_bus(sc->id, child, rid, r)); +#endif + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_deactivate_resource(dev, child, type, + rid, r)); + default: + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + } +} - /* - * If this is a memory resource, map it into the kernel. - */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - paddr = (bus_addr_t)rman_get_start(r); - psize = (bus_size_t)rman_get_size(r); +static int +thunder_pem_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + struct thunder_pem_softc *sc; + rman_res_t length, start; + int error; - paddr = range_addr_pci_to_phys(sc->ranges, paddr); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); - err = bus_space_map(&memmap_bus, paddr, psize, 0, &vaddr); - if (err != 0) { - rman_deactivate_resource(r); - return (err); - } - rman_set_bustag(r, &memmap_bus); - rman_set_virtual(r, (void *)vaddr); - rman_set_bushandle(r, vaddr); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + break; + default: + return (EINVAL); } + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + sc = device_get_softc(dev); + start = range_addr_pci_to_phys(sc->ranges, start); + error = bus_space_map(&memmap_bus, start, length, 0, &map->r_bushandle); + if (error) + return (error); + map->r_bustag = &memmap_bus; + map->r_vaddr = (void *)map->r_bushandle; + map->r_size = length; return (0); } -/* - * This function is an exact copy of nexus_deactivate_resource() - * Keep it up-to-date with all changes in nexus. To be removed - * once bus-mapping interface is developed. - */ static int -thunder_pem_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) +thunder_pem_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) { - bus_size_t psize; - bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); - - if (vaddr != 0) { - bus_space_unmap(&memmap_bus, vaddr, psize); - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + bus_space_unmap(map->r_bustag, map->r_bushandle, map->r_size); + return (0); + default: + return (EINVAL); } - - return (rman_deactivate_resource(r)); } static int thunder_pem_adjust_resource(device_t dev, device_t child, int type, struct resource *res, rman_res_t start, rman_res_t end) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct thunder_pem_softc *sc; - struct rman *rm; sc = device_get_softc(dev); +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_adjust_bus(sc->id, child, res, start, end)); #endif - - rm = thunder_pem_rman(sc, type); - if (rm == NULL) + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_adjust_resource(dev, child, type, res, + start, end)); + default: return (bus_generic_adjust_resource(dev, child, type, res, start, end)); - if (!rman_is_region_manager(res, rm)) - /* - * This means a child device has a memory or I/O - * resource not from you which shouldn't happen. - */ - return (EINVAL); - return (rman_adjust_resource(res, start, end)); + } } static bus_dma_tag_t @@ -629,17 +675,19 @@ thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct thunder_pem_softc *sc = device_get_softc(dev); - struct rman *rm = NULL; struct resource *res; device_t parent_dev; + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_alloc_bus(sc->id, child, rid, start, end, count, flags)); #endif - rm = thunder_pem_rman(sc, type); - if (rm == NULL) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: /* Find parent device. On ThunderX we know an exact path. */ parent_dev = device_get_parent(device_get_parent(dev)); return (BUS_ALLOC_RESOURCE(parent_dev, dev, type, rid, start, @@ -663,28 +711,15 @@ thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid, start, end, count); } - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) - goto fail; - - rman_set_rid(res, *rid); - - if (flags & RF_ACTIVE) - if (bus_activate_resource(child, type, *rid, res)) { - rman_release_resource(res); - goto fail; - } - - return (res); - -fail: - if (bootverbose) { + res = bus_generic_rman_alloc_resource(dev, child, type, rid, start, + end, count, flags); + if (res == NULL && bootverbose) { device_printf(dev, "%s FAIL: type=%d, rid=%d, " "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", __func__, type, *rid, start, end, count, flags); } - return (NULL); + return (res); } static int @@ -694,24 +729,31 @@ thunder_pem_release_resource(device_t dev, device_t child, int type, int rid, device_t parent_dev; #if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct thunder_pem_softc *sc = device_get_softc(dev); +#endif - if (type == PCI_RES_BUS) + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_release_bus(sc->id, child, rid, res)); #endif - /* Find parent device. On ThunderX we know an exact path. */ - parent_dev = device_get_parent(device_get_parent(dev)); - - if ((type != SYS_RES_MEMORY) && (type != SYS_RES_IOPORT)) + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_release_resource(dev, child, type, + rid, res)); + default: + /* Find parent device. On ThunderX we know an exact path. */ + parent_dev = device_get_parent(device_get_parent(dev)); return (BUS_RELEASE_RESOURCE(parent_dev, child, type, rid, res)); - - return (rman_release_resource(res)); + } } static struct rman * -thunder_pem_rman(struct thunder_pem_softc *sc, int type) +thunder_pem_get_rman(device_t bus, int type, u_int flags) { + struct thunder_pem_softc *sc; + sc = device_get_softc(bus); switch (type) { case SYS_RES_IOPORT: return (&sc->io_rman); @@ -866,7 +908,7 @@ thunder_pem_attach(device_t dev) if (size == 0) continue; /* empty range element */ - rman = thunder_pem_rman(sc, sc->ranges[tuple].flags); + rman = thunder_pem_get_rman(dev, sc->ranges[tuple].flags, 0); if (rman != NULL) error = rman_manage_region(rman, base, base + size - 1); From nobody Thu Feb 27 16:55:56 2025 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 4Z3ct51Dvfz5qNVr; Thu, 27 Feb 2025 16:55: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct50kjwz45wr; Thu, 27 Feb 2025 16:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675357; 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=LWz1+WbUl+G2TatniDv2WIMyxZi9EBq+FErIP/4JwSs=; b=XlgaOQoSeC7Kptu3xgONoqik0vXUQ780ExEAHloxjH5PCKPrePdIWsmn/xDoL4PyS6/AxV fHGSyJFAHoLgcseQlxtkKmzyWbyv9bgwlot5PYMo0mYxML5LZUCxhWZ68A8seVtgRCmYeS pINubkhLbvg1EzYLy+z3i9H/Ovdvid9bt4o7sOpAN6w/gDby6xrMeCVzbNdCkH5NBmZROh VAFeIY6LFxDXH8BS83Yu/BisbTeA3EzlsLyrcwV0YXGikfcAYpD8yTmZbdbvc6xehk5+iY +B/Wb2rphSMeQ8MO8hKnxT7Ml+bUA9zFcqptAX7g+8FTq2mMc2L6v3G2UARZEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675357; a=rsa-sha256; cv=none; b=Fr3oTqaSAOPaOkAzD4ebxtluYRO8351E0ANLRu8DlUobHCgn+9qlT+m8dIfoNbFGGSgD1V LfAbA1P544m0hb4O1l2Vbz9L2UbDCs5iKLOQZM/XFKhWao5FvWUxEjXcJY+RkBHT9+CPoW ucg1Yz05BAnvmT9H9yQXsBp8J2WollJY0LUKoYhUiwF96rBK4PZbW+kxWewC10QfbumDQ+ /4Z82zytFyU1WryBlxifjDrOmMtrijsQRKJ2I+eCnPunRwNZWf2yEUDJW7RNLuOv/Runw9 ni/iTlWEN3iqeKu7oXSC1NF+nFg51SaoW5SNUk6M5GNGAsQD9FVIR+NsWP/EvQ== 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=1740675357; 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=LWz1+WbUl+G2TatniDv2WIMyxZi9EBq+FErIP/4JwSs=; b=bdhb3GxbwHSxOgxi4wNGiIRtk3Omf2O/TJn2BPkrZ+ypCrGJRPuDpxkeBH/ah8ubzPBMoU BpThZxzc9voYwusaogEYqu0ymR/D72UWhrgEYK0rDGbW615NsiWWi+XUy9SOA9+VWk0cYp gY7e5MVC7AHKLTFc0mt2qIv0iQcJUXoSoRcrzZ6UyTYKrRZW+lyel0KLyHjFsYfA8xrZC2 IesWVNfGOE/O7Q7whZ+Ru0nBPQIevtJrv0CtHYh8hVbFup1vsPvrg/XuCLlQqOa9Gy1AhH axKWYn5qK2h7mBQ0VmrVtu+FaQgKmO3uMoaDfS8sJ+omYtpz5WGcHpCRuBqa2A== 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 4Z3ct50Fm3zrtt; Thu, 27 Feb 2025 16:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtuwe017097; Thu, 27 Feb 2025 16:55:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtuxh017094; Thu, 27 Feb 2025 16:55:56 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:56 GMT Message-Id: <202502271655.51RGtuxh017094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b67839d769dd - stable/14 - stand/kshim: Replace devclass_equal with calls to strcmp 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b67839d769dd01c854ef4d4b2a5474985d26f3b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b67839d769dd01c854ef4d4b2a5474985d26f3b2 commit b67839d769dd01c854ef4d4b2a5474985d26f3b2 Author: John Baldwin AuthorDate: 2025-01-11 04:03:02 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:25:39 +0000 stand/kshim: Replace devclass_equal with calls to strcmp Reviewed by: imp, markj, emaste Differential Revision: https://reviews.freebsd.org/D48412 (cherry picked from commit 40d7ba08773751ff7d0df1a3f112b32d1d04e5ec) --- stand/kshim/bsd_kernel.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index abe81ccc6c1d..1e3b5d245ca7 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -559,27 +559,6 @@ static TAILQ_HEAD(, module_data) module_head = static TAILQ_HEAD(, devclass) devclasses = TAILQ_HEAD_INITIALIZER(devclasses); -static uint8_t -devclass_equal(const char *a, const char *b) -{ - char ta, tb; - - if (a == b) - return (1); - - while (1) { - ta = *a; - tb = *b; - if (ta != tb) - return (0); - if (ta == 0) - break; - a++; - b++; - } - return (1); -} - int bus_generic_resume(device_t dev) { @@ -897,7 +876,7 @@ device_get_method(device_t dev, const char *what) mtod = dev->dev_module->driver->methods; while (mtod->func != NULL) { - if (devclass_equal(mtod->desc, what)) { + if (strcmp(mtod->desc, what) == 0) { return (mtod->func); } mtod++; @@ -950,7 +929,7 @@ device_probe_and_attach(device_t dev) bus_name_parent = device_get_name(device_get_parent(dev)); TAILQ_FOREACH(mod, &module_head, entry) { - if (!devclass_equal(mod->bus_name, bus_name_parent)) + if (strcmp(mod->bus_name, bus_name_parent) != 0) continue; dc = devclass_find(mod->mod_name); @@ -1083,7 +1062,7 @@ devclass_find(const char *classname) devclass_t dc; TAILQ_FOREACH(dc, &devclasses, link) { - if (devclass_equal(dc->name, classname)) + if (strcmp(dc->name, classname) == 0) return (dc); } return (NULL); From nobody Thu Feb 27 14:16:37 2025 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 4Z3YLG13HXz5qGFg; Thu, 27 Feb 2025 14:16:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLG0XR8z3xNp; Thu, 27 Feb 2025 14:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665798; 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=0cQIDUrjfcOKIWbS7/Y1GDBK0hFUhPWSb9itP96aN8I=; b=COyuw4g5kTsrUG9T3+LOcXLZx5lyX834oOR+0ebRagOC277kF0nP2BX+wdvXIPbjoTBb5z E+8n9HA2AGtlxWknLIueOVf9dM4FRObbQ2gw70q1tPuFx17wOTLC0B/3vGo4FQhVjz6Ef0 O/avblWaj1YWTUepivPIfO7o5xEQ9OKW3G4RKQzePgWu5IQjMxF0Tqn01+K90D7pjnz/rU Cn9ybOot0vbzmYS6UEvcgTreMhzXZkBcglJMNjuLPrGC6NoCkAQid13IkVk7KrMOkOVW3Q mP7/ElX55JHuoWIE2yXA6HXblkfheyDVGEnQ5AvrSNsKe//TcT58XbogpKqtmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665798; a=rsa-sha256; cv=none; b=EmBKRt23X0VhoRo0563YR+5m4/zSEw6pzPqvQLPPNz3ccO/leN+2hXUWh3mwqmYNPLn4X1 EWHvizTr8Mc/JO3b8KidF+7m9RYMxlhyvvrqn1fuWw/3dYe5NR/DXWT60F+X2rXrn9Q73a SY7fxJzWlIyZcqivCD3wSp9YyT37zSG4nb1fvyR97cbt0iFpsDhcFSaBzu1/2V7wdOgx9Y mu4wCvqn8BhLdSd17/BJYtApWia3cbDwfHdXOrOhHOHtDX9hwhuP5wixba9E3DDDvPJ55D 3U2ht7KyLMkpjoJ5VFvvx0X98+5ucsjlLYI2ObXf8UoWLwnd1872KrKo/M/8HA== 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=1740665798; 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=0cQIDUrjfcOKIWbS7/Y1GDBK0hFUhPWSb9itP96aN8I=; b=XLzmIKq6WEysaUYmNsQgIzzd5bpj/N9IpvrSjZ/WWxGmxwT5XUy9/8Il4WH6JEnT0HTmX/ OWJzEGd+HK8pWio8kJiJmKhQbl7kJzBJC9lY7XHnhKCNm0JuQW5zQa30Z8VOmZT59y+Cum lqzB46iFCO8wEZS0MHafz89oa7knrkWI14BfJD3dz2skatwlBVohyG8UbtBxTYzNa6AzpU eD1d6wttzgCEXE9esTRVFISkeNdHwk3eKuC3I19YBIGhSdZfQW7XJHoYpAvisPlQpOAsqZ ALyii06k7e+UW90uYexdIP6OwhPrpF9seRC26ZWQpDnEWNI3+t3Cu4iAphxADw== 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 4Z3YLF70QvzmqL; Thu, 27 Feb 2025 14:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGb7N015835; Thu, 27 Feb 2025 14:16:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGbtb015832; Thu, 27 Feb 2025 14:16:37 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:37 GMT Message-Id: <202502271416.51REGbtb015832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 81770095f3d3 - stable/14 - macio: Set resource map size 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 81770095f3d3bac499d9f7092b98b9495e73b812 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=81770095f3d3bac499d9f7092b98b9495e73b812 commit 81770095f3d3bac499d9f7092b98b9495e73b812 Author: Justin Hibbits AuthorDate: 2024-04-11 01:42:31 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 macio: Set resource map size PR: 278278 Fixes: af081ec6f7cf ("powerpc: powermac: Use bus_generic_rman_*") (cherry picked from commit f03a2e7b59d98629bc9a81882ce7ca534bd4f224) --- sys/powerpc/powermac/macio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c index f6ad815064e8..0af6c8aed348 100644 --- a/sys/powerpc/powermac/macio.c +++ b/sys/powerpc/powermac/macio.c @@ -700,6 +700,7 @@ macio_map_resource(device_t bus, device_t child, int type, length, args.memattr); if (map->r_vaddr == NULL) return (ENOMEM); + map->r_size = length; map->r_bustag = &bs_le_tag; map->r_bushandle = (bus_space_handle_t)map->r_vaddr; return (0); From nobody Thu Feb 27 14:17:21 2025 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 4Z3YM611Gpz5qGJt; Thu, 27 Feb 2025 14:17:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM60Ll6z3xDP; Thu, 27 Feb 2025 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665842; 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=S4f7jbzMihCOcRKyXBeUQFSFbgy1W4gEEjWprnOBXYo=; b=VbEd7ZbX8yL+u26Xj2O9mlCS5bxGpFnZBP/jBHJie1XwU3DbvikR7WgpO3GMKa5H7oK9Cf fqbBm6WRuOc99dWSDPPNw/qljNmbghkaAwBK/la60yjjv8TiIsavmTVZp0m+B8p14hGcYV DeQmC0lg3i9FtM5vGvAmfx6xu5HZ5eHdYLcj9+6IV0Si/OSPy1WcOQOiK7GMyfNtLxBAdm DTLNeZvUTmolBLEi0tCJbqlIJjJ/SodXp6iNbeTwC0yiwV2W+m1pru/4TcA34atz1ewRT4 oNvY1ikseJB5GQIb5mOGjkKq/D8HxBHNto9nMLJe1bORaEP5g9ixleP/gl4JuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665842; a=rsa-sha256; cv=none; b=e+ks2Y/Sf61jPmFgyqr/5UFDjVBlGs82H99Yz6sjq7+XM2MsG+ZvL7ubTJgaOnDrleEfjN YqV+z8CSKaDqWVDbMX3xiSnEVy74D1ouPKWQRTzMsxKEksh0Isg8ufVOXURagp2XQ3iLvF xpSXegMkFj+jKW1fLT24Jpvcl5g859tcrKbYPUvDZz4sKu3B9zT9gzc2eAmXeMe4cOQGCQ Lixase8bFO0MJVTD2htyYLM8xkEcO1cHWu9nq0vOtx9J7o+et3Hx4G1CoUMzfIiaQQbYXj QXoTTkVAWjAVLTShoQUKsaV1TOWg+oPoi3mNaWgWnh3M54F4wWlZSRS0rfiTEQ== 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=1740665842; 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=S4f7jbzMihCOcRKyXBeUQFSFbgy1W4gEEjWprnOBXYo=; b=IbE2xlaliHTvbmRCzIOtzyH30p/ouk419MetGGCODXu9cnKWJizTqZBH6grjoAwCUldcDr 0HHrT51aso6J1EY1E1pePiXtM7FRLOcA57EU+S/SCoKrygELRDHhwPW2Ewcqu0wClfksdL NlvxatDdPVwPXhxfrtuXg6NaTeg/IZ4zlAWoXJgbSaiAOrY0yFStczLfjpDWOFK5NdfFGs 0wiaf40aJa55D699ifVivBfo1037R+Nc16OGLryJeLqQgxwkg01sNMM71ThCw/XrBVI5Sq CdLrKFc33kanyXJ/D9q1LJlmNhsMmMaUbn2Qf/jt0sYP44YO3wOmFYtvF6tNEQ== 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 4Z3YM56vm3zmf0; Thu, 27 Feb 2025 14:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHLWm017222; Thu, 27 Feb 2025 14:17:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHLj1017219; Thu, 27 Feb 2025 14:17:21 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:21 GMT Message-Id: <202502271417.51REHLj1017219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6343760d7405 - stable/14 - bhnd: Use rman_get_type in bhndb_find_resource_limits 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6343760d74050b27eb84dc7c3712837361661a1d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6343760d74050b27eb84dc7c3712837361661a1d commit 6343760d74050b27eb84dc7c3712837361661a1d Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 bhnd: Use rman_get_type in bhndb_find_resource_limits Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44126 (cherry picked from commit 3351964c5e5d29ef93b3f26b7fc31a4972aa9af7) --- sys/dev/bhnd/bhndb/bhndb.c | 2 +- sys/dev/bhnd/bhndb/bhndb_private.h | 2 +- sys/dev/bhnd/bhndb/bhndb_subr.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c index 978ad9c3e62b..ea5230bf459b 100644 --- a/sys/dev/bhnd/bhndb/bhndb.c +++ b/sys/dev/bhnd/bhndb/bhndb.c @@ -1113,7 +1113,7 @@ bhndb_adjust_resource(device_t dev, device_t child, int type, goto done; /* Otherwise, the range is limited by the bridged resource mapping */ - error = bhndb_find_resource_limits(sc->bus_res, type, r, &mstart, + error = bhndb_find_resource_limits(sc->bus_res, r, &mstart, &mend); if (error) goto done; diff --git a/sys/dev/bhnd/bhndb/bhndb_private.h b/sys/dev/bhnd/bhndb/bhndb_private.h index 851cbe82d3a7..7b56f0b05c84 100644 --- a/sys/dev/bhnd/bhndb/bhndb_private.h +++ b/sys/dev/bhnd/bhndb/bhndb_private.h @@ -73,7 +73,7 @@ int bhndb_add_resource_region( const struct bhndb_regwin *static_regwin); int bhndb_find_resource_limits( - struct bhndb_resources *br, int type, + struct bhndb_resources *br, struct resource *r, rman_res_t *start, rman_res_t *end); diff --git a/sys/dev/bhnd/bhndb/bhndb_subr.c b/sys/dev/bhnd/bhndb/bhndb_subr.c index 94d415d67064..b695785a4f7a 100644 --- a/sys/dev/bhnd/bhndb/bhndb_subr.c +++ b/sys/dev/bhnd/bhndb/bhndb_subr.c @@ -988,7 +988,6 @@ bhndb_find_intr_handler(struct bhndb_resources *br, void *cookiep) * returned. * * @param br The resource state to search. - * @param type The resource type (see SYS_RES_*). * @param r The resource to search for in @p br. * @param[out] start On success, the minimum supported start address. * @param[out] end On success, the maximum supported end address. @@ -997,14 +996,14 @@ bhndb_find_intr_handler(struct bhndb_resources *br, void *cookiep) * @retval ENOENT no active mapping found for @p r of @p type */ int -bhndb_find_resource_limits(struct bhndb_resources *br, int type, +bhndb_find_resource_limits(struct bhndb_resources *br, struct resource *r, rman_res_t *start, rman_res_t *end) { struct bhndb_dw_alloc *dynamic; struct bhndb_region *sregion; struct bhndb_intr_handler *ih; - switch (type) { + switch (rman_get_type(r)) { case SYS_RES_IRQ: /* Is this one of ours? */ STAILQ_FOREACH(ih, &br->bus_intrs, ih_link) { @@ -1043,7 +1042,8 @@ bhndb_find_resource_limits(struct bhndb_resources *br, int type, } default: - device_printf(br->dev, "unknown resource type: %d\n", type); + device_printf(br->dev, "unknown resource type: %d\n", + rman_get_type(r)); return (ENOENT); } } From nobody Thu Feb 27 14:16:38 2025 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 4Z3YLH1LD2z5qFx5; Thu, 27 Feb 2025 14:16:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLH0gtzz3wyr; Thu, 27 Feb 2025 14:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665799; 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=G4y9gMueCn/4POpmx+NrrIZZ3wzDf/obajeS7G5nsGM=; b=KwV9ZA9Te0P+oXx/7z2IHI6+vi2uoc8eZFnA59dGuWoGq362+5aZcLdwNtsF7awyoJrEBq RFnMRe/UQHIdlDs6eBftzfGnbGhE+LIYmEPEGe0dlO++QxG5hR++94jlUsicuMX/R/U1F9 YdnefCbY1l4FeKHDv1qcIawFHjMJKvDq/o7AueAyWOlfxVnOB8w8CYdCF9ZbOAygCkOk+p /yE1N1WSlXr40TUSf0USgVOskWCDiIKSZ7zOEDsN20QQFBHcYGvdvgLRB/VxrTLclOnJZb oax2WMVjxzE6WCE3e6l17kqf2+bRz8WInyTfgxW3nbzhQvch94nDwvM0Ns2Hbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665799; a=rsa-sha256; cv=none; b=bTudMSn2kJhl/uo64oqXqhBsQSoLqaZuf9fXPCrYwHu/UVAKCg/ZPevn2R9FToSUcOUFhn MA+a4ufXXG3u+0m502iavB6cF1PmoqSmN5dVxOE3bSyZYg1w4O07YYl034iE3uJmBrIZDI 7jdgeeuMwT6bsIMiIWS+leUiFoDe5qVQfu+S1Npu6OQrFBc0481YtGilQ1TAt0U0TXiXrW vRO8wcBvzRD6S+aYUolCp5Tke3mT3iqUAL6ZXMJeFAJ11G4N1O0uENimMijWoGu51MzZdd dUhmcy7EGW/hj40otjWKZXza0CPgJo/EAilANjxtJm8iBazulkj9VonB7Y1rAA== 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=1740665799; 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=G4y9gMueCn/4POpmx+NrrIZZ3wzDf/obajeS7G5nsGM=; b=dyn75OpIII6m4mg6nE2FYsMa7v1zccYPMoDLRrSTjvOvhqQIAFkdp2qofpJBhkX6g3XGf6 +lpEIPY8vttYS9Qbf393+1ZLGV9ajPpAnvb+zYmEkL3QQ1aKqzw8qc+o8Eh5Ecx1J8n/1x aDGLeFj7/JNm6aVVvq8xbbDU4lA2g11q/A7lrdH1cSW6AJKKBTk3qe626eqJonc6/zV+8z 5DTlT4PsRIOdkRx3DpX+MFl6oDC7F2j6q4k0HeRvDMpOvgrbZD1acUCfTYPXFXbdym/p5D qaXJAsToUzlxnjDhOkNcrwempqFVW6AXY5zio/3wwXer0hjC7+rHUfc4gFEfdA== 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 4Z3YLH0CR7zmZN; Thu, 27 Feb 2025 14:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGcsT015879; Thu, 27 Feb 2025 14:16:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGcoA015876; Thu, 27 Feb 2025 14:16:38 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:38 GMT Message-Id: <202502271416.51REGcoA015876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 64ab61b1284a - stable/14 - powerpc nexus: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 64ab61b1284a1e9d578c1df61a63cff7f2004b5f Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=64ab61b1284a1e9d578c1df61a63cff7f2004b5f commit 64ab61b1284a1e9d578c1df61a63cff7f2004b5f Author: John Baldwin AuthorDate: 2024-01-23 17:37:02 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc nexus: Use bus_generic_rman_* Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43436 (cherry picked from commit 7b5a5e4eef504d2972b6b5f6abfff8058be6371e) --- sys/powerpc/powerpc/nexus.c | 129 ++++---------------------------------------- 1 file changed, 11 insertions(+), 118 deletions(-) diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index c5f460baf44e..a2043c3cfdf9 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -68,12 +68,8 @@ static struct rman mem_rman; static device_probe_t nexus_probe; static device_attach_t nexus_attach; -static bus_activate_resource_t nexus_activate_resource; -static bus_adjust_resource_t nexus_adjust_resource; -static bus_alloc_resource_t nexus_alloc_resource; -static bus_deactivate_resource_t nexus_deactivate_resource; +static bus_get_rman_t nexus_get_rman; static bus_map_resource_t nexus_map_resource; -static bus_release_resource_t nexus_release_resource; static bus_unmap_resource_t nexus_unmap_resource; #ifdef SMP @@ -94,12 +90,13 @@ static device_method_t nexus_methods[] = { /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_rman_adjust_resource), + DEVMETHOD(bus_activate_resource, bus_generic_rman_activate_resource), + DEVMETHOD(bus_alloc_resource, bus_generic_rman_alloc_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), + DEVMETHOD(bus_get_rman, nexus_get_rman), DEVMETHOD(bus_map_resource, nexus_map_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), + DEVMETHOD(bus_release_resource, bus_generic_rman_release_resource), DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), @@ -232,121 +229,17 @@ nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, return (intr); } -/* - * Allocate a resource on behalf of child. NB: child is usually going to be a - * child of one of our descendants, not a direct child of nexus0. - */ -static struct resource * -nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +static struct rman * +nexus_get_rman(device_t bus, int type, u_int flags) { - struct rman *rm; - struct resource *rv; - switch (type) { case SYS_RES_IRQ: - rm = &intr_rman; - break; + return (&intr_rman); case SYS_RES_MEMORY: - rm = &mem_rman; - break; + return (&mem_rman); default: return (NULL); } - - rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, - child); - if (rv == NULL) - return (NULL); - rman_set_rid(rv, *rid); - - if ((flags & RF_ACTIVE) != 0) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); -} - -static int -nexus_activate_resource(device_t bus __unused, device_t child __unused, - int type, int rid __unused, struct resource *r) -{ - - if (type == SYS_RES_MEMORY) { - vm_paddr_t start; - void *p; - - start = (vm_paddr_t) rman_get_start(r); - if (bootverbose) - printf("nexus mapdev: start %jx, len %jd\n", - (uintmax_t)start, rman_get_size(r)); - - p = pmap_mapdev(start, (vm_size_t) rman_get_size(r)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(r, p); - rman_set_bustag(r, &bs_be_tag); - rman_set_bushandle(r, (u_long)p); - } - return (rman_activate_resource(r)); -} - -static int -nexus_deactivate_resource(device_t bus __unused, device_t child __unused, - int type __unused, int rid __unused, struct resource *r) -{ - - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - bus_size_t psize; - - psize = rman_get_size(r); - pmap_unmapdev(rman_get_virtual(r), psize); - } - - return (rman_deactivate_resource(r)); -} - -static int -nexus_adjust_resource(device_t bus, device_t child __unused, int type, - struct resource *r, rman_res_t start, rman_res_t end) -{ - struct rman *rm; - - switch (type) { - case SYS_RES_IRQ: - rm = &intr_rman; - break; - case SYS_RES_MEMORY: - rm = &mem_rman; - break; - default: - return (EINVAL); - } - if (rm == NULL) - return (ENXIO); - if (rman_is_region_manager(r, rm) == 0) - return (EINVAL); - return (rman_adjust_resource(r, start, end)); -} - -static int -nexus_release_resource(device_t bus, device_t child, int type, - int rid, struct resource *r) -{ - int error; - - if ((rman_get_flags(r) & RF_ACTIVE) != 0) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); - } - return (rman_release_resource(r)); } static int From nobody Thu Feb 27 21:04:21 2025 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 4Z3kNj2c9Hz59WmB; Thu, 27 Feb 2025 21:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kNj1y5Cz43pT; Thu, 27 Feb 2025 21:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690261; 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=AMNaQgsr4OdFuWfiIFVEZrWAVDTMiHxpKhrGJzznsW4=; b=hZNamV94P1Tm9Qi1V+3TTPnyDoPTlX5HkjGRNwXRfelkMxpJZcaWGsgbjiZFTLc07luee2 w1WZsG7xdR7u2JkEPlm08dUD5AZVZFCTUy9wRFpBYl5kxCQyS/QRuMeIZpgMK64vXAJlMR WeG76wrJ6TnAkXKqNFJ14udY0wWJCb2EQ+ERtYLtt9Dgy4SEzj/9nGsBRXkeBcq6dvKK3v EKYn4wjd6T/9HYZnpc8eA/F2pcM1ELzwp6v6NRkfxv1/VBJwG7DMuhJzL86YcfjNiEN8Ze 7COhwPC5Qrcg3s/l/Fh8DEF60COmOjkfr/oCsSMeBC5269RjRz7U+hGr3Q6FUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690261; a=rsa-sha256; cv=none; b=OSmWAPNw0Hs+ldXn2M2DsXk1bY5Z5zl7srnAelTvRem54ZeEkvHaY2NAinyDD/TmrrxGIy 1fp5+Qe9IQE/14MC9Ip3xinWuz0EAS1FpsmXfmxpMZSlhN9qt/hDHOKu+Y6urzTk+zNnDa jtg160P6zBvBWparkNiecVNpPIcUGosKkAIFUDiJxoSNyyleJwrXWbBtgRih6xI5BdD8GQ x3VQg89Ky+GddI7U3jknsbsm6SBKMXXDcNEdKPk10sspYbODtYpOCFI262ZKFBsdUNohZ1 VMJmjmq35QiD/WLnj0IPhBd8qEHl2BtrI5WPfb8eCDSl0JWTI8T6/Y9wapyQfQ== 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=1740690261; 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=AMNaQgsr4OdFuWfiIFVEZrWAVDTMiHxpKhrGJzznsW4=; b=cm0qLrBZRmxllIAd2NmGwALdqT/moiShpjs8LXiBFMEvzm2NnkfYpt+NDSktNp3TmKJDwG cUkFXkuj0SSDPAH/5/0ABwdRdJSLoq5JJ83Kb1vb5QsntFnGuIudpFYI0m8HS8h3zOz8X/ Tsg9E7c9Bsz4LIq3tAhAGMc9ZglM8UG2T6x4vBZ0JSaTK34ULvWzXr9lERZFLOxQ8ii0qs Bx9uNBAa3o0rG8toskJUL6gy0EtD0wU2moUcI7uGX0up7NPu3CCvSvm6wBiUgDiytVzjBN v9O7TKOVb7eEdxZIlZWeirw1gkPcTSwOHMtWPXM3Pit0/o+TkY41klv0nmGGUg== 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 4Z3kNj1YKqz10GD; Thu, 27 Feb 2025 21:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RL4Lgq085475; Thu, 27 Feb 2025 21:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RL4Lff085472; Thu, 27 Feb 2025 21:04:21 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:04:21 GMT Message-Id: <202502272104.51RL4Lff085472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9a39e5f46bed - stable/14 - LinuxKPI: 802.11: ensure to select the correct channel width 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a39e5f46bedab6aa3be65c0fb2e1ebbf34df230 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9a39e5f46bedab6aa3be65c0fb2e1ebbf34df230 commit 9a39e5f46bedab6aa3be65c0fb2e1ebbf34df230 Author: Bjoern A. Zeeb AuthorDate: 2025-02-25 01:57:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-27 21:03:21 +0000 LinuxKPI: 802.11: ensure to select the correct channel width If HT is enabled but not using CHW=40 set CHW=20 to make sure we do not get stuck on any other value. If VHT and the VHT Operation element Channel Width field is 0 (use 20/40) do not update the bandwidth but stick with what HT selected. This is better than disabling VHT alltogether for 20/40 and allows us to work on VHT20 and VHT40 APs it seems. We will have to do more work to can align with the chanctx or deal with Operating Mode Notification Action frames in LinuxKPI or net80211. Sponsored by: The FreeBSD Foundation (cherry picked from commit 3e022a91c91cf1b967d7de7b6fe81c6632fe1207) --- sys/compat/linuxkpi/common/src/linux_80211.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b7d3d7a298fc..5db1512394cc 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -401,6 +401,8 @@ lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) != 0) sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + else + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; /* * 802.11n-2009 20.6 Parameters for HT MCSs gives the mandatory/ @@ -450,6 +452,13 @@ lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) sta->deflink.vht_cap.cap = ni->ni_vhtcap; sta->deflink.vht_cap.vht_mcs = ni->ni_vht_mcsinfo; + /* + * If VHT20/40 are selected do not update the bandwidth + * from HT but stya on VHT. + */ + if (ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_USE_HT) + goto skip_bw; + width = (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK); switch (width) { #if 0 @@ -467,7 +476,7 @@ lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni) #endif sta->deflink.bandwidth = IEEE80211_STA_RX_BW_80; } - +skip_bw: rx_nss = 0; rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; From nobody Thu Feb 27 14:17:04 2025 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 4Z3YLn2Mfkz5qFY0; Thu, 27 Feb 2025 14:17:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLn0Zcyz3xMT; Thu, 27 Feb 2025 14:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665825; 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=eym0QiXoc1fofSrOB57wTdgEztu+wS1aUaMYtfS2MZ8=; b=TKxg6EutWmvxNCqOyE/8xx5xL23+nixCUF22sB0GoVzoMC1lcQrtn8bBNNQQxn/G5KAcdP YjsgEv6q3RduXda21FQZSKUzO/TltDtf4uIeph7LUVruHX7pvA8xIyvQsG2zZuxBp611xq u8SuKmeDNaAm9fUdym7XOikXiMxQF+8aUAFtYnaNtZYgB8Y4tYYytukIy508eklt2SDMPT ZJVuIbOuVgb99fW7ULWn0/WfNM1PaPNy76XaNvqC/kbHhj//HP1g7fRsI40Ajhc+5DU5iR x4N5b2frWzuNTFVLpoklC6XMG1ES9syw6CLGznBnTeqRF75H9j4rwSqT0nExpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665825; a=rsa-sha256; cv=none; b=QzUaMWDmuNl5FlJMLiPlGCUmXi5Zsu5HMYDAg5/5aG/FTcIcB6aBK6H/jHupJwutrHW4J7 1bdDBsSZ1NleQYSPeKdKNQ4+/gdTFR5YPcLeZZcecyKpyaCIzbWZPeu+0ay/vMm6+wDC7S fiZXnuhr1bJ1AQUlGOmD2eTxE90WgGCcRrlfdSpn+Kco3F+UMaRxRcXGmfNEAUWjUDIUu+ KYev/A/pBIsMiJUe/u+nHFjG1sJVNxK0LUM+3p4zr41RRnCT8xnuDBUeMBzNW2lNaYTQqc 2QBuQ4+QH8zcfiJbqIprltT4mscRFmKSVFrG/lPMa3IIFgdWYpyq/wOI+urkZg== 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=1740665825; 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=eym0QiXoc1fofSrOB57wTdgEztu+wS1aUaMYtfS2MZ8=; b=gkgSbiznHBa4CdUr0ZzmiXZCJhSf7vLr1wO2uV4/arhqU1QSloCqmXDTamEe34iXhOWInD 8QHWktEFKUmyXQF6Bb0GrNRRt/R5oKsisAdGf3o2cRYbDigXtZ4d7Gt6lOt+O/jvFYZOzL 1VEU9X5c/bxaSveQd3siff/EV0mpXjUP3Y2XvFgG8TL3rXIIRr1bXDC7vrsgkSJA2x8Wn/ 1Hm9o827jtO7b3TeDGj0XvVYPMAMxMgtjBs4VzX5QzaQGxdeXpREn6KwP4exeGCBtTBdxm 1pme6INav61aR0X7PefRyq0hgOHRO5fuS8N2kBP+gcmgsL76gysOKXRX6YqDVw== 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 4Z3YLn05T2zmdx; Thu, 27 Feb 2025 14:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH49T016710; Thu, 27 Feb 2025 14:17:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH4wf016707; Thu, 27 Feb 2025 14:17:04 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:04 GMT Message-Id: <202502271417.51REH4wf016707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1b0dd6b64b8e - stable/14 - pci_host_generic: Fix build without PCI_RES_BUS 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1b0dd6b64b8e0d75362d70e1e68c2e55f90acffc Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1b0dd6b64b8e0d75362d70e1e68c2e55f90acffc commit 1b0dd6b64b8e0d75362d70e1e68c2e55f90acffc Author: John Baldwin AuthorDate: 2024-02-16 20:09:46 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 pci_host_generic: Fix build without PCI_RES_BUS Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation (cherry picked from commit 66d37dbedfbf2dc94ccf49e6983c3652d5909b91) --- sys/dev/pci/pci_host_generic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 386b8411d29a..520462972a66 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -537,10 +537,14 @@ struct resource * pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; +#endif struct resource *res; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) sc = device_get_softc(dev); +#endif switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) From nobody Thu Feb 27 17:19:19 2025 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 4Z3dP32bqpz59Jhw; Thu, 27 Feb 2025 17:19:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3dP31pj7z46yV; Thu, 27 Feb 2025 17:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740676759; 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=+TtCuVhoSSHwL5vKBLkrA1ZDDvx24jRb68+m7vn34mY=; b=ypiOa1R1vm9uwnU+ydwg6NqXjvxd4/LSb58puVH+Kqm8w1CoYmdgb5ZhVrmxZLZtpTP8HK igvPJp/6+XDaRUCgrV7sqkZbo2/EA3kFK7JuMPc3nKdTBNtxIDxVXn1zh/QWVKkoGuXr7a KjFYPJPJ2YQJfqyWgJZ42BR8Y/QRQoMUo9MXYstdokAv9lK3UGN6Vu6obquR+Mpf1f/DNJ Y0x6wdeQPUuG8Oe8jV7vvpnkN6ElElVCc3KF/9Fd/9Mh6/luAjlbe8XUDgd52iamowbEIo 0LoopJETO1T2XDE4HOTMl09Ru1ORJlUldbWsio5H9ccYOABcs+CkrYO7m8mq8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740676759; a=rsa-sha256; cv=none; b=bqDMDtYtMLl++kUiEp1bk1Y22fGE77LdPBbU7LrBi1A1pL7p0W22yskHJdZJNua0meQ3Sw /kn1fKIT122Lx4wyVnszAkitJPpXIEgnxjKxazmCoHgQEC1OkgPwpr1tHrJRHpDLjP0eLW HpltVE6vpo4IJFHc4BEvr1pmDOx5xp9ayv0hHKN2TtEqfZfTeTz8jXl2TcOLbt8lyUk7br ub4Y8lO5Z9nIZNylg1lXVDULl3om2ncUrEky8N+gsZ0YWJB+nBprnJIC/pUZRxBim+p3Lc wMpptIJ6nQwMWxMMp7fgFrJc4tG+Et9GUqXa64WXju+DbAbkKyc4pvD+wLm1RA== 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=1740676759; 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=+TtCuVhoSSHwL5vKBLkrA1ZDDvx24jRb68+m7vn34mY=; b=D7RGlAmpzIDeV/NMuovmIZC5lln748z3SmoisJzSSAykNdBVirUS7CKvhtWYFTgweFn8wS EulR4esVY73soK2y7LqgK9A4kF/MTmkPCy2Ll4pk3q7Gf/PlKwhBIHxmo1/GDj9l6pq45g Eno7AZtZ9b6pnptFKoTVIajlMPF1l7vq6eDidRfEZWXN//hN0p3vPAbP1XQVOUc2OewkiV cSju2pNBxWKy5bs05MGplV6f2ltLNGVyzdkUXDs3tbx4smB/AmlKroVhdTY3NGI5wFlMT3 uUwCZ+Vu25n7PuYkw/YVCnJaoy4KL9AwmxsADlCUwpvUJAV12bH4AqxtwqDNPQ== 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 4Z3dP31HwlzsS6; Thu, 27 Feb 2025 17:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RHJJNx056780; Thu, 27 Feb 2025 17:19:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RHJJ1q056777; Thu, 27 Feb 2025 17:19:19 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:19:19 GMT Message-Id: <202502271719.51RHJJ1q056777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 513cd54856e1 - stable/14 - Use bus_generic_detach directly instead of a wrapper 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 513cd54856e1730dea9d709477319ff075f5112d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=513cd54856e1730dea9d709477319ff075f5112d commit 513cd54856e1730dea9d709477319ff075f5112d Author: John Baldwin AuthorDate: 2024-11-05 01:30:13 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:08:57 +0000 Use bus_generic_detach directly instead of a wrapper Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47386 (cherry picked from commit d62d10eb1229c9aa0b3cf1b18872df59c18155db) --- sys/dev/acpica/acpi_container.c | 10 +--------- sys/dev/adb/adb_bus.c | 8 +------- sys/dev/mdio/mdio.c | 10 +--------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/sys/dev/acpica/acpi_container.c b/sys/dev/acpica/acpi_container.c index 43da3cdc47e1..057f72716fed 100644 --- a/sys/dev/acpica/acpi_container.c +++ b/sys/dev/acpica/acpi_container.c @@ -39,7 +39,6 @@ ACPI_MODULE_NAME("CONTAINER") static int acpi_syscont_probe(device_t); static int acpi_syscont_attach(device_t); -static int acpi_syscont_detach(device_t); static int acpi_syscont_alloc_msi(device_t, device_t, int count, int maxcount, int *irqs); static int acpi_syscont_release_msi(device_t bus, device_t dev, @@ -55,7 +54,7 @@ static device_method_t acpi_syscont_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_syscont_probe), DEVMETHOD(device_attach, acpi_syscont_attach), - DEVMETHOD(device_detach, acpi_syscont_detach), + DEVMETHOD(device_detach, bus_generic_detach), /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), @@ -109,13 +108,6 @@ acpi_syscont_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -acpi_syscont_detach(device_t dev) -{ - - return (bus_generic_detach(dev)); -} - static int acpi_syscont_alloc_msi(device_t bus, device_t dev, int count, int maxcount, int *irqs) diff --git a/sys/dev/adb/adb_bus.c b/sys/dev/adb/adb_bus.c index ac09231fb914..144cce51b9f4 100644 --- a/sys/dev/adb/adb_bus.c +++ b/sys/dev/adb/adb_bus.c @@ -43,7 +43,6 @@ static int adb_bus_probe(device_t dev); static int adb_bus_attach(device_t dev); -static int adb_bus_detach(device_t dev); static void adb_bus_enumerate(void *xdev); static void adb_probe_nomatch(device_t dev, device_t child); static int adb_print_child(device_t dev, device_t child); @@ -58,7 +57,7 @@ static device_method_t adb_bus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, adb_bus_probe), DEVMETHOD(device_attach, adb_bus_attach), - DEVMETHOD(device_detach, adb_bus_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), @@ -189,11 +188,6 @@ adb_bus_enumerate(void *xdev) config_intrhook_disestablish(&sc->enum_hook); } -static int adb_bus_detach(device_t dev) -{ - return (bus_generic_detach(dev)); -} - static void adb_probe_nomatch(device_t dev, device_t child) { diff --git a/sys/dev/mdio/mdio.c b/sys/dev/mdio/mdio.c index 55122edd16cc..b3446445901d 100644 --- a/sys/dev/mdio/mdio.c +++ b/sys/dev/mdio/mdio.c @@ -59,14 +59,6 @@ mdio_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -mdio_detach(device_t dev) -{ - - bus_generic_detach(dev); - return (0); -} - static int mdio_readreg(device_t dev, int phy, int reg) { @@ -108,7 +100,7 @@ static device_method_t mdio_methods[] = { DEVMETHOD(device_identify, mdio_identify), DEVMETHOD(device_probe, mdio_probe), DEVMETHOD(device_attach, mdio_attach), - DEVMETHOD(device_detach, mdio_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), /* bus interface */ From nobody Thu Feb 27 14:17:34 2025 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 4Z3YML2gkRz5qGFX; Thu, 27 Feb 2025 14:17:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YML2D1Vz3xXW; Thu, 27 Feb 2025 14:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665854; 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=EUDEZhQcxZnjWG56B1tQAXwYAa1s9dJdZCY5MRIHG5s=; b=Q4bMrWk9lW3rae4dUI+WW3OlEG9/+OV6n9INukZuXJifzdBkWBUoLhr2PHQ2kaWl7iiZQB CxN2eDnpVRdIT0yM23UThRXixSMkGuLA+NMHszddEyKatQP2zDnpK3qLLUuMgo5rXRMiDw qvnz1GuvhbH+0VxZWLcrWRL4c2w7gF2VM5/DVF/I8jssLqzy6tYEpjMXeYYQfW4xKITqM7 ttzpqXK7yBcs9oOFsAl392Z2dxvXAJ9zPnnCiBpCGLwcIvfqQ8q8C2nVrltNZ/eC9yP9ny t363w3UmP914YmHKJ0xiJwYPLPd/0ehP5HGaCASwf1rhN+5jTLG3N2jOeh+Yjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665854; a=rsa-sha256; cv=none; b=Hun1SrbGefuFXDb7ezDTF39kZZHx+ntoj5SYdQWoCiS0LrO/tqC7fXZsbw912L2VjyNrkV SVq64Kcs43j1AKFcdcfghNZaJSTdf67wdd1PM3zX/NtOCX7BOYHA5oFRYecTZuQuVcAYop AON/P0fW/hplSK0mxmPGJh8TUJnqxxGmR6Ud3y8ssudh5awNEz4cJ5A1EJCOZyLAUjzBrg xMVIhQk/eOigZkAwieMWKmgtLCVl4t7/0exaJaKJhMHtjz3SnnhP0LD2Bi1n9+dnQX0ofZ B/6Nje32sGZ42UmIXaxUXVweW3XN/WQnhqlfw0H68RVWdf9F+0+ePOKSaYDo6g== 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=1740665854; 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=EUDEZhQcxZnjWG56B1tQAXwYAa1s9dJdZCY5MRIHG5s=; b=Q4pdg8tjjfsOU4kOgrSkviijqumage6dcv1ipUA8luhk8hN4j+Jul+kRs/iR0AiDxcR8Be 1Mbi5HtS8SuGgxPVWpjjKu7BYSW819XXd9et2TWslyJ8gbSv21gEHk9K5vTwSsmdsXQw3U bKduI51Y9oA16LCO7i5vp0r/B024HGwjaRU/Vz7PdlQlLSiy2nfDkXxCkewiGs1n9KjV1M m5CX5DjlUbIW9GzrDCismgEA/HKUWMXb8hurOVqlLdzRNZXmIB0KfauGA0KNXNJP3uAjX0 nuacSRhsFZj5716ME+6iXnrrPCjLFJqeqFAZ4sT9Vjq3K0iW6p0wwAtDUWRW5g== 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 4Z3YML1cTbzm7S; Thu, 27 Feb 2025 14:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHYxr017607; Thu, 27 Feb 2025 14:17:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHY3C017604; Thu, 27 Feb 2025 14:17:34 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:34 GMT Message-Id: <202502271417.51REHY3C017604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 59cec1382dd8 - stable/14 - pci: Renove #ifdef PCI_IOV from declarations now used unconditionally 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 59cec1382dd81b816d4c98c185350b08b9d39fb3 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=59cec1382dd81b816d4c98c185350b08b9d39fb3 commit 59cec1382dd81b816d4c98c185350b08b9d39fb3 Author: Jessica Clarke AuthorDate: 2024-08-08 22:35:09 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:24 +0000 pci: Renove #ifdef PCI_IOV from declarations now used unconditionally Fixes: 971c9f57d7e6 ("pci: Narrow the scope of recently-added PCI_IOV #ifdefs") (cherry picked from commit 104ee24349c033b63a50bd89ddc431a0d3ef9902) --- sys/dev/pci/pci_private.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index d3dd41abdb62..f4164f32293b 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -65,16 +65,12 @@ bus_get_dma_tag_t pci_get_dma_tag; bus_get_resource_list_t pci_get_resource_list; bus_delete_resource_t pci_delete_resource; bus_alloc_resource_t pci_alloc_resource; -#ifdef PCI_IOV bus_adjust_resource_t pci_adjust_resource; -#endif bus_release_resource_t pci_release_resource; bus_activate_resource_t pci_activate_resource; bus_deactivate_resource_t pci_deactivate_resource; -#ifdef PCI_IOV bus_map_resource_t pci_map_resource; bus_unmap_resource_t pci_unmap_resource; -#endif bus_child_deleted_t pci_child_deleted; bus_child_detached_t pci_child_detached; bus_child_pnpinfo_t pci_child_pnpinfo_method; From nobody Thu Feb 27 14:17:16 2025 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 4Z3YM02bdkz5qFxB; Thu, 27 Feb 2025 14:17:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM027x7z3xDH; Thu, 27 Feb 2025 14:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665836; 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=diA3GpNGK0FHDQGDtjNVL3p7BnNSg/yAlNjLvzidHZ0=; b=d697H0WIy3uvEer9WcR9mi9TNktQvPwtEY2Z+zHXoiJZlNo5WPSP3V3xmC6FerfjQaWSaU +Xvc39JFa/eSSZYXDx2PMx5oFZbU8qlPTFwX8Ti3U0Frhfw7BEbRPmQ8rDlz5IfzvgIb9q SzjzhRpLd5awkBouKs6tGcWa4ojmEdbqnqg6Dz0eQkf66DawXM7bxtnti/CvGiTBCrq/+T jGlKSFHamdPXh5F/8UQYI7CzjMhJfHILpJqzHLryZbyVT7oGuuT9kjbmwiL2JPvV1q7qd+ nOeTpsSwVfjhGj4Et84jwekhpSg8juMYaF5kISubm0pUeCs2ruBoQMKhFWBSAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665836; a=rsa-sha256; cv=none; b=wDJTG6hgGZfMHqR4PuMsBEFUD7QPUQLTrE0zaz9hB30gFSeQ5nkCp9fbFpdBlk946+/V9c BtJHgwuaj8JGB4GW+tmUZaz1flnZF8qCqh34LsLqpYkuFwPW33OlVhfbj5SEYAoYUdldX5 y6Y2agaDzhmPRmPqAPJ6PaQP9cc37jD39L49sHAktTjkgyZ+m1uXs+mu+HZbe0WxgvBKk8 Z+7CKATuKCMbQ87Iot1DNXkDXPcDZQffkJVV0Zs/xqvA2kIompq8qU4zPinzkSNI7pwoDq UCIN+e5dMsiHGevOmuDpR2IadtFinnXBMpQbRgClYtRmHssu9HY57cLs24WPsg== 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=1740665836; 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=diA3GpNGK0FHDQGDtjNVL3p7BnNSg/yAlNjLvzidHZ0=; b=yIX8SwyCImRSftzIUQR92YWuSUetW0VWQJulEtLAF1hBcE/3zs4y3dYdfwqMSEXvw5JiU0 5GsUyt+l3Em2pWMKaJbkTe4OAB5jyjJKCkTOSl9aqnGYEWdLIMTOpuUUEfHDp327Tre6pd PHJpx1WGcTIvAxmR7OkJd/Pjl+VgCa+9hKJlppxaZMb/O7+hOV/t4zXNPuA9XHGPQhfdGO VvGdENb8BZHytckpX0t8icIZ8QlLdfqoNbIqZfRsx1/p2Fm2YyvJ1p5sWqSxr9BWiomNuq DyDzjgZit9ko0E3Ut/q4d1DS2r9KxZhKi/rBFvfFsmHnbRhh6V8fB1273yE2kw== 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 4Z3YM01kMhzmqT; Thu, 27 Feb 2025 14:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHGe2017050; Thu, 27 Feb 2025 14:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHGut017047; Thu, 27 Feb 2025 14:17:16 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:16 GMT Message-Id: <202502271417.51REHGut017047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0ed9854b5bf4 - stable/14 - Revert "new-bus: Disable assertions for rman mismatches for activate/deactivate" 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0ed9854b5bf406b3d2bfda700ed749d3da015050 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0ed9854b5bf406b3d2bfda700ed749d3da015050 commit 0ed9854b5bf406b3d2bfda700ed749d3da015050 Author: John Baldwin AuthorDate: 2024-03-13 20:19:10 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 Revert "new-bus: Disable assertions for rman mismatches for activate/deactivate" With recent fixes to the ACPI and pcib drivers to translate mapping requests of child resources into mappings of sub-ranges of parent resources these assertions should now be true. This reverts commit ed88eef140a1c3d57d546f409c216806dd3da809. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43691 (cherry picked from commit f980f48f1369cda3f1f5e84e54e45b738bf0dd0b) --- sys/kern/subr_bus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index f08a7718e071..bd54977cc6f1 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4377,12 +4377,12 @@ bus_generic_rman_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { struct resource_map map; -#ifdef INVARIANTS_XXX +#ifdef INVARIANTS struct rman *rm; #endif int error; -#ifdef INVARIANTS_XXX +#ifdef INVARIANTS rm = BUS_GET_RMAN(dev, type, rman_get_flags(r)); KASSERT(rman_is_region_manager(r, rm), ("%s: rman %p doesn't match for resource %p", __func__, rm, r)); @@ -4425,12 +4425,12 @@ bus_generic_rman_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { struct resource_map map; -#ifdef INVARIANTS_XXX +#ifdef INVARIANTS struct rman *rm; #endif int error; -#ifdef INVARIANTS_XXX +#ifdef INVARIANTS rm = BUS_GET_RMAN(dev, type, rman_get_flags(r)); KASSERT(rman_is_region_manager(r, rm), ("%s: rman %p doesn't match for resource %p", __func__, rm, r)); From nobody Thu Feb 27 14:17:24 2025 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 4Z3YM82ZCbz5qFxD; Thu, 27 Feb 2025 14:17: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM828jtz3xRy; Thu, 27 Feb 2025 14:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665844; 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=eTaOfm1QqJ+o43VfMWgKMmhMLO6obV4gBVAsGkYoo1U=; b=t8QswPO23i3MpGv33xOjql94uCaG1pTh2g9sIGa0p1WM+oEDCWAVg8fpXiS/ZMBtOXJ5xf DYdN3qCsV2bTIxCHNHNNq7iTsReWo1RNYB+w0sZ8ru0LlADueGeJHwklMvqs6d/Hq+NUBJ zljwXxwwRdYDJ0zYIQEsqK+BoysjwkQLrCHkaWaS2pr8g059GOHe0aIg6q3CH/2g4p8tL2 M3rn7fJKO/yIKElzHy20+8vE3tgMRXPWKwbX+6jm6EWB40lCnPGI4gyhKFCe1Mpcmb75WI k9NMoWSe5nfJl6i74B5Kwu7h5QOiATs8yUDZG63yY56QiWzmOSj38TVnoEkIhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665844; a=rsa-sha256; cv=none; b=oXgqgcbqTQ7/LPfdgJrtV+tchWaadTuI5oy+uHLkSmcAR3b0BlMNim4JA7hETRBYGoLnn3 inM1w627Div9GTGmHO+vdC9yuzWfIWHWk6uNZh7ZZFmZFtMbXMCwdH+dWic46UHuLNAJNW IFj8f+kHkslNj6yKwfdd74s0mUOn5kLvBoUHbZ6UtfZ9tSbNVqvl8YrEjkK7l8yhIipVSy xVB/H0a5w99mFdXfYsa0ocoFddVG3/mJA/pJhy/89jaYlUmdJOxNk/tp4YukFg1RjFzdRl mwgi+8Qk4T17xoCXhLdEWIwe6UUBJmQyAX+xVF3dkvGwXprhKY7gttS1U3+qmg== 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=1740665844; 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=eTaOfm1QqJ+o43VfMWgKMmhMLO6obV4gBVAsGkYoo1U=; b=HK+jFaMna9EdL4fOP5n1m2JRdi0pcV2JOrXBw9/U+0bto9UtE0BovDjxnszGeM/gdBfPHV BgeHAdCn/IP/DAQBKoc2Wk44/6AJSqg3RGCbOTf1m33MvtEFcjZZJeKnb76XuHVf+gI2O3 YCPEvIUxkBEt9jaP1HdMSP41salZnYulpn/cHu9DuclUMuwecK2AL2Z4b5w8EJkPx8PXob 81gVynbUpg2CrqMFZ6edGbRBN1ZASuOcHHuqg5VUJUhloAPuK111jjrc9bFv4qgDVjByQk 2dnHBUBqbeRiucBkEEkqkj/+ohD/03gMcCMZDVcvg2NOd83rI/tlxhEtpbu6QA== 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 4Z3YM81g4XzmqW; Thu, 27 Feb 2025 14:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHORw017300; Thu, 27 Feb 2025 14:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHOec017296; Thu, 27 Feb 2025 14:17:24 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:24 GMT Message-Id: <202502271417.51REHOec017296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d172f42e4ba7 - stable/14 - Bump __FreeBSD_version for bus resource API change 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d172f42e4ba7ba8542ae0866aaba56e329b4ea2c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d172f42e4ba7ba8542ae0866aaba56e329b4ea2c commit d172f42e4ba7ba8542ae0866aaba56e329b4ea2c Author: John Baldwin AuthorDate: 2024-03-13 22:14:23 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 Bump __FreeBSD_version for bus resource API change Specifically, the change to remove redundant rid and type arguments from bus_* when passing an allocated struct resource. (cherry picked from commit a7b9f4d96e8bdc30db27ec7a193a8d8fdf7c652c) --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 3103da173f47..0e91a65170df 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1402501 +#define __FreeBSD_version 1402502 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Feb 27 14:17:07 2025 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 4Z3YLq2Qcrz5qG2J; Thu, 27 Feb 2025 14:17:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLq207bz3xH2; Thu, 27 Feb 2025 14:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665827; 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=zvtayANn1VHjv/z+T+oPa+EGnUSK6AdKtfjLAQN5bRE=; b=ezEhM1BxCcgWE75LDt45NjIG9xsFrq1lYvsEcQKVOTuf50KPNeY9oBAgDuwUGiMToVvGsq VwNSaNW1pBe8wO62Yw9SAWQvLtBq5w+xZuZ28W7oVa5MgkQoi9EkjYulDuBrk1h9/ytYlU Wg22ctqQZt/JZpYvykl+pDS4Eq4PfE+T3h8Kc+NvXIw+uu6ugWFdUzl1mvN9lSCrw2wfYV Joy3/iayEhkwVc5Yq73JLOEeA5wUjCT8Z+XmYA8nKeM3ASX+oF+iaUGQT8NFG4bacJecgZ HuBTOQ41DBjpG7NGKYcjCSdurQH/M1Y1vKINBuge20KE2XzlVycFVUor5pJeiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665827; a=rsa-sha256; cv=none; b=OWcRgaew9SThkdQhbfAk9ScT6OjiNw46scT7DRtG1ckOH56mGliNsas1vudx9miWmVv2bM gTQdC/XXUDzCoPI/woOxBzP+/vYFdtwGh/0z5dSIHY3kExsh3931btRwTNkyjcBJhdLuzp vqp7j25mYnfiq4hNBFRAkP3D9ySXmgBm2sDuxGjVppqEEn5oWyf8r+h/6lvrUYF64+3gxR 083Iac5xNDDg1kL5B/CKq56mKVFmu7wzyRnpUyQA0v5ywpsYkMLqn2UYGkD7yPC4Xlrwtr eMIobcFpccya2wgxmAO98FjcTBwbTqUP8KbcCHgtsiUAZam/dfOdrxDyKWGciQ== 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=1740665827; 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=zvtayANn1VHjv/z+T+oPa+EGnUSK6AdKtfjLAQN5bRE=; b=vH8yep0RHBU8WetZwhbhYT2omKQAHpUx1sWKhKAU69BiGIzeBVLTgpHzyUuT4hU/U/QdOU VHH2QFoRm1HW7KgfXO6xT/i9bs27+ZwCCq3fMfwcnUPXMw2gsLfHb0ltKSTbkl2ZemtVov vURFHYqRhrUlL+ZfkKjw3TUR9NrF8Woj7IoM+7z2RFqL4sveC5QCc3ZgEobC/bZgWuMMmV lERhuVMsBTrlzTnaJbSbBp6WxixFi4P52TvJ+1GqxI2qbmOU2vv61BCAyQ+NBtJ22X6uCh GGV45BeTXoB7z2RKMHtZMG/6SvSPYa4udvX6WsRfspyznGJn2uPXQ+s7jqn2/w== 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 4Z3YLq1blNzmqQ; Thu, 27 Feb 2025 14:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REH7J7016785; Thu, 27 Feb 2025 14:17:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REH7Me016782; Thu, 27 Feb 2025 14:17:07 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:07 GMT Message-Id: <202502271417.51REH7Me016782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1ee7a9a25053 - stable/14 - powerpc psim: Fix infinite recursion in multiple bus methods 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ee7a9a2505398989ecbf44a73d56c945de8561b Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1ee7a9a2505398989ecbf44a73d56c945de8561b commit 1ee7a9a2505398989ecbf44a73d56c945de8561b Author: John Baldwin AuthorDate: 2024-02-17 07:17:42 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 powerpc psim: Fix infinite recursion in multiple bus methods Similar to 68a3ff041129208ea98a3bd5142061176ab4165e, the default case needs to call bus_generic_* to pass the request up the tree, not bus_* which will just call this method again. Fixes: d7c16b333455 powerpc psim: Use bus_generic_rman_* (cherry picked from commit 61d9bd21e9d6c3f876c4c8549fafaaaa4de75983) --- sys/powerpc/psim/iobus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index c572a1fdc12b..eea0255aa21c 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -370,7 +370,7 @@ iobus_release_resource(device_t bus, device_t child, int type, int rid, return (bus_generic_rman_release_resource(bus, child, type, rid, res)); case SYS_RES_IRQ: - return (bus_release_resource(bus, type, rid, res)); + return (bus_generic_release_resource(bus, child, type, rid, res)); default: return (EINVAL); } @@ -383,7 +383,7 @@ iobus_activate_resource(device_t bus, device_t child, int type, int rid, switch (type) { case SYS_RES_IRQ: - return (bus_activate_resource(bus, type, rid, res)); + return (bus_generic_activate_resource(bus, child, type, rid, res)); case SYS_RES_IOPORT: case SYS_RES_MEMORY: return (bus_generic_rman_activate_resource(bus, child, type, @@ -400,7 +400,7 @@ iobus_deactivate_resource(device_t bus, device_t child, int type, int rid, switch (type) { case SYS_RES_IRQ: - return (bus_deactivate_resource(bus, type, rid, res)); + return (bus_generic_deactivate_resource(bus, child, type, rid, res)); case SYS_RES_IOPORT: case SYS_RES_MEMORY: return (bus_generic_rman_deactivate_resource(bus, child, type, From nobody Thu Feb 27 16:55:50 2025 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 4Z3csy2l90z59J84; Thu, 27 Feb 2025 16:55:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3csy2R2rz45wl; Thu, 27 Feb 2025 16:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675350; 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=yZ9ZCv4HFF79n7mhRqgNjcFMbEKdN8+UKw0rZjWFBLE=; b=mwyA7v9uBXoS7NmE3RIq3httG2DDZfOelqM4omjGc71k9tUdrj6pjWd/QuKfe7KR+Qe7Hq dbSXMetaq7aa3dhwxBQv3EhPrIsiXtXuk7HAxz8oiX73dCB5Ll4WALDLqojatGYSb/wFp8 Nh6Jh6UcP6PXHkeglMueK3q/b27GrDbnOv/2sWb2IodYlfpFe1AHQ/x0smkw3x0G4fWfy7 W5cx8keLfHyIgjeF5iBMscufIzmkt/XhsbcG87eUfAodM6XEjs93QOHsj33YcmLVVgD2ee mcTFW7irKMU7ErzasD5jqRrS+XaSGN3B1S2J/0axyaCJtMp80cxe+VHQJjNZGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675350; a=rsa-sha256; cv=none; b=hcLUeziTmnOaosuwR9+uJp+REA6CZBSrHgGGWGClzhQQQ7gezY0MaUv3gmKrISSNyZ+Wom O1bw63dwDTYVdi1wgrLCrN0pC0zphdj5DwFw3nfczamhAXBHbio/Wqb0NHcrcdszj8x+DZ xXUHgXQq1jBzY83y6yDNEWs+0FPQ2Rd/fV+KJBpbxZXb3oUzE0zWzl1AjByaT9nDUS9CY8 /xAYp5+u1QyflLzGHytNvAfnmFo7ysSvAmUa7McEJHWrozCx3Oaq4M02KhHh0g5gDJho2x T5kpcrHHXk/ylPoix6GK0IOQL1f2zf6pXMLbVQ48FSa6pTw52yzu5rqZcF/MBg== 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=1740675350; 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=yZ9ZCv4HFF79n7mhRqgNjcFMbEKdN8+UKw0rZjWFBLE=; b=PG0qflSXfssADMr/hrhpO00FGmRgb5Ef4EQii2NenDERNSY1yw0QOdA5BwNrCa3hVvJKQA z+39OAD5jECAJu3irLYWU+li0pdK6NC4jokBfTcFt5xjGn3GeAc8kT+FYbxKyxX/aYewhh GgkGhwc1OOvwRZggscHVXGsENm4KuQZKjMbIfWX8MQubd7EW/mWlciu7gAeHQK+5lj5E+I tN1tFGEdnDiN6Z/w8JUy0iyTT30V+b9ojhFO1kWalSVBe8wSt6mP70r9t2ctAxAqt4jhiv RCQY2S3IEtFpxmteR7zdRkN8hOBUHPboGKSX7fZq31a20vNcGFF7pAxDS0yHlQ== 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 4Z3csy1yCFzrGl; Thu, 27 Feb 2025 16:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtoWo016883; Thu, 27 Feb 2025 16:55:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtowk016880; Thu, 27 Feb 2025 16:55:50 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:50 GMT Message-Id: <202502271655.51RGtowk016880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1ab14e185ae1 - stable/14 - Check for errors when detaching children first, not last 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ab14e185ae192e7be26fb9d10be1a8db315972b Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1ab14e185ae192e7be26fb9d10be1a8db315972b commit 1ab14e185ae192e7be26fb9d10be1a8db315972b Author: John Baldwin AuthorDate: 2024-11-05 01:30:33 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:17:49 +0000 Check for errors when detaching children first, not last These detach routines in these drivers all ended with 'return (bus_generic_detach())' meaning that if any child device failed to detach, the parent driver was left in a mostly destroyed state, but still marked attached. Instead, bus drivers should detach child drivers first and return errors before destroying driver state in the parent. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47387 (cherry picked from commit d412c07617eb35435668b024bc2cecda05f57f1f) --- sys/arm/nvidia/as3722.c | 7 ++++++- sys/arm/nvidia/drm2/tegra_dc.c | 7 ++++++- sys/arm/nvidia/drm2/tegra_hdmi.c | 8 +++++++- sys/arm/nvidia/drm2/tegra_host1x.c | 7 ++++++- sys/arm/nvidia/tegra_abpmisc.c | 7 ++++++- sys/arm/nvidia/tegra_efuse.c | 7 ++++++- sys/arm/nvidia/tegra_i2c.c | 7 ++++++- sys/arm/nvidia/tegra_mc.c | 7 ++++++- sys/arm/nvidia/tegra_rtc.c | 7 ++++++- sys/arm/ti/ti_adc.c | 7 ++++++- sys/arm64/nvidia/tegra210/max77620.c | 7 ++++++- sys/arm64/nvidia/tegra210/max77620_rtc.c | 7 ++++++- sys/dev/dwwdt/dwwdt.c | 7 ++++++- sys/dev/ena/ena.c | 6 +++++- sys/dev/fdt/simplebus.c | 7 ++++++- sys/dev/gve/gve_main.c | 7 ++++++- sys/dev/iicbus/pmic/act8846.c | 7 ++++++- sys/dev/mana/gdma_main.c | 7 ++++++- sys/powerpc/mpc85xx/pci_mpc85xx.c | 7 ++++++- sys/powerpc/powermac/cuda.c | 7 ++++++- sys/powerpc/powermac/pmu.c | 7 ++++++- 21 files changed, 126 insertions(+), 21 deletions(-) diff --git a/sys/arm/nvidia/as3722.c b/sys/arm/nvidia/as3722.c index 537cd4f6e24a..1feb6d400aa8 100644 --- a/sys/arm/nvidia/as3722.c +++ b/sys/arm/nvidia/as3722.c @@ -343,6 +343,11 @@ static int as3722_detach(device_t dev) { struct as3722_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -351,7 +356,7 @@ as3722_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm/nvidia/drm2/tegra_dc.c b/sys/arm/nvidia/drm2/tegra_dc.c index f086570e3f09..f79cb76aa10d 100644 --- a/sys/arm/nvidia/drm2/tegra_dc.c +++ b/sys/arm/nvidia/drm2/tegra_dc.c @@ -1394,6 +1394,11 @@ static int dc_detach(device_t dev) { struct dc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -1413,7 +1418,7 @@ dc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_dc_methods[] = { diff --git a/sys/arm/nvidia/drm2/tegra_hdmi.c b/sys/arm/nvidia/drm2/tegra_hdmi.c index 641787a40e71..16454601ec13 100644 --- a/sys/arm/nvidia/drm2/tegra_hdmi.c +++ b/sys/arm/nvidia/drm2/tegra_hdmi.c @@ -1273,6 +1273,12 @@ static int hdmi_detach(device_t dev) { struct hdmi_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); + sc = device_get_softc(dev); TEGRA_DRM_DEREGISTER_CLIENT(device_get_parent(sc->dev), sc->dev); @@ -1295,7 +1301,7 @@ hdmi_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_hdmi_methods[] = { diff --git a/sys/arm/nvidia/drm2/tegra_host1x.c b/sys/arm/nvidia/drm2/tegra_host1x.c index 7d5044d5403b..84f6229e76ca 100644 --- a/sys/arm/nvidia/drm2/tegra_host1x.c +++ b/sys/arm/nvidia/drm2/tegra_host1x.c @@ -587,6 +587,11 @@ static int host1x_detach(device_t dev) { struct host1x_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -609,7 +614,7 @@ host1x_detach(device_t dev) if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t host1x_methods[] = { diff --git a/sys/arm/nvidia/tegra_abpmisc.c b/sys/arm/nvidia/tegra_abpmisc.c index 88f9ecde3f31..1f54a918f63b 100644 --- a/sys/arm/nvidia/tegra_abpmisc.c +++ b/sys/arm/nvidia/tegra_abpmisc.c @@ -166,13 +166,18 @@ static int tegra_abpmisc_detach(device_t dev) { struct tegra_abpmisc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->abp_misc_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->abp_misc_res); if (sc->strap_opt_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 1, sc->strap_opt_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_abpmisc_methods[] = { diff --git a/sys/arm/nvidia/tegra_efuse.c b/sys/arm/nvidia/tegra_efuse.c index 7c88bcb3fe03..a7af16504ab3 100644 --- a/sys/arm/nvidia/tegra_efuse.c +++ b/sys/arm/nvidia/tegra_efuse.c @@ -500,6 +500,11 @@ static int tegra_efuse_detach(device_t dev) { struct tegra_efuse_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); dev_sc = NULL; @@ -510,7 +515,7 @@ tegra_efuse_detach(device_t dev) if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_efuse_methods[] = { diff --git a/sys/arm/nvidia/tegra_i2c.c b/sys/arm/nvidia/tegra_i2c.c index 6b68b859a037..94e130ec3623 100644 --- a/sys/arm/nvidia/tegra_i2c.c +++ b/sys/arm/nvidia/tegra_i2c.c @@ -740,6 +740,11 @@ static int tegra_i2c_detach(device_t dev) { struct tegra_i2c_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); tegra_i2c_hw_init(sc); @@ -753,7 +758,7 @@ tegra_i2c_detach(device_t dev) LOCK_DESTROY(sc); if (sc->iicbus) device_delete_child(dev, sc->iicbus); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm/nvidia/tegra_mc.c b/sys/arm/nvidia/tegra_mc.c index bad75f274af0..4c567657a96b 100644 --- a/sys/arm/nvidia/tegra_mc.c +++ b/sys/arm/nvidia/tegra_mc.c @@ -280,6 +280,11 @@ static int tegra_mc_detach(device_t dev) { struct tegra_mc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -290,7 +295,7 @@ tegra_mc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_mc_methods[] = { diff --git a/sys/arm/nvidia/tegra_rtc.c b/sys/arm/nvidia/tegra_rtc.c index b489967c946e..d2cc4d29f202 100644 --- a/sys/arm/nvidia/tegra_rtc.c +++ b/sys/arm/nvidia/tegra_rtc.c @@ -266,6 +266,11 @@ static int tegra_rtc_detach(device_t dev) { struct tegra_rtc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -276,7 +281,7 @@ tegra_rtc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_rtc_methods[] = { diff --git a/sys/arm/ti/ti_adc.c b/sys/arm/ti/ti_adc.c index 5a3a337afff5..d13dd87001de 100644 --- a/sys/arm/ti/ti_adc.c +++ b/sys/arm/ti/ti_adc.c @@ -915,6 +915,11 @@ static int ti_adc_detach(device_t dev) { struct ti_adc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -938,7 +943,7 @@ ti_adc_detach(device_t dev) if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t ti_adc_methods[] = { diff --git a/sys/arm64/nvidia/tegra210/max77620.c b/sys/arm64/nvidia/tegra210/max77620.c index a27edf01889d..47a7ca343067 100644 --- a/sys/arm64/nvidia/tegra210/max77620.c +++ b/sys/arm64/nvidia/tegra210/max77620.c @@ -450,6 +450,11 @@ static int max77620_detach(device_t dev) { struct max77620_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -458,7 +463,7 @@ max77620_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm64/nvidia/tegra210/max77620_rtc.c b/sys/arm64/nvidia/tegra210/max77620_rtc.c index b3ef0fd8da79..26e611ef20e6 100644 --- a/sys/arm64/nvidia/tegra210/max77620_rtc.c +++ b/sys/arm64/nvidia/tegra210/max77620_rtc.c @@ -367,11 +367,16 @@ static int max77620_rtc_detach(device_t dev) { struct max77620_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } /* diff --git a/sys/dev/dwwdt/dwwdt.c b/sys/dev/dwwdt/dwwdt.c index e1787bb549ca..b5eb6138db93 100644 --- a/sys/dev/dwwdt/dwwdt.c +++ b/sys/dev/dwwdt/dwwdt.c @@ -309,6 +309,7 @@ static int dwwdt_detach(device_t dev) { struct dwwdt_softc *sc = device_get_softc(dev); + int error; if (dwwdt_started(sc)) { /* @@ -318,6 +319,10 @@ dwwdt_detach(device_t dev) return (EBUSY); } + error = bus_generic_detach(dev); + if (error != 0) + return (error); + EVENTHANDLER_DEREGISTER(watchdog_list, sc->sc_evtag); sc->sc_evtag = NULL; @@ -337,7 +342,7 @@ dwwdt_detach(device_t dev) sc->sc_mem_res); } - return (bus_generic_detach(dev)); + return (0); } static int diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index e9d4530e9085..f0b6cec1bb61 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -4030,6 +4030,10 @@ ena_detach(device_t pdev) return (EBUSY); } + rc = bus_generic_detach(pdev); + if (rc != 0) + return (rc); + ether_ifdetach(adapter->ifp); ifmedia_removeall(&adapter->media); @@ -4096,7 +4100,7 @@ ena_detach(device_t pdev) free(ena_dev, M_DEVBUF); - return (bus_generic_detach(pdev)); + return (0); } /****************************************************************************** diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index 4c6f5921b713..6868dd9cf4bb 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -203,12 +203,17 @@ int simplebus_detach(device_t dev) { struct simplebus_softc *sc; + int rv; + + rv = bus_generic_detach(dev); + if (rv != 0) + return (rv); sc = device_get_softc(dev); if (sc->ranges != NULL) free(sc->ranges, M_DEVBUF); - return (bus_generic_detach(dev)); + return (0); } void diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index e40f77b08e85..0e40656ca928 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -861,6 +861,11 @@ gve_detach(device_t dev) { struct gve_priv *priv = device_get_softc(dev); if_t ifp = priv->ifp; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); ether_ifdetach(ifp); @@ -877,7 +882,7 @@ gve_detach(device_t dev) taskqueue_free(priv->service_tq); if_free(ifp); - return (bus_generic_detach(dev)); + return (0); } static device_method_t gve_methods[] = { diff --git a/sys/dev/iicbus/pmic/act8846.c b/sys/dev/iicbus/pmic/act8846.c index af3ee0ede5e5..f0963e5d2d45 100644 --- a/sys/dev/iicbus/pmic/act8846.c +++ b/sys/dev/iicbus/pmic/act8846.c @@ -226,11 +226,16 @@ static int act8846_detach(device_t dev) { struct act8846_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t act8846_methods[] = { diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 70985f4fbf65..b9316e872816 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -1879,6 +1879,11 @@ static int mana_gd_detach(device_t dev) { struct gdma_context *gc = device_get_softc(dev); + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); mana_remove(&gc->mana); @@ -1890,7 +1895,7 @@ mana_gd_detach(device_t dev) pci_disable_busmaster(dev); - return (bus_generic_detach(dev)); + return (0); } diff --git a/sys/powerpc/mpc85xx/pci_mpc85xx.c b/sys/powerpc/mpc85xx/pci_mpc85xx.c index 7409d8c4e07b..4f58c9e55626 100644 --- a/sys/powerpc/mpc85xx/pci_mpc85xx.c +++ b/sys/powerpc/mpc85xx/pci_mpc85xx.c @@ -674,12 +674,17 @@ static int fsl_pcib_detach(device_t dev) { struct fsl_pcib_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); mtx_destroy(&sc->sc_cfg_mtx); - return (bus_generic_detach(dev)); + return (0); } static int diff --git a/sys/powerpc/powermac/cuda.c b/sys/powerpc/powermac/cuda.c index 97f60f269559..f134f0e17663 100644 --- a/sys/powerpc/powermac/cuda.c +++ b/sys/powerpc/powermac/cuda.c @@ -260,6 +260,11 @@ cuda_attach(device_t dev) static int cuda_detach(device_t dev) { struct cuda_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -268,7 +273,7 @@ static int cuda_detach(device_t dev) { bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memr); mtx_destroy(&sc->sc_mutex); - return (bus_generic_detach(dev)); + return (0); } static uint8_t diff --git a/sys/powerpc/powermac/pmu.c b/sys/powerpc/powermac/pmu.c index f9d9d4d40c72..07ebfdf8aad3 100644 --- a/sys/powerpc/powermac/pmu.c +++ b/sys/powerpc/powermac/pmu.c @@ -525,6 +525,11 @@ static int pmu_detach(device_t dev) { struct pmu_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -536,7 +541,7 @@ pmu_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memr); mtx_destroy(&sc->sc_mutex); - return (bus_generic_detach(dev)); + return (0); } static uint8_t From nobody Thu Feb 27 14:17:31 2025 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 4Z3YMJ0pRnz5qG2R; Thu, 27 Feb 2025 14:17:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMJ06chz3xXS; Thu, 27 Feb 2025 14:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665852; 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=jcmeIKxE9R4ObTfG7gMl9/tMdA9kbnWJg7EbGBpLhwE=; b=xvUJtPsMXI8cBle9P/QfN3r4u07n6gJn4zwovjjcgBu2rqywzlaWrJJ/V0zxMBwyeHemcd /Hnvl1QKwliaBxziVz3vgMkQtOAS5BlT4M5+MvE0qHMxwlbhK5bbWOOIxYqlNUsEJNcS7O 44hOCS3DuzvEHkWc9O7bXBNvFCjG2G0P9SYgbsCfI8e9Rk6Bir++OqKBH85n9ZtPMlR4VT H5DW4U3F9zm0ChqKGmykGrbf3qhNwR+DdTnAtx/lpw8JDSp8DzZC6+/EhbF/tivqfLbgfr mDVBqiD1F0UMwJUTdth2hm1GGjOieMdsQbOjctQR34xEx+//JhTFUIAqilkV/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665852; a=rsa-sha256; cv=none; b=gHNZHUHVgwNb/mt085z2ny4SZytNSa8f576OZ4RfU+iIWCYfKmoQF3fYrgnT7PfILvVJAX 720ucC7h3zsliGwutE2OX9ykrJv3yfhD9WdJnCawb9yJyvQXEz23S3flj+DfGg9bi4JDA1 +VUcv2W78zt3eAEtKqfUMhm98IaGdgYKTHVR2TQ0S8MFXWPAfkupSQUyQIhn4Ta79EcOij 0h4aXqgFIjTZcRUsqAJgre9qlCi1Oh19p4vf1seMYQ7CG+p0Vk5/NZMBn72XzOJV6RLLWO 1VbLgjKqIwxPEs+8s3kInDl3eGfa2kxe+ZjoULhY7qeRGV0qpMM48cIuPb5rrw== 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=1740665852; 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=jcmeIKxE9R4ObTfG7gMl9/tMdA9kbnWJg7EbGBpLhwE=; b=AjCuEz6AaNtMHSKYMSj28xPDurCc84BHnnr7tC+MfRJdvyetEFO2AyPgjsZOKuugwXbAkk LawfcUVsrWU6/VMaIXxWyhTvJC5YlCPO7xqR0K7AKgB3bAHgAKVggnmPfPIFlDwieJDwBp +uEf75lh3QEaMY44+q25mqGP2T58apoTAZxHqARtA2rCvecn53ngtCvrY8VWuUDSWKKjqu 6EZP5TeDiVgcCAXrIoNvr9iwJnBWmXWwCARo8UBLWUuO0u+rCufPUwLqHbAKW0wXrLUNAQ d6vE4KpTN7naN5zzX1I786S8ZMk1qAJzwTc/OLmZQgmhbcqeu0dueTQmqLuMzw== 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 4Z3YMH6qYtzmQK; Thu, 27 Feb 2025 14:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHVop017539; Thu, 27 Feb 2025 14:17:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHVPJ017536; Thu, 27 Feb 2025 14:17:31 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:31 GMT Message-Id: <202502271417.51REHVPJ017536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 60662799b126 - stable/14 - pci: Only add special VF handling for direct children in bus methods 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 60662799b1268ddbed2896223a77493b8def436c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=60662799b1268ddbed2896223a77493b8def436c commit 60662799b1268ddbed2896223a77493b8def436c Author: John Baldwin AuthorDate: 2024-06-05 16:50:05 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci: Only add special VF handling for direct children in bus methods For activate/deactivate resource, use a more standard check at the start of the function since the addition of the PCI_IOV code made this more complex. For the three recently added methods, just add the typical check at the beginning that I missed. This wasn't always fatal as if your system only had PCI device_t's as children of PCI bus devices it would happen to work ok, but if you have a non-PCI child device (e.g. an ATA channel) then dereferencing ivars for non-direct-children could fault. Reported by: Cirrus-CI (via emaste) Reviewed by: emaste Fixes: 871b33ad65ba pci: Consistently use pci_vf_* for suballocated VF memory resources Differential Revision: https://reviews.freebsd.org/D45499 (cherry picked from commit 56b822a17cde5940909633c50623d463191a7852) --- sys/dev/pci/pci.c | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 8ff31beca696..4be3210840fc 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -5702,6 +5702,10 @@ pci_activate_resource(device_t dev, device_t child, int type, int rid, struct pci_devinfo *dinfo; int error; + if (device_get_parent(child) != dev) + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + dinfo = device_get_ivars(child); #ifdef PCI_IOV if (dinfo->cfg.flags & PCICFG_VF) { @@ -5724,18 +5728,17 @@ pci_activate_resource(device_t dev, device_t child, int type, int rid, if (error) return (error); + /* Device ROMs need their decoding explicitly enabled. */ + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) + pci_write_bar(child, pci_find_bar(child, rid), + rman_get_start(r) | PCIM_BIOS_ENABLE); + /* Enable decoding in the command register when activating BARs. */ - if (device_get_parent(child) == dev) { - /* Device ROMs need their decoding explicitly enabled. */ - if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) - pci_write_bar(child, pci_find_bar(child, rid), - rman_get_start(r) | PCIM_BIOS_ENABLE); - switch (type) { - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - error = PCI_ENABLE_IO(dev, child, type); - break; - } + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + error = PCI_ENABLE_IO(dev, child, type); + break; } return (error); } @@ -5747,6 +5750,10 @@ pci_deactivate_resource(device_t dev, device_t child, int type, struct pci_devinfo *dinfo; int error; + if (device_get_parent(child) != dev) + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + dinfo = device_get_ivars(child); #ifdef PCI_IOV if (dinfo->cfg.flags & PCICFG_VF) { @@ -5771,11 +5778,9 @@ pci_deactivate_resource(device_t dev, device_t child, int type, return (error); /* Disable decoding for device ROMs. */ - if (device_get_parent(child) == dev) { - if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) - pci_write_bar(child, pci_find_bar(child, rid), - rman_get_start(r)); - } + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) + pci_write_bar(child, pci_find_bar(child, rid), + rman_get_start(r)); return (0); } @@ -5786,6 +5791,10 @@ pci_adjust_resource(device_t dev, device_t child, int type, struct resource *r, { struct pci_devinfo *dinfo; + if (device_get_parent(child) != dev) + return (bus_generic_adjust_resource(dev, child, type, r, start, + end)); + dinfo = device_get_ivars(child); if (dinfo->cfg.flags & PCICFG_VF) { switch (rman_get_type(r)) { @@ -5809,6 +5818,10 @@ pci_map_resource(device_t dev, device_t child, int type, struct resource *r, { struct pci_devinfo *dinfo; + if (device_get_parent(child) != dev) + return (bus_generic_map_resource(dev, child, type, r, argsp, + map)); + dinfo = device_get_ivars(child); if (dinfo->cfg.flags & PCICFG_VF) { switch (rman_get_type(r)) { @@ -5832,6 +5845,9 @@ pci_unmap_resource(device_t dev, device_t child, int type, struct resource *r, { struct pci_devinfo *dinfo; + if (device_get_parent(child) != dev) + return (bus_generic_unmap_resource(dev, child, type, r, map)); + dinfo = device_get_ivars(child); if (dinfo->cfg.flags & PCICFG_VF) { switch (rman_get_type(r)) { From nobody Fri Feb 28 00:54:25 2025 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 4Z3qVB0cV4z5Jtwx; Fri, 28 Feb 2025 00:54:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3qVB022Nz3Lhq; Fri, 28 Feb 2025 00:54:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740704066; 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=HR750Z3sdCJVOLQEHS7hjm5QlrRe/8ziK5ifxZRoFEo=; b=fmhCNzRPrvC7LbNNeGg2vbthv2Usuqj01C/lb1T04x7sKAohOUB4DxA/BErGdjdTf0Ra46 KPMEOtvs/BYir7DliaVLKSBUkjc9WJD5SGR3eMB/cTfUY3WEHxDOma+jw5HwPsfrqdiS24 Lta15YsQ9mHud2Lme8XJN7vS9ZTe/vD9F3mYOCPdMumRxkZ9iENkgozmurVGH/XOttYOxk 53/pwRp4g1+7PMWsc7Ss/ch0vD/zpgyxGmPjGmnHmOvYvVUBnKAF918AvE6cJ3LFAa9D6/ KS779n6lqN6QUzLm+YZlEzB9pLaZwWoZdAGGHgjoTXvhoUEE0WX7lsSvkJOnGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740704066; a=rsa-sha256; cv=none; b=opB1FFsltRQPijtZsxO5/GlRYM3ykX6VxSSnNglN/tI/pGHdrQVJN7YGB33QMT3hLU872Z npZzzKh6sTpHjFeX5V0iyfYBUynzt5UxhX52vaG9LDU4kg6pD90VPAjbdJezEDocfyylF2 SvKtJAQyawRJp05zPCR0gqH8O/zavfL/Ch2dIvbXqljee8vCzAg/6Yl3+gZkYEhp9tUjoc s7RrosGW9Z4O9r9vzN1xHAWN6LrRcABiVrdf8Pnbtw7BisGz5TzwpeFJT+WyVZtKc1b6l9 FkVHa7rwKRR5RWJoABUZbmw0qyEB0odL0x6ucRqk1B+nEhuWxEBex390FHBXGQ== 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=1740704066; 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=HR750Z3sdCJVOLQEHS7hjm5QlrRe/8ziK5ifxZRoFEo=; b=uFmRzGNPLLGKO44RcLxRqxVAEzBHsnoShy9I1b6A6UqsR+95h91+pJGLdZj2Pr4FqM6hsW 3E2mE8K7VO271LOUr4lf/AwShfsWzHFyCnFmGtrLe+QcGkKReb3har22tTio1ur456vx/B PWKBikdWoK+xItT+dR47d31HcmjIY/IcfCdkkg7uLuy7KlW8EUhEg90cSkF6UIo/YI0YSl aCcM8/KPnqlx4N2WFlcCVxLZKPf03gIn9aZebLDQIsCITrVdiPcHpc9Z/t17Oi553gED/N FKjsgmI9ExnxHExhu4GOqIQT5FexjvS2CgNJg9VlDD4d/3ZUC/wvZ5SEPE2IRA== 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 4Z3qV96Q46z152M; Fri, 28 Feb 2025 00:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51S0sPvJ015015; Fri, 28 Feb 2025 00:54:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51S0sPQO015012; Fri, 28 Feb 2025 00:54:25 GMT (envelope-from git) Date: Fri, 28 Feb 2025 00:54:25 GMT Message-Id: <202502280054.51S0sPQO015012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: a24b044a1e3b - releng/13.5 - 13.5: Update to RC1 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: a24b044a1e3b2bca2a4ebaa048d388158d6d1a14 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=a24b044a1e3b2bca2a4ebaa048d388158d6d1a14 commit a24b044a1e3b2bca2a4ebaa048d388158d6d1a14 Author: Colin Percival AuthorDate: 2025-02-28 00:48:37 +0000 Commit: Colin Percival CommitDate: 2025-02-28 00:48:37 +0000 13.5: Update to RC1 Approved by: re (implicit) Sponsored by: Amazon --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index fee92b14d847..7d74035f3adf 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.5" -BRANCH="BETA3" +BRANCH="RC1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Thu Feb 27 14:16:46 2025 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 4Z3YLR0lYsz5qGFP; Thu, 27 Feb 2025 14:16:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLR0K5Hz3x9S; Thu, 27 Feb 2025 14:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665807; 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=6kVxoiZm87AuwS/ECDPSViv6BJoRpv2a8miKqtUq6mI=; b=PVOn4DBaSDuFDU3nU+d81Jlhf2xC1xP8aZXgSSXxZIIng5iemqGFXPC/62wZOzHkgFVas3 inghoVjUAWUk40yBf92wX0RknleP23AEkJRmh68cdh4Y45beMz1gVWjX6K96S9I0h9CHfB h4aAL0/rixqKIDd9K2iGv4KcJhf/1lOBq22uE5QZhN6y+QA8cW4CmO8zn8CRbetXbb+Nm9 kGY/0ubhaJNliliUhBLtxzwpPR4s4vHMSjs259oJgPrx01Hc0ROKHlALBgN0/k5cS87DOq 8EXV25ao8XDks5TDc9CEmn+GRG3BTqwiH4/tKr1KhoQrDZHUeEGL0VodZ9oIoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665807; a=rsa-sha256; cv=none; b=GBlFHiHR2GTMuyY+2mKRJDpAma3Pm7IMkoL24Ts8261jrno768WfeZNiW2EE84FKcT4LB4 vuJE5ov/atMpBNvVMo7g4+mThahzYTalfjBYQKAhsUdDvrtYNRt0cG+7w0KQZPVQUqn2OH ExfB2pJXZ7r5Q6Mr6LrCmX5l5FYL37yqJt5enrfgmmwhzcptVlanZCOw/7BOI1TganrKVo i1z4FsywE8TYHe6zToqzP5mB40EhzzfAKndkQXJzLiYuLREixYegNfRDvXGz9Yk3tn4YfG 8MlS3Y+TAtkEB2Oa5Pmx9tL9UIau4UAJMtFIIfIDn4U6sXu9z+gM02OMVG/clQ== 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=1740665807; 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=6kVxoiZm87AuwS/ECDPSViv6BJoRpv2a8miKqtUq6mI=; b=rzVU5V89BD3bktLNPnwXtvGMMaPT255fyxFBBNzolWtggE1LMk4yAPjik4E6Bqb131OaGi AGvZ13lvG+Hkp9ZtW1s5iYHdERA58xXiCpRuMVgIhlG9Ar/ko/JSQigQfyces5cqal4zrA 8YLeBtBK9lmahV+lJ2FYdOyLEqKK50Gs22igxhqG9KHKwwunuUg3ABnfDLCA3QpfNichpN YX4XRvcAfLj5a4243QZObJVT0p/p80SfiFnema1p7LYgZgN9F3fNFyavke+RbP295ArTB9 VdZkxSQfDsoyqJKWzkN/qJ1WBXYNvmm18vQSlj9Dnu0CspY9eDWEYRKGLRBr+w== 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 4Z3YLQ70Jczmdt; Thu, 27 Feb 2025 14:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGkoX016127; Thu, 27 Feb 2025 14:16:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGkM7016124; Thu, 27 Feb 2025 14:16:46 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:46 GMT Message-Id: <202502271416.51REGkM7016124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 57720609f705 - stable/14 - powerpc: Add RF_LITTLEENDIAN resource flag 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57720609f705edaea4afc245d6f877530b741f69 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=57720609f705edaea4afc245d6f877530b741f69 commit 57720609f705edaea4afc245d6f877530b741f69 Author: John Baldwin AuthorDate: 2024-01-23 17:38:36 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 powerpc: Add RF_LITTLEENDIAN resource flag If this powerpc-specific flag is set on a resource, then the little-endian bus tag is always used when mapping that resource. Make use of this flag in the mpc85xx/fsl_sata driver to avoid setting the SATA BAR's bus tag after bus_alloc_resource. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D43553 (cherry picked from commit a82470212b7659afb7d3287e2ccae72d5e496b71) --- sys/powerpc/include/resource.h | 7 +++++++ sys/powerpc/mpc85xx/fsl_sata.c | 3 +-- sys/powerpc/powerpc/nexus.c | 10 ++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/powerpc/include/resource.h b/sys/powerpc/include/resource.h index 9477572176e0..e7e9493569cc 100644 --- a/sys/powerpc/include/resource.h +++ b/sys/powerpc/include/resource.h @@ -41,4 +41,11 @@ #define SYS_RES_IOPORT 4 /* i/o ports */ #define PCI_RES_BUS 5 /* PCI bus numbers */ +/* + * A powerpc-specific resource flag to request little-endian bus tags + * for a resource. + */ + +#define RF_LITTLEENDIAN RF_SPARE1 + #endif /* !_MACHINE_RESOURCE_H_ */ diff --git a/sys/powerpc/mpc85xx/fsl_sata.c b/sys/powerpc/mpc85xx/fsl_sata.c index 9279a8d43810..5fdd05282676 100644 --- a/sys/powerpc/mpc85xx/fsl_sata.c +++ b/sys/powerpc/mpc85xx/fsl_sata.c @@ -353,9 +353,8 @@ fsl_sata_attach(device_t dev) } ch->r_mid = 0; if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &ch->r_mid, RF_ACTIVE))) + &ch->r_mid, RF_ACTIVE | RF_LITTLEENDIAN))) return (ENXIO); - rman_set_bustag(ch->r_mem, &bs_le_tag); fsl_sata_dmainit(dev); fsl_sata_slotsalloc(dev); fsl_sata_init(dev); diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index a2043c3cfdf9..826e75daa374 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -276,14 +276,20 @@ nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, panic("%s:%d SYS_RES_IOPORT handling not implemented", __func__, __LINE__); /* XXX: untested map->r_bushandle = start; - map->r_bustag = nexus_get_bus_tag(NULL, NULL); + if ((rman_get_flags(r) & RF_LITTLEENDIAN) != 0) + map->r_bustag = &bs_le_tag; + else + map->r_bustag = nexus_get_bus_tag(NULL, NULL); map->r_size = length; map->r_vaddr = NULL; */ break; case SYS_RES_MEMORY: map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); - map->r_bustag = nexus_get_bus_tag(NULL, NULL); + if ((rman_get_flags(r) & RF_LITTLEENDIAN) != 0) + map->r_bustag = &bs_le_tag; + else + map->r_bustag = nexus_get_bus_tag(NULL, NULL); map->r_size = length; map->r_bushandle = (bus_space_handle_t)map->r_vaddr; break; From nobody Thu Feb 27 14:17:13 2025 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 4Z3YLy0ngvz5qG9s; Thu, 27 Feb 2025 14:17:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLy0DzCz3xBC; Thu, 27 Feb 2025 14:17:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665834; 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=VYTropdEDUYsxQnEzH7426OkbyxfL8u8JBGnDguToqE=; b=vm6+r6hcCT1QJUZdRwAp20h6BuYjzm3+9949MzKqL1MV685ACdFz9uRCRp3bR6bfbLJESn ceHeDoH8M6X+7Bxxq9NHUYH9NUZHom3HPwZp2xDBKeek3txWMLYTNvaeNb0DNhF8HDrbFm eqRwJgis62mqCZ4E+b7MD/WmLLZB78anvuUCSkv9HBLLjI2WRvFQaBqg/aHJ3wZfObTZm2 O77c2VU5dyyi6YwfXtT2ey2wy6YYf3VFqtB2yTF9o9j+iTS3pobBGg/UN7sUt+CyTkdkgV tcCBIwGnsBbCRkO8NZeRbb+4bqcYZIIqKFgXMAd8dz0JyExecI9EIsD2CFBzYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665834; a=rsa-sha256; cv=none; b=JYUlwhobY1TufSMv1nnJNjMk/lI1v29Jsh3mlH4bfvoCTa8QVhNuCLzUZwgL0gCxhIRPoW dJa0e7wNZlCWBGEeBFMNWfXd734ZzDh89u8qK3xXc8MkpUQ8WV1Lkc3izipPJKptzQJzVG jYX3zaO3n+KfiBcqilYBes5c8ozsji8WTENUz8Adcq6tQa3wUDkNF9eft4eiDrMpD4ME6P 4AsY/s9IRLGCxVm6Pm92HXLJNRGC0ziQsrGzd3v0IEbHx5ac/Khe/Tx3zzqAKR9qxeeEdn b6srsZCQTUPS4lN1S9IXQz0tMSNTs7UoFRRWEUQl91YW6uiAdOckUSWXxUG0/g== 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=1740665834; 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=VYTropdEDUYsxQnEzH7426OkbyxfL8u8JBGnDguToqE=; b=WbLXPhoki5WKbdpwMKmYX+Fmo9Hh+cSXpC+K0Elml8yP7oxSV9pvVyblcymwWg2Hb6EaLj tQjOofmIFlElDgS0JecEDdNHE517a8hu1NjYntP6wK1hJSltTxyxBRGv3L5as9uOKqtR6c /nKqabKhzAG6lNttY2YvCnRUHE4MAJGrzou9G5j02r6mymqrIEQLHqqszHo33wpt2zyVLG F79c3SmozINrwfhL70jICOBY9NNJQh5ci7MULZkbNdTPYdflCahNWsqNG3xxzAR3A0oe0B umDwGrLNp3A4R3fuHOAWTffNJpJcK8FzDno9jypcZWFAB/f0iXRL+qAUcfB+ZQ== 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 4Z3YLx6rf6zmqS; Thu, 27 Feb 2025 14:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHDf4016986; Thu, 27 Feb 2025 14:17:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHDJX016983; Thu, 27 Feb 2025 14:17:13 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:13 GMT Message-Id: <202502271417.51REHDJX016983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 799a372ecfb3 - stable/14 - pci_host_generic: Pass a valid end address in generic_pcie_translate_resource 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 799a372ecfb32ba405d34692caccce28be71fd02 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=799a372ecfb32ba405d34692caccce28be71fd02 commit 799a372ecfb32ba405d34692caccce28be71fd02 Author: John Baldwin AuthorDate: 2024-03-05 04:52:54 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 pci_host_generic: Pass a valid end address in generic_pcie_translate_resource The generic_pcie_containing_range helper added in commit d79b6b8ec267 assumed that the passed in (start, end) range used to locate the containing mapping range was a valid address range (with end >= start). The previous version of generic_pcie_translate_resource_common only used the start address to locate a mapping range, so the end address of 0 did not matter, but an end of 0 now causes the first range to match and an incorrect translation for resources using a later range. PR: 277211 Reported by: dch, tuexen Reviewed by: tuexen Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Differential Revision: https://reviews.freebsd.org/D44205 (cherry picked from commit 332dbd3a2f08a887014a425d2532af93503588ce) --- sys/dev/pci/pci_host_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 67b329b58685..0f85e23eb028 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -538,7 +538,7 @@ generic_pcie_translate_resource(device_t bus, int type, rman_res_t newend; /* unused */ return (generic_pcie_translate_resource_common( - bus, type, start, 0, newstart, &newend)); + bus, type, start, start, newstart, &newend)); } struct resource * From nobody Thu Feb 27 16:55:55 2025 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 4Z3ct40bhDz59J85; Thu, 27 Feb 2025 16:55:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct404rjz469x; Thu, 27 Feb 2025 16:55:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675356; 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=kFuIaVY3wmwive1sSFJ7/WEgzcyGsbedvplOTC1InNk=; b=lA8lupZpgCPBrUmtRrxxoSYqKHP+689EQNd/oHHrrOGiPqLZDC4fPrVCKAkl7nCMk6ocWT /I5r2nozaHMT91FDlLdQZXQK3QFG2wQILD0FWr5JKVekBC76qXHAZwRIkuaxXhAEX5sw7w t+l/zxzLhG0eH69+/Cg/nIn5XfwzONX6zj4kogXaq3Ps9e3G24PWmpRRgZwrPt7ID4xG54 7NCmUrExTQ7KIDMZrxcPP2oeIzq5XrjpE6KoV328pdGJVVGeAKG5dnKyDpl/3xdvKtJovC tBP5sOpyDdePYwqNhW55X0Z/4AShMp2/8HZtoByhfU1iKGaV/Cc7YJX06RcucA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675356; a=rsa-sha256; cv=none; b=yylgvdE05TyVK2miJPXDFIV01ohCf+sguF8qnwjwImYmHXQXkKoE0PUgNq8OGbm/RfWUR6 2/KLLfS0YS5t9DCLVzhMrWLnSyB/i3RXVEPzqmpPKiQNVJ3GatCTf7sqCbai36qTyXtrWP 075lAkbPHOL3gvRTtsMF7D/6WCu6bRgOcjpY6VCBIMHgFb5vpBjnDYPeYOW3XH12i+6zbv ojRmEcYwb+Ip6QtVucB9/ONiAcDo139D7gaIqbfNafVGZTuOgksiZK6CZf2AU8tiKp0Tnq rp1b2SWnjtRjaHYyvGO0G7HerS0WU2o3GRmeSrMc9AUjZP6cDaIxcobmEavM8A== 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=1740675356; 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=kFuIaVY3wmwive1sSFJ7/WEgzcyGsbedvplOTC1InNk=; b=ERrkwNnk5Ez/PKcQHrr8EqWIHWFJJb5SDeKh5TWkBgPQabaqMb2z/WUsdKtWFVMJIjW8Ig NLQaglhwtO00FoZajKKr0sQ+1I/YZ/lkkbP7abFowhFZSNLB/5g5kaXyyE5S881XDQux7E xwmAqqcN3vT+HsyLqOE26/pxrSgQck8hc2fvAjyOAU2/h8BmBEGkCZvNCT5nLu1AW9eqvZ rssKS/58wGh5iZuQI97MeSO0DEmZ5yuCKNGphCK4cKE/hn3erimEG0gqEISdvy94wpXycd xzbI/L2dLTsh0pEYGlqkD1ssd35mg5CJt6Tm+gF76cnkA9uOqCL2eJEKu9giHQ== 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 4Z3ct36kpmzrts; Thu, 27 Feb 2025 16:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGttVD017062; Thu, 27 Feb 2025 16:55:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGttdQ017059; Thu, 27 Feb 2025 16:55:55 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:55 GMT Message-Id: <202502271655.51RGttdQ017059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: aa2b4a172621 - stable/14 - stand/usb: Quiet warnings so this builds again 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aa2b4a172621037e34ee3154e09f574c4135fdb4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aa2b4a172621037e34ee3154e09f574c4135fdb4 commit aa2b4a172621037e34ee3154e09f574c4135fdb4 Author: John Baldwin AuthorDate: 2025-01-11 04:02:46 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:25:10 +0000 stand/usb: Quiet warnings so this builds again Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D48411 (cherry picked from commit f6f5aa8a2df5910b0769ab7cd0e6199c9b2ab624) --- stand/usb/Makefile | 2 +- stand/usb/test/Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stand/usb/Makefile b/stand/usb/Makefile index 0a1c9e0022ee..a9c20fc340ad 100644 --- a/stand/usb/Makefile +++ b/stand/usb/Makefile @@ -35,7 +35,7 @@ INTERNALLIB= CFLAGS+= -DBOOTPROG=\"usbloader\" CFLAGS+= -ffunction-sections -fdata-sections -CFLAGS+= -Wformat -Wall +CFLAGS+= -Wformat -Wall -Wno-unused CFLAGS+= -g CFLAGS+= -fno-pic diff --git a/stand/usb/test/Makefile b/stand/usb/test/Makefile index 74e501a39ae7..d92ef6dddecb 100644 --- a/stand/usb/test/Makefile +++ b/stand/usb/test/Makefile @@ -35,6 +35,7 @@ PROG= usbloader SRCS= CFLAGS+= -Wall +CFLAGS+= -Wno-error=missing-prototypes -Wno-error=unused-parameter CFLAGS+= -g .if ${MACHINE_CPUARCH} == "amd64" From nobody Thu Feb 27 14:16:27 2025 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 4Z3YL40bp6z5qGFK; Thu, 27 Feb 2025 14:16:28 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL402Tsz3xHv; Thu, 27 Feb 2025 14:16:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665788; 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=Mkuol3FMJKvBZSCpSUuUKGWEs17KyFnSe3UAzOqpLwE=; b=v9Yv1RvUxuSmSlwXyl8E2J8iG9wZLk2LefrH7sDyiNCxG4kdNSNFGXfjvUFYRYBSUtgtuV OxCslvU0fqi2+1FGsKlePn33O5iouCllIQwxn6KdUdyZhiQnqqgMoiDgpxLKcXC87BPzjA AcngHQQWuNn0QvGmMRzEVNh57rKFcCaZK6i494rIScI4B4kj8LBbcySyg7YHbK2nQq/lPu T2jXqcdi5qP6idOW2NGHcEpckm88+T8vMBQ2vXEW9ajLy97g7JrLFgaATLMP3odm8fyym0 F3INkCw3NvsRA14iVo3IJLkdgwmIjgjOSQNPc+II/12/Yu1NYuF8oT43C/e3KQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665788; a=rsa-sha256; cv=none; b=lMZqEhoTsc56H9r/PsjnQwNosmMwJG3IgePkciQcOfKLwiAYaTI7xgfUuqEZaP5PtRkKWB 5nZ1oJm0dORqCJdSdxBGhs1uRoG+CBVFlbLmcvpJ2x/OUoM64vhgkJIpIRS0PuvMSkmBf8 F2HL5o6txKY7RXhws04Igqve7WxQdnms3IFSlpdjqJSIbA+kI+7mDJtjwN7mlIjtm7qZyc Wdn23ulhpxV0xmTZHDYb4sNo2M9H6UXx9SKbONkuyrBoAvBZG0XV/szCZCoMlEQ8Xnwdnk /ykuVNnpjfRJilR4DjT87c6wXE8eSRLk9gzQMRDDo5Bsz7JYgYmrZJ2rw/GWBQ== 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=1740665788; 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=Mkuol3FMJKvBZSCpSUuUKGWEs17KyFnSe3UAzOqpLwE=; b=YdRrYDUB/HpXzr5lqOm5bvzipBcf86X9t0b3+ErIdPLAMNQmyWMqcgJAAB2zdewNcJOcR/ 24MCxx8oCkiIM4Qa3yzaPio7iq0sFJLA4pAJ6rHW29z+leZ5OAtiJEvQMTV/K1cmL/aOp3 MrThceBqnkV9OyB+evXkqSLs3h6/ZMKzsprzSqishy+Wq7psawFko2UAO0IitCJl4I04e0 t63eEnkQP8pf62DXFsT2QLZ0YtQ7pub58HFNV/E96F/dbHMrDCFKfA81+nzvawpBKCUurX JqQp+NzDbqIR8edx9OO5tbVZ6WcDb58vVT54n1uKCu5QrrVJymyS7OGJOPD3gA== 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 4Z3YL36YBPzmbV; Thu, 27 Feb 2025 14:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGR9h015518; Thu, 27 Feb 2025 14:16:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGRC8015515; Thu, 27 Feb 2025 14:16:27 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:27 GMT Message-Id: <202502271416.51REGRC8015515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a5275ec0a89f - stable/14 - pcib: Add helper routines for [de]activating PCI_RES_BUS resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a5275ec0a89f6145603e22b8973daedb609d3f39 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a5275ec0a89f6145603e22b8973daedb609d3f39 commit a5275ec0a89f6145603e22b8973daedb609d3f39 Author: John Baldwin AuthorDate: 2024-01-23 17:35:08 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:19 +0000 pcib: Add helper routines for [de]activating PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43427 (cherry picked from commit 23e3b83ab61a440ccce20da7fbf1340d58db361c) --- sys/dev/pci/pci_subr.c | 32 ++++++++++++++++++++++++++++++++ sys/dev/pci/pcib_private.h | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c index 71485875ebe3..d0f6c9500b17 100644 --- a/sys/dev/pci/pci_subr.c +++ b/sys/dev/pci/pci_subr.c @@ -379,6 +379,38 @@ pci_domain_release_bus(int domain, device_t dev, int rid, struct resource *r) #endif return (rman_release_resource(r)); } + +int +pci_domain_activate_bus(int domain, device_t dev, int rid, struct resource *r) +{ +#ifdef INVARIANTS + struct pci_domain *d; +#endif + + if (domain < 0 || domain > PCI_DOMAINMAX) + return (EINVAL); +#ifdef INVARIANTS + d = pci_find_domain(domain); + KASSERT(rman_is_region_manager(r, &d->pd_bus_rman), ("bad resource")); +#endif + return (rman_activate_resource(r)); +} + +int +pci_domain_deactivate_bus(int domain, device_t dev, int rid, struct resource *r) +{ +#ifdef INVARIANTS + struct pci_domain *d; +#endif + + if (domain < 0 || domain > PCI_DOMAINMAX) + return (EINVAL); +#ifdef INVARIANTS + d = pci_find_domain(domain); + KASSERT(rman_is_region_manager(r, &d->pd_bus_rman), ("bad resource")); +#endif + return (rman_deactivate_resource(r)); +} #endif /* PCI_RES_BUS */ #endif /* NEW_PCIB */ diff --git a/sys/dev/pci/pcib_private.h b/sys/dev/pci/pcib_private.h index d4c66407d739..bc0b48d9f031 100644 --- a/sys/dev/pci/pcib_private.h +++ b/sys/dev/pci/pcib_private.h @@ -160,6 +160,10 @@ int pci_domain_adjust_bus(int domain, device_t dev, struct resource *r, rman_res_t start, rman_res_t end); int pci_domain_release_bus(int domain, device_t dev, int rid, struct resource *r); +int pci_domain_activate_bus(int domain, device_t dev, int rid, + struct resource *r); +int pci_domain_deactivate_bus(int domain, device_t dev, int rid, + struct resource *r); struct resource *pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); From nobody Thu Feb 27 14:17:29 2025 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 4Z3YMF5ykSz5qGLk; Thu, 27 Feb 2025 14:17: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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YMF5McRz3xHd; Thu, 27 Feb 2025 14:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665849; 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=1+UII0slfC6Zt51HS/8KmdalOtDSZ4tNO6ZM6KgbsSo=; b=cNv7h7ymMlaI0/fr4UvxIGvnBWs4z2qGyVnARkLaPO6LInBexWYbOY9b+2FzOkHUjWDbT9 0pCnpKnuubqiFiim6TBBEoAexWOxgdoFXPg/G8r1zwsaNDHr4P9yF3MKLKFhGFd9MOUU7y puMzucbloQkbBkX0lMx9i08Cw2xluEVRR9etsNUbQYXFAL0uV2hrO/Od+uY3zmWZsEdFZb 6YuiWvE0h2/2rOEe4Hp4aNHX61UDDMxh8iFixLBXirmvD3JB5uaJez0DU5ZfK3+mZqR34V RPcuMAOGTmDZpImPxw8NLQa7SUv217dreRcnVlZ9LAArqLQ5hsZ2qUJ4T3KDnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665849; a=rsa-sha256; cv=none; b=SvYUS3+k47WrrmI1KHSxcehzaT0Vy48lG8YjU3fAvcqhW1d/PKxZp0D+pfG4DCInbsFuNA bnkQMrw9QkO8w/F3eBfxSJm6TDEI3D3JJxn8d8W3t+vlLx8pRGQSMmQ4u6CC3xQwIC84GD G5LdZVObGKaTu419W8j2AcX3ls5eNd22cnPcPrlI67C5VKZOCw8jNaHkQma49IT07IOnaW 2KsQf5jqk+gsvJcbUalwHgogAgQpDgtI8GtHus1LDbWlW/H7Af3zhw2jZZmwWn87bdjn6f qTXvhIw0skLxxG0DgcaA9iZ3Ly8GL/d+7WUmVc4aMFvVPq1DigT2PpCISkQSaQ== 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=1740665849; 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=1+UII0slfC6Zt51HS/8KmdalOtDSZ4tNO6ZM6KgbsSo=; b=nU+F5rCQ/R5twgiD3c4bXZr8Rp4LOr9DrBWb3YAoeV+npQJE3WbAZd6dL+o0W7YuU1Gmyy vL6VmBxP6561yMuhG81CVxTCBjPCuJ0XndFdDen8XcfQgJfjWK5HP5nsXDGzBjcYveaGH4 MoE/MtDKbV3g9TiOQvTn/DUrngYOmGLN1xL57T4Amz/a7kxuvZICVSRJoIJkoY1ZMFRPx3 qqp8H0CuWt0bzUlMaI058pkvs9UnrnqQ8VGF0JjoIKvG00LTltjO7iYzwdP06PrWAAn05q feCcgjqX7sRPAWlO2M5P4+bBef9+VT9jqz9EFxv3wWzsF6SD4TxORcON5ChZvA== 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 4Z3YMF4vQSzmZY; Thu, 27 Feb 2025 14:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHTDM017468; Thu, 27 Feb 2025 14:17:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHTxw017465; Thu, 27 Feb 2025 14:17:29 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:29 GMT Message-Id: <202502271417.51REHTxw017465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0787c99b477e - stable/14 - pci(4): unbreak the build 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0787c99b477e92b6beb22d3c9e5a8c27fae29c12 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0787c99b477e92b6beb22d3c9e5a8c27fae29c12 commit 0787c99b477e92b6beb22d3c9e5a8c27fae29c12 Author: Enji Cooper AuthorDate: 2024-06-05 04:16:48 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 pci(4): unbreak the build `argsp` is not defined in `generic_pcie_unmap_resource(..)`. Remove the parameter passed to `bus_generic_unmap_resource(..)` as this parameter is never passed to `generic_pcie_unmap_resource(..)`. Fixes: 98056127ddfa ("acpi/pci/vmd: Fix a nit with nested resource mapping requests") Reported by: Jenkins (aarch64, armv6, armv7, etc) Differential Revision: https://reviews.freebsd.org/D45493 (cherry picked from commit 637ee1391957acb3ae0f68aef3e2fad76a5ae338) --- sys/dev/pci/pci_host_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 4fd8c3b42250..19a2ec419ad0 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -672,7 +672,7 @@ generic_pcie_unmap_resource(device_t dev, device_t child, int type, case SYS_RES_MEMORY: break; default: - return (bus_generic_unmap_resource(dev, child, type, r, argsp, map)); + return (bus_generic_unmap_resource(dev, child, type, r, map)); } range = generic_pcie_containing_range(dev, type, rman_get_start(r), From nobody Thu Feb 27 16:55:53 2025 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 4Z3ct15rpKz59J61; Thu, 27 Feb 2025 16:55:53 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3ct15GbMz46Gf; Thu, 27 Feb 2025 16:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675353; 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=JlL8ipzl4X9KKNfPHq0Lip2lRTPr3I2PAj8HIFugKeo=; b=sh0cCDxGeZQJ83Scmq2sA74XX2f1NvFLB+jpI16Q1RqnltZdnPi2jXzNJZhKYuxU+oN5xB 0Gzgoq3YagjOvArgbS9tggzN3Bn+ulq+hjBVKfqVrcceClDjE8SKtBBqKTICYVw7sej4Ar aIrla68CldtbY4WspgqhA5ei2Umd4f4E/PYClU+DK0I5OV+gdi+jLherdady/kHq+zAVvJ 6qTrq/kEGFkNzt+/8UXewvcpx6Tlu3DxN1zj3CYUlHmB5Y2aC5EeBG+Zfjo89Pu9cdySAo dIPoUTzxrhi9DLcaUyHEHz37fL4q2KuAPL/izGGmKfktWiXcS8qGZdh+f9FVnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675353; a=rsa-sha256; cv=none; b=AAI5l+yyJEkm8OybkXNZh548ki7qF9xq9C82/HSKTYrgImo+CHxAjSpSazn3VDwUgyLyVT KXcjiwOV9JqnwCCuZMYjBI6d4V/G6nWWE+1V0QeATNcaBk+5TQGOg5BQ31F7Y9vY5iio7E 6jeHPQ/WmPgbeGKJuWWOFKh7ZcFjHFZgd9xgRPNR8jQgqMqLznLr7bexzFv/uuVyrzZzls EsdqcGB+cjsG9tHkeFMSA5uhvapGWXGLagU/MbKE9pGiH0db+++zk+B7jrHwBLMxgodWJn ty2TghVbqX5d04w85w9ofdpGu4jsshycKE+o7a9qey0qYSGU76o05RyUi3/iOw== 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=1740675353; 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=JlL8ipzl4X9KKNfPHq0Lip2lRTPr3I2PAj8HIFugKeo=; b=i2x8Ei5q/UAYgx+1/LRI9QxRpdXGIfhKINnHEAJUW+Sz1EgR8eOT0FiNxu/47T/IzQBert 8r0HbH8pxGgZNmMUL+9S8zE+BXL7YodPlRLaHOWd78IUiq+UOhrBrGqGIdqdL4adKoG/TO IrbvoLggUNl7MQoyCpAyPiXSjvGLgCBqlNgsv7NGjOmrKzTfpSJV7tVzbD11W5UmDGIrbl kvl7mqsDHG7MYYu7AWUZc2gpt9JNmoIdpHGS3IpITMnbRuhDzf0jsG44xdNNtmHH9gQueE XTAWLkp8Ep9RMYfiiJF95Q+OUWY23EYfj8s8bA8tFMHN6BEXs6aJ8zimfx+1uA== 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 4Z3ct14ZRpzrkC; Thu, 27 Feb 2025 16:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RGtrdR016987; Thu, 27 Feb 2025 16:55:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RGtrBn016984; Thu, 27 Feb 2025 16:55:53 GMT (envelope-from git) Date: Thu, 27 Feb 2025 16:55:53 GMT Message-Id: <202502271655.51RGtrBn016984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4aed8b3b613c - stable/14 - new-bus: Add bus_(identify|attach|detach)_children 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4aed8b3b613c5e1499336e4d7ec7e9a3ac3d9a12 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4aed8b3b613c5e1499336e4d7ec7e9a3ac3d9a12 commit 4aed8b3b613c5e1499336e4d7ec7e9a3ac3d9a12 Author: John Baldwin AuthorDate: 2024-12-06 22:25:04 +0000 Commit: John Baldwin CommitDate: 2025-02-27 15:19:24 +0000 new-bus: Add bus_(identify|attach|detach)_children These correspond to the current implementations of bus_generic_(probe|attach|detach) but with more accurate names and semantics. The intention is to deprecate bus_generic_(probe|attach) and reimplement bus_generic_detach in a future commit. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47673 (cherry picked from commit 46297859a74563dde6fc5bff9f9ecded9fb61ba6) bus_generic_(probe|attach|detach) will not be changed in stable/14, but providing the new APIs in stable/14 permits drivers to use the new APIs. --- sys/kern/subr_bus.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++----- sys/sys/bus.h | 4 ++++ sys/sys/param.h | 2 +- 3 files changed, 65 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 5d1a13c08892..b71a46edc544 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3401,6 +3401,22 @@ bus_generic_add_child(device_t dev, u_int order, const char *name, int unit) */ int bus_generic_probe(device_t dev) +{ + bus_identify_children(dev); + return (0); +} + +/** + * @brief Ask drivers to add child devices of the given device. + * + * This function allows drivers for child devices of a bus to identify + * child devices and add them as children of the given device. NB: + * The driver for @param dev must implement the BUS_ADD_CHILD method. + * + * @param dev the parent device + */ +void +bus_identify_children(device_t dev) { devclass_t dc = dev->devclass; driverlink_t dl; @@ -3419,8 +3435,6 @@ bus_generic_probe(device_t dev) continue; DEVICE_IDENTIFY(dl->driver, dev); } - - return (0); } /** @@ -3432,14 +3446,29 @@ bus_generic_probe(device_t dev) */ int bus_generic_attach(device_t dev) +{ + bus_attach_children(dev); + return (0); +} + +/** + * @brief Probe and attach all children of the given device + * + * This function attempts to attach a device driver to each unattached + * child of the given device using device_probe_and_attach(). If an + * individual child fails to attach this function continues attaching + * other children. + * + * @param dev the parent device + */ +void +bus_attach_children(device_t dev) { device_t child; TAILQ_FOREACH(child, &dev->children, link) { device_probe_and_attach(child); } - - return (0); } /** @@ -3453,7 +3482,7 @@ int bus_delayed_attach_children(device_t dev) { /* Probe and attach the bus children when interrupts are available */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + config_intrhook_oneshot((ich_func_t)bus_attach_children, dev); return (0); } @@ -3467,6 +3496,32 @@ bus_delayed_attach_children(device_t dev) */ int bus_generic_detach(device_t dev) +{ + int error; + + error = bus_detach_children(dev); + if (error != 0) + return (error); + + return (0); +} + +/** + * @brief Detach drivers from all children of a device + * + * This function attempts to detach a device driver from each attached + * child of the given device using device_detach(). If an individual + * child fails to detach this function stops and returns an error. + * NB: Children that were successfully detached are not re-attached if + * an error occurs. + * + * @param dev the parent device + * + * @retval 0 success + * @retval non-zero a device would not detach + */ +int +bus_detach_children(device_t dev) { device_t child; int error; diff --git a/sys/sys/bus.h b/sys/sys/bus.h index c1391c4a7284..91a54b93a1db 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -597,8 +597,12 @@ void bus_delete_resource(device_t dev, int type, int rid); int bus_child_present(device_t child); int bus_child_pnpinfo(device_t child, struct sbuf *sb); int bus_child_location(device_t child, struct sbuf *sb); + +void bus_attach_children(device_t dev); +int bus_detach_children(device_t dev); void bus_enumerate_hinted_children(device_t bus); int bus_delayed_attach_children(device_t bus); +void bus_identify_children(device_t dev); static __inline struct resource * bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags) diff --git a/sys/sys/param.h b/sys/sys/param.h index 0e91a65170df..914433bace0e 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1402502 +#define __FreeBSD_version 1402503 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Feb 27 14:16:50 2025 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 4Z3YLV5cshz5qGJj; Thu, 27 Feb 2025 14:16:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLV3S7Mz3xGR; Thu, 27 Feb 2025 14:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665810; 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=Gtk4Cx5/p8mcrwK33jqA3UkU8UlgLFEpjklLv994960=; b=V5+oRgZfy86HZ8jD9BjIaUATjW4xM6x+UsY3rYQiwwxVIJdx41iPYDwA68c2WBt4UERPc4 gpiwEzZUqb+qhZTguGYRIMOjKIn1GZNwOnu2Hmxu9aJf6IwmJRwgFgHnssDsUcU1158LMm izUp0+1FavE+3Jkh3THrzk+ubLggs1WbP/TTrgmKIZ4PGMIgqO2/yMwqhhaF85tyeCkaTW rwFiutL5CqjAN+/Vo/v0mOeeSU01V4srrLA2HXOs+B8n3PPWOlJjYegAalQfLzR5QD9w3S hze50YlEQlzPpygAOGopgbbY05s0QRFYzcujVWArWqWMv3E6TjJJhrz2Hxxr8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665810; a=rsa-sha256; cv=none; b=NQGKUQadbxd/V2mkIpwCm+U08CmibXODoEP8GsoyWszEi/GbOUMWRHQ3xS0nK3JvhBP/CT p8rUwHyC5wa6RNkoLPj01lM1t4fy+mHQqb24MnvXaK+RasdFZqyZCXKmu0ET/rYnBo93BA 9U9tbLjcq+IXWqhN3vYHmxGYVWhD8E5Z6+fDRocwKIFCCUju2S/NsvZyh65hSR6IO36q0I ohp933UW+Xu9xdN1Q495lS59knrpm5nu5zZUCTOr4pUUvaoIs+o3KRP2zXT9bg9s1v5UBJ 6IWltTOoLlpA334PyCpUBQ+RKgg4ovkCjBROST13QnWM5a9JcAPnOoH1TgXByA== 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=1740665810; 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=Gtk4Cx5/p8mcrwK33jqA3UkU8UlgLFEpjklLv994960=; b=d8DtXVvklXr8udNWWbDwtwbUbkFVvHsZAnbG9vhpwKkpGhmL5mbECSBwJQ5YpM3b65QA20 AUXLZjZZQshnje/3cDeuxJHCiPBNzc6BMTCyEySBZ7SOESLkrupGHp6OKo0l/DdwGpdMs9 ocOuGjeK7KQdxiu00vE1IGeodaiSRT/wF7PjPlS3lDBy3uiWXNz2iR6JfaqaNTaPjXS+T1 kY8dhT1ZBSCn0ofwxm1W3Q9d3OhTkseyMiPM61J33f7xgtPNw+vUtEZ2AcZO6fE0rTGLzE nd1XEn+j78bdzbYfKFtywVGbEbU3ujsxuzmMnnWVQWVOaBJ1Q88WhVct19GDrw== 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 4Z3YLV32cTzmqN; Thu, 27 Feb 2025 14:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGosD016233; Thu, 27 Feb 2025 14:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGoQT016230; Thu, 27 Feb 2025 14:16:50 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:50 GMT Message-Id: <202502271416.51REGoQT016230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 621c8145b81a - stable/14 - pcib: Refine handling of resources allocated from bridge windows 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 621c8145b81a42e412256e5b6a4088d8e54042d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=621c8145b81a42e412256e5b6a4088d8e54042d8 commit 621c8145b81a42e412256e5b6a4088d8e54042d8 Author: John Baldwin AuthorDate: 2024-02-09 18:27:45 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pcib: Refine handling of resources allocated from bridge windows Fix a long-standing layering violation in the original NEW_PCIB code by not passing suballocated resources up to the parent bus for activation and mapping. Instead, handle activation and mapping of sub-allocated resources in this driver. When mapping resources, request a mapping from a suitable sub-region of the resource allocated from the parent bus for the associated bridge window. Note that this does require passing RF_ACTIVE (with RF_UNMAPPED) when allocating bridge window resources from the parent. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43690 (cherry picked from commit b377ff8110e3489eb6e6b920b51a2384dfc4eb0b) --- sys/dev/pci/pci_pci.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 5286d4e82e53..02fa8cf1fb9e 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -66,6 +66,10 @@ static bus_alloc_resource_t pcib_alloc_resource; #ifdef NEW_PCIB static bus_adjust_resource_t pcib_adjust_resource; static bus_release_resource_t pcib_release_resource; +static bus_activate_resource_t pcib_activate_resource; +static bus_deactivate_resource_t pcib_deactivate_resource; +static bus_map_resource_t pcib_map_resource; +static bus_unmap_resource_t pcib_unmap_resource; #endif static int pcib_reset_child(device_t dev, device_t child, int flags); @@ -108,12 +112,16 @@ static device_method_t pcib_methods[] = { #ifdef NEW_PCIB DEVMETHOD(bus_adjust_resource, pcib_adjust_resource), DEVMETHOD(bus_release_resource, pcib_release_resource), + DEVMETHOD(bus_activate_resource, pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, pcib_deactivate_resource), + DEVMETHOD(bus_map_resource, pcib_map_resource), + DEVMETHOD(bus_unmap_resource, pcib_unmap_resource), #else DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), -#endif DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), +#endif DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_reset_child, pcib_reset_child), @@ -381,7 +389,7 @@ alloc_ranges(rman_res_t start, rman_res_t end, void *arg) device_printf(as->sc->dev, "allocating non-ISA range %#jx-%#jx\n", start, end); as->res[as->count] = bus_alloc_resource(as->sc->dev, SYS_RES_IOPORT, - &rid, start, end, end - start + 1, 0); + &rid, start, end, end - start + 1, RF_ACTIVE | RF_UNMAPPED); if (as->res[as->count] == NULL) as->error = ENXIO; else @@ -454,7 +462,7 @@ pcib_alloc_window(struct pcib_softc *sc, struct pcib_window *w, int type, else { rid = w->reg; res = bus_alloc_resource(sc->dev, type, &rid, w->base, w->limit, - w->limit - w->base + 1, flags); + w->limit - w->base + 1, flags | RF_ACTIVE | RF_UNMAPPED); if (res != NULL) pcib_add_window_resources(w, &res, 1); } @@ -2001,7 +2009,7 @@ pcib_alloc_new_window(struct pcib_softc *sc, struct pcib_window *w, int type, count = roundup2(count, (rman_res_t)1 << w->step); rid = w->reg; res = bus_alloc_resource(sc->dev, type, &rid, start, end, count, - flags & ~RF_ACTIVE); + flags | RF_ACTIVE | RF_UNMAPPED); if (res == NULL) return (ENOSPC); pcib_add_window_resources(w, &res, 1); @@ -2452,6 +2460,120 @@ pcib_release_resource(device_t dev, device_t child, int type, int rid, } return (bus_generic_release_resource(dev, child, type, rid, r)); } + +static int +pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct pcib_softc *sc = device_get_softc(dev); + struct resource_map map; + int error; + + if (!pcib_is_resource_managed(sc, type, r)) + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + + error = rman_activate_resource(r); + if (error != 0) + return (error); + + if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && + (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { + error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map); + if (error != 0) { + rman_deactivate_resource(r); + return (error); + } + + rman_set_mapping(r, &map); + } + return (0); +} + +static int +pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct pcib_softc *sc = device_get_softc(dev); + struct resource_map map; + int error; + + if (!pcib_is_resource_managed(sc, type, r)) + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + + error = rman_deactivate_resource(r); + if (error != 0) + return (error); + + if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && + (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { + rman_get_mapping(r, &map); + BUS_UNMAP_RESOURCE(dev, child, type, r, &map); + } + return (0); +} + +static struct resource * +pcib_find_parent_resource(struct pcib_window *w, struct resource *r) +{ + for (int i = 0; i < w->count; i++) { + if (rman_get_start(w->res[i]) <= rman_get_start(r) && + rman_get_end(w->res[i]) >= rman_get_end(r)) + return (w->res[i]); + } + return (NULL); +} + +static int +pcib_map_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct pcib_softc *sc = device_get_softc(dev); + struct resource_map_request args; + struct pcib_window *w; + struct resource *pres; + rman_res_t length, start; + int error; + + w = pcib_get_resource_window(sc, type, r); + if (w == NULL) + return (bus_generic_map_resource(dev, child, type, r, argsp, + map)); + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + pres = pcib_find_parent_resource(w, r); + if (pres == NULL) + return (ENOENT); + + args.offset = start - rman_get_start(pres); + args.length = length; + return (bus_generic_map_resource(dev, child, type, pres, &args, map)); +} + +static int +pcib_unmap_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + struct pcib_softc *sc = device_get_softc(dev); + struct pcib_window *w; + + w = pcib_get_resource_window(sc, type, r); + if (w != NULL) { + r = pcib_find_parent_resource(w, r); + if (r == NULL) + return (ENOENT); + } + return (bus_generic_unmap_resource(dev, child, type, r, map)); +} #else /* * We have to trap resource allocation requests and ensure that the bridge From nobody Thu Feb 27 14:16:35 2025 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 4Z3YLC6Fjlz5qGJf; Thu, 27 Feb 2025 14:16:35 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLC5l5xz3x9H; Thu, 27 Feb 2025 14:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665795; 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=/zmUIpqLuWE22dqqYkFDAAhvZ5cizYJ484HakKZHzY8=; b=QisaTcXS4010bxcpfV0JWwhc7ygw/iYyOhAc/F4eXZ2C9vq03hcbntxHEPYKMY9Hqq3+yq RbP+XgTp1iQd4D7gpfZzW9qREK3xW3nDHfVMfwteVVu8X2e3fpv5B6QQSxSXSzqA21nB6a FiTXrrYMenvFcf4vlGMtju1rvaTCQWN/0x6YrAZ5M8O0/Jh5YMKkyStLD0tkf1ofPHguKq EIHNsyHxj+n8m61+bV+wIqnNqyqxJyhKCMb8fMwCwCETvdWyLmpV0mDPr43gkvk11N5rIG 6ZLaXciW8vkHuGCTgoX8lEi2BEe8ycgRBqjtuYA7Tjr9sACW968gfiSFqhydTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665795; a=rsa-sha256; cv=none; b=pWbm0BxmgUOmF3qAic0++0ffFUjVvwm4SMLNSs48wc0WCpltxHU6quOQsbblbQWmxY7Kuu 3sOd22n0jaInkUXYGwrULmsrzQqmfViijQeMR8mAv3Z743bDymc40C+W2NNE53qZn/BUeW Bgo+tHjcJsjl3RBi4D+KegbydewwviMpu9KJ4aljpP2jAzkuonIfm+q4pNvrVXAggTz0l0 Umu4r/0crTBrLHoEmW8RJyvTmRTpwtwRrMu8jOTsSmKDBPjhNR9JgwXjSLyHqSFHp2X8bf K9QgHfBotfYXXRyJ0vKrnINGdJqxz0nhBhiEF7jhw+U1l6hxUSRlkSzf4qfeMw== 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=1740665795; 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=/zmUIpqLuWE22dqqYkFDAAhvZ5cizYJ484HakKZHzY8=; b=GSJunuBYw4EuXRoUSeqmx/FjbAXuxeyctlc3u2hVRYN4BZ9uuZw8j8p4+X8ZdsrnKZ2bIU qoJhAOnmXAyFHU9kQCPYd5kRbs7xTMzlt6diRHfRjjZYvMp+JizshWXUjavg+VtT4fChCP EAZp3Gb2+il2jnuCI2BI9ewrF39oJ59iTNU0R8UCJ3mrQZEXmeiaC9wofEQpNYVWikO/wT MK0ktqt3gASG8E1TC5tk8SOFoVtjcZod+On9tccuuimDAzgH2aH8pAna+58v7RLX1VHzPg zdP0CJP8aSYx0PZBjkR6wRLPa5K78evf+w9RB954zXUgJ9DTp2AxWB3/i6AQvQ== 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 4Z3YLC5HKhzmZL; Thu, 27 Feb 2025 14:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGZfZ015760; Thu, 27 Feb 2025 14:16:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGZDE015757; Thu, 27 Feb 2025 14:16:35 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:35 GMT Message-Id: <202502271416.51REGZDE015757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 14c7df4ec04f - stable/14 - powerpc mpc85xx: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14c7df4ec04f8a79f7c4db119a26bd23bbb4a509 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=14c7df4ec04f8a79f7c4db119a26bd23bbb4a509 commit 14c7df4ec04f8a79f7c4db119a26bd23bbb4a509 Author: John Baldwin AuthorDate: 2024-01-23 17:36:37 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc mpc85xx: Use bus_generic_rman_* - Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY for bus_activate/deactivate/adjust/release_resource. - Implement bus_map/unmap_resource. - Add an implementation of bus_adjust_resource. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D43434 (cherry picked from commit 5a7e717fb790842eddf766363d337ec879b3b513) --- sys/powerpc/mpc85xx/lbc.c | 185 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 137 insertions(+), 48 deletions(-) diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c index 3652b20984a6..52e28a5fb1cb 100644 --- a/sys/powerpc/mpc85xx/lbc.c +++ b/sys/powerpc/mpc85xx/lbc.c @@ -70,13 +70,20 @@ static MALLOC_DEFINE(M_LBC, "localbus", "localbus devices information"); static int lbc_probe(device_t); static int lbc_attach(device_t); static int lbc_shutdown(device_t); -static int lbc_activate_resource(device_t bus __unused, device_t child __unused, - int type, int rid __unused, struct resource *r); -static int lbc_deactivate_resource(device_t bus __unused, - device_t child __unused, int type __unused, int rid __unused, +static int lbc_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); +static int lbc_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *map); +static int lbc_activate_resource(device_t bus, device_t child, + int type, int rid, struct resource *r); +static int lbc_deactivate_resource(device_t bus, + device_t child, int type __unused, int rid, struct resource *r); +static struct rman *lbc_get_rman(device_t, int, u_int); static struct resource *lbc_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int lbc_adjust_resource(device_t, device_t, int, struct resource *, + rman_res_t, rman_res_t); static int lbc_print_child(device_t, device_t); static int lbc_release_resource(device_t, device_t, int, int, struct resource *); @@ -96,10 +103,14 @@ static device_method_t lbc_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, NULL), + DEVMETHOD(bus_get_rman, lbc_get_rman), DEVMETHOD(bus_alloc_resource, lbc_alloc_resource), + DEVMETHOD(bus_adjust_resource, lbc_adjust_resource), DEVMETHOD(bus_release_resource, lbc_release_resource), DEVMETHOD(bus_activate_resource, lbc_activate_resource), DEVMETHOD(bus_deactivate_resource, lbc_deactivate_resource), + DEVMETHOD(bus_map_resource, lbc_map_resource), + DEVMETHOD(bus_unmap_resource, lbc_unmap_resource), /* OFW bus interface */ DEVMETHOD(ofw_bus_get_devinfo, lbc_get_devinfo), @@ -673,22 +684,31 @@ lbc_shutdown(device_t dev) return(0); } +static struct rman * +lbc_get_rman(device_t bus, int type, u_int flags) +{ + struct lbc_softc *sc; + + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + return (&sc->sc_rman); + default: + return (NULL); + } +} + static struct resource * lbc_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { - struct lbc_softc *sc; struct lbc_devinfo *di; struct resource_list_entry *rle; - struct resource *res; - struct rman *rm; - int needactivate; /* We only support default allocations. */ if (!RMAN_IS_DEFAULT_RANGE(start, end)) return (NULL); - sc = device_get_softc(bus); if (type == SYS_RES_IRQ) return (bus_alloc_resource(bus, type, rid, start, end, count, flags)); @@ -703,6 +723,10 @@ lbc_alloc_resource(device_t bus, device_t child, int type, int *rid, if (type == SYS_RES_IOPORT) type = SYS_RES_MEMORY; + /* + * XXX: We are supposed to return a value to the user, so this + * doesn't seem right. + */ rid = &di->di_bank; rle = resource_list_find(&di->di_res, type, *rid); @@ -715,32 +739,8 @@ lbc_alloc_resource(device_t bus, device_t child, int type, int *rid, count = rle->count; end = start + count - 1; - sc = device_get_softc(bus); - - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - - rm = &sc->sc_rman; - - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) { - device_printf(bus, "failed to reserve resource %#jx - %#jx " - "(%#jx)\n", start, end, count); - return (NULL); - } - - rman_set_rid(res, *rid); - rman_set_bustag(res, &bs_be_tag); - rman_set_bushandle(res, rman_get_start(res)); - - if (needactivate) - if (bus_activate_resource(child, type, *rid, res)) { - device_printf(child, "resource activation failed\n"); - rman_release_resource(res); - return (NULL); - } - - return (res); + return (bus_generic_rman_alloc_resource(bus, child, type, rid, start, + end, count, flags)); } static int @@ -762,36 +762,125 @@ lbc_print_child(device_t dev, device_t child) return (rv); } +static int +lbc_adjust_resource(device_t dev, device_t child, int type, struct resource *r, + rman_res_t start, rman_res_t end) +{ + switch (type) { + case SYS_RES_IOPORT: + type = SYS_RES_MEMORY; + /* FALLTHROUGH */ + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(dev, child, type, r, + start, end)); + case SYS_RES_IRQ: + return (bus_adjust_resource(dev, type, r, start, end)); + default: + return (EINVAL); + } +} + static int lbc_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { - int err; + switch (type) { + case SYS_RES_IOPORT: + type = SYS_RES_MEMORY; + /* FALLTHROUGH */ + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(dev, child, type, + rid, res)); + case SYS_RES_IRQ: + return (bus_release_resource(dev, type, rid, res)); + default: + return (EINVAL); + } +} - if (rman_get_flags(res) & RF_ACTIVE) { - err = bus_deactivate_resource(child, type, rid, res); - if (err) - return (err); +static int +lbc_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + switch (type) { + case SYS_RES_IOPORT: + type = SYS_RES_MEMORY; + /* FALLTHROUGH */ + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, r)); + case SYS_RES_IRQ: + return (bus_activate_resource(bus, type, rid, r)); + default: + return (EINVAL); } +} - return (rman_release_resource(res)); +static int +lbc_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + switch (type) { + case SYS_RES_IOPORT: + type = SYS_RES_MEMORY; + /* FALLTHROUGH */ + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, r)); + case SYS_RES_IRQ: + return (bus_deactivate_resource(bus, type, rid, r)); + default: + return (EINVAL); + } } static int -lbc_activate_resource(device_t bus __unused, device_t child __unused, - int type __unused, int rid __unused, struct resource *r) +lbc_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) { + struct resource_map_request args; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); - /* Child resources were already mapped, just activate. */ - return (rman_activate_resource(r)); + map->r_bustag = &bs_be_tag; + map->r_bushandle = start; + map->r_size = length; + map->r_vaddr = NULL; + return (0); } static int -lbc_deactivate_resource(device_t bus __unused, device_t child __unused, - int type __unused, int rid __unused, struct resource *r) +lbc_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) { - return (rman_deactivate_resource(r)); + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + return (0); } static const struct ofw_bus_devinfo * From nobody Thu Feb 27 14:16:34 2025 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 4Z3YLB5j6Dz5qGFL; Thu, 27 Feb 2025 14:16:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLB5FGLz3wr3; Thu, 27 Feb 2025 14:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665794; 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=tyFmOywq9/LrA5eC90px5xQyOkD7Fx+nLXL0RplQsUE=; b=X/lwNrG+gpqEJYwdMeo6s5LfNuvQ/m5C5Eewur11NJ6FqSQbns71vSbCxQo6Rb2qSPZrc+ pA3ykLpjxR4EmCRCQ3J8GwI2KcrUlpuLzHOmW+8Oa5trkgZC9hwooFgbENmHzu5+R4KPfY aqnBxJcog/W8fCqS0i2exgZGsglGVBpobcM5+Xq+fb9awJjWA6IdK9xmzFxUj5mC8q6hLq 7a25oW8vAs4NT74rbhyp2M5Zi0r5rf3+bPNhl9wIxExGY3C9ip1cYyITmzWWPfLVLwgpFG km1jDwVy6QxMFGroJlNhGfbzMPjF+YzYq+DuMV64YXHPLdYhTLom/wAMowRAoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665794; a=rsa-sha256; cv=none; b=jsROjTyjMxGPmJ1KHl7Hcp5HfixxUx5Igf+l+AEDlQZMKsUmK+GnfAOwA5MZTT4kOWvZhK AQ0f7OIDam099WiiZA21wqDLTWtdq+hewVcDx/+ESglOLLW4lSEhk5JOAD/nkqzMRw3vk2 6p+O60Gwm7q8Lpkx9ik3IguV8MWO/zAL611MuzWqb0CqAvHHVolOtZBvKgN77rCVTOM3/c 3OHLlOlwh9RWq0Dc2MujfHIQnlwIkCXDOeMVA3uiuHrtgG+JQX9qrICChHkek9EzIW/rFg 54Djyp+kXAlL/gBq2IUi9KR9ur7YBdCwWmYu5dWvDxkNVMjZlUgERZHSRbvkZw== 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=1740665794; 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=tyFmOywq9/LrA5eC90px5xQyOkD7Fx+nLXL0RplQsUE=; b=rB+OhOkvc45vUplsDECd/nJCyMb/+ta20Dhf4eZhlmGoPgf2gNTH8QO16m4874/TE37/Ux fP5O+rcwg0uhwBtw9Rtfh5CMNMC9rfRLeAVeBZn8AOFuBmXWS/MDS3xbD8VfZvZWa4cwOg cqnaLmEF73XBZhbbXAl7zwDmecVcytilN+l8Ph8cd/ydX8KFAhdA4fIMRUq0AwQY3NbGA6 2l74ERPf+hcSuCgEywkKhMKNj/6AUx1cQBGEy4VZbKX3LhhkZasmbveKsxt6Y6q9njNB/N enjwD8sjzwXDwORUfn1aJSMQ6eBSLekZFZBZlj1kooTHGbAyxZN/aG6Y5DJmqQ== 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 4Z3YLB4cDxzmQD; Thu, 27 Feb 2025 14:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGYu8015726; Thu, 27 Feb 2025 14:16:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGYWT015723; Thu, 27 Feb 2025 14:16:34 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:34 GMT Message-Id: <202502271416.51REGYWT015723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 326dfed42c7e - stable/14 - powerpc psim: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 326dfed42c7ead51f63a60424441d332a7444c57 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=326dfed42c7ead51f63a60424441d332a7444c57 commit 326dfed42c7ead51f63a60424441d332a7444c57 Author: John Baldwin AuthorDate: 2024-01-23 17:36:26 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 powerpc psim: Use bus_generic_rman_* - Split out bits of iobus_activate/deactive_resource to implement iobus_map/unmap_resource. - Use bus_generic_rman_* methods in several bus methods to handle memory and I/O port resources. - Add an implementation of bus_adjust_resource. Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43433 (cherry picked from commit d7c16b333455faef4236d98bb6e671651e87a66d) --- sys/powerpc/psim/iobus.c | 183 +++++++++++++++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 60 deletions(-) diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index 4ec0f1664e1c..497ef42d82e6 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -70,13 +70,21 @@ static int iobus_print_child(device_t dev, device_t child); static void iobus_probe_nomatch(device_t, device_t); static int iobus_read_ivar(device_t, device_t, int, uintptr_t *); static int iobus_write_ivar(device_t, device_t, int, uintptr_t); +static struct rman *iobus_get_rman(device_t, int, u_int); static struct resource *iobus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int iobus_adjust_resource(device_t, device_t, int, struct resource *, + rman_res_t, rman_res_t); static int iobus_activate_resource(device_t, device_t, int, int, struct resource *); static int iobus_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int iobus_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, + struct resource_map *); +static int iobus_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static int iobus_release_resource(device_t, device_t, int, int, struct resource *); @@ -100,10 +108,14 @@ static device_method_t iobus_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_rman, iobus_get_rman), DEVMETHOD(bus_alloc_resource, iobus_alloc_resource), + DEVMETHOD(bus_adjust_resource, iobus_adjust_resource), DEVMETHOD(bus_release_resource, iobus_release_resource), DEVMETHOD(bus_activate_resource, iobus_activate_resource), DEVMETHOD(bus_deactivate_resource, iobus_deactivate_resource), + DEVMETHOD(bus_map_resource, iobus_map_resource), + DEVMETHOD(bus_unmap_resource, iobus_unmap_resource), { 0, 0 } }; @@ -293,26 +305,32 @@ iobus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) return (EINVAL); } -static struct resource * -iobus_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, - u_int flags) +static struct rman * +iobus_get_rman(device_t bus, int type, u_int flags) { struct iobus_softc *sc; - int needactivate; - struct resource *rv; - struct rman *rm; sc = device_get_softc(bus); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; +static struct resource * +iobus_alloc_resource(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, + u_int flags) +{ switch (type) { case SYS_RES_MEMORY: case SYS_RES_IOPORT: - rm = &sc->sc_mem_rman; - break; + return (bus_generic_rman_alloc_resource(bus, child, type, rid, + start, end, count, flags)); case SYS_RES_IRQ: return (bus_alloc_resource(bus, type, rid, start, end, count, flags)); @@ -321,80 +339,125 @@ iobus_alloc_resource(device_t bus, device_t child, int type, int *rid, device_get_nameunit(child)); return (NULL); } +} - rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == NULL) { - device_printf(bus, "failed to reserve resource for %s\n", - device_get_nameunit(child)); - return (NULL); - } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } +static int +iobus_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ - return (rv); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_adjust_resource(bus, child, type, r, + start, end)); + case SYS_RES_IRQ: + return (bus_adjust_resource(bus, type, r, start, end)); + default: + return (EINVAL); + } } static int iobus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - if (rman_get_flags(res) & RF_ACTIVE) { - int error = bus_deactivate_resource(child, type, rid, res); - if (error) - return error; - } - return (rman_release_resource(res)); + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_release_resource(bus, child, type, rid, + res)); + case SYS_RES_IRQ: + return (bus_release_resource(bus, type, rid, res)); + default: + return (EINVAL); + } } static int iobus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - struct iobus_softc *sc; - void *p; - - sc = device_get_softc(bus); - if (type == SYS_RES_IRQ) + switch (type) { + case SYS_RES_IRQ: return (bus_activate_resource(bus, type, rid, res)); - - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - p = pmap_mapdev((vm_paddr_t)rman_get_start(res) + sc->sc_addr, - (vm_size_t)rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_le_tag); - rman_set_bushandle(res, (u_long)p); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(bus, child, type, + rid, res)); + default: + return (EINVAL); } - - return (rman_activate_resource(res)); } static int iobus_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - u_int32_t psize; - psize = rman_get_size(res); - pmap_unmapdev(rman_get_virtual(res), psize); + switch (type) { + case SYS_RES_IRQ: + return (bus_deactivate_resource(bus, type, rid, res)); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, res)); + default: + return (EINVAL); } +} - return (rman_deactivate_resource(res)); +static int +iobus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + struct iobus_softc *sc; + rman_res_t length, start; + int error; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + sc = device_get_softc(bus); + map->r_vaddr = pmap_mapdev_attr((vm_paddr_t)start + sc->sc_addr, + (vm_size_t)length, args.memattr); + if (map->r_vaddr == NULL) + return (ENOMEM); + map->r_bustag = &bs_le_tag; + map->r_bushandle = (vm_offset_t)map->r_vaddr; + map->r_size = length; + return (0); +} + +static int +iobus_unmap_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map *map) +{ + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + pmap_unmapdev(map->r_vaddr, map->r_size); + return (0); + default: + return (EINVAL); + } } From nobody Thu Feb 27 14:16:44 2025 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 4Z3YLN5qRpz5qGFN; Thu, 27 Feb 2025 14:16:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLN58c4z3xNx; Thu, 27 Feb 2025 14:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665804; 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=2vEXuue7FZ1DZVSyjfYtn7Z/GGbUdQVCqlvIJaWZpb4=; b=SJvXYKZW+NdvLEW3j38VeUkfpQ30mNkm4EUC7w6KoWs22tGfEYnShcDn+RpvdahHjXaenT cc5FfugatrBcpHwOFrljKtRiAslxNNbJ1tOcvzmwS0oWYczHSP91nOqqNea48Rkuex/lBn 9PxqrzWf6OnZReE3H6/vn3PerPTnwSrYrt5eOSBeu3X2+l2q1GVNtrAmM5V5H6DGFUFnnC jIHVrOpTn815SGB3FACROAN5nsRx+TP7MTiMv1he1wjTLvO49eno1LSgPz0j7gJ+8/W7GU LBT72lVtJhJaGgqEXHFJgwd+J0tTjsnjaVYQ5YSJZJ74gvqnkWKunpRn6JW3DQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665804; a=rsa-sha256; cv=none; b=J6mnUJ78LanQr16KqerKzaxWnV4gdnjtexjPP0vkeru6YAWFyk8Gwpdg50sYTr3ZuGqfVM ELUp71WTw/ejGzyqa4s42iyb18AY7zEesBMnKbBFNsRDDuil57eVzU8Ha4Q8fEpEQityyv X1xVuPDG7JfO8x2DK5CW7+T59oa0I0976f+YCLr28aQM5Zu1io4DRW3AKPslcAwJFA6AyO arhf3C9VJ9tg8YRBpS0Bb2gFhvD9noPajyljrnGTl8mzdDxuWShF71frSrjc9MSLTyBgHu KGrPV1YDgC8zG775DkdAavQBnK5vBzw3q/3iO6p8Fqim7RBXDzXW9JwWKXzAkw== 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=1740665804; 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=2vEXuue7FZ1DZVSyjfYtn7Z/GGbUdQVCqlvIJaWZpb4=; b=mOPvOcxQu8EIBH7UekLUZG1Cc4KI3gcNKelZcrN+oeuA8pcHbUuSscTp964TIhpDAD1Co2 2SQBz+kN10QofWsOVpaBL79nf5X1tKd5ybCppga8zKbGMZhgJVZq7dHhjI0mG0z8K7i7FJ xYruNbpWldtpzWt+qMphlhNPZbR6HTbXYHcRd2lNSEfXqIN6wo3HFCvyAjt2bsfkXQlDyt 3HRZ1TISMbZw5IRTi5JXQV9JTH73JDV0ktiJykNwaatMYEsm4F/rqHdpqFBZ/xhRcSanCS PLhZw+jZ/o4/EHieDZZmnS2J1cymcTmphtwDUbivVk/Rx+THIpuCY2kunb0tiw== 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 4Z3YLN4kwgzmZQ; Thu, 27 Feb 2025 14:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGiWj016060; Thu, 27 Feb 2025 14:16:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGiZu016057; Thu, 27 Feb 2025 14:16:44 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:44 GMT Message-Id: <202502271416.51REGiZu016057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a93707671c05 - stable/14 - ofw_pcib: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a93707671c053f1e583983d51b1e1a6091eedfef Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a93707671c053f1e583983d51b1e1a6091eedfef commit a93707671c053f1e583983d51b1e1a6091eedfef Author: John Baldwin AuthorDate: 2024-01-23 17:38:09 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 ofw_pcib: Use bus_generic_rman_* - Implement bus_map/unmap_resource pulling bits from the previous ofw_pcib_activate/deactivate_resource. One difference here is that the bus_unmap_resource implementation uses bus_space_unmap instead of pmap_unmapdev as a complement to the existing use of bus_space_map. - Use bus_generic_rman_* in various routines for memory and I/O port resources. - Use pci_domain_* for PCI_RES_BUS in ofw_pcib_activate/deactivate_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43441 (cherry picked from commit 0b60d7a60099e6ce81e0fb012946a1e77b0626c4) --- sys/dev/ofw/ofw_pcib.c | 215 ++++++++++++++++++++++++++++--------------------- 1 file changed, 123 insertions(+), 92 deletions(-) diff --git a/sys/dev/ofw/ofw_pcib.c b/sys/dev/ofw/ofw_pcib.c index 6e0f5fe3dd5f..6855070f992e 100644 --- a/sys/dev/ofw/ofw_pcib.c +++ b/sys/dev/ofw/ofw_pcib.c @@ -65,6 +65,7 @@ /* * bus interface. */ +static struct rman *ofw_pcib_get_rman(device_t, int, u_int); static struct resource * ofw_pcib_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int ofw_pcib_release_resource(device_t, device_t, int, int, @@ -75,6 +76,10 @@ static int ofw_pcib_deactivate_resource(device_t, device_t, int, int, struct resource *); static int ofw_pcib_adjust_resource(device_t, device_t, int, struct resource *, rman_res_t, rman_res_t); +static int ofw_pcib_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); +static int ofw_pcib_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static int ofw_pcib_translate_resource(device_t bus, int type, rman_res_t start, rman_res_t *newstart); @@ -96,7 +101,6 @@ static phandle_t ofw_pcib_get_node(device_t, device_t); * local methods */ static int ofw_pcib_fill_ranges(phandle_t, struct ofw_pci_range *); -static struct rman *ofw_pcib_get_rman(struct ofw_pci_softc *, int, u_int); /* * Driver methods. @@ -111,11 +115,14 @@ static device_method_t ofw_pcib_methods[] = { DEVMETHOD(bus_write_ivar, ofw_pcib_write_ivar), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_rman, ofw_pcib_get_rman), DEVMETHOD(bus_alloc_resource, ofw_pcib_alloc_resource), DEVMETHOD(bus_release_resource, ofw_pcib_release_resource), DEVMETHOD(bus_activate_resource, ofw_pcib_activate_resource), DEVMETHOD(bus_deactivate_resource, ofw_pcib_deactivate_resource), DEVMETHOD(bus_adjust_resource, ofw_pcib_adjust_resource), + DEVMETHOD(bus_map_resource, ofw_pcib_map_resource), + DEVMETHOD(bus_unmap_resource, ofw_pcib_unmap_resource), DEVMETHOD(bus_translate_resource, ofw_pcib_translate_resource), #ifdef __powerpc__ DEVMETHOD(bus_get_bus_tag, ofw_pcib_bus_get_bus_tag), @@ -418,80 +425,50 @@ static struct resource * ofw_pcib_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct ofw_pci_softc *sc; - struct resource *rv; - struct rman *rm; - int needactivate; - - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; sc = device_get_softc(bus); - +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { - return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid, - start, end, count, flags | needactivate)); - } + case PCI_RES_BUS: + return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid, + start, end, count, flags)); #endif - - rm = ofw_pcib_get_rman(sc, type, flags); - if (rm == NULL) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_alloc_resource(bus, child, type, rid, + start, end, count, flags)); + default: return (bus_generic_alloc_resource(bus, child, type, rid, - start, end, count, flags | needactivate)); - } - - rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == NULL) { - device_printf(bus, "failed to reserve resource for %s\n", - device_get_nameunit(child)); - return (NULL); + start, end, count, flags)); } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); } static int ofw_pcib_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct ofw_pci_softc *sc; - struct rman *rm; - int error; sc = device_get_softc(bus); - +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_release_bus(sc->sc_pci_domain, child, rid, res)); #endif - - rm = ofw_pcib_get_rman(sc, type, rman_get_flags(res)); - if (rm == NULL) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_release_resource(bus, child, type, rid, + res)); + default: return (bus_generic_release_resource(bus, child, type, rid, res)); } - KASSERT(rman_is_region_manager(res, rm), ("rman mismatch")); - - if (rman_get_flags(res) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, res); - if (error != 0) - return (error); - } - return (rman_release_resource(res)); } static int @@ -537,26 +514,59 @@ static int ofw_pcib_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct ofw_pci_softc *sc; - bus_space_handle_t handle; - bus_space_tag_t tag; - struct ofw_pci_range *rp; - vm_paddr_t start; - int space; - int rv; sc = device_get_softc(bus); - - if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) { +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_activate_bus(sc->sc_pci_domain, child, rid, + res)); +#endif + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_activate_resource(bus, child, type, rid, + res)); + default: return (bus_generic_activate_resource(bus, child, type, rid, res)); } +} + +static int +ofw_pcib_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + struct ofw_pci_softc *sc; + struct ofw_pci_range *rp; + rman_res_t length, start; + int error, space; + + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + break; + default: + return (EINVAL); + } - start = (vm_paddr_t)rman_get_start(res); + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); /* * Map this through the ranges list */ + sc = device_get_softc(dev); for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && rp->pci_hi != 0; rp++) { if (start < rp->pci || start >= rp->pci + rp->size) @@ -572,7 +582,7 @@ ofw_pcib_activate_resource(device_t bus, device_t child, int type, int rid, break; default: space = -1; - } + } if (type == space) { start += (rp->host - rp->pci); @@ -581,23 +591,35 @@ ofw_pcib_activate_resource(device_t bus, device_t child, int type, int rid, } if (bootverbose) - printf("ofw_pci mapdev: start %jx, len %jd\n", - (rman_res_t)start, rman_get_size(res)); + printf("ofw_pci mapdev: start %jx, len %jd\n", start, length); - tag = BUS_GET_BUS_TAG(child, child); - if (tag == NULL) + map->r_bustag = BUS_GET_BUS_TAG(child, child); + if (map->r_bustag == NULL) return (ENOMEM); - rman_set_bustag(res, tag); - rv = bus_space_map(tag, start, - rman_get_size(res), 0, &handle); - if (rv != 0) - return (ENOMEM); + error = bus_space_map(map->r_bustag, start, length, 0, + &map->r_bushandle); + if (error != 0) + return (error); - rman_set_bushandle(res, handle); - rman_set_virtual(res, (void *)handle); /* XXX for powerpc only ? */ + /* XXX for powerpc only? */ + map->r_vaddr = (void *)map->r_bushandle; + map->r_size = length; + return (0); +} - return (rman_activate_resource(res)); +static int +ofw_pcib_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + bus_space_unmap(map->r_bustag, map->r_bushandle, map->r_size); + return (0); + default: + return (EINVAL); + } } #ifdef __powerpc__ @@ -613,43 +635,50 @@ static int ofw_pcib_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { - vm_size_t psize; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct ofw_pci_softc *sc; - if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) { + sc = device_get_softc(bus); +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_deactivate_bus(sc->sc_pci_domain, child, rid, + res)); +#endif + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_deactivate_resource(bus, child, type, + rid, res)); + default: return (bus_generic_deactivate_resource(bus, child, type, rid, res)); } - - psize = rman_get_size(res); - pmap_unmapdev(rman_get_virtual(res), psize); - - return (rman_deactivate_resource(res)); } static int ofw_pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *res, rman_res_t start, rman_res_t end) { - struct rman *rm; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct ofw_pci_softc *sc; sc = device_get_softc(bus); +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_adjust_bus(sc->sc_pci_domain, child, res, start, end)); #endif - - rm = ofw_pcib_get_rman(sc, type, rman_get_flags(res)); - if (rm == NULL) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + return (bus_generic_rman_adjust_resource(bus, child, type, res, + start, end)); + default: return (bus_generic_adjust_resource(bus, child, type, res, start, end)); } - KASSERT(rman_is_region_manager(res, rm), ("rman mismatch")); - KASSERT(!(rman_get_flags(res) & RF_ACTIVE), - ("active resources cannot be adjusted")); - - return (rman_adjust_resource(res, start, end)); } static phandle_t @@ -711,9 +740,11 @@ ofw_pcib_fill_ranges(phandle_t node, struct ofw_pci_range *ranges) } static struct rman * -ofw_pcib_get_rman(struct ofw_pci_softc *sc, int type, u_int flags) +ofw_pcib_get_rman(device_t bus, int type, u_int flags) { + struct ofw_pci_softc *sc; + sc = device_get_softc(bus); switch (type) { case SYS_RES_IOPORT: return (&sc->sc_io_rman); From nobody Thu Feb 27 14:17:19 2025 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 4Z3YM36J3Jz5qFY1; Thu, 27 Feb 2025 14:17:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YM35cH3z3xPg; Thu, 27 Feb 2025 14:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665839; 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=ZTTwMC19pYLW6+Yj9n3SYb9PTjDdsreiaykl3kxWv2Y=; b=Jf2M7ZtG9e/ru5P/NlzmyqkvaACuEGX6ObiLt0xyfhpacH9/rZcRkJkVAv3gj4gdmGX+I5 4JpLGp5CO0SntxId4VDfaFUsY+WU/pYoC0P5TjX0zae6pfSpQKVup+rqPP7pWAIMx6pMTB qd48vW9jLaUHjxcASoZbQ4WQHwwhIUQ9GIvedwVvwtbwdHcwMRgBOrRC6NsFnIodlinp2D yPUDob2YrQ8njYun8xdGJH7NODKVZmZQjv8ReXlIisnLywxYpcdwUR63a3Y0dJhRNHo4S1 OoK7Oqyot+TZVP07MWM+QZdfNw+RWegKlO30w0+A15oe9qEkVx6pzyqonRJREQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665839; a=rsa-sha256; cv=none; b=e1yyT+r4Jz7DMwUC7cEfi2J7zpiDQhHwHRkjq18Qy1JUPp94SfT3dyjdYar12VE1AdT+cm BGo/AXFk14nODT3O6VyCZfiDuJPB9vqpMeg/ABcYwPoXWzEc5YCuMrL4cXK6y5J7XtWejy 4xztERwNZ8a96tSdy7Mrxo3kw9/0ZdqrduRitq3Izi0LuNPKl6TZYuhwfGN4AQ/twJCWZU 9z7FCtLMIjhLTqb86fPO4XwkQzOVoG2+56RIfqiC4EFGGlzknszxv8CM2VrsU/2QVcSLIs DwHPNN+Go9KZRgHSKKFHw6R/GSXXPdJbTSWUCiuikF7tBkO1MzYYhVszj/FKyw== 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=1740665839; 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=ZTTwMC19pYLW6+Yj9n3SYb9PTjDdsreiaykl3kxWv2Y=; b=L5SkaXOnOyWP1k948hqKb+Cu8J5V0PJFGYTn9YW8ntuX5KIMicXOd5QFyBpzEPR42F/23d FztYnBgdxUnrDUvqLbtirQHEBWLHZb5+45w1Br0YgFGLQaskur+u4zyviBTYHzUtGM389q WdJmMTPlWRIlYZBoBw5z4F7EuQ4neOgNUCzdWt3dzagieuVsjeFZLcPkcnjYBFgcvz8AKI vwJ+drU4Wz2ex6om3VKs18hiilvZqyIKXgHcZxM7tU5Z3qlmQ4mR+iqSm3AUsRpyeXx5YC RBu3mTpGoWRZDyjB4h59EQGVsB48Ly8uQZW2ZIBEK2apRmQ9N3lcWcwI4rsNmw== 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 4Z3YM34rwCzm7R; Thu, 27 Feb 2025 14:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHJwd017156; Thu, 27 Feb 2025 14:17:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHJCl017153; Thu, 27 Feb 2025 14:17:19 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:19 GMT Message-Id: <202502271417.51REHJCl017153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e14fd50dd810 - stable/14 - new-bus: Introduce a simpler bus API for managing resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e14fd50dd810a0b5fcdda002755a1942e202aaeb Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e14fd50dd810a0b5fcdda002755a1942e202aaeb commit e14fd50dd810a0b5fcdda002755a1942e202aaeb Author: John Baldwin AuthorDate: 2024-03-13 22:05:53 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:23 +0000 new-bus: Introduce a simpler bus API for managing resources Remove the 'type' and 'rid' arguments from the wrapper bus API functions (e.g. bus_release_resource) that accept a struct resource. The "new" versions extract the 'type' and/or 'rid' from the passed in resource object via rman_get_type and rman_get_rid. This commit adds the new API as functions with a _new suffix. Wrapper macros choose between the old and new functions based on the number of arguments provided to the macro. This commit does not change the ABI but can be safely MFCd to older branches so long as older kernels use rman_set_type when allocating resources. Future commits will push the removal of these extraneous arguments through the bus implementation. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44124 (cherry picked from commit 9edb8d0aedef2f1e13ed1f8134deb3f8291d2fe9) --- sys/kern/subr_bus.c | 42 ++++++++++++++++++++++++++++++++++++++++++ sys/sys/bus.h | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index ffad54c34925..5d1a13c08892 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4618,6 +4618,13 @@ bus_adjust_resource(device_t dev, int type, struct resource *r, rman_res_t start return (BUS_ADJUST_RESOURCE(dev->parent, dev, type, r, start, end)); } +int +bus_adjust_resource_new(device_t dev, struct resource *r, rman_res_t start, + rman_res_t end) +{ + return (bus_adjust_resource(dev, rman_get_type(r), r, start, end)); +} + /** * @brief Wrapper function for BUS_TRANSLATE_RESOURCE(). * @@ -4647,6 +4654,13 @@ bus_activate_resource(device_t dev, int type, int rid, struct resource *r) return (BUS_ACTIVATE_RESOURCE(dev->parent, dev, type, rid, r)); } +int +bus_activate_resource_new(device_t dev, struct resource *r) +{ + return (bus_activate_resource(dev, rman_get_type(r), rman_get_rid(r), + r)); +} + /** * @brief Wrapper function for BUS_DEACTIVATE_RESOURCE(). * @@ -4661,6 +4675,13 @@ bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r) return (BUS_DEACTIVATE_RESOURCE(dev->parent, dev, type, rid, r)); } +int +bus_deactivate_resource_new(device_t dev, struct resource *r) +{ + return (bus_deactivate_resource(dev, rman_get_type(r), rman_get_rid(r), + r)); +} + /** * @brief Wrapper function for BUS_MAP_RESOURCE(). * @@ -4676,6 +4697,13 @@ bus_map_resource(device_t dev, int type, struct resource *r, return (BUS_MAP_RESOURCE(dev->parent, dev, type, r, args, map)); } +int +bus_map_resource_new(device_t dev, struct resource *r, + struct resource_map_request *args, struct resource_map *map) +{ + return (bus_map_resource(dev, rman_get_type(r), r, args, map)); +} + /** * @brief Wrapper function for BUS_UNMAP_RESOURCE(). * @@ -4691,6 +4719,13 @@ bus_unmap_resource(device_t dev, int type, struct resource *r, return (BUS_UNMAP_RESOURCE(dev->parent, dev, type, r, map)); } +int +bus_unmap_resource_new(device_t dev, struct resource *r, + struct resource_map *map) +{ + return (bus_unmap_resource(dev, rman_get_type(r), r, map)); +} + /** * @brief Wrapper function for BUS_RELEASE_RESOURCE(). * @@ -4708,6 +4743,13 @@ bus_release_resource(device_t dev, int type, int rid, struct resource *r) return (rv); } +int +bus_release_resource_new(device_t dev, struct resource *r) +{ + return (bus_release_resource(dev, rman_get_type(r), rman_get_rid(r), + r)); +} + /** * @brief Wrapper function for BUS_SETUP_INTR(). * diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 5d5336591ea6..c1391c4a7284 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -613,6 +613,43 @@ bus_alloc_resource_anywhere(device_t dev, int type, int *rid, return (bus_alloc_resource(dev, type, rid, 0, ~0, count, flags)); } +/* Compat shims for simpler bus resource API. */ +int bus_adjust_resource_new(device_t child, struct resource *r, + rman_res_t start, rman_res_t end); +int bus_activate_resource_new(device_t dev, struct resource *r); +int bus_deactivate_resource_new(device_t dev, struct resource *r); +int bus_map_resource_new(device_t dev, struct resource *r, + struct resource_map_request *args, struct resource_map *map); +int bus_unmap_resource_new(device_t dev, struct resource *r, + struct resource_map *map); +int bus_release_resource_new(device_t dev, struct resource *r); + +#define _BUS_API_MACRO(_1, _2, _3, _4, _5, NAME, ...) NAME + +#define bus_adjust_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, bus_adjust_resource, \ + bus_adjust_resource_new)(__VA_ARGS__) + +#define bus_activate_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, INVALID, bus_activate_resource, \ + INVALID, bus_activate_resource_new)(__VA_ARGS__) + +#define bus_deactivate_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, INVALID, bus_deactivate_resource, \ + INVALID, bus_deactivate_resource_new)(__VA_ARGS__) + +#define bus_map_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, bus_map_resource, \ + bus_map_resource_new)(__VA_ARGS__) + +#define bus_unmap_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, INVALID, bus_unmap_resource, \ + bus_unmap_resource_new)(__VA_ARGS__) + +#define bus_release_resource(...) \ + _BUS_API_MACRO(__VA_ARGS__, INVALID, bus_release_resource, \ + INVALID, bus_release_resource_new)(__VA_ARGS__) + /* * Access functions for device. */ From nobody Thu Feb 27 14:17:11 2025 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 4Z3YLv6T6Gz5qGFV; Thu, 27 Feb 2025 14:17:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLv5qNLz3xPV; Thu, 27 Feb 2025 14:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665831; 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=zyNxCC95qpxUUEkLIoGJofHa/X7BBPNU0JnuTMWUIik=; b=UiOnKHc89wweE7YWUgiea4/OyElU4RiDPmyYJFmNQj7Qz2Hp8A8Ey3DxvxjzJQZXuya8Pt 7YVvr8HNbMb5Epbg9hheGJQA55xDkiGhk3KiaHJ0xUdqluk78ld+76tu4DuTVTAWKzA88x O9lCRw32ltBaAZ3Spbu8J1k6bDy52tbP4WDCIojxT9d9x8qr5bIyYkvELcDUFoHsPTrTn2 Eo6rJ9YT6rDlagGuAvdpGqX8rDzS9bndKxIu+Js1tNN++HY+6ZPbJgONh870TXe0X1JEK6 I9T7nHumkNSfKROT2h4yIFuFvz+Nfw/zI9vXzdilJ1e2nkpv5igrEz3A5MDjDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665831; a=rsa-sha256; cv=none; b=vyCdGxtZNIxw2lIfReceZFnYrsIJ9jv9nYo9Zx/gbgDCvWXSCkyW0I5sU8MFHb/PNpAfme E2TelvU/OZKPmtbWnd6yxyCNlA4MsJjsg4YZAUEIM1IUj45dd8bvhx2avaJvejg3icIo5O vTzOzi7SpsaroaQvtCr+NbLXvfp5jdqZwRJT0GOUbXdK8dVRkqVBG5dgxYzG00vsZiiYq9 vRre0Nz0GdAaFaDKdpj3E7HJHA++QDGqfmNno/j7s6B05TQUVowo63uD3SnU4phyf9jGSs 9mxAfZ0kQJZnol6f8gsy0JtInLROFaWg4UMcXrG7pZadVtgBQCQib2+ErH3XNw== 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=1740665831; 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=zyNxCC95qpxUUEkLIoGJofHa/X7BBPNU0JnuTMWUIik=; b=DCnfQxhQALl04ImLzf5h3j37PzTchuiJAxWZ+K9LhuchkpCrAXmXP0Gr7qhrLocp3n24FN rWpOTNJITOb7d7gWYNPLHZsuC92Ug+nL1RdXJd08iC8dGUvTcZ5dNT0o7+H5FstRe/o+gY ARUtkgxk8C6UgmKBoInUcd9biSzyZtowpMslWKUROLjEmxoeRu2+Hm7sL9YgrvzhldarH5 9jiXfioroXo/PeRzCFiZJvquaIwFH9gihPNZuHTC/3tId8VsxNvxnEwOABsME90ZlSgIyr cj2D/tQmTsGHuMJj3h3yzvKHrOfOlHuQkzLduVv2AxlK0LWYta1bNp9cfVZbhg== 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 4Z3YLv5PcMzmZX; Thu, 27 Feb 2025 14:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHBU3016916; Thu, 27 Feb 2025 14:17:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHBpu016913; Thu, 27 Feb 2025 14:17:11 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:11 GMT Message-Id: <202502271417.51REHBpu016913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7f2360a108f9 - stable/14 - bhnd_chipc: Make use of bus_generic_rman_* to simplify some code 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7f2360a108f910d5f126c39dcb968c8a720520e6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7f2360a108f910d5f126c39dcb968c8a720520e6 commit 7f2360a108f910d5f126c39dcb968c8a720520e6 Author: John Baldwin AuthorDate: 2024-02-27 19:44:22 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 bhnd_chipc: Make use of bus_generic_rman_* to simplify some code This uses bus_generic_rman_alloc/release_resource to reduce some code duplication. However, I've left the custom activate/deactivate methods as-is. Differential Revision: https://reviews.freebsd.org/D43939 (cherry picked from commit 3a48dfe115f35abac6c2d9ec03a6a574baeaf0bc) --- sys/dev/bhnd/cores/chipc/chipc.c | 68 +++++++++++++--------------------------- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a/sys/dev/bhnd/cores/chipc/chipc.c b/sys/dev/bhnd/cores/chipc/chipc.c index 0510a3195015..f99f42fb3ac3 100644 --- a/sys/dev/bhnd/cores/chipc/chipc.c +++ b/sys/dev/bhnd/cores/chipc/chipc.c @@ -123,13 +123,13 @@ static void chipc_disable_otp_power(struct chipc_softc *sc); static int chipc_enable_sprom_pins(struct chipc_softc *sc); static void chipc_disable_sprom_pins(struct chipc_softc *sc); -static int chipc_try_activate_resource(struct chipc_softc *sc, +static int chipc_try_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r, bool req_direct); static int chipc_init_rman(struct chipc_softc *sc); static void chipc_free_rman(struct chipc_softc *sc); -static struct rman *chipc_get_rman(struct chipc_softc *sc, int type); +static struct rman *chipc_get_rman(device_t dev, int type, u_int flags); /* quirk and capability flag convenience macros */ #define CHIPC_QUIRK(_sc, _name) \ @@ -747,10 +747,13 @@ chipc_free_rman(struct chipc_softc *sc) * * @param sc The chipc device state. * @param type The resource type (e.g. SYS_RES_MEMORY, SYS_RES_IRQ, ...) + * @param flags Resource flags (e.g. RF_PREFETCHABLE) */ static struct rman * -chipc_get_rman(struct chipc_softc *sc, int type) +chipc_get_rman(device_t dev, int type, u_int flags) { + struct chipc_softc *sc = device_get_softc(dev); + switch (type) { case SYS_RES_MEMORY: return (&sc->mem_rman); @@ -782,7 +785,7 @@ chipc_alloc_resource(device_t dev, device_t child, int type, rle = NULL; /* Fetch the resource manager, delegate request if necessary */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, flags); if (rm == NULL) { /* Requested resource type is delegated to our parent */ rv = bus_generic_rl_alloc_resource(dev, child, type, rid, @@ -851,31 +854,13 @@ chipc_alloc_resource(device_t dev, device_t child, int type, return (NULL); /* Make our rman reservation */ - rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, - child); + rv = bus_generic_rman_alloc_resource(dev, child, type, rid, start, end, + count, flags); if (rv == NULL) { chipc_release_region(sc, cr, RF_ALLOCATED); return (NULL); } - rman_set_rid(rv, *rid); - - /* Activate */ - if (flags & RF_ACTIVE) { - error = bus_activate_resource(child, type, *rid, rv); - if (error) { - device_printf(dev, - "failed to activate entry %#x type %d for " - "child %s: %d\n", - *rid, type, device_get_nameunit(child), error); - - chipc_release_region(sc, cr, RF_ALLOCATED); - rman_release_resource(rv); - - return (NULL); - } - } - /* Update child's resource list entry */ if (rle != NULL) { rle->res = rv; @@ -900,7 +885,7 @@ chipc_release_resource(device_t dev, device_t child, int type, int rid, sc = device_get_softc(dev); /* Handled by parent bus? */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) { return (bus_generic_rl_release_resource(dev, child, type, rid, r)); @@ -912,13 +897,8 @@ chipc_release_resource(device_t dev, device_t child, int type, int rid, return (EINVAL); /* Deactivate resources */ - if (rman_get_flags(r) & RF_ACTIVE) { - error = BUS_DEACTIVATE_RESOURCE(dev, child, type, rid, r); - if (error) - return (error); - } - - if ((error = rman_release_resource(r))) + error = bus_generic_rman_release_resource(dev, child, type, rid, r); + if (error != 0) return (error); /* Drop allocation reference */ @@ -943,7 +923,7 @@ chipc_adjust_resource(device_t dev, device_t child, int type, sc = device_get_softc(dev); /* Handled by parent bus? */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) { return (bus_generic_adjust_resource(dev, child, type, r, start, end)); @@ -978,16 +958,17 @@ chipc_adjust_resource(device_t dev, device_t child, int type, * as RF_ACTIVE if bhnd direct resource allocation fails. */ static int -chipc_try_activate_resource(struct chipc_softc *sc, device_t child, int type, +chipc_try_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r, bool req_direct) { + struct chipc_softc *sc = device_get_softc(dev); struct rman *rm; struct chipc_region *cr; bhnd_size_t cr_offset; rman_res_t r_start, r_end, r_size; int error; - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) return (EINVAL); @@ -1033,21 +1014,18 @@ static int chipc_activate_bhnd_resource(device_t dev, device_t child, int type, int rid, struct bhnd_resource *r) { - struct chipc_softc *sc; struct rman *rm; int error; - sc = device_get_softc(dev); - /* Delegate non-locally managed resources to parent */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r->res)); if (rm == NULL || !rman_is_region_manager(r->res, rm)) { return (bhnd_bus_generic_activate_resource(dev, child, type, rid, r)); } /* Try activating the chipc region resource */ - error = chipc_try_activate_resource(sc, child, type, rid, r->res, + error = chipc_try_activate_resource(dev, child, type, rid, r->res, false); if (error) return (error); @@ -1064,20 +1042,17 @@ static int chipc_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { - struct chipc_softc *sc; struct rman *rm; - sc = device_get_softc(dev); - /* Delegate non-locally managed resources to parent */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) { return (bus_generic_activate_resource(dev, child, type, rid, r)); } /* Try activating the chipc region-based resource */ - return (chipc_try_activate_resource(sc, child, type, rid, r, true)); + return (chipc_try_activate_resource(dev, child, type, rid, r, true)); } /** @@ -1095,7 +1070,7 @@ chipc_deactivate_resource(device_t dev, device_t child, int type, sc = device_get_softc(dev); /* Handled by parent bus? */ - rm = chipc_get_rman(sc, type); + rm = chipc_get_rman(dev, type, rman_get_flags(r)); if (rm == NULL || !rman_is_region_manager(r, rm)) { return (bus_generic_deactivate_resource(dev, child, type, rid, r)); @@ -1396,6 +1371,7 @@ static device_method_t chipc_methods[] = { DEVMETHOD(bus_activate_resource, chipc_activate_resource), DEVMETHOD(bus_deactivate_resource, chipc_deactivate_resource), DEVMETHOD(bus_get_resource_list, chipc_get_resource_list), + DEVMETHOD(bus_get_rman, chipc_get_rman), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), From nobody Thu Feb 27 17:03:59 2025 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 4Z3d3M6JhXz59JZH; Thu, 27 Feb 2025 17:03:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3d3M5RGgz46G7; Thu, 27 Feb 2025 17:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740675839; 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=HBwSrxgXhIYMmOHgqtJsQLyHPS9/O/GtFPv8/3Xo9ZM=; b=fK8XPCzmdYpZolzK44flYCbzGOF07gnWXLihh8XiCPLZqEZJXlsFVhPpO610MfJsIbUTjE C5tFb4C/NrXQWQVSRPqidxhamZyT2Cwxu/3ZyDBFUybs9WHMjsvXXZ8HG4ShNAocFNKl2a S78XemmCcuDLuVjDIIvVxamn46NYmuStdsnkn47sFlCQ5nJa+feC4ZfgV2bXpCCSMwzmPy DxFtWPnP/wFKkzL0PLE6epdhy6j1CRoIiwSWGAWFqRTXXO1ALps6vflZxR/05AAGblnoUO 1AA/5YgtJfzUQjrsYSoyGUXBkdcK8/Sfy2XggQfoz/C+bDrb1rVsu9rLeh7F4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740675839; a=rsa-sha256; cv=none; b=er2Q4WtgSjomQLS1kdhxPmNyJZeRXlCxsfSn8EJT4W5/0YAYqgQL9M3iufr0TvXSkHf85+ w4KyMr3LQIeO9Q1bfevGiG3KNlRMeEH4WnkvquDi4CtaPXJgK74MhrQqMmozuyLiXjj7Uk aF+LH41vqE88mbVBB/fag4cLYOhUmR4cwQVAAtwDYetXoKJWP0CbwnnqHcnan9nNSjA48N EgK9FgsMKbmC9xjqpjdvvo732cE2FeTzKY0B4GoYnN1259z4EgDDTMnNZkIfzbyt0TDelv 84fk82KX7BpTLmE1vENM5iYTH0k2XVql89vyqq/142ejtwQuqXld6MwZUyJClQ== 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=1740675839; 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=HBwSrxgXhIYMmOHgqtJsQLyHPS9/O/GtFPv8/3Xo9ZM=; b=pz6ra1e7Cm5Bop7/r9SGwqRMkx+UvvkGhVr0fBtgLDnln86AQoXA55sH4c/O+0aa3uYanQ zchJlrKVT6/zgvuDxOTYidVTvf3WedHwSXwXgPYEixgogBWseGMp2fzQrcD3HgEMWT1AZI 4SjSKLDEkndwm69eEMg8LSR39Qw48zhzkC+VuAxCHoWMAIOERQQbCUfgaTMQDXRNXp/WDm ggK3V8bVqcGbmBQ4FZGj2xIn6iiJHe71oSq34OVcbueCR5+CJgZrm10lkwNkuQcDBSFq/D EYnClNOgegax5RZBzf/rfVvjidqfGS7ZReh8SULx/VVLYCStZsK8v1lVEtFrvA== 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 4Z3d3M4vQyzr26; Thu, 27 Feb 2025 17:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RH3xaC036996; Thu, 27 Feb 2025 17:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RH3xqh036993; Thu, 27 Feb 2025 17:03:59 GMT (envelope-from git) Date: Thu, 27 Feb 2025 17:03:59 GMT Message-Id: <202502271703.51RH3xqh036993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0f1708d8570d - stable/14 - cxgbe: Tidy TOE tunables under hw.cxgbe 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0f1708d8570d10e023b9f9af847b12ef48ea9bf8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0f1708d8570d10e023b9f9af847b12ef48ea9bf8 commit 0f1708d8570d10e023b9f9af847b12ef48ea9bf8 Author: John Baldwin AuthorDate: 2024-12-10 20:30:30 +0000 Commit: John Baldwin CommitDate: 2025-02-27 17:03:06 +0000 cxgbe: Tidy TOE tunables under hw.cxgbe - Only two of these tunables are used for RATELIMIT without TCP_OFFLOAD. - Mark t4_tmr_idx_ofld and t4_pktc_idx_ofld static. - Move hw.cxgbe.cop_managed_offloading under hw.cxgbe.toe since it is specific to TOE. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47765 (cherry picked from commit 90652188232458891a2922fb5a542971aa58055d) --- sys/dev/cxgbe/t4_main.c | 19 +++++++++++-------- usr.sbin/cxgbetool/cxgbetool.8 | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 011978ce131b..6b3a68b352ad 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -318,15 +318,17 @@ static int t4_nofldtxq = -NOFLDTXQ; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldtxq, CTLFLAG_RDTUN, &t4_nofldtxq, 0, "Number of offload TX queues per port"); -#define NOFLDRXQ 2 -static int t4_nofldrxq = -NOFLDRXQ; -SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq, CTLFLAG_RDTUN, &t4_nofldrxq, 0, - "Number of offload RX queues per port"); - #define NOFLDTXQ_VI 1 static int t4_nofldtxq_vi = -NOFLDTXQ_VI; SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldtxq_vi, CTLFLAG_RDTUN, &t4_nofldtxq_vi, 0, "Number of offload TX queues per VI"); +#endif + +#if defined(TCP_OFFLOAD) +#define NOFLDRXQ 2 +static int t4_nofldrxq = -NOFLDRXQ; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq, CTLFLAG_RDTUN, &t4_nofldrxq, 0, + "Number of offload RX queues per port"); #define NOFLDRXQ_VI 1 static int t4_nofldrxq_vi = -NOFLDRXQ_VI; @@ -334,12 +336,12 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, nofldrxq_vi, CTLFLAG_RDTUN, &t4_nofldrxq_vi, 0, "Number of offload RX queues per VI"); #define TMR_IDX_OFLD 1 -int t4_tmr_idx_ofld = TMR_IDX_OFLD; +static int t4_tmr_idx_ofld = TMR_IDX_OFLD; SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_timer_idx_ofld, CTLFLAG_RDTUN, &t4_tmr_idx_ofld, 0, "Holdoff timer index for offload queues"); #define PKTC_IDX_OFLD (-1) -int t4_pktc_idx_ofld = PKTC_IDX_OFLD; +static int t4_pktc_idx_ofld = PKTC_IDX_OFLD; SYSCTL_INT(_hw_cxgbe, OID_AUTO, holdoff_pktc_idx_ofld, CTLFLAG_RDTUN, &t4_pktc_idx_ofld, 0, "holdoff packet counter index for offload queues"); @@ -686,9 +688,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l4_errors, CTLFLAG_RDTUN, * TOE tunables. */ static int t4_cop_managed_offloading = 0; -SYSCTL_INT(_hw_cxgbe, OID_AUTO, cop_managed_offloading, CTLFLAG_RDTUN, +SYSCTL_INT(_hw_cxgbe_toe, OID_AUTO, cop_managed_offloading, CTLFLAG_RDTUN, &t4_cop_managed_offloading, 0, "COP (Connection Offload Policy) controls all TOE offload"); +TUNABLE_INT("hw.cxgbe.cop_managed_offloading", &t4_cop_managed_offloading); #endif #ifdef KERN_TLS diff --git a/usr.sbin/cxgbetool/cxgbetool.8 b/usr.sbin/cxgbetool/cxgbetool.8 index a25a227669ed..995a4146deb3 100644 --- a/usr.sbin/cxgbetool/cxgbetool.8 +++ b/usr.sbin/cxgbetool/cxgbetool.8 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd April 14, 2022 +.Dd December 10, 2024 .Dt CXGBETOOL 8 .Os .Sh NAME @@ -553,7 +553,7 @@ Install the Connection Offload Policy (COP) in A COP offers fine-grained control over which connections get offloaded and with what parameters. Set -.Cm hw.cxgbe.cop_managed_offloading="1" +.Cm hw.cxgbe.toe.cop_managed_offloading="1" in loader.conf to ensure that t4_tom will not offload any connection before a COP is installed. Note that t4_tom must be loaded and operational (IFCAP_TOE enabled) as always From nobody Thu Feb 27 21:48:43 2025 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 4Z3lMv6FSvz5Jk9s; Thu, 27 Feb 2025 21:48:43 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3lMv5f1Tz3MQS; Thu, 27 Feb 2025 21:48:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740692923; 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=q74/qWq25vJqxPhiLPxF13tPYgL09M3WvVxMbuHnjcA=; b=EnfmGAylylPvhgREbVW+Y/h3RLHEWrLikudb8L7ROkCtWfgdGav2n8KD05Eq4GCqdswbbI HrKjo8tt0zyM9ZaInOtexMZgAyyHR7JJL9axVun7Iv/P84LP45JOlf4snL6fIn4EewmTR7 96ojvsG0sQKXRYW1TBje8MthVB5u1VjuTror6HL+Fgd5EaJg3PzG4Ok4d7iDVsj4TUkySH 92ZUQ3DabrpACoMxvm8vRdfJ9j615f7qYbzC8QeCYMn7H+N8WnEiiqn6ApYcYiaHIdp29c hf+WVb9bBwDkHshf0wVTWLWBQJlFi8284h46Glfc8lsPiEzeDHAlameuOTO2ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740692923; a=rsa-sha256; cv=none; b=X6xqlPvd9sfnj9uXeC02WEVC2oDtW0rh0VrY+DPrLB4yHLBbWBrC7z4El2WoSEz+p6hjrH qI30FETsbg8F9PlEeDfCJbDFeqfUXGIdcekGFB0j6QBgn3cUZ53Yey0ior7nO9fjXbd/fN X5mjA8nL2CSs9cmIp4w4MpNh2DJo1b01zW6/2jw07OHqHsBEXn4F9bipMW4VzdoMWyisib Zc10JYOMWxHXfQkjQZcv7/nFbWoOSGAa90ZRApuPO7gtVrOwuYRJQBXc38SlnkNwaTTHbp BlSz9Nh3aYoPxdflHClw4tuJe9B6nR9MsbtmpEO3hHKI/3AMSzenph0XeP3j6g== 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=1740692923; 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=q74/qWq25vJqxPhiLPxF13tPYgL09M3WvVxMbuHnjcA=; b=OIm+S0RH5W9X+7MHjDossrLQXutJsQ9UTQjQKM3tXspS8DgXycRSqX3tpUtutCbqgpbVQW a2X1WFctU3fdeAsFqpAI0EelfBq57nEHJ1+qYb7qlU8JJHIOPQVJ3tueekcZ7rQeyoZQpa XJHiBftsttr/Pn7t/qklo20DhI+iKAp/MIHy+xIvGweChzhlv4pNVWx0zMjz67AYKoICKp IdQPoFbV+fM/Ewz78EBoQrkKvlzTXobNSyQMhUPJrmi8hbTzRO/mcY9MgeFqLap0/WRkX6 lyGSZqFc2BNhQNWzadqwFsp8+aEpzOfmONcExsa6vYvnKVNZYbksEGeXX/AHpg== 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 4Z3lMv5528z10h9; Thu, 27 Feb 2025 21:48:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RLmh5I060854; Thu, 27 Feb 2025 21:48:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RLmh5w060851; Thu, 27 Feb 2025 21:48:43 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:48:43 GMT Message-Id: <202502272148.51RLmh5w060851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Igor Ostapenko Subject: git: db06c8fd7f5b - stable/14 - kyuafile.5: ATF metadata mapping reference 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: db06c8fd7f5bbe0b49bd0f5cd63920326b9105ce Auto-Submitted: auto-generated The branch stable/14 has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=db06c8fd7f5bbe0b49bd0f5cd63920326b9105ce commit db06c8fd7f5bbe0b49bd0f5cd63920326b9105ce Author: Igor Ostapenko AuthorDate: 2025-01-26 17:15:32 +0000 Commit: Igor Ostapenko CommitDate: 2025-02-27 21:43:35 +0000 kyuafile.5: ATF metadata mapping reference Reviewed by: ngie MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48190 (cherry picked from commit 68206add1173920065092c06eea40c90bb73b5c5) --- contrib/kyua/doc/kyuafile.5.in | 45 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/contrib/kyua/doc/kyuafile.5.in b/contrib/kyua/doc/kyuafile.5.in index a667f5dc2816..4fe5f12fd9b1 100644 --- a/contrib/kyua/doc/kyuafile.5.in +++ b/contrib/kyua/doc/kyuafile.5.in @@ -122,6 +122,7 @@ of the test program and a collection of optional metadata settings for all the test cases in the test program. Any metadata properties defined by the test cases themselves override the metadata values defined here. +The mapping to ATF metadata naming for each property is provided below. .Pp .Em Plain test programs are those that return 0 on success and non-0 on failure; in general, most test @@ -153,10 +154,16 @@ The following metadata properties can be passed to any test program definition: Whitespace-separated list of machine architecture names allowed by the test. If empty or not defined, the test is allowed to run on any machine architecture. +.Pp +ATF: +.Va require.arch .It Va allowed_platforms Whitespace-separated list of machine platform names allowed by the test. If empty or not defined, the test is allowed to run on any machine platform. +.Pp +ATF: +.Va require.machine .It Va custom.NAME Custom variable defined by the test where .Sq NAME @@ -171,8 +178,14 @@ in it, you will have to use a special Lua syntax to define the property. Refer to the .Sx EXAMPLES section below for clarification. +.Pp +ATF: +.Va X-NAME .It Va description Textual description of the test. +.Pp +ATF: +.Va descr .It Va execenv The name of the execution environment to be used for running the test. If empty or not defined, the @@ -220,6 +233,9 @@ All non-alphanumeric characters are replaced with .Sq kyua_usr_tests_sys_netpfil_pf_pass_block_v4 is an example for /usr/tests/sys/netpfil/pf/pass_block:v4 test case. .El +.Pp +ATF: +.Va execenv .It Va execenv_jail_params Additional test-specific whitespace-separated parameters of .Fx @@ -242,6 +258,9 @@ configuration. It can be overridden via .Va execenv_jail_params if needed. +.Pp +ATF: +.Va execenv.jail.params .It Va is_exclusive If true, indicates that this test program cannot be executed along any other programs at the same time. @@ -251,19 +270,36 @@ value of a setting, must set themselves as exclusive to prevent failures due to race conditions. Defaults to false. +.Pp +ATF: +.Va is.exclusive .It Va required_configs Whitespace-separated list of configuration variables that the test requires to be defined before it can run. +.Pp +ATF: +.Va require.config .It Va required_disk_space Amount of available disk space that the test needs to run successfully. +.Pp +ATF: not mapped .It Va required_files Whitespace-separated list of paths that the test requires to exist before it can run. +.Pp +ATF: +.Va require.files .It Va required_memory Amount of physical memory that the test needs to run successfully. +.Pp +ATF: +.Va require.memory .It Va required_programs Whitespace-separated list of basenames or absolute paths pointing to executable binaries that the test requires to exist before it can run. +.Pp +ATF: +.Va require.progs .It Va required_user If empty, the test has no restrictions on the calling user for it to run. If set to @@ -272,8 +308,14 @@ the test needs to not run as root. If set to .Sq root , the test must run as root. +.Pp +ATF: +.Va require.user .It Va timeout Amount of seconds that the test is allowed to execute before being killed. +.Pp +ATF: +.Va timeout .El .Ss Recursion To reference test programs in another subdirectory, a different @@ -450,7 +492,8 @@ but required_user='root' metadata property reminds that the jail execution environment requires .Xr kyua 1 being running with root privileges, and the test is skipped otherwise with -the respective message. The combination of +the respective message. +The combination of .Va execenv set to .Sq jail From nobody Thu Feb 27 14:16:54 2025 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 4Z3YLb2t1Dz5qGFS; Thu, 27 Feb 2025 14:16:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLZ6lX9z3xP7; Thu, 27 Feb 2025 14:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665814; 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=mFN780bje7cBIs/h6sGWuEeu/Wk1kH+75HmXh8652rs=; b=PIZJ+cvIHBT504Y9tcqR7FM7yOFxptVwHFst9A4WEjAspt44cujN1rsh3In3ZbBYRueNls qNCHYKcbB/k8+fijGEaaaaYs2Dh8EKJ4mIuIPxGBTXwhoADnIONG1ZSQiBgxf6zQOnqMv6 UMFQXjx7a32/xAzx6phrNK8NI1rEPgEtaJE+0GaQMG0tZABqmd99zBzAdYIEGq4IRuH9s2 wIuck3ajNJ8pxs14N/9iar/H1qyX7XGO2zE8rgFInL16JpOzLhOaU1sHBmAu81KFsYlNTT 60fHVze64OfyWVPOLMlm8zZg4B2aVovgKlEhNYclE1bQlf5gkWOj+239I1EVvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665814; a=rsa-sha256; cv=none; b=r+dd5199VmIBx3MRqqDqVEhA28vaSZA94e9iC4QC75ZdJlwEF97cIcrOthcpv44mJw3Ebp oc++0eUWiZlRTERYdsmeQEjA8RFNvQnCk8/wXcJt4f4N7Mq6RHVglsnqN1Ngp6z8jiSKCA iNtjDMuFbarMnn7YulNAGwzH6EsHvLqIWtTQm/nj8LjAkQQ8m2Iq4VAZPE1Tn7nZijbNlf +uXdowhS2xVvVa5cWVH/e+ibDBELESoXeE2HLGRXd3Fr0yeEUCpOxQLFUITPv09OzafsHq gn81/y+tlpAFBnwh2ZVkU0RJ3QcKF+p3lgokStCissnfZ+vf4uJRx8TaFa2hKg== 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=1740665814; 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=mFN780bje7cBIs/h6sGWuEeu/Wk1kH+75HmXh8652rs=; b=HOioeTYu5CHNuEn1hRmyBRg8lNGOWNRdFF05S9QzvaHU+csITO+IBaVL/noM7sDtemqDxM McHMQk+vbr1InyrC/b4+1d5SF3zoriaKYu1+BRLvhb2BhTgE67CSZ4AKwm+FnriDSYJeR5 lVpVMh3HL+7xlR6bLXhHpVjN5XbgVGZBdCLTE+80LhrhMmDB0OMN/YB0mpZb8lXa48zxOs 73k4J1+uVCOoSCp0FtuYKTBhfsYlLB8wof1YIbBU+6ngIUdjjpeIKAYjOhwZKA/gXSZukg dSmyJWOXpctGaoMwH00ulCWrtkQO8hzW30ndSjFRArfl5H6RQgt/SlfSfuuzfA== 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 4Z3YLZ6DxSzmZR; Thu, 27 Feb 2025 14:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGs6N016379; Thu, 27 Feb 2025 14:16:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGs9o016376; Thu, 27 Feb 2025 14:16:54 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:54 GMT Message-Id: <202502271416.51REGs9o016376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b9ec2a943df7 - stable/14 - pci_host_generic: Don't rewrite resource start address for translation 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b9ec2a943df7331a9ae067723c79243fe73771ee Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b9ec2a943df7331a9ae067723c79243fe73771ee commit b9ec2a943df7331a9ae067723c79243fe73771ee Author: John Baldwin AuthorDate: 2024-02-14 22:07:33 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 pci_host_generic: Don't rewrite resource start address for translation Allocate resources from the parent device for decoded physical address ranges. When child resources suballocated from rman's are mapped, translate those mapping requests into a mapping request of the associated physical address range in a bus_map_resource method. While here, convert generic_pcie_rman to a bus_get_rman method and use bus_generic_rman_* for operations on child resources. Factor out a generic_pcie_containing_range to share logic between bus_translate_resource and bus_*map_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43894 (cherry picked from commit d79b6b8ec267e7eef6e07cf4245159705e24acd5) --- sys/dev/pci/pci_host_generic.c | 366 ++++++++++++++++++++++++++--------------- sys/dev/pci/pci_host_generic.h | 1 + 2 files changed, 235 insertions(+), 132 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 02ca010a14d7..45a478634d20 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -85,7 +85,7 @@ pci_host_generic_core_attach(device_t dev) uint64_t size; char buf[64]; int domain, error; - int rid, tuple; + int flags, rid, tuple, type; sc = device_get_softc(dev); sc->dev = dev; @@ -173,19 +173,26 @@ pci_host_generic_core_attach(device_t dev) phys_base = sc->ranges[tuple].phys_base; pci_base = sc->ranges[tuple].pci_base; size = sc->ranges[tuple].size; - if (phys_base == 0 || size == 0) + rid = tuple + 1; + if (size == 0) continue; /* empty range element */ switch (FLAG_TYPE(sc->ranges[tuple].flags)) { case FLAG_TYPE_PMEM: sc->has_pmem = true; + flags = RF_PREFETCHABLE; + type = SYS_RES_MEMORY; error = rman_manage_region(&sc->pmem_rman, pci_base, pci_base + size - 1); break; case FLAG_TYPE_MEM: + flags = 0; + type = SYS_RES_MEMORY; error = rman_manage_region(&sc->mem_rman, pci_base, pci_base + size - 1); break; case FLAG_TYPE_IO: + flags = 0; + type = SYS_RES_IOPORT; error = rman_manage_region(&sc->io_rman, pci_base, pci_base + size - 1); break; @@ -197,11 +204,44 @@ pci_host_generic_core_attach(device_t dev) "error = %d\n", error); goto err_rman_manage; } + error = bus_set_resource(dev, type, rid, phys_base, size); + if (error != 0) { + device_printf(dev, + "failed to set resource for range %d: %d\n", tuple, + error); + goto err_rman_manage; + } + sc->ranges[tuple].res = bus_alloc_resource_any(dev, type, &rid, + RF_ACTIVE | RF_UNMAPPED | flags); + if (sc->ranges[tuple].res == NULL) { + device_printf(dev, + "failed to allocate resource for range %d\n", tuple); + goto err_rman_manage; + } } return (0); err_rman_manage: + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + if (sc->ranges[tuple].size == 0) + continue; /* empty range element */ + switch (FLAG_TYPE(sc->ranges[tuple].flags)) { + case FLAG_TYPE_PMEM: + case FLAG_TYPE_MEM: + type = SYS_RES_MEMORY; + break; + case FLAG_TYPE_IO: + type = SYS_RES_IOPORT; + break; + default: + continue; + } + if (sc->ranges[tuple].res != NULL) + bus_release_resource(dev, type, tuple + 1, + sc->ranges[tuple].res); + bus_delete_resource(dev, type, tuple + 1); + } rman_fini(&sc->io_rman); err_io_rman: rman_fini(&sc->mem_rman); @@ -222,7 +262,7 @@ int pci_host_generic_core_detach(device_t dev) { struct generic_pcie_core_softc *sc; - int error; + int error, tuple, type; sc = device_get_softc(dev); @@ -230,6 +270,25 @@ pci_host_generic_core_detach(device_t dev) if (error != 0) return (error); + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + if (sc->ranges[tuple].size == 0) + continue; /* empty range element */ + switch (FLAG_TYPE(sc->ranges[tuple].flags)) { + case FLAG_TYPE_PMEM: + case FLAG_TYPE_MEM: + type = SYS_RES_MEMORY; + break; + case FLAG_TYPE_IO: + type = SYS_RES_IOPORT; + break; + default: + continue; + } + if (sc->ranges[tuple].res != NULL) + bus_release_resource(dev, type, tuple + 1, + sc->ranges[tuple].res); + bus_delete_resource(dev, type, tuple + 1); + } rman_fini(&sc->io_rman); rman_fini(&sc->mem_rman); rman_fini(&sc->pmem_rman); @@ -349,8 +408,9 @@ generic_pcie_write_ivar(device_t dev, device_t child, int index, } static struct rman * -generic_pcie_rman(struct generic_pcie_core_softc *sc, int type, int flags) +generic_pcie_get_rman(device_t dev, int type, u_int flags) { + struct generic_pcie_core_softc *sc = device_get_softc(dev); switch (type) { case SYS_RES_IOPORT: @@ -371,8 +431,6 @@ pci_host_generic_core_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { struct generic_pcie_core_softc *sc; - struct rman *rm; - int error; sc = device_get_softc(dev); @@ -381,76 +439,79 @@ pci_host_generic_core_release_resource(device_t dev, device_t child, int type, return (pci_domain_release_bus(sc->ecam, child, rid, res)); } #endif + return (bus_generic_rman_release_resource(dev, child, type, rid, res)); +} - rm = generic_pcie_rman(sc, type, rman_get_flags(res)); - if (rm != NULL) { - KASSERT(rman_is_region_manager(res, rm), ("rman mismatch")); - if (rman_get_flags(res) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, res); - if (error) - return (error); - } - return (rman_release_resource(res)); +static struct pcie_range * +generic_pcie_containing_range(device_t dev, int type, rman_res_t start, + rman_res_t end) +{ + struct generic_pcie_core_softc *sc = device_get_softc(dev); + uint64_t pci_base; + uint64_t size; + int i, space; + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (NULL); } - return (bus_generic_release_resource(dev, child, type, rid, res)); + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + pci_base = sc->ranges[i].pci_base; + size = sc->ranges[i].size; + if (size == 0) + continue; /* empty range element */ + + if (start < pci_base || end >= pci_base + size) + continue; + + switch (FLAG_TYPE(sc->ranges[i].flags)) { + case FLAG_TYPE_MEM: + case FLAG_TYPE_PMEM: + space = SYS_RES_MEMORY; + break; + case FLAG_TYPE_IO: + space = SYS_RES_IOPORT; + break; + default: + continue; + } + + if (type == space) + return (&sc->ranges[i]); + } + return (NULL); } static int generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, rman_res_t end, rman_res_t *new_start, rman_res_t *new_end) { - struct generic_pcie_core_softc *sc; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; - int i, space; - bool found; + struct pcie_range *range; - sc = device_get_softc(dev); /* Translate the address from a PCI address to a physical address */ switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: - found = false; - for (i = 0; i < MAX_RANGES_TUPLES; i++) { - pci_base = sc->ranges[i].pci_base; - phys_base = sc->ranges[i].phys_base; - size = sc->ranges[i].size; - - if (start < pci_base || start >= pci_base + size) - continue; - - switch (FLAG_TYPE(sc->ranges[i].flags)) { - case FLAG_TYPE_MEM: - case FLAG_TYPE_PMEM: - space = SYS_RES_MEMORY; - break; - case FLAG_TYPE_IO: - space = SYS_RES_IOPORT; - break; - default: - space = -1; - continue; - } - - if (type == space) { - *new_start = start - pci_base + phys_base; - *new_end = end - pci_base + phys_base; - found = true; - break; - } + range = generic_pcie_containing_range(dev, type, start, end); + if (range == NULL) + return (ENOENT); + if (range != NULL) { + *new_start = start - range->pci_base + range->phys_base; + *new_end = end - range->pci_base + range->phys_base; } break; default: /* No translation for non-memory types */ *new_start = start; *new_end = end; - found = true; break; } - return (found ? 0 : ENOENT); + return (0); } static int @@ -469,48 +530,32 @@ pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, { struct generic_pcie_core_softc *sc; struct resource *res; - struct rman *rm; sc = device_get_softc(dev); + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) { - return (pci_domain_alloc_bus(sc->ecam, child, rid, start, end, - count, flags)); - } + case PCI_RES_BUS: + res = pci_domain_alloc_bus(sc->ecam, child, rid, start, end, + count, flags); + break; #endif - - rm = generic_pcie_rman(sc, type, flags); - if (rm == NULL) - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, - type, rid, start, end, count, flags)); - - if (bootverbose) { - device_printf(dev, - "rman_reserve_resource: start=%#jx, end=%#jx, count=%#jx\n", - start, end, count); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + res = bus_generic_rman_alloc_resource(dev, child, type, rid, + start, end, count, flags); + break; + default: + res = bus_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags); + break; + } + if (res == NULL) { + device_printf(dev, "%s FAIL: type=%d, rid=%d, " + "start=%016jx, end=%016jx, count=%016jx, flags=%x\n", + __func__, type, *rid, start, end, count, flags); } - - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) - goto fail; - - rman_set_rid(res, *rid); - - if (flags & RF_ACTIVE) - if (bus_activate_resource(child, type, *rid, res)) { - rman_release_resource(res); - goto fail; - } - return (res); - -fail: - device_printf(dev, "%s FAIL: type=%d, rid=%d, " - "start=%016jx, end=%016jx, count=%016jx, flags=%x\n", - __func__, type, *rid, start, end, count, flags); - - return (NULL); } static int @@ -519,33 +564,22 @@ generic_pcie_activate_resource(device_t dev, device_t child, int type, { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; -#endif - rman_res_t start, end; - int res; -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) sc = device_get_softc(dev); - if (type == PCI_RES_BUS) { +#endif + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_activate_bus(sc->ecam, child, rid, r)); - } #endif - - if ((res = rman_activate_resource(r)) != 0) - return (res); - - start = rman_get_start(r); - end = rman_get_end(r); - res = generic_pcie_translate_resource_common(dev, type, start, end, - &start, &end); - if (res != 0) { - rman_deactivate_resource(r); - return (res); + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(dev, child, type, + rid, r)); + default: + return (bus_generic_activate_resource(dev, child, type, rid, + r)); } - rman_set_start(r, start); - rman_set_end(r, end); - - return (BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, - rid, r)); } static int @@ -554,50 +588,115 @@ generic_pcie_deactivate_resource(device_t dev, device_t child, int type, { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; -#endif - int res; -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) sc = device_get_softc(dev); - if (type == PCI_RES_BUS) { - return (pci_domain_deactivate_bus(sc->ecam, child, rid, r)); - } #endif - if ((res = rman_deactivate_resource(r)) != 0) - return (res); - switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (pci_domain_deactivate_bus(sc->ecam, child, rid, r)); +#endif case SYS_RES_IOPORT: case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; + return (bus_generic_rman_deactivate_resource(dev, child, type, + rid, r)); default: - break; + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); } - - return (res); } static int generic_pcie_adjust_resource(device_t dev, device_t child, int type, struct resource *res, rman_res_t start, rman_res_t end) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) struct generic_pcie_core_softc *sc; - struct rman *rm; sc = device_get_softc(dev); +#endif + switch (type) { #if defined(NEW_PCIB) && defined(PCI_RES_BUS) - if (type == PCI_RES_BUS) + case PCI_RES_BUS: return (pci_domain_adjust_bus(sc->ecam, child, res, start, end)); #endif + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(dev, child, type, res, + start, end)); + default: + return (bus_generic_adjust_resource(dev, child, type, res, + start, end)); + } +} + +static int +generic_pcie_map_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map_request *argsp, + struct resource_map *map) +{ + struct resource_map_request args; + struct pcie_range *range; + rman_res_t length, start; + int error; + + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (EINVAL); +#endif + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (bus_generic_map_resource(dev, child, type, r, argsp, + map)); + } - rm = generic_pcie_rman(sc, type, rman_get_flags(res)); - if (rm != NULL) - return (rman_adjust_resource(res, start, end)); - return (bus_generic_adjust_resource(dev, child, type, res, start, end)); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + range = generic_pcie_containing_range(dev, type, rman_get_start(r), + rman_get_end(r)); + if (range == NULL || range->res == NULL) + return (ENOENT); + + args.offset = start - range->pci_base; + args.length = length; + return (bus_generic_map_resource(dev, child, type, range->res, &args, + map)); +} + +static int +generic_pcie_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + struct pcie_range *range; + + switch (type) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + case PCI_RES_BUS: + return (EINVAL); +#endif + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + range = generic_pcie_containing_range(dev, type, + rman_get_start(r), rman_get_end(r)); + if (range == NULL || range->res == NULL) + return (ENOENT); + r = range->res; + break; + default: + break; + } + return (bus_generic_unmap_resource(dev, child, type, r, map)); } static bus_dma_tag_t @@ -613,6 +712,7 @@ static device_method_t generic_pcie_methods[] = { DEVMETHOD(device_attach, pci_host_generic_core_attach), DEVMETHOD(device_detach, pci_host_generic_core_detach), + DEVMETHOD(bus_get_rman, generic_pcie_get_rman), DEVMETHOD(bus_read_ivar, generic_pcie_read_ivar), DEVMETHOD(bus_write_ivar, generic_pcie_write_ivar), DEVMETHOD(bus_alloc_resource, pci_host_generic_core_alloc_resource), @@ -621,6 +721,8 @@ static device_method_t generic_pcie_methods[] = { DEVMETHOD(bus_deactivate_resource, generic_pcie_deactivate_resource), DEVMETHOD(bus_release_resource, pci_host_generic_core_release_resource), DEVMETHOD(bus_translate_resource, generic_pcie_translate_resource), + DEVMETHOD(bus_map_resource, generic_pcie_map_resource), + DEVMETHOD(bus_unmap_resource, generic_pcie_unmap_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), diff --git a/sys/dev/pci/pci_host_generic.h b/sys/dev/pci/pci_host_generic.h index 8e72ac6e5cef..2d7583b861c8 100644 --- a/sys/dev/pci/pci_host_generic.h +++ b/sys/dev/pci/pci_host_generic.h @@ -63,6 +63,7 @@ struct pcie_range { #define FLAG_TYPE_IO 0x1 #define FLAG_TYPE_MEM 0x2 #define FLAG_TYPE_PMEM 0x3 + struct resource *res; }; struct generic_pcie_core_softc { From nobody Thu Feb 27 14:17:14 2025 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 4Z3YLz2tvDz5qG2M; Thu, 27 Feb 2025 14:17:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLz15GRz3xPb; Thu, 27 Feb 2025 14:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665835; 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=WtGqKK6Noe0LGu+K5LInQeyjSHnLo/fZqIXTq1aSnAA=; b=BiCdp45hANMsINouHWEFosjwen9KPnzBFVye+YOPcMRLuN9XMqEvfH+DMIKGWkDiJXj2sq EdHzPVtkREUZVSnYoiYxm6bNGHshrnulPoT2uODXDm+9X5pbvuywPzF/QiCpN4GB4Rz8I3 fsKQHzd5OIEovsCCuwFMCwlUduX+o33cZHFZQYL4ygX3Zhksj6v5c6o478Ijf8jOFROfbT 339tYuohr4ie+wu7NVyt7FZlMLcgUW0qBXtSml177BHVGGEa66Uqd9wvRvYpiJ5B+PMe6N JfogacaPSmqEX3zEl6Qumql17LAMA2XHwmrB2q61OxrCCPjE2Ltb6MzQW2ThDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665835; a=rsa-sha256; cv=none; b=RniANNx8LEscAfREUmGh0hG0cQE3u+dsFpIB13JdUs1Rd2xDJQRBCjN5VTMqJDlbtQCuD6 fEYXWCfSg3tv0IEe0XHdMAkwe1raS6zo63NPpozEkW+c7qLYwWWB/mIP+dO9zH9/b2w4t9 9HMnFZuxpIDwcU83v7kRx61byzR481lHcWRbW49gqJyT1EX0ABpp1Qfu8jTWKOchYQsQXB cJyQ90cMwh7FXBCJbA+YkO1Js4zLSli1Jgrxek26sOGmGIuTl7SzjE10A7EANhA6qng0Y3 jiLq8I5uTjOcOuH2R1+81NS42HaW67KgJKcs6dyWARExFbah0gySShNB0+Lu6w== 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=1740665835; 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=WtGqKK6Noe0LGu+K5LInQeyjSHnLo/fZqIXTq1aSnAA=; b=RGMdu0ZlHbA8b+KyMZJzj86bo7yMfkIbcUxSmQePyTEXygOTVJwZRg5o8pxT7SVq53S70a 8+DOrLAPMcVzaB8BzpCXH7aXpRTDzWO0Jr1tIPsBQM/Hux/VfJ+gumm16JpSLWGPkZQsj7 syW/1ZCAddnOIp+/WvKwRxsWLP4w4wdxsJDInSYUodZdgdVB2Rv9mj+RPy7WSs3t3f3+de M182Mx79xGaLds1K7iOgTbcpRJCK2arvs0FnKZ+csXhTiB+ne8yaywpfaSbpZqC6ATqOYd weo0sk2tR1aIyWDLVGcj2qdRiUfR7M+s2urtVYHWGIUGf+EWqGFiOFuUoD9Ofw== 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 4Z3YLz0gs7zm7P; Thu, 27 Feb 2025 14:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REHEBG017018; Thu, 27 Feb 2025 14:17:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REHEDa017015; Thu, 27 Feb 2025 14:17:14 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:17:14 GMT Message-Id: <202502271417.51REHEDa017015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: fff81f9d4e14 - stable/14 - pci_host_generic: Simplify generic_pcie_translate_resource 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fff81f9d4e140e0ff03ff338f541d3f2c13982f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fff81f9d4e140e0ff03ff338f541d3f2c13982f6 commit fff81f9d4e140e0ff03ff338f541d3f2c13982f6 Author: John Baldwin AuthorDate: 2024-03-05 04:53:21 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:22 +0000 pci_host_generic: Simplify generic_pcie_translate_resource Inline generic_pcie_translate_resource_common into its sole caller. No functional change. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D44206 (cherry picked from commit 291079d0ebdd078840ccb27aaa5d286e03e2e7e6) --- sys/dev/pci/pci_host_generic.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 0f85e23eb028..da49edcf91f5 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -504,8 +504,8 @@ generic_pcie_containing_range(device_t dev, int type, rman_res_t start, } static int -generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, - rman_res_t end, rman_res_t *new_start, rman_res_t *new_end) +generic_pcie_translate_resource(device_t dev, int type, rman_res_t start, + rman_res_t *new_start) { struct pcie_range *range; @@ -513,34 +513,20 @@ generic_pcie_translate_resource_common(device_t dev, int type, rman_res_t start, switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: - range = generic_pcie_containing_range(dev, type, start, end); + range = generic_pcie_containing_range(dev, type, start, start); if (range == NULL) return (ENOENT); - if (range != NULL) { - *new_start = start - range->pci_base + range->phys_base; - *new_end = end - range->pci_base + range->phys_base; - } + *new_start = start - range->pci_base + range->phys_base; break; default: /* No translation for non-memory types */ *new_start = start; - *new_end = end; break; } return (0); } -static int -generic_pcie_translate_resource(device_t bus, int type, - rman_res_t start, rman_res_t *newstart) -{ - rman_res_t newend; /* unused */ - - return (generic_pcie_translate_resource_common( - bus, type, start, start, newstart, &newend)); -} - struct resource * pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) From nobody Thu Feb 27 21:11:49 2025 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 4Z3kYL37l2z59Wbc; Thu, 27 Feb 2025 21:11:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3kYK74TKz45xr; Thu, 27 Feb 2025 21:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740690710; 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=OK6X8UmxkDgVUKbJqrmNv0is0JHvQAyeRWS6vPYyIfI=; b=VzST+2TJgUKKOif54Sr2viyHTxTgiau/0va6i7zF2yMjPAJPGMvzTBx3gexFKHaPMCdm4n OSvBRbgYi2cKXErF5bjyqrcoz+plavU8cNvqI2jgxLEl6hzWRABQL328CueQmxBy2cBXBB peTrYqn/tPu6Oep1t0vWKwcwfb4DPpK8MRC7W3FEVdoxbQk0AzGiC2RvnzTdxgDf0Qf5nu gBoE+PSabCpHfRL01jc1CUKJWdYc5TlMyCaJvAY63LadkE7agAAE/oGNebM9qtQTVvaCuF Q4To9l6AmTnEws2+KioTQdfKmNA4d+9vqaaH4YlJIdeUVROgCICsT8MSVlKBCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740690710; a=rsa-sha256; cv=none; b=TLIv/bdLX2eNSBO0/YuiORPgUB1sctuF8PMraKb4k3l8w5d1bE/BfW/O8aKAmlb13TNV0N L2ZOfPiOqj1Dc12/xKtM+E8cuFU3CD/koQovTtkGnyNOBqoJRLNfUTb3rB70aC64wVaQCa A4U1bfxqepb3Ql9J9j5AEyDXULK9iDJBTr6PcmZ7g3o6tsLLlKxRtFYv56e9HaXW1dRyOr X8h4JGR7KqmX0t+PP/oYNjdd6VeOslC1Au0KEM1+O98l9yHOi6GRjsnI8EAyAS9x5l1/yq S/QLdHIsT7SiKwyTux0qJEYJQvAyOT1ZKJnSK7MlN0zSAQz+8qgnf2kVpkISdw== 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=1740690710; 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=OK6X8UmxkDgVUKbJqrmNv0is0JHvQAyeRWS6vPYyIfI=; b=NvJ3XqMq4zurEzTHExrIsbJgNXV4si3+nrUkvf3K7bQbduIAa2xDJnxLKTYMKuyjonC96d D4dXGt/OY4z3KCPN1VuRLku/w6NAdMbSVNEXDPzM2ek/0cdR40Ulhi+xSyKaslRSVnQuZn 8yhPwbQyPd4vlzIX/QUrJKoJEnJF+QcLxYmmUwsj/q6tTxbx7T44KMzLBDdYP4QWBdmVjX s6xPsR9HT7o1m41Cw4XIgPXhwEtXqvGkvfs8wC5wnH3RG9v1gPbrjpbkHmR3Q8j0tmvcCU GZheZu2HQGU/8SeRLTfQ/dDCOFRzuIFrUGrj+b9KsG9uWLK4qUI0Gm9fVHk4XQ== 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 4Z3kYK6Z70z10K7; Thu, 27 Feb 2025 21:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51RLBnPG098614; Thu, 27 Feb 2025 21:11:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51RLBna7098611; Thu, 27 Feb 2025 21:11:49 GMT (envelope-from git) Date: Thu, 27 Feb 2025 21:11:49 GMT Message-Id: <202502272111.51RLBna7098611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4fd887f08b00 - stable/13 - queue: Fix STAILQ_ASSERT_EMPTY() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4fd887f08b000173c196e954b510752025ff3fc0 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4fd887f08b000173c196e954b510752025ff3fc0 commit 4fd887f08b000173c196e954b510752025ff3fc0 Author: Olivier Certner AuthorDate: 2025-02-27 20:59:41 +0000 Commit: Olivier Certner CommitDate: 2025-02-27 21:11:10 +0000 queue: Fix STAILQ_ASSERT_EMPTY() The 'while' part corresponding to the 'do' was missing. Did not notice the problem as later commits using it have been stashed and never reworked up to now, and it is currently unused in the tree. While here, fix spacing after the '#define' in the !(_KERNEL && INVARIANS) part. Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") MFC after: 1 minute Sponsored by: The FreeBSD Foundation (cherry picked from commit d3c4b002d1fd54ac69c1714e208051867ee56dc4) --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 0b1e1f9fba55..31a220bcdcc0 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -356,7 +356,7 @@ struct { \ #define STAILQ_ASSERT_EMPTY(head) do { \ if (!STAILQ_EMPTY((head))) \ panic("stailq %p is not empty", (head)); \ -} +} while (0) /* * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) @@ -370,7 +370,7 @@ struct { \ } while (0) #else #define QMD_STAILQ_CHECK_EMPTY(head) -#define STAILQ_ASSERT_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) #define QMD_STAILQ_CHECK_TAIL(head) #endif /* (_KERNEL && INVARIANTS) */ From nobody Thu Feb 27 14:16:58 2025 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 4Z3YLf392nz5qFrN; Thu, 27 Feb 2025 14:16:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLf2cBtz3xMD; Thu, 27 Feb 2025 14:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665818; 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=YXUr+Ky+kqeJ7TxEFAwfjnixXTFHw6Km/rXZebiv+tg=; b=DUMk59ag0fua3rRUNhf/47QavqZxAgozqnXidbBscY1y3/SJF0aRcYL+SxWwhkmd62pVQa cDfOfsoCGwIZ+daIVDS+GeOYvalOc53zIC+T1iA1qj4nLfvXJzurg+MtvTg3FRqPyyNfqq qoU3ajW3oW4SKZbaIxedHdCZ2cdl4ZEFFa29Br6OPA3mo+eTKZqPSIi6ue2CuLK5RjASaN tt9y6UPj6XK1mmeQe8fG0TqjaUpXZJa9HRvZ2Ew9goIxe4/PbwT9yZjsLxkQXIxS7wmi7N uQvu0fJbgHm2dPuCjYA1Zl5LbCUPzJdlRvl+aDydrlB/dXSil3IDNEI4L9eYog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665818; a=rsa-sha256; cv=none; b=FklNnLtUeGbMWA0AEqyrhSN1Z0pw8ej23lRfgct2V68E1/DJsyKlrybwBoqCPtoxd2MYVt kiRw8bq9vf7I3/TSBd6Gcsk3uCpGcv5sFerKj7i3dhZAwvKnV3fH7fBzgzSXO6pTnfwdba 54+mFkDzPliVvp936mMt5/P9Q2A2RmbebTQxwWbu/6kaEczzgTsbBR78Yk5aQJoCictK5U Y7XViSWoBCV23t50Gbhp4wakqGDVCbteVbYE+UxMFopNkK3U3VerpE1UnFZ3EBBHU2zwqz 5UOdgTjkcaw71bJyOzYPWxBnuUKscWsg8c6Cpye5kmFPi2V14yMwK/s+wPX6kQ== 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=1740665818; 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=YXUr+Ky+kqeJ7TxEFAwfjnixXTFHw6Km/rXZebiv+tg=; b=H4a6HMPG73i7VxPiTpGcwpDiZ+Oorjw2v71ODLtpHsQPlNN/6ror29HV+iET0hrPxhCKPl L8JOi+cg38D6OJ5wMPa5btEPpaUUIoru46q9Vr1hTgpSyr+TIDWueg4GHy3Dd40YGQWIr8 7iS9aaac+jm3H6GLrsZTlOMa36reGh36lNrqG5ch2WcNnr7b5Fukml4+S1x7mQ0UJ4uY2+ +eLNZNHbveLOJPszd79t1vQSxDZ/ZGarOIbR6/9R/hGdQJGt7HAPjVkeNSWnDxqQnzmDi8 ohYXRlMrtPZP+MemasYHWzhvj485amJ8XK28b6VnukaGwU+sWS/RFbBgUu3E7Q== 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 4Z3YLf20Cdzmdw; Thu, 27 Feb 2025 14:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGwDL016492; Thu, 27 Feb 2025 14:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGwsO016489; Thu, 27 Feb 2025 14:16:58 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:58 GMT Message-Id: <202502271416.51REGwsO016489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8765268c119f - stable/14 - simplebus: Map SYS_RES_IOPORT to SYS_RES_MEMORY later in alloc_resource 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8765268c119f3fe4d0a4a9e65ce3be0efd283133 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8765268c119f3fe4d0a4a9e65ce3be0efd283133 commit 8765268c119f3fe4d0a4a9e65ce3be0efd283133 Author: John Baldwin AuthorDate: 2024-02-16 00:04:50 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:21 +0000 simplebus: Map SYS_RES_IOPORT to SYS_RES_MEMORY later in alloc_resource Specifically, the set/get_resource methods do not currently remap resource types, so remap the type in alloc_resource only after looking for a matching resource list entry. Fixes: 3cf553288b96 simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY (cherry picked from commit 4505c89242025f840023cdf092fdab845586f42d) --- sys/dev/fdt/simplebus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index 273e77abd642..854494eb4899 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -448,9 +448,6 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, sc = device_get_softc(bus); - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - /* * Request for the default allocation with a given rid: use resource * list stored in the local device info. @@ -471,6 +468,9 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, count = rle->count; } + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + if (type == SYS_RES_MEMORY) { /* Remap through ranges property */ for (j = 0; j < sc->nranges; j++) { From nobody Thu Feb 27 14:16:41 2025 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 4Z3YLK38Kvz5qFXv; Thu, 27 Feb 2025 14:16:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YLK2WYLz3wys; Thu, 27 Feb 2025 14:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665801; 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=9ihQVPaY/E+OywMuFy9GJxWOhdLeSoR79zz+I/4QUlQ=; b=NybVgevjHR8u1IRSw1VxfYipR9lqBYhhhVTVrUIxpi7GkThjeqaUiabPgClIDAsufYNXVE q9t9nOYHrPIrOrv2A8xxFrwQHkz31NDfbGN4Q0vfx8wf83KEaVo8c3G7SbiRiLxhm67yGW QK/9T23XXa7E6B3AsQq15/WmtIsK8HWPywSHRhMrrA40TalaIlVb3+ou2enFnsIiWj3CeB OHJOohs58Q3DiLlINnTBaI4/k6aDYfRLdjbHu42lul0QDVIyQnrJDzzOf9dGxvA/CLQUYN 0F3dAVcu4KwGvLJTxY8CC7NOqs8kc1ejSYA/g/6JkkUHqb33R/4MxdZMC7gYDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665801; a=rsa-sha256; cv=none; b=NclYjqGeL0L4XV+my/3Kvd8wxTAi2EhI5zdfWOu2O8mGxRkEmjnKhoS9iYmU2JqSuwhv3n 3FmnO8i5QBS/QQGQ96IzdvcB3dcT1S2TEIWEmU+xVPVshAvltL+kcK6KGOR9RzzA80D863 YyMFpbCnU2ZbadW8AYWMyUUpS0UA53+nROeZVJuIoJKdYC4cOhJRQO5eb8kYSt7uM34JA9 iPgBlErtb9yXgNspSLHk+VS9QLAh0ElvaYilVwShPjVQ3u1E4n11joAKGNPjoK6NgAjThP F6kitWeBFDvb1fvB/VmN9PBnWWtoml7SlUIlVWqoRq68WILAeH3YHqFsU4k1TQ== 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=1740665801; 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=9ihQVPaY/E+OywMuFy9GJxWOhdLeSoR79zz+I/4QUlQ=; b=RRn5/xJtDHFztKNI1J8xICLZPcODdmjK6Qn0q66UUw1CcA52lGLvNtDmlrmxR9wdJBxQb0 XCSIa+wslMONBc8iaGMf2WVookBVuTtMiJEA9tfeq+w3ZtFF9tfSTKjwAjoaR1+fFGCipm BMJpLWXummlTtKRmm3QuYJMnEJOuDDJRgDAhIeSMiOwBBUObJoKt/dmvTwTIH65HAMpErc ON76WTuV4UwnUckiAO306ZG28AvOy8rBunn/AwHp6/BaC0YDINC2nS5Y6LUuVAVpyq9T3i KZbZyr9xi5YUaRb24uDZvK9Rc/RWLxmbbxeKxpSSG3HRmCFJx3dWEIUwbmK1yA== 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 4Z3YLK2474zmZP; Thu, 27 Feb 2025 14:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGfCE015951; Thu, 27 Feb 2025 14:16:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGfC0015948; Thu, 27 Feb 2025 14:16:41 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:41 GMT Message-Id: <202502271416.51REGfC0015948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e389a717877b - stable/14 - arm mv_pcib: Use bus_generic_rman_* 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e389a717877bca69241f41cb4015743f2058ab25 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e389a717877bca69241f41cb4015743f2058ab25 commit e389a717877bca69241f41cb4015743f2058ab25 Author: John Baldwin AuthorDate: 2024-01-23 17:37:30 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 arm mv_pcib: Use bus_generic_rman_* - Implement bus_get_rman pulling bits from mv_pcib_alloc_resource. - Implement bus_map/unmap_resource pulling bits from mv_pcib_activate/deactivate_resource. - Use bus_generic_rman_* to handle memory and I/O resources for mv_pcib_alloc/activate/adjust/deactivate/release_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43438 (cherry picked from commit 4e1d94d99798b9176b477062a9c7502c33d3e810) --- sys/arm/mv/mv_pci.c | 180 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 157 insertions(+), 23 deletions(-) diff --git a/sys/arm/mv/mv_pci.c b/sys/arm/mv/mv_pci.c index f6aa52611c86..64736d8c1108 100644 --- a/sys/arm/mv/mv_pci.c +++ b/sys/arm/mv/mv_pci.c @@ -343,10 +343,21 @@ static int mv_pcib_mem_init(struct mv_pcib_softc *); static int mv_pcib_probe(device_t); static int mv_pcib_attach(device_t); +static struct rman *mv_pcib_get_rman(device_t, int, u_int); static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int mv_pcib_adjust_resource(device_t, device_t, int, struct resource *, + rman_res_t, rman_res_t); static int mv_pcib_release_resource(device_t, device_t, int, int, struct resource *); +static int mv_pcib_activate_resource(device_t, device_t, int, int, + struct resource *r); +static int mv_pcib_deactivate_resource(device_t, device_t, int, int, + struct resource *r); +static int mv_pcib_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); +static int mv_pcib_unmap_resource(device_t, device_t, int, struct resource *, + struct resource_map *); static int mv_pcib_read_ivar(device_t, device_t, int, uintptr_t *); static int mv_pcib_write_ivar(device_t, device_t, int, uintptr_t); @@ -371,10 +382,14 @@ static device_method_t mv_pcib_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, mv_pcib_read_ivar), DEVMETHOD(bus_write_ivar, mv_pcib_write_ivar), + DEVMETHOD(bus_get_rman, mv_pcib_get_rman), DEVMETHOD(bus_alloc_resource, mv_pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, mv_pcib_adjust_resource), DEVMETHOD(bus_release_resource, mv_pcib_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_activate_resource, mv_pcib_activate_resource), + DEVMETHOD(bus_deactivate_resource, mv_pcib_deactivate_resource), + DEVMETHOD(bus_map_resource, mv_pcib_map_resource), + DEVMETHOD(bus_unmap_resource, mv_pcib_unmap_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -877,20 +892,30 @@ mv_pcib_init_all_bars(struct mv_pcib_softc *sc, int bus, int slot, return (0); } +static struct rman * +mv_pcib_get_rman(device_t dev, int type, u_int flags) +{ + struct mv_pcib_softc *sc = device_get_softc(dev); + + switch (type) { + case SYS_RES_IOPORT: + return (&sc->sc_io_rman); + case SYS_RES_MEMORY: + return (&sc->sc_mem_rman); + default: + return (NULL); + } +} + static struct resource * mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct mv_pcib_softc *sc = device_get_softc(dev); - struct rman *rm = NULL; - struct resource *res; switch (type) { case SYS_RES_IOPORT: - rm = &sc->sc_io_rman; - break; case SYS_RES_MEMORY: - rm = &sc->sc_mem_rman; break; #ifdef PCI_RES_BUS case PCI_RES_BUS: @@ -912,21 +937,32 @@ mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, (end > sc->sc_mem_base + sc->sc_mem_size - 1)) return (NULL); - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) - return (NULL); - - rman_set_rid(res, *rid); - rman_set_bustag(res, fdtbus_bs_tag); - rman_set_bushandle(res, start); + return (bus_generic_rman_alloc_resource(dev, child, type, rid, + start, end, count, flags)); +} - if (flags & RF_ACTIVE) - if (bus_activate_resource(child, type, *rid, res)) { - rman_release_resource(res); - return (NULL); - } +static int +mv_pcib_adjust_resource(device_t dev, device_t child, int type, + struct resource *r, rman_res_t start, rman_res_t end) +{ +#ifdef PCI_RES_BUS + struct mv_pcib_softc *sc = device_get_softc(dev); +#endif - return (res); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_adjust_resource(dev, child, type, r, + start, end)); +#ifdef PCI_RES_BUS + case PCI_RES_BUS: + return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, + end)); +#endif + default: + return (bus_generic_adjust_resource(dev, child, type, r, + start, end)); + } } static int @@ -935,15 +971,113 @@ mv_pcib_release_resource(device_t dev, device_t child, int type, int rid, { #ifdef PCI_RES_BUS struct mv_pcib_softc *sc = device_get_softc(dev); +#endif - if (type == PCI_RES_BUS) + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_release_resource(dev, child, type, + rid, res)); +#ifdef PCI_RES_BUS + case PCI_RES_BUS: return (pci_domain_release_bus(sc->ap_segment, child, rid, res)); #endif - if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) + default: return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, type, rid, res)); + } +} + +static int +mv_pcib_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ +#ifdef PCI_RES_BUS + struct mv_pcib_softc *sc = device_get_softc(dev); +#endif + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_activate_resource(dev, child, type, + rid, r)); +#ifdef PCI_RES_BUS + case PCI_RES_BUS: + return (pci_domain_activate_bus(sc->ap_segment, child, rid, r)); +#endif + default: + return (bus_generic_activate_resource(dev, child, type, rid, + r)); + } +} + +static int +mv_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ +#ifdef PCI_RES_BUS + struct mv_pcib_softc *sc = device_get_softc(dev); +#endif + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (bus_generic_rman_deactivate_resource(dev, child, type, + rid, r)); +#ifdef PCI_RES_BUS + case PCI_RES_BUS: + return (pci_domain_deactivate_bus(sc->ap_segment, child, rid, + r)); +#endif + default: + return (bus_generic_deactivate_resource(dev, child, type, rid, + r)); + } +} + +static int +mv_pcib_map_resource(device_t dev, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t length, start; + int error; - return (rman_release_resource(res)); + /* Resources must be active to be mapped. */ + if (!(rman_get_flags(r) & RF_ACTIVE)) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + error = resource_validate_map_request(r, argsp, &args, &start, &length); + if (error) + return (error); + + map->r_bustag = fdtbus_bs_tag; + map->r_bushandle = start; + map->r_size = length; + return (0); +} + +static int +mv_pcib_unmap_resource(device_t dev, device_t child, int type, + struct resource *r, struct resource_map *map) +{ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + return (0); + default: + return (EINVAL); + } } static int From nobody Thu Feb 27 14:16:30 2025 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 4Z3YL62y1dz5qGFf; Thu, 27 Feb 2025 14:16:30 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3YL624VVz3wtg; Thu, 27 Feb 2025 14:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740665790; 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=BvCWGfpyi4mCtqcL8wASZhmRZFdq1wEdmS0GHwiibMA=; b=ygnD8bGNiNxOGevR2bEU7iT00lTgQdc8Mg0D0qUySxZSGx1xHgPKOt6ggjPmVC/YH4fmIy fC+CX6tKnFPBp/AafG0iKdk7TwR11+f3m3B+W3sEDzL87Xn3ksXMR7rW4W8u3DA51pVOWw SYA28AS5vAec5lD6VnN00+IHstzxtjpmlkLgUpdSi9SfwJPV5gfOwyXMNTZ2/1tulwpLzD x+wWK+krzu7Coenk/JM8pk49uBF/drZi6Y6UM25PyD8EWsjgCi9J7p5rbM0Kf/9PVgruuk c2FbYvEstCNNMAVTZAkEaSaY0Z/BB+mvWoOG4HdiG00fIgR/wnnzTS1/HC9DUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740665790; a=rsa-sha256; cv=none; b=RZ5GFfUXfCToDmznrcvoebCoaCj8cU6ugGqrKD9n3DW7XymSozhIzS6uiQUArjDQ5LXL3n NwZQaT6wv13Vq6QOduhSO4U8JfTBSKW5gF7GYcVvbxBQNb46PVihwrr/uJpNfQ6LfV//x+ CQ/3YsakU6oAnRInZx2rPEmLfQlzwF8sJP9Yo1lBMaA4FTo2AEsEr0/ywo8upQ7onBxIKu HvGRgyzPqT1CuVVd4NGrcSqwl5SqQLy06GFJaA9DOrbTjRMhyGapHNQLG9ShjnaAKYF9zR jDc8itbeMC2UsEo3wzYooTXA92o6KJr1wWZYq7xGJ09tRypFMEwL+0HnUNb2Rg== 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=1740665790; 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=BvCWGfpyi4mCtqcL8wASZhmRZFdq1wEdmS0GHwiibMA=; b=JhjQsQnE038wZRajsTWb3R1jSzdlZeBUdc0NBE0QhTsvU4KGVn8Hq1d+Oai0TaTBD2KIwJ I7373Te9x8UTfOuEm9gNyYYd2TOeJf/6tXjlrUDWfrKRPQO50e6NV9gJrNeDY9aKmObp43 CU3/V+Ous3iwjs3QTdwI1aKGtLJ/aeZySu9cGLuEpi46ae2nCSBjrFp5qbqbhRH5m6uZv0 ZBVupSK2WaK1S/9WIVBK70KnEFVkfg0bQQhw4s0QmoB5Y73Ry5BxpjHZO95mE/y+iJRhBn 9AmEVn48cfDb4lHz9jJqzb3+7o0V3I8xJjE+7agg7nkNmxdYutNAmnIdltKhmg== 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 4Z3YL61YgrzmZK; Thu, 27 Feb 2025 14:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51REGUdj015584; Thu, 27 Feb 2025 14:16:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51REGUtD015581; Thu, 27 Feb 2025 14:16:30 GMT (envelope-from git) Date: Thu, 27 Feb 2025 14:16:30 GMT Message-Id: <202502271416.51REGUtD015581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c96d316a888e - stable/14 - pci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c96d316a888e41d1b266fd880383c7802aaf2bd8 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c96d316a888e41d1b266fd880383c7802aaf2bd8 commit c96d316a888e41d1b266fd880383c7802aaf2bd8 Author: John Baldwin AuthorDate: 2024-01-23 17:35:36 +0000 Commit: John Baldwin CommitDate: 2025-02-27 13:09:20 +0000 pci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43429 (cherry picked from commit e9eb353b324a3d051f81dde91d9f9f0fc044d822) --- sys/dev/pci/pci_host_generic.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 082d083fc681..02ca010a14d7 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -517,9 +517,19 @@ static int generic_pcie_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct generic_pcie_core_softc *sc; +#endif rman_res_t start, end; int res; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + sc = device_get_softc(dev); + if (type == PCI_RES_BUS) { + return (pci_domain_activate_bus(sc->ecam, child, rid, r)); + } +#endif + if ((res = rman_activate_resource(r)) != 0) return (res); @@ -542,8 +552,17 @@ static int generic_pcie_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct generic_pcie_core_softc *sc; +#endif int res; +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + sc = device_get_softc(dev); + if (type == PCI_RES_BUS) { + return (pci_domain_deactivate_bus(sc->ecam, child, rid, r)); + } +#endif if ((res = rman_deactivate_resource(r)) != 0) return (res); From nobody Fri Feb 28 09:53:24 2025 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 4Z43SC3Yfcz59Rnn for ; Fri, 28 Feb 2025 09:53:31 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Z43S80s3cz3k2P; Fri, 28 Feb 2025 09:53:27 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=dec.sakura.ne.jp header.s=s2405 header.b=JlzhJAdL; dmarc=pass (policy=none) header.from=dec.sakura.ne.jp; spf=pass (mx1.freebsd.org: domain of junchoon@dec.sakura.ne.jp designates 153.125.133.21 as permitted sender) smtp.mailfrom=junchoon@dec.sakura.ne.jp Received: from kalamity.joker.local (124-18-40-20.area1c.commufa.jp [124.18.40.20]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 51S9rO75052421; Fri, 28 Feb 2025 18:53:25 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dec.sakura.ne.jp; s=s2405; t=1740736405; bh=JsKTRMYRxheXNN+zMTgUBDizx3xkVb7vkA5kzQNeksc=; h=Date:From:To:Cc:Subject; b=JlzhJAdL3jZDus1G9u4tlM5lFdDMd/vfJVlUq6u2Rdyo7gathIS8nIBBNCA09IAUT GxHNWwIr8XELTz7AshR/LwOLTABc7tdXXfNzVfFA5+RvIz3Cgv9zWErzmRK9QBG3BK zP4GK8Pt5WE9Nw76WjqeDDwNH0Xnb+VlkQ1931/Y= Date: Fri, 28 Feb 2025 18:53:24 +0900 From: Tomoaki AOKI To: Cy Schubert Cc: dev-commits-src-branches@freebsd.org Subject: Re: git: 1a241a911dc8 - stable/14 - ntpd: Use the ntpd -u option in preference to the rc su plumbing Message-Id: <20250228185324.df32beaa550475b0832e1ca0@dec.sakura.ne.jp> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.2) 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [0.62 / 15.00]; SUSPICIOUS_URL_IN_SUSPICIOUS_MESSAGE(1.00)[]; FAKE_REPLY(1.00)[]; NEURAL_HAM_LONG(-0.99)[-0.995]; NEURAL_HAM_MEDIUM(-0.96)[-0.958]; NEURAL_HAM_SHORT(-0.73)[-0.726]; MV_CASE(0.50)[]; URIBL_RED(0.50)[dec.sakura.ne.jp:dkim,dec.sakura.ne.jp:mid,dec.sakura.ne.jp:email]; ONCE_RECEIVED(0.20)[]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_ANON_DOMAIN(0.10)[]; HAS_ORG_HEADER(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_DKIM_ALLOW(0.00)[dec.sakura.ne.jp:s=s2405]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; DMARC_POLICY_ALLOW(0.00)[dec.sakura.ne.jp,none]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-branches@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[dec.sakura.ne.jp:+]; R_SPF_ALLOW(0.00)[+ip4:153.125.133.16/28]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: 4Z43S80s3cz3k2P X-Spamd-Bar: / Hi. Unfortunately, this commit caused ntpd hesitating to (re)start with error messages below on stable/14, amd64. ===== Quote ===== # service ntpd stop Stopping ntpd. Waiting for PIDS: 52508. # service ntpd start Starting ntpd. daemon control: got EOF /etc/rc.d/ntpd: WARNING: failed to start ntpd # ===== End quote ===== Note that I have ntpd_flags="-4 -g -x -f /var/db/ntpd.drift -l /var/log/ntpd.log" ntpd_config="/etc/ntp/ntp.conf" ntpd_enable="YES" ntpd_sync_on_start="YES" daily_ntpd_leapfile_enable="YES" ntp_leapfile_fetch_verbose="YES" in my /etc/rc.conf. And the high PID value above is because this output is obtained after several attempts of stopping and starting. Regards. > The branch stable/14 has been updated by cy: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1a241a911dc8635c3803f1a6620e1ab4692f6ecf > > commit 1a241a911dc8635c3803f1a6620e1ab4692f6ecf > Author: Cy Schubert > AuthorDate: 2024-12-12 20:03:09 +0000 > Commit: Cy Schubert > CommitDate: 2025-02-25 00:37:46 +0000 > > ntpd: Use the ntpd -u option in preference to the rc su plumbing > > Using the rc plumbing to setuid(2) is preferred as it allows the user > to use the -i option in ntpd_flags to chroot ntpd. > > Chrooting ntpd by default will be a 2025 project. > > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D48191 > > (cherry picked from commit 521f66715afb312b356afafc68cbc044a436a753) > --- > libexec/rc/rc.d/ntpd | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd > index 76d83149ae1a..36df4ae08c96 100755 > --- a/libexec/rc/rc.d/ntpd > +++ b/libexec/rc/rc.d/ntpd > @@ -98,7 +98,6 @@ ntpd_precmd() > # by the admin, we don't add the option. If the file exists in the old > # default location we use that, else we use the new default location. > if can_run_nonroot; then > - _user="ntpd" > driftopt="-f ${_ntp_default_driftfile}" > elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || > [ -n "${rc_flags}" ] && > @@ -112,7 +111,13 @@ ntpd_precmd() > fi > > # Set command_args based on the various config vars. > - command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}" > + command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt} -u $ {ntpd_user:=ntpd:ntpd}" > + > + # Unset ntpd_user because rc.subr uses $${name}_user to determine > + # whether to invoke su(1) to setuid() to $ntpd_user for us. We want > + # ntpd to do the setuid() itself through the -u argument, above. > + unset ntpd_user > + > if checkyesno ntpd_sync_on_start; then > command_args="${command_args} -g" > fi -- Tomoaki AOKI From nobody Fri Feb 28 14:12:54 2025 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 4Z49Ct546Gz5m0X5 for ; Fri, 28 Feb 2025 14:13:14 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (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 ECDSA (prime256v1) client-digest SHA256) (Client CN "nuc.oldach.net", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z49Cr0z7Hz3ZxN for ; Fri, 28 Feb 2025 14:13:11 +0000 (UTC) (envelope-from freebsd@oldach.net) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=oldach.net; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.18.1/8.18.1) with ESMTPS id 51SECtM7048021 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 28 Feb 2025 15:12:55 +0100 (CET) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.18.1/8.18.1/Submit) id 51SECsWG048020; Fri, 28 Feb 2025 15:12:54 +0100 (CET) (envelope-from freebsd@oldach.net) Message-Id: <202502281412.51SECsWG048020@nuc.oldach.net> X-Authentication-Warning: nuc.oldach.net: hmo set sender to freebsd@oldach.net using -f Subject: Re: git: 1a241a911dc8 - stable/14 - ntpd: Use the ntpd -u option in preference to the rc su plumbing In-Reply-To: <20250228185324.df32beaa550475b0832e1ca0@dec.sakura.ne.jp> from Tomoaki AOKI at "28 Feb 2025 18:53:24" To: junchoon@dec.sakura.ne.jp (Tomoaki AOKI) Date: Fri, 28 Feb 2025 15:12:54 +0100 (CET) Cc: cy@FreeBSD.org, dev-commits-src-branches@freebsd.org From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Fri, 28 Feb 2025 15:12:55 +0100 (CET) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Spamd-Result: default: False [-1.87 / 15.00]; NEURAL_HAM_LONG(-0.99)[-0.989]; NEURAL_HAM_SHORT(-0.82)[-0.815]; NEURAL_SPAM_MEDIUM(0.74)[0.737]; DMARC_POLICY_ALLOW(-0.50)[oldach.net,none]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; HAS_XAW(0.00)[]; FROM_NO_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; R_DKIM_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-branches@freebsd.org] X-Rspamd-Queue-Id: 4Z49Cr0z7Hz3ZxN X-Spamd-Bar: - Tomoaki AOKI wrote on Fri, 28 Feb 2025 10:53:24 +0100 (CET): > Unfortunately, this commit caused ntpd hesitating to (re)start > with error messages below on stable/14, amd64. > > ===== Quote ===== > # service ntpd stop > Stopping ntpd. > Waiting for PIDS: 52508. > # service ntpd start > Starting ntpd. > daemon control: got EOF > /etc/rc.d/ntpd: WARNING: failed to start ntpd > # > ===== End quote ===== > > Note that I have > ntpd_flags="-4 -g -x -f /var/db/ntpd.drift -l /var/log/ntpd.log" > ntpd_config="/etc/ntp/ntp.conf" > ntpd_enable="YES" > ntpd_sync_on_start="YES" > daily_ntpd_leapfile_enable="YES" > ntp_leapfile_fetch_verbose="YES" > in my /etc/rc.conf. I suggest ensure that the files referenced by the command line or by configuration files can be created/written to by ntpd:ntpd. For example, you're not using the default location for ntpd.drift. The default location is /var/db/ntp/ntpd.drift, where the directory /var/db/ntp/ is owned by ntpd:ntpd (as per /etc/mtree/BSD.var.dist), so ntpd is able to write the drift file after dropping privileges. Kind regards Helge From nobody Fri Feb 28 15:59:06 2025 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 4Z4CZ25BSFz5m8fJ; Fri, 28 Feb 2025 15:59:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4CZ24Xxtz3vfq; Fri, 28 Feb 2025 15:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740758346; 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=w253Sf7EY7l9d/1RYa1u1uzptYJfTy68skQBQP+F+hY=; b=rOi1NVA45nEMC9QSxrjWEMRbouBh88NGF1FaTrAlzpjzNUSprhF5gLOhnAP5mW2dAUgO03 wEwFRxkF+w4LhNrRY7D6MAqIJJSMIWoh4eu8bK9/zW4M8RDsfhLxjCJxeWTPap9ZXHDis6 QJH8wKV2iUHVr2PY+K20fQ/8EiuniHytRMxLAGnsUDDnABwHe1nFu/PJGtIjTMUal2W1ja wf+yfhddOQ61yHldUNX58tOgRGmfEbnaw/0w7VwGFgoCWLxa+8Oy33MO3Uy7Pt1J2fq07g k3pAQWC6jEfBG2/YYn/jGK32filOsl8z/1oKNOcqdx+pzo+aVgea5OQrxx2A0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740758346; a=rsa-sha256; cv=none; b=mUzY2IQlCklaOE1VbvkzdMGZCZ5f6uGdk+yPkoJqsxAvwVWeLbY++XWVaoTbD+TQ9v4PpP lq54PzU1yXyBWb4n5OkjCGIt2fJLKjKxC789qQMIYJQWPOackViBXbE+S72eoxouUq28UH W5Hw4t7Da0s9LChK/jUIg1jj56mIX2zzPtgY0MCALSSfZqOoGRuzPGj25AHZjHvhkcB4aX 6iG2D96gkN/X9RQoLuX2NIvbnlsc0IiozqCEQAvNI6DkuPMrDtdr0Bjat21oi00LNp0xc8 5rL4/uSCg/J7c7oEJj5hBnboZu94n/RNffVtWmNKgV+9sQJwdVX9vtWXyH2USA== 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=1740758346; 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=w253Sf7EY7l9d/1RYa1u1uzptYJfTy68skQBQP+F+hY=; b=HZJ/ylRdDDP7ZKCIGi9MC25BeR/ZjtfCN7KSO4fAJwDC3Ega7Ze1U0vwE0UAOVPMYAoTHm 9d8lpBthSnZXsEzfKROEehHQG3Yzua6UAgqn2OcuH8Ew+SdM1Id5FYSVNzl2Sq8/ARn/ur zpGXpEggCEK1Qx15ddgOhA+Hx8ZTi8J9ZY28744a57bqeblIIsBJDe9yA3WLtxoCEjVtqj wkAacHTbnPi4rgdfOFHUvzuN3f4mExKZxDwBBOdjjNnXs/O+BVeUPECtpq+JQYV1pID0Ji 45dETjWF0W3KEwSY9RSal+aaSYQWGxk49N5RSfiJJD+3nDUadFZI7oOmuyoB9g== 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 4Z4CZ2450Xzc7X; Fri, 28 Feb 2025 15:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SFx60q000889; Fri, 28 Feb 2025 15:59:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SFx6vd000886; Fri, 28 Feb 2025 15:59:06 GMT (envelope-from git) Date: Fri, 28 Feb 2025 15:59:06 GMT Message-Id: <202502281559.51SFx6vd000886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 859aa726fb86 - stable/14 - ntp: NULL pointer deref when create_interface() fails 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 859aa726fb8642d8f329c7a34c51356c4eaeae88 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=859aa726fb8642d8f329c7a34c51356c4eaeae88 commit 859aa726fb8642d8f329c7a34c51356c4eaeae88 Author: Cy Schubert AuthorDate: 2025-02-28 15:46:23 +0000 Commit: Cy Schubert CommitDate: 2025-02-28 15:59:00 +0000 ntp: NULL pointer deref when create_interface() fails Fix NULL pointer dereference when create_interface() fails in update_interfaces(). The upstream bug report says a typo was introduced by https://bk.ntp.org/ntp-dev/ntpd/ntp_io.c?PAGE=diffs&REV=66175036PETA6g__fON8oNrjL54Ttw. ep should have been ep2. Fix obtained from upstream bug report. PR: 285065 Upstream bug: https://bugs.ntp.org/show_bug.cgi?id=3939 (cherry picked from commit 628715fdcc9f2226bfe0f4ebe381aaa7761cb6cc) --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 9d79fe493d9b..12a61ccb1d2c 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1921,7 +1921,7 @@ update_interfaces( } else { DPRINT_INTERFACE(3, - (ep, "updating ", " new - FAILED")); + (ep2, "updating ", " new - FAILED")); msyslog(LOG_ERR, "cannot bind address %s", From nobody Fri Feb 28 15:59:15 2025 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 4Z4CZC6Fjpz5m8W1; Fri, 28 Feb 2025 15:59:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4CZC49f5z3w70; Fri, 28 Feb 2025 15:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740758355; 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=MbhqWNKMSunNlAi+3ko0KeI4mNHw6fsxPsEVFLplDA8=; b=VXklQJVfTWfWEyLIF45kE3y2feZViDOzaWaJrqQDQlVprqfC370vv4vQYTDgp2w7BLOhwi RXIdwdect7hsmWVrltzbzwETnuxb8Z0yM9BLmtEuy4FF0yGuwJbMaV6l6YEG4jDGYJ3qMy SCNF/lug+ODZe8zwNCda9P5nOswzHkL7ZMxNGM946GO/4nxV4hjwaQWroHpGrMsT3eWniN EwcUVuLh7ofXWdmn01D4fNcp5X1oeb8iAG5sP18rq9BpcZgxCVYnN/e+mcmHb07Dl99cMs I752FZeWMfuD56CYZ66oyBnmrefFt0aYQJ5WviyJszOepQYBrBrQJEB+Xunt/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740758355; a=rsa-sha256; cv=none; b=jPhtqqIp/lBmIuZu2jmwpvuYK0YmeAxz/L66u+oQsO7IIwAEOJsXM0/Zvid+mpRnWIonUC s/rMJVvkafG6soVzHo5KCNxG38XouTSeEkq89rrJKVELFHuzcHzkzhuIfPDoieU/sMJqXM gmFwgxsNbzr2bxQznxp6juru3CEdxbVyugq4FxFt9zhl5wO44ZQSczGB6rMOV2oEMWO80a nYGWKcUEo6SLlJ4k7q6JTW1FHa2qHzB6Q6eaijvLzgNKb/8J/nouj//F4eft7J85m3Nrh4 clVOPgSN4bFVt2ut7dBfyCRFbr2V8XTRGqm6ADIKVxGkRhulV7pUHZgI5xB9Ww== 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=1740758355; 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=MbhqWNKMSunNlAi+3ko0KeI4mNHw6fsxPsEVFLplDA8=; b=tkJNVwfBN9guNJJ8eikGwqa1LTKSKWIFxfBGolcfszExQ7YfHwdd5+XlMwrmjWeZL/E1tr G/YD//bF6Nc+KvUNNEAeq/KZVlQ8WteVyUqPfHbA+GkPIi6icT3SgBVc2HYdk1zHZlvlwD wcJw+9MKo55D9JQhtuD0ackRNx/Q7Rj1eyERadvF1Ivso/XaWgFdITEM5d38R4XhAH482P ugYPC4ihSAlE6JFpimeE5MSAa98/CRaQEkI/m6P/f4LHGsZjDxda1LcbY7gBjQLq0mubQ3 KTGDfNUGKMuowEXgZl0S+C5xhFohuXo+D1K5NGFdepynSMsqL58k8aQEnyne8g== 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 4Z4CZC3Xpnzc5L; Fri, 28 Feb 2025 15:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SFxFNi001041; Fri, 28 Feb 2025 15:59:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SFxFrJ001038; Fri, 28 Feb 2025 15:59:15 GMT (envelope-from git) Date: Fri, 28 Feb 2025 15:59:15 GMT Message-Id: <202502281559.51SFxFrJ001038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: a3d32f9e6033 - stable/13 - ntp: NULL pointer deref when create_interface() fails 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3d32f9e6033a9083a22b7c9f25633430372e5b4 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=a3d32f9e6033a9083a22b7c9f25633430372e5b4 commit a3d32f9e6033a9083a22b7c9f25633430372e5b4 Author: Cy Schubert AuthorDate: 2025-02-28 15:46:23 +0000 Commit: Cy Schubert CommitDate: 2025-02-28 15:58:54 +0000 ntp: NULL pointer deref when create_interface() fails Fix NULL pointer dereference when create_interface() fails in update_interfaces(). The upstream bug report says a typo was introduced by https://bk.ntp.org/ntp-dev/ntpd/ntp_io.c?PAGE=diffs&REV=66175036PETA6g__fON8oNrjL54Ttw. ep should have been ep2. Fix obtained from upstream bug report. PR: 285065 Upstream bug: https://bugs.ntp.org/show_bug.cgi?id=3939 (cherry picked from commit 628715fdcc9f2226bfe0f4ebe381aaa7761cb6cc) --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 9d79fe493d9b..12a61ccb1d2c 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1921,7 +1921,7 @@ update_interfaces( } else { DPRINT_INTERFACE(3, - (ep, "updating ", " new - FAILED")); + (ep2, "updating ", " new - FAILED")); msyslog(LOG_ERR, "cannot bind address %s", From nobody Fri Feb 28 16:22:52 2025 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 4Z4D5Y1GlGz5ngFl for ; Fri, 28 Feb 2025 16:22:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4D5X68FNz43Q7; Fri, 28 Feb 2025 16:22:56 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id nzYdt68ey5Mqyo38atJMkc; Fri, 28 Feb 2025 16:22:56 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id o38YtkM06JhBPo38ZtkL6U; Fri, 28 Feb 2025 16:22:56 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=67c1e2e0 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=R3mQYeSd_XdQyng2:21 a=kj9zAlcOel0A:10 a=T2h4t0Lz3GQA:10 a=6I5d2MoRAAAA:8 a=85N1-lAfAAAA:8 a=EkcXrb_YAAAA:8 a=gRS1eiuiAAAA:8 a=YxBL1-UpAAAA:8 a=yqSkI1Li77T7Hif44EAA:9 a=CjuIK1q_8ugA:10 a=cyfSibbquD4hpIoiQNSb:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=udpbrAo2yJH2O6eCpvBn:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 56011465; Fri, 28 Feb 2025 08:22:53 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id E5053324; Fri, 28 Feb 2025 08:22:52 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: freebsd@oldach.net (Helge Oldach) cc: junchoon@dec.sakura.ne.jp (Tomoaki AOKI), cy@FreeBSD.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 1a241a911dc8 - stable/14 - ntpd: Use the ntpd -u option in preference to the rc su plumbing In-reply-to: <202502281412.51SECsWG048020@nuc.oldach.net> References: <202502281412.51SECsWG048020@nuc.oldach.net> Comments: In-reply-to freebsd@oldach.net (Helge Oldach) message dated "Fri, 28 Feb 2025 15:12:54 +0100." 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 28 Feb 2025 08:22:52 -0800 Message-Id: <20250228162252.E5053324@slippy.cwsent.com> X-CMAE-Envelope: MS4xfBdkr7wHW9BjGjxmcl/dTiDEZKjNX+SM8+uMfCwRq2JzedOerQh+5xlNuakTFpZnahlFvFo6v2bWHfglFGvu9gysxI2hhPc+zDLdwBCjVNoX04dLKVbM U8Xsye+nPx+KeScRZqdlh8yCktj8hyBbpW1YrOYkQK61oGbLMCGyp111IkcZ7CzufyL9ATCUeft6rs0hatRWu/X+SWWBKXA+lqHVxpnJPzi5jJ2Pn3fsMrZt GTUcFAKxD6F/sKoElnOiRKRS6n0Y33/oRHv6M6xS3tGohy/70tljip0FI8UxHOIRJLjMFuP6lJ4F0AdzATK9UQ== X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Z4D5X68FNz43Q7 X-Spamd-Bar: ---- In message <202502281412.51SECsWG048020@nuc.oldach.net>, Helge Oldach writes: > Tomoaki AOKI wrote on Fri, 28 Feb 2025 10:53:24 +0100 (CET): > > Unfortunately, this commit caused ntpd hesitating to (re)start > > with error messages below on stable/14, amd64. > > > > ===== Quote ===== > > # service ntpd stop > > Stopping ntpd. > > Waiting for PIDS: 52508. > > # service ntpd start > > Starting ntpd. > > daemon control: got EOF > > /etc/rc.d/ntpd: WARNING: failed to start ntpd > > # > > ===== End quote ===== > > > > Note that I have > > ntpd_flags="-4 -g -x -f /var/db/ntpd.drift -l /var/log/ntpd.log" > > ntpd_config="/etc/ntp/ntp.conf" > > ntpd_enable="YES" > > ntpd_sync_on_start="YES" > > daily_ntpd_leapfile_enable="YES" > > ntp_leapfile_fetch_verbose="YES" > > in my /etc/rc.conf. > > I suggest ensure that the files referenced by the command line or by > configuration files can be created/written to by ntpd:ntpd. > > For example, you're not using the default location for ntpd.drift. > The default location is /var/db/ntp/ntpd.drift, where the directory > /var/db/ntp/ is owned by ntpd:ntpd (as per /etc/mtree/BSD.var.dist), so > ntpd is able to write the drift file after dropping privileges. > > Kind regards > Helge This looks like it's related to, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284863, which is upstream https://bugs.ntp.org/show_bug.cgi?id=3967. It's a regression in 4.2.8p18. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Fri Feb 28 16:22:56 2025 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 4Z4D5b4W36z5nfyj for ; Fri, 28 Feb 2025 16:22:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4D5b1W2zz43cX; Fri, 28 Feb 2025 16:22:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id nyaHtWsyt9JM2o38ctaJpR; Fri, 28 Feb 2025 16:22:58 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id o38btcTK04k0oo38btIv8r; Fri, 28 Feb 2025 16:22:58 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=fLKa3oae c=1 sm=1 tr=0 ts=67c1e2e2 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=R3mQYeSd_XdQyng2:21 a=kj9zAlcOel0A:10 a=T2h4t0Lz3GQA:10 a=6I5d2MoRAAAA:8 a=85N1-lAfAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=GtMiImJ-MpWkFAqZ9TAA:9 a=CjuIK1q_8ugA:10 a=cyfSibbquD4hpIoiQNSb:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id EB59D489; Fri, 28 Feb 2025 08:22:56 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id EA1C73A4; Fri, 28 Feb 2025 08:22:56 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Tomoaki AOKI cc: Cy Schubert , dev-commits-src-branches@freebsd.org Subject: Re: git: 1a241a911dc8 - stable/14 - ntpd: Use the ntpd -u option in preference to the rc su plumbing In-reply-to: <20250228185324.df32beaa550475b0832e1ca0@dec.sakura.ne.jp> References: <20250228185324.df32beaa550475b0832e1ca0@dec.sakura.ne.jp> Comments: In-reply-to Tomoaki AOKI message dated "Fri, 28 Feb 2025 18:53:24 +0900." 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 28 Feb 2025 08:22:56 -0800 Message-Id: <20250228162256.EA1C73A4@slippy.cwsent.com> X-CMAE-Envelope: MS4xfMMVkgLK7GtQQJ9UR9N0vI2uwNB9RIot90PO0UVZcK9OiPI5u1s2hXGGIXp2FOXVT5w+1pCNQcDoEgAQCyY7aqNItF24vt+pFTIOorOAA2p0sDzpyvvE ZRob6OnKTQkn+mwUPuUKGLIrS2aQodf4jjrZVsxwe51+Dh4NcyMO0mZ27VNK6dGIfc0NkioVuiKb1Wl8mNtP8VbwZgFoQ+eEdVwMzc4U9FeygNLiULvsFsga sw22fKYwsXdeqM90VeSHdrmgTtCflWX41J4x/xUPeElACR3zbCWtq7uN0ZB7Z/Qw X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Z4D5b1W2zz43cX X-Spamd-Bar: ---- In message <20250228185324.df32beaa550475b0832e1ca0@dec.sakura.ne.jp>, Tomoaki AOKI writes: > Hi. > > Unfortunately, this commit caused ntpd hesitating to (re)start > with error messages below on stable/14, amd64. > > ===== Quote ===== > # service ntpd stop > Stopping ntpd. > Waiting for PIDS: 52508. > # service ntpd start > Starting ntpd. > daemon control: got EOF > /etc/rc.d/ntpd: WARNING: failed to start ntpd > # > ===== End quote ===== > > Note that I have > ntpd_flags="-4 -g -x -f /var/db/ntpd.drift -l /var/log/ntpd.log" > ntpd_config="/etc/ntp/ntp.conf" > ntpd_enable="YES" > ntpd_sync_on_start="YES" > daily_ntpd_leapfile_enable="YES" > ntp_leapfile_fetch_verbose="YES" > in my /etc/rc.conf. > > And the high PID value above is because this output is obtained after > several attempts of stopping and starting. > > Regards. > > > > The branch stable/14 has been updated by cy: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=1a241a911dc8635c3803f1a6620e1ab4692f6 > ecf > > > > commit 1a241a911dc8635c3803f1a6620e1ab4692f6ecf > > Author: Cy Schubert > > AuthorDate: 2024-12-12 20:03:09 +0000 > > Commit: Cy Schubert > > CommitDate: 2025-02-25 00:37:46 +0000 > > > > ntpd: Use the ntpd -u option in preference to the rc su plumbing > > > > Using the rc plumbing to setuid(2) is preferred as it allows the > user > > to use the -i option in ntpd_flags to chroot ntpd. > > > > Chrooting ntpd by default will be a 2025 project. > > > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D48191 > > > > (cherry picked from commit 521f66715afb312b356afafc68cbc044a436a753) > > --- > > libexec/rc/rc.d/ntpd | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd > > index 76d83149ae1a..36df4ae08c96 100755 > > --- a/libexec/rc/rc.d/ntpd > > +++ b/libexec/rc/rc.d/ntpd > > @@ -98,7 +98,6 @@ ntpd_precmd() > > # by the admin, we don't add the option. If the file exists > in the old > > # default location we use that, else we use the new default > location. > > if can_run_nonroot; then > > - _user="ntpd" > > driftopt="-f ${_ntp_default_driftfile}" > > elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || > > [ -n "${rc_flags}" ] && > > @@ -112,7 +111,13 @@ ntpd_precmd() > > fi > > > > # Set command_args based on the various config vars. > > - command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}" > > + command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt} -u $ > {ntpd_user:=ntpd:ntpd}" > > + > > + # Unset ntpd_user because rc.subr uses $${name}_user to > determine > > + # whether to invoke su(1) to setuid() to $ntpd_user for us. We > want > > + # ntpd to do the setuid() itself through the -u argument, > above. > > + unset ntpd_user > > + > > if checkyesno ntpd_sync_on_start; then > > command_args="${command_args} -g" > > fi > > -- > Tomoaki AOKI This looks like it's related to, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284863, which is upstream https://bugs.ntp.org/show_bug.cgi?id=3967. It's a regression in 4.2.8p18. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Fri Feb 28 18:20:01 2025 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 4Z4Ghd4nvdz5nrym; Fri, 28 Feb 2025 18:20:01 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Ghd2k1mz3Smh; Fri, 28 Feb 2025 18:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740766801; 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=J/5ntODLef3HNy+uSFM9Ybso/KV1pUsNeUIuY3gcQlg=; b=yTlKYmG/14MBy01rxcnS+6z+mYyo+UgAp0lhTp5czV0qSbTOzZ8cRx8bofTaZDDrGf2IiD lhuhYnGCgrGk1Z4S2QlFufQOrKoWH/mEdUgSk465nHKskXej103Vcva7+OTogH8r6BswI4 g5F7tlYZYLVARhp93pRmx85IMV12BqbyFRHSLale8Ku0j1eZZJ9iOJ7iIDsYV/FHXZwelW vg1MhcXofUfjxyZAQXjLClYBInc4qm3sq6RgzZYArV8SIybbfbljeICw6ynWlbeCN9EMc5 JD0NtTUWusFHDX3SU9ocMixd4h5w9gVs4ZECZ+iDoDZebaDR1xnJyIhBoiVHdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740766801; a=rsa-sha256; cv=none; b=KU2xegAQycqIvkL2NOH+wYr0d3lSHWeosQd5lIrrsSR37pPo2ykREgiZ4GrRIxYjOQw3Cs 72FYnWJTUUdC4fyt50XQvPgjkBrI0yY0UrnS2A0mUIm7toRejXYw1tvWRAdNCHttyIZ2tU Di3WnKm8NOXgSztGOqJIqC9gtHxofjpeha4Lou+qmN3ZHrhLVY5G2rczj4QA/8DrD2wf0c skduyerOR2a3kpQ+F1dCN9kqWth1lIA5O7MAAF3cleZWhMWQHhQCBOqSIkhYmX7GLalh2z 3YYGDvqIGn0M5svJ3T+pT9MfdVGk77vmUWv/DRvS5Qe/T67O05cBh9mP5vhHCQ== 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=1740766801; 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=J/5ntODLef3HNy+uSFM9Ybso/KV1pUsNeUIuY3gcQlg=; b=YKUHOazuDOTeID1VXX1ANucgV93POlj93hvzLOLxKrBeSWhOM7fhmJSLFW87bHulqP2RQT pu2tWztYqVv+5omXUwke4Cs4q7pLJ/5EGg7EewyDFsUexNEU5uDVk73tZ2YNdvlO5l/Q+6 QhAvTbQivlYNJR6ft5w/gbqCGlfzKcnKa5jvDOaMT4k9D4p8b+vsRnc4wLj1vadsY1zwNx GQwErTnEBi9xZW9dfnhpNIOfrKPf89YlMOjQSJHEDW5sunzTp7hZIbezgkwCFfGjcMmwzA C5kFnydBGQLPzsMdRx8EDhZwYWVi95jODlOEWJ2WynblH0Eks/79FijyNjLnMQ== 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 4Z4Ghd22CxzgpF; Fri, 28 Feb 2025 18:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SIK1M5065014; Fri, 28 Feb 2025 18:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SIK1oX065009; Fri, 28 Feb 2025 18:20:01 GMT (envelope-from git) Date: Fri, 28 Feb 2025 18:20:01 GMT Message-Id: <202502281820.51SIK1oX065009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 586bdc6f7555 - stable/14 - bsd.mkopt.mk: Avoid warning from makeman 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 586bdc6f755514519f0d2da1ac8e4c7b8077999c Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=586bdc6f755514519f0d2da1ac8e4c7b8077999c commit 586bdc6f755514519f0d2da1ac8e4c7b8077999c Author: Ed Maste AuthorDate: 2025-02-24 14:51:31 +0000 Commit: Ed Maste CommitDate: 2025-02-28 18:19:50 +0000 bsd.mkopt.mk: Avoid warning from makeman Setting WITHOUT_X where X is a __REQUIRED_OPTION produces a warning. This occurred during makeman's `make showconfig` invocatation, but the warning serves no purpose there, and clutters makeman's output. Skip the warning for the showconfig target used by makeman. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49123 (cherry picked from commit 085c0641a2ea0dee2c58b5bc6e62790a164ebd52) --- share/mk/bsd.mkopt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk index 7d43e91b042d..6ddb7af5fc0d 100644 --- a/share/mk/bsd.mkopt.mk +++ b/share/mk/bsd.mkopt.mk @@ -58,7 +58,7 @@ MK_${var}:= yes # step towards removing the options entirely. # .for var in ${__REQUIRED_OPTIONS} -.if defined(WITHOUT_${var}) +.if defined(WITHOUT_${var}) && !make(showconfig) .warning WITHOUT_${var} option ignored: it is no longer supported .endif MK_${var}:= yes From nobody Fri Feb 28 20:37:19 2025 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 4Z4KlG6TSYz5p53c for ; Fri, 28 Feb 2025 20:37:30 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Z4KlG04wmz3j5p; Fri, 28 Feb 2025 20:37:29 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (124-18-40-20.area1c.commufa.jp [124.18.40.20]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 51SKbJoA098072; Sat, 1 Mar 2025 05:37:20 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dec.sakura.ne.jp; s=s2405; t=1740775041; bh=Bu8SDU6RmR4mjqzLT9Uy6cu9GwpVceccB8WjFH860IA=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=aKSGzOXdY61gATtRseG0TP5jWvniBNRUb9VQInAxiHaIgNuM9hRm/pL0PJXw+GQkB GqRGUwlwuJwWu1cM8ijPLjAOOA4FHhIt4JH0bO4OjoNtZfsk68BUWxBnPpw60gShio JnJaXxmySiqY2XIDRkrO2wWWweJUAU+gkjCVZ2C4= Date: Sat, 1 Mar 2025 05:37:19 +0900 From: Tomoaki AOKI To: Cy Schubert Cc: freebsd@oldach.net (Helge Oldach), cy@FreeBSD.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 1a241a911dc8 - stable/14 - ntpd: Use the ntpd -u option in preference to the rc su plumbing Message-Id: <20250301053719.2449ddcf28e417f6639ac58f@dec.sakura.ne.jp> In-Reply-To: <20250228162252.E5053324@slippy.cwsent.com> References: <202502281412.51SECsWG048020@nuc.oldach.net> <20250228162252.E5053324@slippy.cwsent.com> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.2) 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] X-Rspamd-Queue-Id: 4Z4KlG04wmz3j5p X-Spamd-Bar: ---- On Fri, 28 Feb 2025 08:22:52 -0800 Cy Schubert wrote: > In message <202502281412.51SECsWG048020@nuc.oldach.net>, Helge Oldach > writes: > > Tomoaki AOKI wrote on Fri, 28 Feb 2025 10:53:24 +0100 (CET): > > > Unfortunately, this commit caused ntpd hesitating to (re)start > > > with error messages below on stable/14, amd64. > > > > > > ===== Quote ===== > > > # service ntpd stop > > > Stopping ntpd. > > > Waiting for PIDS: 52508. > > > # service ntpd start > > > Starting ntpd. > > > daemon control: got EOF > > > /etc/rc.d/ntpd: WARNING: failed to start ntpd > > > # > > > ===== End quote ===== > > > > > > Note that I have > > > ntpd_flags="-4 -g -x -f /var/db/ntpd.drift -l /var/log/ntpd.log" > > > ntpd_config="/etc/ntp/ntp.conf" > > > ntpd_enable="YES" > > > ntpd_sync_on_start="YES" > > > daily_ntpd_leapfile_enable="YES" > > > ntp_leapfile_fetch_verbose="YES" > > > in my /etc/rc.conf. > > > > I suggest ensure that the files referenced by the command line or by > > configuration files can be created/written to by ntpd:ntpd. > > > > For example, you're not using the default location for ntpd.drift. > > The default location is /var/db/ntp/ntpd.drift, where the directory > > /var/db/ntp/ is owned by ntpd:ntpd (as per /etc/mtree/BSD.var.dist), so > > ntpd is able to write the drift file after dropping privileges. > > > > Kind regards > > Helge Thanks for advice! IIRC, my configuration was to allow keeping use of old-school place. Anyway, edited /etc/rc/conf to switch /var/db/ntpd.drift to /var/db/ntp/ntpd.drift (serivce command picks configs everytime invoked, so no reboots), without luck. Of course, /var/db/ntp has ntpd:ntpd ownweship. Comparing succeeded (with reverted /etc/rc.d/ntpd) and failed (/etc/rc.d/ntpd without reverts), I found an error only in the latter case. 1 Mar 04:32:59 ntpd[12772]: Need MAC 'ntpd' policy enabled to drop root privileges 1 Mar 04:32:59 ntpd[12771]: daemon child exited with code 255 In normal case, ntpd starts soliciting pool servers, but the erroneous case, stops there (does not start soiciting pool servers). > This looks like it's related to, > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284863, which is upstream > https://bugs.ntp.org/show_bug.cgi?id=3967. It's a regression in 4.2.8p18. Thanks! But it's not my case. All interfaces has different IP addresses. (Some are hidden with "*".) % ifconfig em0: flags=1008843 metric 0 mtu 1454 options=4e504bb ether 98:*:*:*:*:* inet 192.168.*.45 netmask 0xffffff00 broadcast 192.168.*.255 media: Ethernet autoselect (1000baseT ) status: active nd6 options=29 lo0: flags=1008049 metric 0 mtu 16384 options=680003 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 groups: lo nd6 options=21 wlan0: flags=8c43 metric 10 mtu 1500 options=0 ether 24:*:*:*:*:* inet 192.168.*.108 netmask 0xffffff00 broadcast 192.168.*.255 groups: wlan ssid "" channel 36 (5180 MHz 11a) regdomain JAPAN country JP authmode WPA1+WPA2/802.11i privacy ON deftxkey UNDEF txpower 23 bmiss 7 mcastrate 6 mgmtrate 6 scanvalid 60 wme roaming MANUAL parent interface: iwlwifi0 media: IEEE 802.11 Wireless Ethernet autoselect mode 11a status: no carrier nd6 options=29 The problem seems to be "how to enable MAC 'ntpd' policy?". Reading Chapter 18 of the Handbook (especially 18.5) and looking into /boot/kernel, mac_ntpd.ko seems to be the culprit, but as I still have confusions with MAC feature, I'm not 100% sure loading it is safe or not, thus, still cannot try loading it. *I've read somewhere (lost track with there) stating that "once MAC feature is enabled in a filesystem, it cannot disabled anymore and possibly causes fatal problems on interpoerabilities". This does not match handbook at least with 18.5, though. My /etc/rc.conf is carried over from 2.1.6.1 (IIRC) with modifications on needs. So don't have MAC (not MAC address but Mandatory Access Control feature, I guess) related configurations in it. IMHO, this kinds of mandated (and considered to be safe) configurations should be in /etc/defaults/rc.conf (including auto-loading mandatory in-tree kmods) by default and overrided in /etc/rc.conf[.local] whenever actually needed. > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 Regards. -- Tomoaki AOKI From nobody Fri Feb 28 21:23:09 2025 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 4Z4Lly3BFTz5p8Zf; Fri, 28 Feb 2025 21:23:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Lly0M80z3nDl; Fri, 28 Feb 2025 21:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740777790; 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=B3kMmgIAPLwIEzVYUhJqy5P0KvQfZF9JUByVs7P7vTI=; b=IFG8drxoDiZ/k5qnMkGICOtmx9sLWS+yP47Vwn9e9Ico/9pkWE+qqxxqGd/igibGRWAcf9 OKYj3ra1Tl4JTleGCV3W/s6RFZZ+yzJwcMW3T9x4701T3yZbXpF4OVX7uBK5aNMmZchneO B1iF/GiYgMZvasOi5ERZyaAZ75RZR9gmzjM6bmIaDQrxgrWVkbnecEwmTb6jzAYqglR5ni C4bdefMiO+bzwapriqrV7vHIZmXGD9oxqGME8UA8FSkP3nPA08T5Z8wW6fPNqfw48kGNXt to55oWN1929hujXZgUmIDgs3I3DjhlpVOREEIavUEyZPEJ9T/aT0VMJG3J7zZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740777790; a=rsa-sha256; cv=none; b=jyx8v0lF2OdbLwDebRDl78S4zdOs0WqgNwYVKKPxdCgOvMrJ5RsBbMHRcO1XjY49ccyJcW xl2g1DrpOTMOOsU/LP8eg4bVWRpJxfQjHpE89exdp6mJJS89CPPqc1VY+gOXJC/xMJ8t+u gKyjwT0SvoJ2NnRMlim1fLuOJRQqGlmog8ebUQzC08sRnE3nui1Q3RJ8WWc065NTyKn9jD u+IEOVPVJjtYOSPY5MRcMfXfXJOAgLPpT2qAZ9jOeJLaeDyVN4fBStAgjw5ps1Xr1ARpzm JkmHaCHcRagWqt8H5Ao06vfziRL2HEKNEvhvWn9jenu2hbDq0dKGmQFTDAl78g== 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=1740777790; 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=B3kMmgIAPLwIEzVYUhJqy5P0KvQfZF9JUByVs7P7vTI=; b=TstJ1xIK52tVNG4zK7aQyXzENnZTdeeqY7EiKDz52acGn/DW1DkOQspuWrjCZ/5C8TNuAt JSXQT2hGohMaMGI223dUp7pMAzBBaJR8ozIW9e1ByhYMB6wnuIMeSn5MlL6Bi+W5j3O5Wk fVmvjLauyUbvuMqjsXxD73OLDUdel1VXuOO1bIsm13LtjV6HHC4K+CMsA46OrzUabXLs7F lCvgS+pwdc7In/Iqeu0omcweNq+G3ygGNrqqjoZKXJdO79VsEH8EMKkCEPTmYDULGblkqi zMt+UVPXXt57wzRLY9JXEdKrO2aa1l4IQoGIn02SXxoHTLw0DXrCo0n4gjFvBw== 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 4Z4Llx74VFzmQV; Fri, 28 Feb 2025 21:23:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SLN966016669; Fri, 28 Feb 2025 21:23:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SLN9M9016666; Fri, 28 Feb 2025 21:23:09 GMT (envelope-from git) Date: Fri, 28 Feb 2025 21:23:09 GMT Message-Id: <202502282123.51SLN9M9016666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 9fed5151903f - stable/14 - nfscl: Add support for CB_RECALL_SLOT 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9fed5151903fa609bf06f2b526a105fc21793651 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9fed5151903fa609bf06f2b526a105fc21793651 commit 9fed5151903fa609bf06f2b526a105fc21793651 Author: Rick Macklem AuthorDate: 2025-02-14 20:56:52 +0000 Commit: Rick Macklem CommitDate: 2025-02-28 21:22:03 +0000 nfscl: Add support for CB_RECALL_SLOT The callback CB_RECALL_SLOT is required for NFSv4.1/4.2. Fortunately, there does not appear to be any extant NFSv4.1/4.2 servers that use it. Since commit b97a478896e9 fixed handling of session slot shrinking, this patch adds support for CB_RECALL_SLOT, which shrinks the number of session slots as well. (cherry picked from commit 4517fbfd4251180147082f94253c4347fa44f570) --- sys/fs/nfs/nfs_commonkrpc.c | 4 ++-- sys/fs/nfs/nfs_var.h | 1 + sys/fs/nfsclient/nfs_clstate.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index e35172ee2b34..0ae3b94bef89 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -123,7 +123,6 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_da SYSCTL_INT(_vfs_nfs, OID_AUTO, dsretries, CTLFLAG_RW, &nfs_dsretries, 0, "Number of retries for a DS RPC before failure"); -static void nfs_resetslots(struct nfsclsession *); static void nfs_down(struct nfsmount *, struct thread *, const char *, int, int); static void nfs_up(struct nfsmount *, struct thread *, const char *, @@ -1474,12 +1473,13 @@ nfsmout: /* * Reset slots above nfsess_foreslots that are not busy. */ -static void +void nfs_resetslots(struct nfsclsession *sep) { int i; uint64_t bitval; + mtx_assert(&sep->nfsess_mtx, MA_OWNED); bitval = (1 << sep->nfsess_foreslots); for (i = sep->nfsess_foreslots; i < NFSV4_SLOTS; i++) { if ((sep->nfsess_slots & bitval) == 0 && diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index c726d956fee2..8b8b3f5ce961 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -780,6 +780,7 @@ int newnfs_request(struct nfsrv_descript *, struct nfsmount *, struct nfsclient *, struct nfssockreq *, vnode_t, NFSPROC_T *, struct ucred *, u_int32_t, u_int32_t, u_char *, int, u_int64_t *, struct nfsclsession *); +void nfs_resetslots(struct nfsclsession *); int newnfs_connect(struct nfsmount *, struct nfssockreq *, struct ucred *, NFSPROC_T *, int, bool, struct __rpc_client **); void newnfs_disconnect(struct nfsmount *, struct nfssockreq *); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index a666792c17f9..e803c2cfb973 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3938,6 +3938,24 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) *tl = txdr_unsigned(NFSV4_CBSLOTS - 1); } break; + case NFSV4OP_CBRECALLSLOT: + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + highslot = fxdr_unsigned(uint32_t, *tl); + NFSLOCKCLSTATE(); + clp = nfscl_getclntsess(sessionid); + if (clp == NULL) + error = NFSERR_SERVERFAULT; + if (error == 0) { + tsep = nfsmnt_mdssession(clp->nfsc_nmp); + mtx_lock(&tsep->nfsess_mtx); + if ((highslot + 1) < tsep->nfsess_foreslots) { + tsep->nfsess_foreslots = (highslot + 1); + nfs_resetslots(tsep); + } + mtx_unlock(&tsep->nfsess_mtx); + } + NFSUNLOCKCLSTATE(); + break; default: if (i == 0 && minorvers != NFSV4_MINORVERSION) error = NFSERR_OPNOTINSESS; From nobody Fri Feb 28 21:27:15 2025 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 4Z4Lrg4LRpz59JBM; Fri, 28 Feb 2025 21:27:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Lrg3YQKz3nTJ; Fri, 28 Feb 2025 21:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740778035; 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=56D4b2vBzg1FwcwiS/iBWuVyr7Xgdj57dEszbuy/dhg=; b=UsrXPmKo2LNHQJJXMSyjhX17g848DDWmdvTVmZcCpv04StIQ2hSu2NQ+eT6uB8dsBHDr0V uUS7m834y4rsgOJt2epMBant/sKw935XMGkLwqHnkiw6y2B9h2Wjya42P6E235V86ereH9 j5pZZghps7mO3icxyCwxJNS+9j5W/qBWnFpJUCI6Zjr7yfjwL7rmbwXS7r/MpRT+jBSzSj xrynqOLRYFreWoNwwTKrzsnHQi5z8tiPpnMApleEm3fS33wLuGxmW2fvErOpbhvE2X/PjB v84XbCcyL0z9K5nUOreaeXSaHOd+0MDiRg5wD7LPlfPO1Jqduf+l43y5sgXuzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740778035; a=rsa-sha256; cv=none; b=AanZ8xQX5CLy0fQx+nBGDnP+j3eEjxiCIfiRKtl6LjwIGvSmTR8wTD92bz3sY6Ajmp0Gwy a4I8Y13miMikGxZ+3ZCXv1niS+TiE9IjzbxN9DBF95SUaWoy9ktRyEIbkr0/su2dUfVClR yXS6qR4GBI17uwnM8bp9yhWRy4ZIvlz6LVZ5T/ZBQekp1e4hjuQdhgvBHYrcSzxfnHhGW6 P1qJhd8gUgJ+ObY2NO+i/AxU1xBfunPMdU/uVWCiVQLo8lSOOVEz8Dw6XoegIvkrli22ql zuyoXnu6D5+8oqLG3sq/5aXuupNM90NW/Z7kNUAXSDqt36E0KKbE4KT/9Liz+g== 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=1740778035; 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=56D4b2vBzg1FwcwiS/iBWuVyr7Xgdj57dEszbuy/dhg=; b=si/eF/PPKFPEh7GRQU+k0PeyYP9vFeoQE30M8Ac1c2rZQjEMKcUlMsNXbBhwMIWavAFcLC RGAlwXgOtdLcXUCdDEEKTnFRGWzTRRvb0UC8M0Zq0a/dO7g8o0eoBbY27tteLkhJAJpTUi IFNQWyty+pThHAOjKEKawVRYTvv7yuBOXA23SHWparUPpOAvJplWiDDTFNXfKJt4Q4b2NI aG4MJ2k68qlInaVQoe/LECkSHRqoiX1RxDPxuSf/CHnjLp0EyTLUdifKHisAu/UMX5HW/t W6H6kah2MH86oJCLzNmBEuiK3PjRse7rVB7wJsI88LSKypSLPqOCD/3aSk6DMQ== 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 4Z4Lrg2r2KzmdD; Fri, 28 Feb 2025 21:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SLRFu5017955; Fri, 28 Feb 2025 21:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SLRFBF017952; Fri, 28 Feb 2025 21:27:15 GMT (envelope-from git) Date: Fri, 28 Feb 2025 21:27:15 GMT Message-Id: <202502282127.51SLRFBF017952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 310646a92ab4 - stable/14 - param.h: Bump _FreeBSD_version for commit 9fed5151903f 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 310646a92ab448156c34a3b84494fd2166079b55 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=310646a92ab448156c34a3b84494fd2166079b55 commit 310646a92ab448156c34a3b84494fd2166079b55 Author: Rick Macklem AuthorDate: 2025-02-28 21:25:43 +0000 Commit: Rick Macklem CommitDate: 2025-02-28 21:25:43 +0000 param.h: Bump _FreeBSD_version for commit 9fed5151903f --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 914433bace0e..12a0e2098fec 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1402503 +#define __FreeBSD_version 1402504 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Feb 28 21:35:18 2025 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 4Z4M1y4c76z59KKt; Fri, 28 Feb 2025 21:35:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4M1y38ylz3q7l; Fri, 28 Feb 2025 21:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740778518; 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=ZyHGsgoDcOnK9OcqNJ4Qnpz3DW9vRZmzRupSvYlPm8E=; b=iazo/WD4/nHBNfICx7CvcUGl1pMtSqrUIzJprQqAyiRJuVwRJhl39AHU+Qnz6DJe9M+jmq cZO3qeIf5g2hlIFb7XNc+ZJlAUcxH2kagKCYZH1kp0t5tqXr1RuFJX76J50KiBGKKfnUu6 KC4ltaCkaJQUjjjiSj5WmK2ixjuwxb138i02TaaJ01vVd6wc965bnbInb5UThILaTnE8aS 701Hpe6NjblqSsnf07tl9xDZRHFoKQHS9vUoGnYVdc9Sl8ntjh4+SvRew36svZo9P/yH5k lKrr7XWNviYeALwj1fP9E4G6eBgMWjhDiHBHN8BhM0UAx5ABkVMQHaRXr0gO6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740778518; a=rsa-sha256; cv=none; b=JH5XSvGYkdsrxOXDBQmkd/DcklcswMljJMxykAh3adUuZ0x2d0JYkYooQSwQet3lyB/Y34 XYUgdPf9NkmetX6yzXE4AXXbggyWub7HrjbMwMj5J14LzHuaeIY/FRJNEmKT6KK00oBCV3 E7h0w337droiF2lTO0i72iLwehk+302J0TZIzOzrzAzYPGoYB4bHpYAjL9AHg1YaK1QK/p JFNjum85WWrVjSVSxdsr6c7C1CcT3D7hPeoqT8gOwEybjCsRlBh2DWE2BLUrSdUIqOYTN4 wwm0rXJE+SkL7DYf9n0UknzRj7lkjZ12m1DkMwqQa0z31w+4vyDhHfjK7J1muQ== 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=1740778518; 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=ZyHGsgoDcOnK9OcqNJ4Qnpz3DW9vRZmzRupSvYlPm8E=; b=bo4Fr3yPI3bZE79CiU+46M1PgkDIg56zeZZjcAEy2PGqzIVeyUsFqeXyWjZZtQFg6xEAFJ nItdHCECf1i+a1Y9XoBRW5myJ7Qc4ydspY2ObcPYGLRkN7a+A1sxl5UoGdkjM35uiPm3eB IwIdRH4fOIccZVY0AKDd8r4oHnTqx0P+/J+OIiJecFs1esONoMxGvfmPyJ4eZ3uZz7UEoJ Muzby9IKyaZ9Ru16Cv8FAKuVqaxsErNptqqv8o7S6mEG02kWDuY3Lxe9aD/7BMB69sOP5m yOS3Fw/u2QOT8E0FibsZrPd6WcFSziuJZYba4E5MoVG8n8TTTXoUAQ6191MWYA== 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 4Z4M1y2jrJzmTF; Fri, 28 Feb 2025 21:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SLZIYl036218; Fri, 28 Feb 2025 21:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SLZIQ8036215; Fri, 28 Feb 2025 21:35:18 GMT (envelope-from git) Date: Fri, 28 Feb 2025 21:35:18 GMT Message-Id: <202502282135.51SLZIQ8036215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 76fdef764db9 - stable/14 - UPDATING: Add an entry for commit 9fed5151903f 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 76fdef764db9b21f913e56eea571172fe1608c4b Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=76fdef764db9b21f913e56eea571172fe1608c4b commit 76fdef764db9b21f913e56eea571172fe1608c4b Author: Rick Macklem AuthorDate: 2025-02-28 21:34:18 +0000 Commit: Rick Macklem CommitDate: 2025-02-28 21:34:18 +0000 UPDATING: Add an entry for commit 9fed5151903f --- UPDATING | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPDATING b/UPDATING index 9509e5405daa..f35f4267117b 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,12 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250228: + Commit 9fed5151903f modified the internal API between the + nfscommon and nfscl modules. As such, both of these modules + need to be rebuilt from sources. + __FreeBSD_version was bumped to 1402504 for this patch. + 20250117: The layout of NFS file handles for the tarfs, cd9660, and ext2fs file systems has changed. An NFS server that exports any of these file From nobody Sat Mar 1 02:29:24 2025 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 4Z4TYK2CJKz5VqD7; Sat, 01 Mar 2025 02:29:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4TYK1H3Yz3Ydj; Sat, 01 Mar 2025 02:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740796165; 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=SJlRhIc165neErY+MyqM8ktpjTIkOc3mt0oDm8QB2qg=; b=U8lChoVkanrOCtcLXtMWx1G1wgYxdfw3GQxpabEHmaaFfCWwGj6OtgbkkL2x2dEfzOi0sg MKwuH9h8iH1lRXU/IeYXWzPVrsB/y1kSYHz3odfeWFdQ1540sf8i8DDIQijqN/T5kUneK2 3bnIB4+cVeGKlhhOuzp8e+3H/vPjAThrReOjlwMoGQ1WDvI41fOKLh108rvNdALWuxrJNB fV3XX7/m2QGVY169kdT9K96zQKq8gtSdTMVAdQ7d5+Twtx1D3a4Vw+Q68Mp8SCG7zxV5PW YIxu8ERr3BZExgBRaleAEODbSfjQ7rj6iTwGHXQKDrk/uLXDueKGVsi+STCkLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740796165; a=rsa-sha256; cv=none; b=tI9hj9LJ33xmXCBjFSw1Z7izMoH9KTNgJdzVEnouh2sJbfE3F3JcPi3dzkNXLsONAHfNR6 gd4wxQWcxSXPCLAGhsjt/JNUpHb/jwnIHhf03beu7PQNgvBd7r8pRk+GiI6Rvt0NliwHI6 6QYjXLhWmGl8qBJC2XEAsGCHLMGMpVF3QedkoG7gu7425/xmuRRJguH8dSbVS8l6iislS4 8i1uxr7a7DPMU5HBW/uP1r21g6VDmIXpJ7d2mGPNepJTXl78gppMUmTge488Gh3UVi/zYQ +9+f/35MYKZ9DdKvTQNTDw1KTGZvULvCf65ia88t5UBz/WKa/WiwVkS7gHOrkw== 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=1740796165; 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=SJlRhIc165neErY+MyqM8ktpjTIkOc3mt0oDm8QB2qg=; b=DNgYZq0iEf25Lr33syCjvv2aV5zUYatwn/vm1kRp1/xp8YPaKCIJu9FNku1NX9CxkhFy0t co49PYZbkA8uEkHiL7Ov95lXAMuUODzAEOgA1cw9pWXQgtLrM8/2UYSt7VWaLAFnYa027I zaKkVBEn7hX1G+pNfI3/pk19Fza0UtuO3laWVgKIrsjfTXJfsxj7G2W3c75Yn3zA77KP+Z wwOBjb0bI6HLdNkQkdHVQAH3YR0EvB0bawbe8tjWtBtXiD6S69cDIhz4ghkgCvryNfaZRX 59Bh9RjEF+xst9EgfhmX1hdn/Tjtyu2dRxWiz1eYUcGfdrcDhOOotALb3odFTQ== 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 4Z4TYK0lNtzwSB; Sat, 01 Mar 2025 02:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5212TOka078000; Sat, 1 Mar 2025 02:29:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5212TOLk077997; Sat, 1 Mar 2025 02:29:24 GMT (envelope-from git) Date: Sat, 1 Mar 2025 02:29:24 GMT Message-Id: <202503010229.5212TOLk077997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Lo Subject: git: 8ac7c651dbe0 - stable/14 - ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevlo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ac7c651dbe01791284301b9d109ad856f564b36 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=8ac7c651dbe01791284301b9d109ad856f564b36 commit 8ac7c651dbe01791284301b9d109ad856f564b36 Author: Kevin Lo AuthorDate: 2025-02-28 08:12:00 +0000 Commit: Kevin Lo CommitDate: 2025-03-01 02:28:58 +0000 ixgbe: Fix a logic error in ixgbe_read_mailbox_vf() Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D49156 (cherry picked from commit 5c7087c349fc1d826807aa1a11912c9e774e3321) --- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 5f1f64e02b82..0b866e7a39af 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -297,7 +297,7 @@ static u32 ixgbe_read_mailbox_vf(struct ixgbe_hw *hw) u32 vf_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX); vf_mailbox |= hw->mbx.vf_mailbox; - hw->mbx.vf_mailbox |= vf_mailbox % IXGBE_VFMAILBOX_R2C_BITS; + hw->mbx.vf_mailbox |= vf_mailbox & IXGBE_VFMAILBOX_R2C_BITS; return vf_mailbox; } From nobody Sat Mar 1 09:39:38 2025 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 4Z4g5k3Rnyz5p7Tx; Sat, 01 Mar 2025 09:39:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4g5k1k2Sz3HN1; Sat, 01 Mar 2025 09:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821978; 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=HKgXF6oGzTb8vm4OQ9YPJ2WgNRYwKNiZCclW2AnDuyU=; b=Y2IkZMFVmlubTwDw8XQES3YVhG8xSQ259EGbZW1d4lz3yW+5W1Bd7UP3Pw5y3vXihxeSJI otq+IeSsGczepcS1/NQ9cv9LQ/htBQO+0+5OcgcUT9ZyoIAsQjlUvJ0BkETYRuZ3wC1nDG Or9vYt1EPtJiPa9p9N66su52LHwVudFnlR50KQHKBp69fGbs57J25WTIA8LyflRsGkFw0q gY1Ek9Gzfbvp9qVunsyPeYZd3WpIfsrqJG7fBmqTeVOT9GT1TSbsMq1/3a+vb2eopa2N6o NJcXgdsB1ndhfoH/VKiOQLLYKu9P//JDZTYLaebgB2X0bl+orw6GCNOZClzyUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740821978; a=rsa-sha256; cv=none; b=idUSXC1QIfuWmFEE09r2GUiu2g+/kQdF6xComKptArWcS6FJ7RCj25oF9WaQiKKPK/Uyma w1w1P+HdjxcG3doqA4p3qPwfX0SiiXJF5jE+bs5HQoTV0J9ivqppL7DWcgYBaryJHZvOQ/ SB15y6jtFMBVOBkLSz3l8ZCwN8Eb4OZ0OaJ4ziimDyBBbHb70sozw38lX+MJlcGVgmWeFX T4fNJgMR1iGIwqLNKD2MPWrD3TmOMuTfTQUtTFvOEccHcSagO8ttQc9mhpqI6NT4ylHomd V5DwCCPKD+NjHRxW8RA8uxvmiAl0azU39YJcZfylUQLHI2htlWwVMhoJQVO16Q== 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=1740821978; 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=HKgXF6oGzTb8vm4OQ9YPJ2WgNRYwKNiZCclW2AnDuyU=; b=pmIDAOUeiNyLzrYfrr3buFjZ3+5frxm8WBSBhOsd4t1heQnQ2WOmO1tTDB04cljIyf+ny5 lgHYmXGHBsOMxcjRYnbtCS4yKfb9PZevQ4AoRPz8ssWYq16NAkQNQVU/1xGFwZt9uqOOlR pwGVMZY39y7oXKVqR0x5yDjSvQ85n67kheOI+bRPiKLwC4keYLU+GBtWfCJfrVDYK3EPms k1r3unm0VLjdavX6cPQ7+VvVz9rtrF4A4PVKkMmoF/4s/8RaTt2wWhbVEPr7miX2Yu2QRQ vwguPDxl05C/OjeJx6ohKyvab0DnsXPJXZUgi4vi1nyiUab0gnZ9xCIEGr7w7w== 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 4Z4g5k1KWkz18P8; Sat, 01 Mar 2025 09:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5219dcCn084552; Sat, 1 Mar 2025 09:39:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5219dcN9084549; Sat, 1 Mar 2025 09:39:38 GMT (envelope-from git) Date: Sat, 1 Mar 2025 09:39:38 GMT Message-Id: <202503010939.5219dcN9084549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: d3f637b744e2 - stable/14 - Refactor iwmbtfw: set default firmware_dir after argument parsing 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d3f637b744e20f11ebfa3ea6d08cd2923325838a Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d3f637b744e20f11ebfa3ea6d08cd2923325838a commit d3f637b744e20f11ebfa3ea6d08cd2923325838a Author: Eygene Ryabinkin AuthorDate: 2025-01-29 21:56:40 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-01 09:36:01 +0000 Refactor iwmbtfw: set default firmware_dir after argument parsing Don't repeat firmware_dir stanza at all "if" branches: be more DRY. Signed-off-by: Eygene Ryabinkin Reviewed by: wulf MFC after: 1 month (cherry picked from commit f466ba4ca479ec500b927deadaba104469662994) --- usr.sbin/bluetooth/iwmbtfw/main.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 9c899d374e92..e4bb22af0e8a 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -451,6 +451,10 @@ main(int argc, char *argv[]) /* NOTREACHED */ } + /* Default the firmware path */ + if (firmware_dir == NULL) + firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); + /* libusb setup */ r = libusb_init(&ctx); if (r != 0) { @@ -508,10 +512,6 @@ main(int argc, char *argv[]) goto reset; } - /* Default the firmware path */ - if (firmware_dir == NULL) - firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "bseq"); if (firmware_path == NULL) goto shutdown; @@ -603,10 +603,6 @@ main(int argc, char *argv[]) goto shutdown; } - /* Default the firmware path */ - if (firmware_dir == NULL) - firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "sfi"); if (firmware_path == NULL) goto shutdown; @@ -689,10 +685,6 @@ main(int argc, char *argv[]) goto shutdown; } - /* Default the firmware path */ - if (firmware_dir == NULL) - firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); - firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "sfi"); if (firmware_path == NULL) goto shutdown; From nobody Sat Mar 1 09:39:39 2025 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 4Z4g5l3sxvz5p7jC; Sat, 01 Mar 2025 09:39:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4g5l296Tz3Hb6; Sat, 01 Mar 2025 09:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821979; 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=CMlIynyPL0ifnYxs0OJFPwy2MUG86Ou22qkkrR4Semg=; b=NT0Tff2fPyuhI+xNbJg5DChmY5jmk6v5yoHBXvDuTFBKWGVGBh7NesAjUg/+fh/jPenCT4 jb1MV36JtaCW/gvVNW3e2YZ0A3yP3ZYU8ZRgWzSjmfdssl44whbdBkV7GZNzqQCniWr0k9 stbvFvB+iTlyQd5JdmIqnMG7qWdGE/rxr/rKVrJcrlai8lHk8yih6m0lIgVG8FRCbzBlPB fM+cYTbPW33yUtq3pLnhyQGnefpc1GvmJgSDfLK5zrX+PaMcuUyV3yuL4P8SrVapmqo/v6 +cfsCRQjyA1k53rg9xaZ1ENKY1t/g1993I0JQkYKpu4Nl5joCHKp45PjWVA2Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740821979; a=rsa-sha256; cv=none; b=YdscfSX9Hxzu+pF/0huT/iUEtPMmI6PLRYYUkvTe1MxrN9s3MG/bMP+gVzSSaddNM+SKA/ 6EXmS+f6JSksYZYDqCwgxL9zDFzbGHzXVmFdCN/6kYitQuVMAXK0HjAvI9aRBEH7tBDHb1 ukhvluinHX0j6DDNL2qusEbXmv+E1ejRkqPY0fTHEHv9jAypTIdAlBY1olJA6ukElUu6o8 3qvQmUzKOwsCTc2QqC0Ve3kdwmjkI8k8VTOBooBdW6p+fNvzc31XUnp4RwNT6u+T+bjDRH /4VXQW6XQmRZNkAuF71G2bANxXGWCnsLyFg3Iu/0ZQQHooaLY8Xnnwm+dzl1MQ== 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=1740821979; 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=CMlIynyPL0ifnYxs0OJFPwy2MUG86Ou22qkkrR4Semg=; b=qm+r6px50uScviuxX+pcC5n44JpZKioRlRnuErTihQkixIcbi9nOl1VGf313+usMYu+3A7 Voomm+/BHUDw1t3hLvFejfkTSamG0Y3Xq7yIKNjEG0uIyiJZTV8zIPI3uB22mW0m9Pjvt0 hdbqGK5kPa7OnWA/g2Fixj+EmGk69MpBfGJRB3hbRrhMZykfx5HjYpVwHp+v9qEa4YZYXj Ow+4jOhoxbulS5zq3oDSlTMcEvpB4KRQ2uscYSEY3jltHPMlH8j1TxA3yQBftEgPBbQsPr JUmq86zJCvVdaHUNwcev1hVmZREH4c72qTuXTXjPyQnjtG0B47ufVufcd/G5bw== 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 4Z4g5l1lZtz18gd; Sat, 01 Mar 2025 09:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5219ddMx084586; Sat, 1 Mar 2025 09:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5219dd6L084583; Sat, 1 Mar 2025 09:39:39 GMT (envelope-from git) Date: Sat, 1 Mar 2025 09:39:39 GMT Message-Id: <202503010939.5219dd6L084583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 3d5e49294142 - stable/14 - Refactor iwmbtfw: modularize and de-constify 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3d5e49294142012f0df988edfa574d4378f678b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=3d5e49294142012f0df988edfa574d4378f678b8 commit 3d5e49294142012f0df988edfa574d4378f678b8 Author: Eygene Ryabinkin AuthorDate: 2025-01-29 21:56:40 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-01 09:36:12 +0000 Refactor iwmbtfw: modularize and de-constify - Move logic for firmware download into different adapter types to the own functions to allow main() to be simpler - Use enums/typedefs for exit modes, image types, etc - Purge most obvious comments: functions are named properly, so most of their invocations self-document the code. Signed-off-by: Eygene Ryabinkin Reviewed by: wulf MFC after: 1 month (cherry picked from commit 06969db312022277729dd144e3655a90007306ef) --- usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c | 1 + usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h | 8 + usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c | 15 +- usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h | 14 +- usr.sbin/bluetooth/iwmbtfw/main.c | 526 ++++++++++++++++++---------------- 5 files changed, 298 insertions(+), 266 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c index 815b40982d5b..3a5cd9d42658 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c @@ -119,6 +119,7 @@ iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, switch (ver->hw_variant) { case 0x07: /* 7260 */ case 0x08: /* 7265 */ + // NB: don't use params, they are NULL for 7xxx asprintf(&fwname, "%s/ibt-hw-%x.%x.%x-fw-%x.%x.%x.%x.%x.%s", prefix, le16toh(ver->hw_platform), diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h index 2666d123c8f0..eb6909a1f91d 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h @@ -52,6 +52,10 @@ struct iwmbt_version { uint8_t fw_patch_num; } __attribute__ ((packed)); +/* Known values for fw_variant */ +#define FW_VARIANT_BOOTLOADER 0x06 /* Bootloader mode */ +#define FW_VARIANT_OPERATIONAL 0x23 /* Operational mode */ + struct iwmbt_boot_params { uint8_t status; uint8_t otp_format; @@ -131,6 +135,10 @@ struct iwmbt_version_tlv { bdaddr_t otp_bd_addr; }; +/* Known TLV img_type values */ +#define TLV_IMG_TYPE_BOOTLOADER 0x01 /* Bootloader mode */ +#define TLV_IMG_TYPE_OPERATIONAL 0x03 /* Operational mode */ + struct iwmbt_firmware { char *fwname; int len; diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c index 1efd24ecf9f6..255181b8f4bc 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c @@ -437,7 +437,8 @@ iwmbt_enter_manufacturer(struct libusb_device_handle *hdl) } int -iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, int mode) +iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, + enum iwmbt_mm_exit mode) { int ret, transferred; static struct iwmbt_hci_cmd cmd = { @@ -447,17 +448,7 @@ iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, int mode) }; uint8_t buf[IWMBT_HCI_MAX_EVENT_SIZE]; - /* - * The mode sets the type of reset we want to perform: - * 0x00: simply exit manufacturer mode without a reset. - * 0x01: exit manufacturer mode with a reset and patches disabled - * 0x02: exit manufacturer mode with a reset and patches enabled - */ - if (mode > 2) { - iwmbt_debug("iwmbt_exit_manufacturer(): unknown mode (%d)", - mode); - } - cmd.data[1] = mode; + cmd.data[1] = (uint8_t)mode; ret = iwmbt_hci_command(hdl, &cmd, diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h index 89ee344fe587..aac885dfd153 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h @@ -58,6 +58,18 @@ struct iwmbt_hci_event_cmd_compl { uint8_t data[]; } __attribute__ ((packed)); +/* + * Manufacturer mode exit type: selects reset type, + * 0x00: simply exit manufacturer mode without a reset. + * 0x01: exit manufacturer mode with a reset and patches disabled + * 0x02: exit manufacturer mode with a reset and patches enabled + */ +enum iwmbt_mm_exit { + IWMBT_MM_EXIT_ONLY = 0x00, + IWMBT_MM_EXIT_COLD_RESET = 0x01, + IWMBT_MM_EXIT_WARM_RESET = 0x02, +}; + #define IWMBT_HCI_EVT_COMPL_SIZE(payload) \ (offsetof(struct iwmbt_hci_event_cmd_compl, data) + sizeof(payload)) #define IWMBT_HCI_EVENT_COMPL_HEAD_SIZE \ @@ -91,7 +103,7 @@ extern int iwmbt_load_fwfile(struct libusb_device_handle *hdl, const struct iwmbt_firmware *fw, uint32_t *boot_param, int offset); extern int iwmbt_enter_manufacturer(struct libusb_device_handle *hdl); extern int iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, - int mode); + enum iwmbt_mm_exit mode); extern int iwmbt_get_version(struct libusb_device_handle *hdl, struct iwmbt_version *version); extern int iwmbt_get_version_tlv(struct libusb_device_handle *hdl, diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index e4bb22af0e8a..497edcb254cf 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -215,9 +215,11 @@ iwmbt_dump_version_tlv(struct iwmbt_version_tlv *ver) ver->otp_bd_addr.b[2], ver->otp_bd_addr.b[1], ver->otp_bd_addr.b[0]); - if (ver->img_type == 0x01 || ver->img_type == 0x03) + if (ver->img_type == TLV_IMG_TYPE_BOOTLOADER || + ver->img_type == TLV_IMG_TYPE_OPERATIONAL) iwmbt_info("%s timestamp %u.%u buildtype %u build %u", - ver->img_type == 0x01 ? "Bootloader" : "Firmware", + (ver->img_type == TLV_IMG_TYPE_BOOTLOADER ? + "Bootloader" : "Firmware"), 2000 + (ver->timestamp >> 8), ver->timestamp & 0xff, ver->build_type, @@ -399,22 +401,266 @@ usage(void) exit(127); } + +/* + * Returns 0 on success. + */ +static int +handle_7260(libusb_device_handle *hdl, char *firmware_dir) +{ + int r; + struct iwmbt_version ver; + char *firmware_path = NULL; + + r = iwmbt_get_version(hdl, &ver); + if (r < 0) { + iwmbt_debug("iwmbt_get_version() failed code %d", r); + return 1; + } + iwmbt_dump_version(&ver); + iwmbt_debug("fw_patch_num=0x%02x", (int) ver.fw_patch_num); + + /* fw_patch_num = >0 operational mode */ + if (ver.fw_patch_num > 0x00) { + iwmbt_info("Firmware has already been downloaded"); + return 0; + } + + firmware_path = iwmbt_get_fwname(&ver, NULL, firmware_dir, "bseq"); + if (firmware_path == NULL) + return 1; + iwmbt_debug("firmware_path = %s", firmware_path); + + r = iwmbt_enter_manufacturer(hdl); + if (r < 0) { + iwmbt_debug("iwmbt_enter_manufacturer() failed code %d", r); + return 1; + } + + /* Download firmware */ + r = iwmbt_patch_firmware(hdl, firmware_path); + free(firmware_path); + if (r < 0) { + (void)iwmbt_exit_manufacturer(hdl, IWMBT_MM_EXIT_COLD_RESET); + return 1; + } + + iwmbt_info("Firmware download complete"); + + r = iwmbt_exit_manufacturer(hdl, + (r == 0 ? IWMBT_MM_EXIT_ONLY : IWMBT_MM_EXIT_WARM_RESET)); + if (r < 0) { + iwmbt_debug("iwmbt_exit_manufacturer() failed code %d", r); + return 1; + } + + /* Once device is running in operational mode we can ignore failures */ + + /* Dump actual controller version */ + r = iwmbt_get_version(hdl, &ver); + if (r == 0) + iwmbt_dump_version(&ver); + + if (iwmbt_enter_manufacturer(hdl) < 0) + return 0; + r = iwmbt_set_event_mask(hdl); + if (r == 0) + iwmbt_info("Intel Event Mask is set"); + (void)iwmbt_exit_manufacturer(hdl, IWMBT_MM_EXIT_ONLY); + + return 0; +} + + +/* + * Returns 0 on success. + */ +static int +handle_8260(libusb_device_handle *hdl, char *firmware_dir) +{ + int r; + uint32_t boot_param; + struct iwmbt_version ver; + struct iwmbt_boot_params params; + char *firmware_path = NULL; + + r = iwmbt_get_version(hdl, &ver); + if (r < 0) { + iwmbt_debug("iwmbt_get_version() failed code %d", r); + return 1; + } + iwmbt_dump_version(&ver); + iwmbt_debug("fw_variant=0x%02x", (int) ver.fw_variant); + + if (ver.fw_variant == FW_VARIANT_OPERATIONAL) { + iwmbt_info("Firmware has already been downloaded"); + return 0; + } + + if (ver.fw_variant != FW_VARIANT_BOOTLOADER){ + iwmbt_err("unknown fw_variant 0x%02x", (int) ver.fw_variant); + return 1; + } + + /* Read Intel Secure Boot Params */ + r = iwmbt_get_boot_params(hdl, ¶ms); + if (r < 0) { + iwmbt_debug("iwmbt_get_boot_params() failed!"); + return 1; + } + iwmbt_dump_boot_params(¶ms); + + /* Check if firmware fragments are ACKed with a cmd complete event */ + if (params.limited_cce != 0x00) { + iwmbt_err("Unsupported Intel firmware loading method (%u)", + params.limited_cce); + return 1; + } + + firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "sfi"); + if (firmware_path == NULL) + return 1; + iwmbt_debug("firmware_path = %s", firmware_path); + + /* Download firmware and parse it for magic Intel Reset parameter */ + r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, 0, 0); + free(firmware_path); + if (r < 0) + return 1; + + iwmbt_info("Firmware download complete"); + + r = iwmbt_intel_reset(hdl, boot_param); + if (r < 0) { + iwmbt_debug("iwmbt_intel_reset() failed!"); + return 1; + } + + iwmbt_info("Firmware operational"); + + /* Once device is running in operational mode we can ignore failures */ + + /* Dump actual controller version */ + r = iwmbt_get_version(hdl, &ver); + if (r == 0) + iwmbt_dump_version(&ver); + + /* Apply the device configuration (DDC) parameters */ + firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "ddc"); + iwmbt_debug("ddc_path = %s", firmware_path); + if (firmware_path != NULL) { + r = iwmbt_init_ddc(hdl, firmware_path); + if (r == 0) + iwmbt_info("DDC download complete"); + free(firmware_path); + } + + r = iwmbt_set_event_mask(hdl); + if (r == 0) + iwmbt_info("Intel Event Mask is set"); + + return 0; +} + + +static int +handle_9260(libusb_device_handle *hdl, char *firmware_dir) +{ + int r; + uint32_t boot_param; + struct iwmbt_version vl; + struct iwmbt_version_tlv vt; + char *firmware_path = NULL; + + r = iwmbt_get_version_tlv(hdl, &vt); + if (r < 0) { + iwmbt_debug("iwmbt_get_version_tlv() failed code %d", r); + return 1; + } + iwmbt_dump_version_tlv(&vt); + iwmbt_debug("img_type=0x%02x", (int) vt.img_type); + + if (vt.img_type == TLV_IMG_TYPE_OPERATIONAL) { + iwmbt_info("Firmware has already been downloaded"); + return 0; + } + + if (vt.img_type != TLV_IMG_TYPE_BOOTLOADER) { + iwmbt_err("unknown img_type 0x%02x", (int) vt.img_type); + return 1; + } + + /* Check if firmware fragments are ACKed with a cmd complete event */ + if (vt.limited_cce != 0x00) { + iwmbt_err("Unsupported Intel firmware loading method (%u)", + vt.limited_cce); + return 1; + } + + /* Check if secure boot engine is supported: 1 (ECDSA) or 0 (RSA) */ + if (vt.sbe_type > 0x01) { + iwmbt_err("Unsupported secure boot engine (%u)", + vt.sbe_type); + return 1; + } + + firmware_path = iwmbt_get_fwname_tlv(&vt, firmware_dir, "sfi"); + if (firmware_path == NULL) + return 1; + iwmbt_debug("firmware_path = %s", firmware_path); + + /* Download firmware and parse it for magic Intel Reset parameter */ + r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, + vt.cnvi_bt >> 16 & 0x3f, vt.sbe_type); + free(firmware_path); + if (r < 0) + return 1; + + iwmbt_info("Firmware download complete"); + + r = iwmbt_intel_reset(hdl, boot_param); + if (r < 0) { + iwmbt_debug("iwmbt_intel_reset() failed!"); + return 1; + } + + iwmbt_info("Firmware operational"); + + /* Once device is running in operational mode we can ignore failures */ + + r = iwmbt_get_version(hdl, &vl); + if (r == 0) + iwmbt_dump_version(&vl); + + /* Apply the device configuration (DDC) parameters */ + firmware_path = iwmbt_get_fwname_tlv(&vt, firmware_dir, "ddc"); + iwmbt_debug("ddc_path = %s", firmware_path); + if (firmware_path != NULL) { + r = iwmbt_init_ddc(hdl, firmware_path); + if (r == 0) + iwmbt_info("DDC download complete"); + free(firmware_path); + } + + r = iwmbt_set_event_mask(hdl); + if (r == 0) + iwmbt_info("Intel Event Mask is set"); + + return 0; +} + + int main(int argc, char *argv[]) { libusb_context *ctx = NULL; libusb_device *dev = NULL; libusb_device_handle *hdl = NULL; - static struct iwmbt_version ver; - static struct iwmbt_version_tlv ver_tlv; - static struct iwmbt_boot_params params; - uint32_t boot_param; int r; uint8_t bus_id = 0, dev_id = 0; int devid_set = 0; int n; char *firmware_dir = NULL; - char *firmware_path = NULL; int retcode = 1; enum iwmbt_device iwmbt_device; @@ -494,256 +740,30 @@ main(int argc, char *argv[]) goto shutdown; } - if (iwmbt_device == IWMBT_DEVICE_7260) { - - /* Get Intel version */ - r = iwmbt_get_version(hdl, &ver); - if (r < 0) { - iwmbt_debug("iwmbt_get_version() failed code %d", r); - goto shutdown; - } - iwmbt_dump_version(&ver); - iwmbt_debug("fw_patch_num=0x%02x", (int) ver.fw_patch_num); - - /* fw_patch_num = >0 operational mode */ - if (ver.fw_patch_num > 0x00) { - iwmbt_info("Firmware has already been downloaded"); - retcode = 0; - goto reset; - } - - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "bseq"); - if (firmware_path == NULL) - goto shutdown; - - iwmbt_debug("firmware_path = %s", firmware_path); - - /* Check firmware file exists before changing HW mode */ - r = access(firmware_path, R_OK); - if (r) { - perror("Failed to open firmware"); - goto shutdown; - } - - /* Enter manufacturer mode */ - r = iwmbt_enter_manufacturer(hdl); - if (r < 0) { - iwmbt_debug("iwmbt_enter_manufacturer() failed code %d", r); - goto shutdown; - } - - /* Download firmware and parse it for magic Intel Reset parameter */ - r = iwmbt_patch_firmware(hdl, firmware_path); - free(firmware_path); - if (r < 0) { - (void)iwmbt_exit_manufacturer(hdl, 0x01); - goto shutdown; - } - - iwmbt_info("Firmware download complete"); - - /* Exit manufacturer mode */ - r = iwmbt_exit_manufacturer(hdl, r == 0 ? 0x00 : 0x02); - if (r < 0) { - iwmbt_debug("iwmbt_exit_manufacturer() failed code %d", r); - goto shutdown; - } - - /* Once device is running in operational mode we can ignore failures */ - retcode = 0; - - /* Execute Read Intel Version one more time */ - r = iwmbt_get_version(hdl, &ver); - if (r == 0) - iwmbt_dump_version(&ver); - - /* Set Intel Event mask */ - if (iwmbt_enter_manufacturer(hdl) < 0) - goto reset; - r = iwmbt_set_event_mask(hdl); - if (r == 0) - iwmbt_info("Intel Event Mask is set"); - (void)iwmbt_exit_manufacturer(hdl, 0x00); - - } else if (iwmbt_device == IWMBT_DEVICE_8260) { - - /* Get Intel version */ - r = iwmbt_get_version(hdl, &ver); - if (r < 0) { - iwmbt_debug("iwmbt_get_version() failed code %d", r); - goto shutdown; - } - iwmbt_dump_version(&ver); - iwmbt_debug("fw_variant=0x%02x", (int) ver.fw_variant); - - /* fw_variant = 0x06 bootloader mode / 0x23 operational mode */ - if (ver.fw_variant == 0x23) { - iwmbt_info("Firmware has already been downloaded"); - retcode = 0; - goto reset; - } - - if (ver.fw_variant != 0x06){ - iwmbt_err("unknown fw_variant 0x%02x", (int) ver.fw_variant); - goto shutdown; - } - - /* Read Intel Secure Boot Params */ - r = iwmbt_get_boot_params(hdl, ¶ms); - if (r < 0) { - iwmbt_debug("iwmbt_get_boot_params() failed!"); - goto shutdown; - } - iwmbt_dump_boot_params(¶ms); - - /* Check if firmware fragments are ACKed with a cmd complete event */ - if (params.limited_cce != 0x00) { - iwmbt_err("Unsupported Intel firmware loading method (%u)", - params.limited_cce); - goto shutdown; - } - - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "sfi"); - if (firmware_path == NULL) - goto shutdown; - - iwmbt_debug("firmware_path = %s", firmware_path); - - /* Download firmware and parse it for magic Intel Reset parameter */ - r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, 0, 0); - free(firmware_path); - if (r < 0) - goto shutdown; - - iwmbt_info("Firmware download complete"); - - r = iwmbt_intel_reset(hdl, boot_param); - if (r < 0) { - iwmbt_debug("iwmbt_intel_reset() failed!"); - goto shutdown; - } - - iwmbt_info("Firmware operational"); - - /* Once device is running in operational mode we can ignore failures */ - retcode = 0; - - /* Execute Read Intel Version one more time */ - r = iwmbt_get_version(hdl, &ver); - if (r == 0) - iwmbt_dump_version(&ver); - - /* Apply the device configuration (DDC) parameters */ - firmware_path = iwmbt_get_fwname(&ver, ¶ms, firmware_dir, "ddc"); - iwmbt_debug("ddc_path = %s", firmware_path); - if (firmware_path != NULL) { - r = iwmbt_init_ddc(hdl, firmware_path); - if (r == 0) - iwmbt_info("DDC download complete"); - free(firmware_path); - } - - /* Set Intel Event mask */ - r = iwmbt_set_event_mask(hdl); - if (r == 0) - iwmbt_info("Intel Event Mask is set"); - - } else { - - /* Get Intel version */ - r = iwmbt_get_version_tlv(hdl, &ver_tlv); - if (r < 0) { - iwmbt_debug("iwmbt_get_version_tlv() failed code %d", r); - goto shutdown; - } - iwmbt_dump_version_tlv(&ver_tlv); - iwmbt_debug("img_type=0x%02x", (int) ver_tlv.img_type); - - /* img_type = 0x01 bootloader mode / 0x03 operational mode */ - if (ver_tlv.img_type == 0x03) { - iwmbt_info("Firmware has already been downloaded"); - retcode = 0; - goto reset; - } - - if (ver_tlv.img_type != 0x01){ - iwmbt_err("unknown img_type 0x%02x", (int) ver_tlv.img_type); - goto shutdown; - } - - /* Check if firmware fragments are ACKed with a cmd complete event */ - if (ver_tlv.limited_cce != 0x00) { - iwmbt_err("Unsupported Intel firmware loading method (%u)", - ver_tlv.limited_cce); - goto shutdown; - } - - /* Check if secure boot engine is supported: 1 (ECDSA) or 0 (RSA) */ - if (ver_tlv.sbe_type > 0x01) { - iwmbt_err("Unsupported secure boot engine (%u)", - ver_tlv.sbe_type); - goto shutdown; - } - - firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "sfi"); - if (firmware_path == NULL) - goto shutdown; - - iwmbt_debug("firmware_path = %s", firmware_path); - - /* Download firmware and parse it for magic Intel Reset parameter */ - r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, - ver_tlv.cnvi_bt >> 16 & 0x3f, ver_tlv.sbe_type); - free(firmware_path); - if (r < 0) - goto shutdown; - - r = iwmbt_intel_reset(hdl, boot_param); - if (r < 0) { - iwmbt_debug("iwmbt_intel_reset() failed!"); - goto shutdown; - } - - iwmbt_info("Firmware operational"); - - /* Once device is running in operational mode we can ignore failures */ - retcode = 0; - - /* Execute Read Intel Version one more time */ - r = iwmbt_get_version(hdl, &ver); - if (r == 0) - iwmbt_dump_version(&ver); - - /* Apply the device configuration (DDC) parameters */ - firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "ddc"); - iwmbt_debug("ddc_path = %s", firmware_path); - if (firmware_path != NULL) { - r = iwmbt_init_ddc(hdl, firmware_path); - if (r == 0) - iwmbt_info("DDC download complete"); - free(firmware_path); - } - - /* Set Intel Event mask */ - r = iwmbt_set_event_mask(hdl); - if (r == 0) - iwmbt_info("Intel Event Mask is set"); - - iwmbt_info("Firmware download complete"); + switch(iwmbt_device) { + case IWMBT_DEVICE_7260: + retcode = handle_7260(hdl, firmware_dir); + break; + case IWMBT_DEVICE_8260: + retcode = handle_8260(hdl, firmware_dir); + break; + case IWMBT_DEVICE_9260: + retcode = handle_9260(hdl, firmware_dir); + break; + default: + iwmbt_err("FIXME: unknown iwmbt type %d", (int)iwmbt_device); + retcode = 1; } -reset: - - /* Ask kernel driver to probe and attach device again */ - r = libusb_reset_device(hdl); - if (r != 0) - iwmbt_err("libusb_reset_device() failed: %s", - libusb_strerror(r)); + if (retcode == 0) { + /* Ask kernel driver to probe and attach device again */ + r = libusb_reset_device(hdl); + if (r != 0) + iwmbt_err("libusb_reset_device() failed: %s", + libusb_strerror(r)); + } shutdown: - - /* Shutdown */ - if (hdl != NULL) libusb_close(hdl); From nobody Sat Mar 1 09:39:40 2025 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 4Z4g5n26P3z5p7sD; Sat, 01 Mar 2025 09:39:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4g5m5M3Jz3HKV; Sat, 01 Mar 2025 09:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821980; 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=fJrs1/8ff5aukNSrWAyn172ArOrYYWsmAOhFWmEpi4o=; b=iKOkIFjPHaFPf+pyz6e/tJoloQl2FE53Czk4AP9hE5onwO3vyMdBFKfqOs5At0lCaru0ng JI0mttvZ+bCbgBOblkPYxnA8+/L9e/6mB/MYBuBjU5HzaOauzEcQAKrnxjXy84SBfO2yjO anNZcVay1xxygH3xGnKPrbFLcN1NIks4edzeiOiYuhdc65n8m87bkmA2WwXTcH6D2l1O/N cbqr25nhRJZwLz7CYor7DymagGsGJcLrByGr9+qxkiP1OgGya8c7PiyFjxFSyBYV7zMChr r4zwMNakmtahySmmeDP3kspxVhTkYO7XGXzvmlU/KfiRAzaPFKCpPBitxVZ8XA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740821980; a=rsa-sha256; cv=none; b=hn+rX7h/0Mbe6fNEW29Nhy+NuAFPWkR7jTe5auOIAtbxOtn1Z15Y4Q9DDs749o1oxqUkh6 U3HMcLX7g+eMsOthSLsi+Sc7ljosNtdfvxjLDseXs6o2TO31voATJBPYpvPBP1o5skJJOZ pww3cSGouApDeSGl/et0cSuNT4yUCSuJPnip673bVyoRRGAXWDZ7Sl1ZmfTscuXdev92Dd rfW5QIyxP/gais75ot/d0bIJsL271DkICdETpZCM+EJjDNWlTk3C7B2UbhxTXBAc1GYL7j Lf+tgbD8N1qnCnLsaszp/ho3h7l3pF3LEOX+NBBPCfM1pTnCCNZsA2mX+55QrQ== 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=1740821980; 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=fJrs1/8ff5aukNSrWAyn172ArOrYYWsmAOhFWmEpi4o=; b=pMHv9cX+DCfoQ8b2wl2htv47eodCR3fU+2iWQJLQm7QbOEg0kzXJBjSf6Psyr49mvtS30n BrbgfADQzJMYKd0ufwwRX8JxZL0FjHGELYXhqqt1TtWI5JVdzUBX2KwzVXSS8ZIQtSlj+A Te6yxV7j5DcgBqopIjbIzrhI0Tsr1kjvWhg3ISA5L6OTN/4vzdqATEhsFFdnZclLHXICEo 8LabC1+PI1Q5Xn/RQ+75QRT1iUYfnD/fWaGESQxinY6Brv9WX0OGXK4xYhsNE+NPEEmVAq J5/F78Wc1QZgw1itU8S/EfTaXtY5BiscjbsM20mwLuMPfi47zsC6V/AXqD5w0Q== 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 4Z4g5m2jWxz181q; Sat, 01 Mar 2025 09:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5219de58084620; Sat, 1 Mar 2025 09:39:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5219denA084617; Sat, 1 Mar 2025 09:39:40 GMT (envelope-from git) Date: Sat, 1 Mar 2025 09:39:40 GMT Message-Id: <202503010939.5219denA084617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: f2591781f354 - stable/14 - iwmbtfw(8): don't program hardware without existing firmware image 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2591781f354b6602927e53084af61721f0a2dd7 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f2591781f354b6602927e53084af61721f0a2dd7 commit f2591781f354b6602927e53084af61721f0a2dd7 Author: Eygene Ryabinkin AuthorDate: 2025-01-29 21:56:41 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-01 09:36:26 +0000 iwmbtfw(8): don't program hardware without existing firmware image One should not start firmware update sequence just to understand that there is no firmware image to program: update sequence for 7260 requires leaving manufacturing mode and in the case of missing firmware file it will trigger complete re-initialization of BT adapter. Which, in turn, will make the USB device to go away and reappear. Since devd(8) has hooks for USB device attachment, in the case of missing firmware it used to - trigger the (failing) firmware download, - which triggers device reset, - which creates USB notification and devd(8) kicks back in. Nice infinite cycle with many notifications via syslog: {{{ Jan 3 09:00:01 kernel: ugen0.2: at usbus0 Jan 3 09:00:01 kernel: ugen0.2: at usbus0 (disconnected) Jan 3 09:00:02 kernel: ugen0.2: at usbus0 Jan 3 09:00:02 kernel: ugen0.2: at usbus0 (disconnected) }}} Signed-off-by: Eygene Ryabinkin Reviewed by: wulf MFC after: 1 month (cherry picked from commit ff4116313eb4a5e6c24a688edf5df1e19eb82042) --- usr.sbin/bluetooth/iwmbtfw/main.c | 41 +++++++++++++-------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 497edcb254cf..7af07bb68322 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -226,30 +226,6 @@ iwmbt_dump_version_tlv(struct iwmbt_version_tlv *ver) ver->build_num); } -static int -iwmbt_patch_firmware(libusb_device_handle *hdl, const char *firmware_path) -{ - struct iwmbt_firmware fw; - int ret; - - iwmbt_debug("loading %s", firmware_path); - - /* Read in the firmware */ - if (iwmbt_fw_read(&fw, firmware_path) <= 0) { - iwmbt_debug("iwmbt_fw_read() failed"); - return (-1); - } - - /* Load in the firmware */ - ret = iwmbt_patch_fwfile(hdl, &fw); - if (ret < 0) - iwmbt_debug("Loading firmware file failed"); - - /* free it */ - iwmbt_fw_free(&fw); - - return (ret); -} static int iwmbt_init_firmware(libusb_device_handle *hdl, const char *firmware_path, @@ -402,6 +378,7 @@ usage(void) } + /* * Returns 0 on success. */ @@ -409,8 +386,9 @@ static int handle_7260(libusb_device_handle *hdl, char *firmware_dir) { int r; + char *firmware_path; struct iwmbt_version ver; - char *firmware_path = NULL; + struct iwmbt_firmware fw; r = iwmbt_get_version(hdl, &ver); if (r < 0) { @@ -431,16 +409,25 @@ handle_7260(libusb_device_handle *hdl, char *firmware_dir) return 1; iwmbt_debug("firmware_path = %s", firmware_path); + r = iwmbt_fw_read(&fw, firmware_path); + free(firmware_path); + if (r <= 0) { + iwmbt_debug("iwmbt_fw_read() failed"); + return 1; + } + r = iwmbt_enter_manufacturer(hdl); if (r < 0) { iwmbt_debug("iwmbt_enter_manufacturer() failed code %d", r); + iwmbt_fw_free(&fw); return 1; } /* Download firmware */ - r = iwmbt_patch_firmware(hdl, firmware_path); - free(firmware_path); + r = iwmbt_patch_fwfile(hdl, &fw); + iwmbt_fw_free(&fw); if (r < 0) { + iwmbt_debug("Loading firmware file failed"); (void)iwmbt_exit_manufacturer(hdl, IWMBT_MM_EXIT_COLD_RESET); return 1; } From nobody Sat Mar 1 09:39:41 2025 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 4Z4g5p3Ty4z5p7vt; Sat, 01 Mar 2025 09:39:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4g5n3p52z3Hdf; Sat, 01 Mar 2025 09:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740821981; 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=j8LmgIqvFBmVOHJKVYF7xR8iyYk8U2ipNlty1qhNt9w=; b=ElXiqWP9OlfnEi0dnFDS2gexza2xbqby+wpCGQH6dl/2qzSPMkp2ztbPXrHjZPIW5HnJta ettUtvyVyQo/FwYHVFwtWRWp7pbHbvLmSl2/H/kpLry7/wFU1DFRt7EfgM9zuALqOoZJU6 bL0gBo6kHz99K36WX7TdYEUhdq1XliPUUdt9QZVA/h1zUSFuxO1YdIyprh7vzU2JSUVjTK HyvmgdL20kyibrfGcvBtHw8KN/3gD3BngM1tV83FZGVdwgx8HSi0eHk5+syBJXA5G6lvOq wTRFUKO0iudmFeuogAcr563L5TmBKpbBVn9l6+h6RoHPoyT35ek/jc03jxDqvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740821981; a=rsa-sha256; cv=none; b=Btlw4g3XaVbU2E8mmBMWt/w97r0mauRF01tDwsdW+S82UaHAq1LRDCQNvQwSD0l8caP3o2 Fit9BLm3Y+4G5GSJ+5v7yHZVBmw1SKUZcuZyVJOPPnlCR3bJ1CPw+4YNVOdhTXWD19pMs7 6RmbFkXiZLKbUbgjj3poAjly7dTRcfS9/SsAClevene+MG1k+FYMK/OysVGB9WEvfZf0Sw GOfQFZFIgN9Z3XQo/x/0+sSnxn44DXX5z529rooKq37Pua+uNG/SpDMwjnQbQ/EJ7ApMc3 qmdoZq7Nx5aP3rPAelKxt5GiyJ8Gnx2pyJa8cLb8ECRy+i/rfSw6e9nAl16rYQ== 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=1740821981; 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=j8LmgIqvFBmVOHJKVYF7xR8iyYk8U2ipNlty1qhNt9w=; b=qfARlNCF7J3PYPkLN5lbuW9Tu/+yAKF9OJVkWqBHlsHodYYjbGn/CEqcdEVhv+nnR+m7qg 4+ZpX7ATCzRbvu6agqBbrzr+ygozUVzGDssXXEG6tlYSTqFsmvaWWzHF3lp4GYAzaiLFo3 P5SmOE4YaQMWAD2/W26vdIjN1Xo0z0Hw6VMt+rk0BVTd8/5+QVs71Urk5o/oieQ3ZxJQ97 omqQm+NnAuBF2zKIE9BpFE4IMbS4lbO6A156NUqGI473VtHgpU8xGHRJSK96L92iOB0e0e V4F3zHphXlXREjW35Xi9o/hHe1grd/STYt1mvdbkGYFeQdUB2sXNTngohR8fXA== 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 4Z4g5n3NWLz18VD; Sat, 01 Mar 2025 09:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5219df7k084656; Sat, 1 Mar 2025 09:39:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5219dfQg084653; Sat, 1 Mar 2025 09:39:41 GMT (envelope-from git) Date: Sat, 1 Mar 2025 09:39:41 GMT Message-Id: <202503010939.5219dfQg084653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 666f8246c392 - stable/14 - iwmbtfw(8): fix getopt flags, unify usage()/manual page contents 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 666f8246c39251e70f2a676bd1775f3563e73b1c Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=666f8246c39251e70f2a676bd1775f3563e73b1c commit 666f8246c39251e70f2a676bd1775f3563e73b1c Author: Eygene Ryabinkin AuthorDate: 2025-01-29 21:56:41 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-01 09:36:39 +0000 iwmbtfw(8): fix getopt flags, unify usage()/manual page contents Seems like there was an intention to use command line switches -m, -p and -v (each with argument), but there is no handling for them. Also, some enhancements to the usage()/manpage: - use FreeBSD manpage style -- square brackets -- for denoting optional arguments in usage(); - show default directory path in usage(); - update manual: -f is the optional flag; - show descriptions for -I/-D together: they are logically related. Signed-off-by: Eygene Ryabinkin Reviewed by: wulf MFC after: 1 month (cherry picked from commit 0feaf865ce8e333f834177a5656e57b5e32ad5cf) --- usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 | 6 +++--- usr.sbin/bluetooth/iwmbtfw/main.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 index 2ce828cb5ebe..87f34435d3f4 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 @@ -36,7 +36,7 @@ .Nm .Op Fl DI .Fl d Ar device_name -.Fl f Ar firmware_path +.Op Fl f Ar firmware_path .Nm .Fl h .Sh DESCRIPTION @@ -66,6 +66,8 @@ configuration to load in at runtime. .Pp The options are as follows: .Bl -tag -width "-f firmware_path" +.It Fl I +Enable informational debugging. .It Fl D Enable verbose debugging. .It Fl d Ar device_name @@ -76,8 +78,6 @@ device name. Specify the directory containing the firmware files to search and upload. .It Fl h Display usage message and exit. -.It Fl I -Enable informational debugging. .El .Sh EXIT STATUS .Ex -std diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 7af07bb68322..b27c5ad62239 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -369,10 +369,11 @@ static void usage(void) { fprintf(stderr, - "Usage: iwmbtfw (-D) -d ugenX.Y (-f firmware path) (-I)\n"); + "Usage: iwmbtfw [-DI] -d ugenX.Y [-f firmware path]\n"); fprintf(stderr, " -D: enable debugging\n"); fprintf(stderr, " -d: device to operate upon\n"); - fprintf(stderr, " -f: firmware path, if not default\n"); + fprintf(stderr, " -f: firmware path (defaults to %s)\n", + _DEFAULT_IWMBT_FIRMWARE_PATH); fprintf(stderr, " -I: enable informational output\n"); exit(127); } @@ -652,7 +653,7 @@ main(int argc, char *argv[]) enum iwmbt_device iwmbt_device; /* Parse command line arguments */ - while ((n = getopt(argc, argv, "Dd:f:hIm:p:v:")) != -1) { + while ((n = getopt(argc, argv, "Dd:f:hI")) != -1) { switch (n) { case 'd': /* ugen device name */ devid_set = 1; From nobody Sat Mar 1 22:58:29 2025 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 4Z50qV3hjzz59KR9; Sat, 01 Mar 2025 22:58:30 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z50qV33Ljz3M7S; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740869910; 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=WRUGcI3xG3zmLBRT6H7aDBLIAYdTeQa6LlrTREa+PP0=; b=lHAdowUiTVlliyQDafuLQ0oOvg6lBQIZ5HCeWtfU+uYFiFyxg1XSeFuUjiWIreewSLpwR3 xzn5qHAnp4aRNJ1NoZoT4Jyr/7j3CmdH8U8nl1w5BpKd0UbtV5+9pDSK53FYxVQvrnWl3N O7IB/RPZ1vALk8ls0acyuMxOU0B7yuifOvQYTOqZ3OXHl6shXnc9A7UiMvfluR1DY08HEP AYLXn9+z6sjtXw6tqx5DhYcDLnzNj+Ioni/FgU4OhPAuxz0jGCIBSNsPZ0DYDraXKdF7aL vbxpKLw1+BotU0qaSa/A1MTaSz0InRzmF4KiFu+tLw7tSNGU4GW/mC+oAFY3Xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740869910; a=rsa-sha256; cv=none; b=a4AxahP5DeeciOS2/w86ZNVky6yXtya3qkvLld8Bcos6uVQ2EpsWh9d99AlA1gy67QBhD6 bgHgt8mZeDqubtKX8+SJXwh4DNOIzuZ5kZjwJY+VkXPXOiQyuEE9DLf8XqzAGKeAM84wGX +BvlBANUTGtIv7Wgal8nL1C+WNcUVguQrB7xThiOYKdwT/e5NjlAAOLGoeKuADFYpWJUUZ zF8tw39iHc24gfx1+NRRIPf0pMuIhX5qDOVuzc2KS1qiHNvKaCRJeYPPGsbCVRroLSbZ81 QmfXGe1hyJ+CSvY2qARvFsrNxnrftT5Vfn5eo4/vMrglRgJD7NJmmUhX8NLhdA== 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=1740869910; 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=WRUGcI3xG3zmLBRT6H7aDBLIAYdTeQa6LlrTREa+PP0=; b=HQWV5Hf/3xb8k8Hb1lWlFDJ1O8WDEvJk34m7BRi/Azi5qG9w+qauVrL77dYuEW5isNhnFA g/FBMV+4QalfzKvSKr6nHWOh2jQhmup2N8az0VRZodzM1prk0Ud7xOruhjXzhZSRWRAVNf hz5j1mc92x0iCFw+Vh8+4STHTNeqmwj4KIkhdLRez81owYcmeHF6ZGo4t0fuw8lorYjmLV m4OJr822iIM9Y76zuovVvHwsC3SZNCeP+Itv0ATI8eCkghOBtoJEevqJjOtCkxiluLZFyp RC3/c3BlERHIJ7Y1zFuhWkveDDkaa2WkrZpOyTmChOsB+XDL8gxjxaVAlcv78Q== 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 4Z50qV1VDczc9w; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 521MwTJi079343; Sat, 1 Mar 2025 22:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 521MwTvP079340; Sat, 1 Mar 2025 22:58:29 GMT (envelope-from git) Date: Sat, 1 Mar 2025 22:58:29 GMT Message-Id: <202503012258.521MwTvP079340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: c564603e6449 - stable/14 - netinet6 tests: Add Scapy as a required program 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c564603e6449dc94835c0a73e0a9b50bc43b0e00 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=c564603e6449dc94835c0a73e0a9b50bc43b0e00 commit c564603e6449dc94835c0a73e0a9b50bc43b0e00 Author: Jose Luis Duran AuthorDate: 2025-02-17 19:50:24 +0000 Commit: Jose Luis Duran CommitDate: 2025-03-01 22:53:06 +0000 netinet6 tests: Add Scapy as a required program The ra.py script requires Scapy. Invoke it using the python3 symlink. While technically, at the moment, python points to python3, and python3 points to the current version of python, it is recommended to use python3. No functional change intended. Add the Scapy requirement in the header of each test that makes use of it. Reviewed by: kp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49005 (cherry picked from commit ec60176e7d29d1e9f11121146603ce5b6b5f40b8) --- tests/sys/netinet6/ndp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh index 038a640f331e..378759eb9ba4 100755 --- a/tests/sys/netinet6/ndp.sh +++ b/tests/sys/netinet6/ndp.sh @@ -134,7 +134,7 @@ atf_test_case "ndp_slaac_default_route" "cleanup" ndp_slaac_default_route_head() { atf_set descr 'Test default route installation via SLAAC' atf_set require.user root - atf_set require.progs "python" + atf_set require.progs scapy } ndp_slaac_default_route_body() { @@ -153,7 +153,7 @@ ndp_slaac_default_route_body() { atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv # Send an RA advertising a prefix. - atf_check -e ignore python $(atf_get_srcdir)/ra.py \ + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ --sendif ${epair0}b \ --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ --src $(ndp_if_lladdr ${epair0}b) \ @@ -172,7 +172,7 @@ ndp_slaac_default_route_body() { jexec ${jname} netstat -rn -6 # Send another RA, make sure that the default route is installed again. - atf_check -e ignore python $(atf_get_srcdir)/ra.py \ + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ --sendif ${epair0}b \ --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ --src $(ndp_if_lladdr ${epair0}b) \ From nobody Sat Mar 1 22:58:30 2025 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 4Z50qW2bZsz59KFc; Sat, 01 Mar 2025 22:58:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z50qV75XZz3M14; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740869911; 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=3YbnMW3fOBeAxFsELBm9zmBm3XCs2dt4hMyDJASTAMI=; b=vM7Pyh+rzi9IjLgK9oRj43CcKlKsz54Ustj6N0MZmHO/c/5/e2WwbszKyRBOqB+/BqAiw+ t8q626R0F3Jg0aBcGUOzcFeDPQrGqb3h/hlxjwdb/WzrwhUk3phFPopaOKD/q6O+5SSNhI fbSBFjKq0mspfEY1Tsp70/lKQ8MM2wKiPwcQXZyBeua+O4q83ZTmt7hRsAG5pgAu5Q8Eob 5Ziw+oFc/xkhlh/nNbeNI5LfWnjf5ixN/zuWo2IZy8lFFtiH25y0JhXYs9qKivhX/yJsOd Q8BvNN4nwDREuExFS0U4PKy5OFQ0dX1xfe0lE18NGZzzJ1vqzj2Lc+a0UItO+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740869911; a=rsa-sha256; cv=none; b=bw3QoCwWB0kQmw4MZjAy8J0ui+dtXQOzKhTla/OBqTZS8tMxQpkshP9acua1SytBS0UNEc g+TsloH+quet3KB4g8A7Io1dkBRKRhswBs6f0qp6vRqri5jBpFecsJ7Y1HJegP3iYTxJig Zh76v7ZKvYrYiurTq/IW95Z7VWEna6rzI9pF4u48A5xZN5RafRJ3Y6Pl6LUzQzTvlH0rvL pgcr4MYhF9RojrwVtGJtKg67h8xvzQfisi4hUSy1JBFBEeVNImau7wQdwvB0MniZMyxY/p INom8swNLpUhzXGZ8zy2hLHCPbH/RiXFpxvaElSmr1SPftCj5jFu+C9/res3Xw== 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=1740869911; 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=3YbnMW3fOBeAxFsELBm9zmBm3XCs2dt4hMyDJASTAMI=; b=rFPeACZjRKdKltYb4AIuVS9ve97KyE1AtM5c9oEIYxpJR4U78h9Io/KojIOE3Bc4gSzMNN 0bORZrOLiHZpWKx1BV365ism1XC7F0q+N29X0SK+xF5tAvUHqyP2IWK24aglD5jmYdStOR od2/XtVoyelcvOMiKc8H72STL5btuuo/KOBdtWJY16K9wzCaEmpslDyECJlmLl78+vB7tV BqwxTh+l9t35nOb8cDT2WFlmPa97Geug77p6S0imbDSHlJ0Av8tR6HMmcbLZ59HQhHLEFi YxbQbqlrxHs9H3Tf3a2sGY4NuhSN/tf0JSXVkfQ6tR21O0WGVlXISX8rorIujQ== 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 4Z50qV6ZlBzc9x; Sat, 01 Mar 2025 22:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 521MwU21079379; Sat, 1 Mar 2025 22:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 521MwUiF079376; Sat, 1 Mar 2025 22:58:30 GMT (envelope-from git) Date: Sat, 1 Mar 2025 22:58:30 GMT Message-Id: <202503012258.521MwUiF079376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 1dd41c75b5ac - stable/14 - pf tests: Remove Scapy as a required program 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1dd41c75b5ac0ffca55aafb1095bb70dc1700847 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=1dd41c75b5ac0ffca55aafb1095bb70dc1700847 commit 1dd41c75b5ac0ffca55aafb1095bb70dc1700847 Author: Jose Luis Duran AuthorDate: 2025-02-17 19:52:46 +0000 Commit: Jose Luis Duran CommitDate: 2025-03-01 22:53:59 +0000 pf tests: Remove Scapy as a required program Scapy is not needed to run this test. Remove it from the required programs list. Reviewed by: kp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49006 (cherry picked from commit 1f1963bd32d669f89ea3b044636de0cb7a33134b) --- tests/sys/netpfil/pf/rdr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh index 07aca78cc650..74d12371379d 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/pf/rdr.sh @@ -32,7 +32,7 @@ tcp_v6_head() { atf_set descr 'TCP rdr with IPv6' atf_set require.user root - atf_set require.progs scapy python3 + atf_set require.progs python3 } # From nobody Sun Mar 2 00:36:28 2025 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 4Z530X4QLGz59TBJ; Sun, 02 Mar 2025 00:36:28 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z530X3Mszz3R7p; Sun, 02 Mar 2025 00:36:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740875788; 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=cF63oif1UFNUVwVGxGBY+Bo+P3p2b+rI9NnAfai32Co=; b=MNmaO8YYuqUfC9setQQ0MlJJHfeS1U8HfW6hN8aRWyBFfCSSFYGqwND+HXSeQHE6qC1/qH C8zuSmfBtdi5oiSgMMwRqKL9SFyNvgu5uJZhI1sKKkacQ2sAUD1JqWauLmlO+R+Ofm+U+e HvByuxpsDcNldGzJ5kH7l26EPk06zzjwX9p27yVhGp/ueOIVyMvPORJU4SfYYdWWjjc0/Z axNkyNcIHJTnm5ycuHHXRWP4y/MLb0AqEqcslP1JPVhmrq3k/F39cZXRMzk8tM2MjFYykx 9kp4VDNAuO3LAHbSvZfesKfOfMHBx14dk3aVLkaWzkeW10SoC/GVYz5uPrEAIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740875788; a=rsa-sha256; cv=none; b=xdaKq/ZmNnBwUPW7dawD00nbUUlEo3CgLIr7qlnszKXjKmkAHAYTp9HtzSLIftHyBsGB/r 5iXfKTdWiVBOoJlu/kaUudOLsPpClx5bkdZKxb7JXLqAYXxLa0u1nxytooguO5pQ8p4FaW BmSC4fGDP3NmGqTbUE9J3EVfe4C6Nlyh4vOl51ZeenpKT/P6C/B2TFMGWKC5EynbOHdWjH SA7bKOXusgZs/R8D4O+KInt0fVPdoPsZfzqNP5A2fwiFuRFxX5QxDDYDKO8kk0N8w1lg3C JVIYa+LV3un3xOcrVkfZWn53cPsnSrfz0AuUKRJWkLpkbr3kQvgnKpX0ba7yIg== 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=1740875788; 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=cF63oif1UFNUVwVGxGBY+Bo+P3p2b+rI9NnAfai32Co=; b=GCUd5Zl1sXKNV4aXKFUCFhmphG5l54gFCJc3fKKDre48GgPDvK9mOeqp6fkNiQoRy1m6OH cFUn5JnSFgYFLe5+5KWtqh3Lta5BwQTx4O2IYxMxRczKqrMZ0fD7IXbVWUaVLEGSUWjZEF CJnOgrsQjNDvt6iHU/6ZIDzy2UB2p/zJs3krUDpIK0h0JkBV9G4px8YXWid2CFc+pZ8ak+ ZJghGFHt0GkCB0RHPSA1mAtGNEh2t+pKrfKdi/z2g+GicNpzEB9uNhQzgmOU+uBOEALQ6o zIh467SNstA6kTRiAEzCNDjSOxgDlMfZXiiyVuFx0jubaLowEGXZlxaaFr1fGQ== 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 4Z530X2D49zfGP; Sun, 02 Mar 2025 00:36:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5220aSkF065990; Sun, 2 Mar 2025 00:36:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5220aSru065987; Sun, 2 Mar 2025 00:36:28 GMT (envelope-from git) Date: Sun, 2 Mar 2025 00:36:28 GMT Message-Id: <202503020036.5220aSru065987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 970d9b5d304c - stable/14 - wifi manuals: Mlink + document description consistency 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 970d9b5d304cfdeabc9b2de074fd84205b3ba972 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=970d9b5d304cfdeabc9b2de074fd84205b3ba972 commit 970d9b5d304cfdeabc9b2de074fd84205b3ba972 Author: Alexander Ziaee AuthorDate: 2025-02-19 15:54:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-02 00:35:45 +0000 wifi manuals: Mlink + document description consistency Interfaces all have an mlink to if_$foo. Add these for the missing ones and remove an incorrect one from rtwn_pci. Wireless network drivers are all accessible via `apropos -s4 "wireless network driver", except two which are "wireless network device". I actually prefer the latter, but make them all consistent upon the more common parlance. Tag SPDX on one of the files I touched, while here. MFC after: 3 days Reviewed by: bz, carlavilla, mhorne Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D49063 (cherry picked from commit 4262dbc57982383eb61a8b7806de6dd4b7802da8) --- share/man/man4/Makefile | 4 +++- share/man/man4/uath.4 | 4 +++- share/man/man4/upgt.4 | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 979dc37d7db4..5b8b0fa54630 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -742,7 +742,9 @@ MLINKS+=ptnet.4 if_ptnet.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 +MLINKS+=rtw88.4 if_rtw89.4 +MLINKS+=rtw89.4 if_rtw89.4 +MLINKS+=rtwn.4 if_rtwn.4 MLINKS+=rue.4 if_rue.4 MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ diff --git a/share/man/man4/uath.4 b/share/man/man4/uath.4 index 7d9632fe8e0f..865f04b84232 100644 --- a/share/man/man4/uath.4 +++ b/share/man/man4/uath.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: ISC +.\" .\" Copyright (c) 2006 .\" Damien Bergamini .\" @@ -19,7 +21,7 @@ .Os .Sh NAME .Nm uath -.Nd Atheros USB IEEE 802.11a/b/g wireless network device +.Nd Atheros USB IEEE 802.11a/b/g wireless network driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 508c87c6a925..5d4ada1d1a1f 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -54,7 +54,7 @@ .Sh NAME .Nm upgt .Nd Conexant/Intersil PrismGT SoftMAC USB IEEE 802.11b/g wireless network -device +driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your From nobody Sun Mar 2 01:25:45 2025 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 4Z545m62ZYz5Vbm0 for ; Sun, 02 Mar 2025 01:26:04 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Z545j49JQz3x1T; Sun, 02 Mar 2025 01:26:00 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; dkim=fail ("headers rsa verify failed") header.d=dec.sakura.ne.jp header.s=s2405 header.b=rS5SmU4r; dmarc=pass (policy=none) header.from=dec.sakura.ne.jp; spf=pass (mx1.freebsd.org: domain of junchoon@dec.sakura.ne.jp designates 153.125.133.21 as permitted sender) smtp.mailfrom=junchoon@dec.sakura.ne.jp Received: from kalamity.joker.local (124-18-40-20.area1c.commufa.jp [124.18.40.20]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 5221PjXK075192; Sun, 2 Mar 2025 10:25:46 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dec.sakura.ne.jp; s=s2405; t=1740878747; bh=fWFmRtCFG9o66ZDcoRxFqWVnqR7lxoIiObBRIGenEh4=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=rS5SmU4rGlSRhKYlKgsqbF4CYP4ug0uQz/K0FPg8E7JIYBrrDWPbw1kVosq1LnKlx q16WfHXUCIHNlALqbLGuVOpta3aOzBiK7crnDxoOrPQ8wXTo75ODlsMjJBUk/0ZWLR LpoPX1+4WscoGjJng55wWGujgFQto486w6sTTGLg= Date: Sun, 2 Mar 2025 10:25:45 +0900 From: Tomoaki AOKI To: Cy Schubert Cc: freebsd@oldach.net (Helge Oldach), cy@FreeBSD.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 1a241a911dc8 - stable/14 - ntpd: Use the ntpd -u option in preference to the rc su plumbing Message-Id: <20250302102545.3ce62f3a0f3836d2ff01d544@dec.sakura.ne.jp> In-Reply-To: <20250301053719.2449ddcf28e417f6639ac58f@dec.sakura.ne.jp> References: <202502281412.51SECsWG048020@nuc.oldach.net> <20250228162252.E5053324@slippy.cwsent.com> <20250301053719.2449ddcf28e417f6639ac58f@dec.sakura.ne.jp> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.2) 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [0.23 / 15.00]; SUSPICIOUS_URL_IN_SUSPICIOUS_MESSAGE(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_MEDIUM(-0.90)[-0.904]; URIBL_RED(0.50)[dec.sakura.ne.jp:mid,dec.sakura.ne.jp:email]; MV_CASE(0.50)[]; ONCE_RECEIVED(0.20)[]; NEURAL_HAM_LONG(-0.16)[-0.163]; HAS_ANON_DOMAIN(0.10)[]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_ALLOW(0.00)[dec.sakura.ne.jp,none]; RCPT_COUNT_THREE(0.00)[4]; R_DKIM_REJECT(0.00)[dec.sakura.ne.jp:s=s2405]; DKIM_TRACE(0.00)[dec.sakura.ne.jp:-]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; HAS_ORG_HEADER(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_SOME(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-branches@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DMARC_POLICY_ALLOW_WITH_FAILURES(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:153.125.133.16/28]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4Z545j49JQz3x1T X-Spamd-Bar: / On Sat, 1 Mar 2025 05:37:19 +0900 Tomoaki AOKI wrote: > On Fri, 28 Feb 2025 08:22:52 -0800 > Cy Schubert wrote: > > > In message <202502281412.51SECsWG048020@nuc.oldach.net>, Helge Oldach > > writes: > > > Tomoaki AOKI wrote on Fri, 28 Feb 2025 10:53:24 +0100 (CET): > > > > Unfortunately, this commit caused ntpd hesitating to (re)start > > > > with error messages below on stable/14, amd64. > > > > > > > > ===== Quote ===== > > > > # service ntpd stop > > > > Stopping ntpd. > > > > Waiting for PIDS: 52508. > > > > # service ntpd start > > > > Starting ntpd. > > > > daemon control: got EOF > > > > /etc/rc.d/ntpd: WARNING: failed to start ntpd > > > > # > > > > ===== End quote ===== > > > > > > > > Note that I have > > > > ntpd_flags="-4 -g -x -f /var/db/ntpd.drift -l /var/log/ntpd.log" > > > > ntpd_config="/etc/ntp/ntp.conf" > > > > ntpd_enable="YES" > > > > ntpd_sync_on_start="YES" > > > > daily_ntpd_leapfile_enable="YES" > > > > ntp_leapfile_fetch_verbose="YES" > > > > in my /etc/rc.conf. > > > > > > I suggest ensure that the files referenced by the command line or by > > > configuration files can be created/written to by ntpd:ntpd. > > > > > > For example, you're not using the default location for ntpd.drift. > > > The default location is /var/db/ntp/ntpd.drift, where the directory > > > /var/db/ntp/ is owned by ntpd:ntpd (as per /etc/mtree/BSD.var.dist), so > > > ntpd is able to write the drift file after dropping privileges. > > > > > > Kind regards > > > Helge > > Thanks for advice! > > IIRC, my configuration was to allow keeping use of old-school place. > > Anyway, edited /etc/rc/conf to switch /var/db/ntpd.drift > to /var/db/ntp/ntpd.drift (serivce command picks configs everytime > invoked, so no reboots), without luck. Of course, /var/db/ntp has > ntpd:ntpd ownweship. > > Comparing succeeded (with reverted /etc/rc.d/ntpd) and failed > (/etc/rc.d/ntpd without reverts), I found an error only in the latter > case. > > 1 Mar 04:32:59 ntpd[12772]: Need MAC 'ntpd' policy enabled to drop > root privileges 1 Mar 04:32:59 ntpd[12771]: daemon child exited with > code 255 > > In normal case, ntpd starts soliciting pool servers, but the erroneous > case, stops there (does not start soiciting pool servers). > > > > This looks like it's related to, > > > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284863, which is upstream > > https://bugs.ntp.org/show_bug.cgi?id=3967. It's a regression in 4.2.8p18. > > Thanks! > But it's not my case. All interfaces has different IP addresses. > (Some are hidden with "*".) > > % ifconfig > em0: flags=1008843 > metric 0 mtu 1454 > options=4e504bb > ether 98:*:*:*:*:* inet 192.168.*.45 netmask 0xffffff00 broadcast > 192.168.*.255 media: Ethernet autoselect (1000baseT ) > status: active > nd6 options=29 > lo0: flags=1008049 metric 0 mtu > 16384 options=680003 > inet 127.0.0.1 netmask 0xff000000 > inet6 ::1 prefixlen 128 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 > groups: lo > nd6 options=21 > wlan0: flags=8c43 > metric 10 mtu 1500 options=0 > ether 24:*:*:*:*:* > inet 192.168.*.108 netmask 0xffffff00 broadcast 192.168.*.255 > groups: wlan > ssid "" channel 36 (5180 MHz 11a) > regdomain JAPAN country JP authmode WPA1+WPA2/802.11i privacy ON > deftxkey UNDEF txpower 23 bmiss 7 mcastrate 6 mgmtrate 6 > scanvalid 60 wme roaming MANUAL > parent interface: iwlwifi0 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11a > status: no carrier > nd6 options=29 > > The problem seems to be "how to enable MAC 'ntpd' policy?". > > Reading Chapter 18 of the Handbook (especially 18.5) and looking > into /boot/kernel, mac_ntpd.ko seems to be the culprit, but as I still > have confusions with MAC feature, I'm not 100% sure loading it is safe > or not, thus, still cannot try loading it. > > *I've read somewhere (lost track with there) stating that "once MAC > feature is enabled in a filesystem, it cannot disabled anymore and > possibly causes fatal problems on interpoerabilities". > This does not match handbook at least with 18.5, though. > > My /etc/rc.conf is carried over from 2.1.6.1 (IIRC) with modifications > on needs. So don't have MAC (not MAC address but Mandatory Access > Control feature, I guess) related configurations in it. > > IMHO, this kinds of mandated (and considered to be safe) configurations > should be in /etc/defaults/rc.conf (including auto-loading mandatory > in-tree kmods) by default and overrided in /etc/rc.conf[.local] whenever > actually needed. Tried and turned out that mac_ntpd.ko, which is not auto-loaded, was the culprit. Loading it manually resolved the issue. Looking closer (not limited with the diff) into /etc/rc.d/ntpd, it has function can_run_nonroot() and it has code to auto-load mac_ntpd.ko, but it doesn't work because checks for options that accesses files runs before the auto-load code, thus, returns earlier if any of -f, -k, -p, -i, -l and -s options are specified. I think this order is basically reverseable, as /var/db/ntp/ is defaulted with ownership ntpd:ntpd and ntpd.drift has defaulted to ntpd:ntpd. And pid file and log file are (IIUC) opened before the priviledge is dropped and kept open. Not sure about keyfile, jaildir and statsdir, as I haven't specified them. > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e^(i*pi)+1=0 > > Regards. > > -- > Tomoaki AOKI -- Tomoaki AOKI From nobody Sun Mar 2 05:22:49 2025 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 4Z59Lx2CPlz5hsVR; Sun, 02 Mar 2025 05:22:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z59Lx1bwFz49lm; Sun, 02 Mar 2025 05:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740892969; 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=rzzTRQZAyV9foGr+87IuchY5HdS93FidPyDe+u99Yao=; b=yxUW9MhYlVBdWnIRzUVCxqMLVkjgwNj+ddTx5p/h9qZHeuNHXkuFblCyf1Rcx2KwFH/9IU sm/UTrzdYJXtAFX8KpYHIwPzrn5vZ4ZN+swQIJ0q/Fp3dZxKwYwDFt5ZzdR6FFGntJRAn+ /dKy/FHm7bZxVUMLhqvX04s22C/HRPLWh3funp+Zc4SLOyj0TLC5WBy3gaJiMQR2HnQKXZ pArmoD9pXeAwThlw6pBgZ8KwvPOB7udvAerGZWyq0lDCKWxeXKFQ/4TOz6LzCGe2XfYRri 2+129EiQs0ZytluTNO9SP9rdL3YEtI82Uwp04J4v/5zqTzE86Mf42zeD9R81bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740892969; a=rsa-sha256; cv=none; b=Dnc/nLOVDS3zWh77iunWIEPtTJ1gWjFq7hGZxH1LzOIWfyU60R6/HTXfVMD5ELU+ha78ZK vk6W0dPWgSUBE98Vs3ERE5dQfPolHkouVBfLp8Q+LmkGUclUmN5nfCZdHLoscqsgOvluza 2haQqgnQZSrvXO747YnuHBycrxrNGRnb+cCLDwwR5Y35S+yj+IMxvBTEYJFKwkOXtG/VcG xWVr9dTIBLt0IxtS0ozDiftPWucU5xjDqZ1pg8XlufpJ9Ussvz+4HhD0N4ry/SsbyfuQ0H 0csAOYqIUDmoFVsr9RVLBgHPnHJCUOLlqI9tAZ+lyjIxfbcGxFYGQBtGMmwQEQ== 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=1740892969; 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=rzzTRQZAyV9foGr+87IuchY5HdS93FidPyDe+u99Yao=; b=TJqXeJJtCECG1oZJAGlDk2/7VWTNhLI1WfnHEtWIOiy5OQzV/r4arVSQqS9y4NhgCvKLJx EhdYPsYGZDo04dBuSqpRyZbCnQu7tqXtaKFxKTBGA8u2aP0+pXfN1LaOAAIAaZsITeI5c9 IccfXwWmfVOM7ptoGTRD+TB5XbDxmFh4Us8NsCmjXi28Ee5SgdaBaQCsdsZTxzaAYgwfYO A0tbdvjFJCqgX4LvW7wWNqozmt3WkC0DP89pFb5OUuUKO4vcsvvNu55gQH98IwAk+ZDhUe 1InEl7wNj9tLDVdz+4vjYZUuTHJ1mJrbcdwNVYnrdVzypSnuOlkXn8dRClRWpQ== 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 4Z59Lx140Czp83; Sun, 02 Mar 2025 05:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5225MnqV008223; Sun, 2 Mar 2025 05:22:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5225MnbP008221; Sun, 2 Mar 2025 05:22:49 GMT (envelope-from git) Date: Sun, 2 Mar 2025 05:22:49 GMT Message-Id: <202503020522.5225MnbP008221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 7c5d816006cd - stable/14 - man4: Fix duplicate if_rtw89.4 MLINK 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7c5d816006cd0370149028f0a1fbedeaf634848a Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=7c5d816006cd0370149028f0a1fbedeaf634848a commit 7c5d816006cd0370149028f0a1fbedeaf634848a Author: Ed Maste AuthorDate: 2025-02-28 13:31:02 +0000 Commit: Alexander Ziaee CommitDate: 2025-03-02 05:21:41 +0000 man4: Fix duplicate if_rtw89.4 MLINK Fixes: 4262dbc57982 ("wifi manuals: Mlink + document description consistency") Sponsored by: The FreeBSD Foundation (cherry picked from commit ae2b84d9ab9cb01abb035ad6e938382d1f7c1e3e) --- share/man/man4/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5b8b0fa54630..41fd7d36a74d 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -742,7 +742,7 @@ MLINKS+=ptnet.4 if_ptnet.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 -MLINKS+=rtw88.4 if_rtw89.4 +MLINKS+=rtw88.4 if_rtw88.4 MLINKS+=rtw89.4 if_rtw89.4 MLINKS+=rtwn.4 if_rtwn.4 MLINKS+=rue.4 if_rue.4 From nobody Sun Mar 2 20:57:10 2025 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 4Z5Z532mHcz5qGNv; Sun, 02 Mar 2025 20:57:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5Z523w4Sz3C4h; Sun, 02 Mar 2025 20:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740949030; 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=DCz0Y/L/LU1Wloh3jMb/p0aviXXmYklxagqqD3Q2sbY=; b=KYJhPxplkSBH4+JpRP1H9b94ob0m/IMg3otneiJftxsACq7cJzVXJr4k+rtLmzB90OuEgX Rb5dRuQ6R5Lnk2q5R7N888FJ26/Zhidx4CVVgtFviWH4Hu6/B4wrWAIYjVGpFtsOC/RMS9 3R5qGI0fQEOLR82oBZlcomJ2G0dt5DO1wzy4+JcSqVkozqUwa7WPFam5iFjlK8l1ILVZFJ VaxI2ejd36FIXhEAb7VObKVUPCOMbZIxjHYiC9Ve7SD8nKxbTtexxQPMPNgCIOAZHUBX8W HNhPn08Ni8rFbaJUQtOnljQMAxlUymrwqky8xvbk31pVlWS4XfWp7X5jUyqnkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740949030; a=rsa-sha256; cv=none; b=wcg3c0k1xD6ZsGPDNltX3hi6aT+3vWR+zAz9K8aMf7I/3vyEPPNAaOpJEcZtjn9HpSYKKL 58ya2bRFTNhlG9t83NeZSjs6UrCiau2OI+CX2mRD9QkBNYVR/+mn3QqxfRipBYnTgYCkLP sTutawlINAs+D40ks2F/QiY8XrlXgC6dEvZhdkYPziv4rU2+wic2du3pQJ8tMMuPhp3jhe x6o6mtk/0j7Acjykyhl0P/Cdrz1JbaifsF18QfHRJAO9xHxST2Twv09ku+CxsRfSXilAY0 LjABLyOJ7R1phPBT8O/YCkxmhNCaYq2HlRK3CzZXvV5T2PAHn4ehd0EUFi58+A== 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=1740949030; 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=DCz0Y/L/LU1Wloh3jMb/p0aviXXmYklxagqqD3Q2sbY=; b=KunHz+npuuO1W+YSik1PjgIfiFohDPzzwkWCTcw8Sbt0dd7C2owOvwRQBfkygRadAiIqLE Bu3Iz9Pp5Fq08OZDF3P0KLs31KgYg3Csi0BudsjRdklTOzVlVRNLGKSvnBeJbw/cg92xb9 qhgosNweS/6qyKhlzzGNcIgO4L2cWt7KsFE+xzTqSES/QMbP9ohCsdUaBYOXWipfjGQ+q0 HAP09muveinXxd177DEc+RHb6GWB3oS4r2F3UKDIuf1uY4nZ4aKHN7Pm2rfJvdELGyH0Uv 61TVqiJIgPqE31S5sQmIaEhgIfDt5HemCtWklr4RaWd2/q4WNAeEK+4UnEl0/g== 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 4Z5Z522vMJz2nf; Sun, 02 Mar 2025 20:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 522KvATN043055; Sun, 2 Mar 2025 20:57:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 522KvAKt043052; Sun, 2 Mar 2025 20:57:10 GMT (envelope-from git) Date: Sun, 2 Mar 2025 20:57:10 GMT Message-Id: <202503022057.522KvAKt043052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 85b69389ce56 - stable/14 - net: if_media for 1000Base-BX BiDi 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 85b69389ce56f091281aa2543dea31950f68a054 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=85b69389ce56f091281aa2543dea31950f68a054 commit 85b69389ce56f091281aa2543dea31950f68a054 Author: Tore Amundsen AuthorDate: 2024-11-13 05:08:06 +0000 Commit: Kevin Bowling CommitDate: 2025-03-02 20:56:38 +0000 net: if_media for 1000Base-BX BiDi 1000Base-BX uses two wavelengths, commonly 1310nm, 1490nm, 1550nm, or 1590nm, in a Coarse Wavelength Division Multiplexing (CWDM) arrangement so that a single fiber strand may carry both upstream and downstream. It is sometimes referred to as BiDi for bi-directional usage of one fiber. Optics must be paired such that the RX and TX wavelengths cross over, with one side often called U(pstream) and the other D(ownstream). This technology is useful for increasing link density or working around construction issues, and is also frequently used as a last mile delivery technology for FTTx. Sponsored by: BBOX.io (review/commits) Pull Request: https://github.com/freebsd/freebsd-src/pull/1518 (cherry picked from commit 78c63ed260fa20b3500aedfe41dc0dcae9593f51) --- sys/net/ieee8023ad_lacp.c | 1 + sys/net/if_media.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index f6a1be8004e0..ba397e9e5d3b 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -1147,6 +1147,7 @@ lacp_compose_key(struct lacp_port *lp) case IFM_1000_KX: case IFM_1000_SGMII: case IFM_1000_CX_SGMII: + case IFM_1000_BX: key = IFM_1000_SX; break; case IFM_10G_LR: diff --git a/sys/net/if_media.h b/sys/net/if_media.h index 534ad36da517..a2cac00550ef 100644 --- a/sys/net/if_media.h +++ b/sys/net/if_media.h @@ -445,6 +445,7 @@ struct ifmedia_description { { IFM_1000_SX, "1000baseSX" }, \ { IFM_1000_LX, "1000baseLX" }, \ { IFM_1000_CX, "1000baseCX" }, \ + { IFM_1000_BX, "1000baseBX" }, \ { IFM_1000_T, "1000baseT" }, \ { IFM_HPNA_1, "homePNA" }, \ { IFM_10G_LR, "10Gbase-LR" }, \ @@ -793,6 +794,7 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER | IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_CX, IF_Mbps(1000) }, \ + { IFM_ETHER | IFM_1000_BX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_T, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_HPNA_1, IF_Mbps(1) }, \ { IFM_ETHER | IFM_10G_LR, IF_Gbps(10ULL) }, \ From nobody Sun Mar 2 20:58:15 2025 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 4Z5Z6J2d8nz5qGSm; Sun, 02 Mar 2025 20:58:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z5Z6H6v35z3CwT; Sun, 02 Mar 2025 20:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740949096; 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=+v6rko3T6A8deV3oBlBfZO6XuamUdJBsX+9Ra/CVOyM=; b=PxwWjR850kvhh5tZbvtmt5zTyL/tNwCBwEreNiWgkjRWHkafeMGBQ1sQihFwEFIH7TpLxi dZk/ZTiiKxo+6ycIfF6bObN4UbpKYR1M9QnBzxR/JyonJdEqgYlfNx6hbKuvPehduaLjBo 81tGGfD4Q4SZZV8dgmdJ1WXw71WTJdqxs0GYtRWKRbSG0CX5ZIDoL0rjxFb19fSZEJQGE1 S/XuVrhxoXhha43y/Z/7/vHpGf4zKDFFmSI7GV1fgiVvj/7YtOwCU2QkFEYU3W0aLsMqR8 CbDw4C40UIk1cSo1Fnx5Vwk8r5LFyvXJFyggZCwfp/8qo4aZEgcIetShV9jR9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740949096; a=rsa-sha256; cv=none; b=ebJsDaP20Vhep2COiBSTVSqIpzjakoO1mLgcAGHNG41w3n9WPMpnY5n2kg/gghnOORgzJ5 4MNy9VzNoEYm3ap7xwU2JjBeJEm7hq2/H/4WccuV27D0MJirBePgkhygXVoGYWxr8HUi5n F6gUFLaeYtEJpY/7nIvh6MTdtYoQCiCW3y/oE1OcG1HqW/Zok3n+5x+boCND6vDIpzSSjS S2y1cfrkltkU31lF5Ek1i6KgGwusePd/+x+fo5bNBAjpnMsX8ENCgZATkU134BCQ0chEpY 2gCQ+Ysj16RpxL/tLooSKQDTAfB963zygfYFvZsPTr72ZeEMU7AvlwTYQHSjag== 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=1740949096; 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=+v6rko3T6A8deV3oBlBfZO6XuamUdJBsX+9Ra/CVOyM=; b=HzjaOu4ZrpCe/dkWl2PXLGAvUDr5Ud/nGPIfijihNZPtEn2M+PQC1o1dc+Iiykz2hgONVb Fs5a8VfWqr+mjPyxNJqojBfbSQsFy66l8FDugKA6U4azPLOxdXpwhnXhozkohD7wBJmJkb 23y8rtTAu590VoiDMqGyNDqyo3qsv0ooenSP/TNDO+s6j5xUP0bcfhrgduAcFs52UbMWLt a8ijinwN9VbNlaHq35Lrrc9ffXH1O0FoivKkF+H+phL5PcBALnwNhzrkmwmqoVb3XS6R5S 2l3OByiMZlDMrTGM3C5OziujdYRwrRmvaF/sWFj1Bhhcwu+JdhR4YCXVapJEag== 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 4Z5Z6H6PzLz2ZY; Sun, 02 Mar 2025 20:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 522KwFSO043467; Sun, 2 Mar 2025 20:58:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 522KwFBW043464; Sun, 2 Mar 2025 20:58:15 GMT (envelope-from git) Date: Sun, 2 Mar 2025 20:58:15 GMT Message-Id: <202503022058.522KwFBW043464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e94246e0a2f3 - stable/13 - net: if_media for 1000Base-BX BiDi 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e94246e0a2f36f955f481eb9b6f1faf9bd0d5cfd Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e94246e0a2f36f955f481eb9b6f1faf9bd0d5cfd commit e94246e0a2f36f955f481eb9b6f1faf9bd0d5cfd Author: Tore Amundsen AuthorDate: 2024-11-13 05:08:06 +0000 Commit: Kevin Bowling CommitDate: 2025-03-02 20:57:59 +0000 net: if_media for 1000Base-BX BiDi 1000Base-BX uses two wavelengths, commonly 1310nm, 1490nm, 1550nm, or 1590nm, in a Coarse Wavelength Division Multiplexing (CWDM) arrangement so that a single fiber strand may carry both upstream and downstream. It is sometimes referred to as BiDi for bi-directional usage of one fiber. Optics must be paired such that the RX and TX wavelengths cross over, with one side often called U(pstream) and the other D(ownstream). This technology is useful for increasing link density or working around construction issues, and is also frequently used as a last mile delivery technology for FTTx. Sponsored by: BBOX.io (review/commits) Pull Request: https://github.com/freebsd/freebsd-src/pull/1518 (cherry picked from commit 78c63ed260fa20b3500aedfe41dc0dcae9593f51) --- sys/net/ieee8023ad_lacp.c | 1 + sys/net/if_media.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index 746f8dc08746..3cac86a8f14b 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -1149,6 +1149,7 @@ lacp_compose_key(struct lacp_port *lp) case IFM_1000_KX: case IFM_1000_SGMII: case IFM_1000_CX_SGMII: + case IFM_1000_BX: key = IFM_1000_SX; break; case IFM_10G_LR: diff --git a/sys/net/if_media.h b/sys/net/if_media.h index 534ad36da517..a2cac00550ef 100644 --- a/sys/net/if_media.h +++ b/sys/net/if_media.h @@ -445,6 +445,7 @@ struct ifmedia_description { { IFM_1000_SX, "1000baseSX" }, \ { IFM_1000_LX, "1000baseLX" }, \ { IFM_1000_CX, "1000baseCX" }, \ + { IFM_1000_BX, "1000baseBX" }, \ { IFM_1000_T, "1000baseT" }, \ { IFM_HPNA_1, "homePNA" }, \ { IFM_10G_LR, "10Gbase-LR" }, \ @@ -793,6 +794,7 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER | IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_CX, IF_Mbps(1000) }, \ + { IFM_ETHER | IFM_1000_BX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_T, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_HPNA_1, IF_Mbps(1) }, \ { IFM_ETHER | IFM_10G_LR, IF_Gbps(10ULL) }, \