From nobody Thu Feb 13 14:44:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ytyd404zzz5nZ0r; Thu, 13 Feb 2025 14:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ytyd35xDwz3Lfs; Thu, 13 Feb 2025 14:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739457879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4MNRCHjxkOeA89213/dR1Fq9VQnED2pUiZ+P2BHcqKA=; b=OWpqrkbCUETGQkTeoFZLy+p8Bv++UoBZqR2vMgokY6bB17h7t3YkijdM+e0XBtobC0ZbuS vIPBg6pv1uKrPSNS+80I7DVW9rfComwsSp6T7yaaDEF5lmQrmqUjxw9fZiLogc+gl23gNl rrvbAKsylFyPGaYylgdtzZYg6C//5ApqisYOR02kJRQUdbmhK3/wR7sapRKc4au2AJCimK +AWn4OCTvOT6jiDlgiX4oBrxBhW2P9EoDutt6iOvUxCdXt8+6hv4j4tPeJuelEbZkPJA1A LJ67aiIoWofFEkZnpp6OgXyUvZ/BVp/Wpj1Zcm2Vo/5URvYS1yws6g5K1bDXVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739457879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4MNRCHjxkOeA89213/dR1Fq9VQnED2pUiZ+P2BHcqKA=; b=AaSjRIiBsBd6D+l2s73VHFstlxLzBdf/k0FUTrvhOFDsGKxznWSwiWQ8UJgrrqCj9uxvtz 6sjdxjP7Pz3yO9EbbkLoEq6fvEmQhtdxFSDNwZbjXvRIuIlamCzDvY6bp3ycLZWDkWg9t4 DMdT0HehWL4f5WI5Z/bpeDuDCFYHv6yceqvvDCMk53cHSgNzSeMpNYY0DbSpdOrgf8prX5 pzZ3o4C6/7J2QLHXNHARFxAZJsdkurXhM9qYZzQbVINPf/jrFXIIZyx3Rz3psgx8ef11WR 2JstV7FOvLhyDw8jhpvXhDMsvYqDRxVYxc9crxJ44dhf8NIl92SWLY6XwFOg1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739457879; a=rsa-sha256; cv=none; b=U3mlSp/rOFkIdfOalZbqTNTv4zQC+D89OmD77p2hD9VfZLxGyTO5BIyGPZy2+80DUBpDP/ 83aTsnhjM+a67X50YrUsQHY/tIS3h2klj5w4KpSb1DU52Wayxxf4rh22mg0dWAKvwAZOQ2 fTOsvzvGo4Jo/QUsyMP5rFK7+jJG0ID7R/ezvDODUzpR1r0Iv7bbi0f+JNKBF9zimT/gnI 0slcJtrcCapaKcgKXdnDghHsXO3oH8rlfqasvCzH3xLgeJi+7/z6dxg+TZwsjyBx0J5EsS zgiwbiHZnes1AZK5YMqIwSyJr2PUYZt6bfoJMMOgVpZ5FM28CFgLGrmrVv59TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4Ytyd35S0ZzqKl; Thu, 13 Feb 2025 14:44: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 51DEidrD016068; Thu, 13 Feb 2025 14:44:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51DEidvR016065; Thu, 13 Feb 2025 14:44:39 GMT (envelope-from git) Date: Thu, 13 Feb 2025 14:44:39 GMT Message-Id: <202502131444.51DEidvR016065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: b61fbbed73ea - main - powerpc: Remove flag CTLFLAG_TUN from sysctl knob hw.platform List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: b61fbbed73ea3bf0c84589b56cca160c46a3739d Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b61fbbed73ea3bf0c84589b56cca160c46a3739d commit b61fbbed73ea3bf0c84589b56cca160c46a3739d Author: Zhenlei Huang AuthorDate: 2025-02-13 14:42:45 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-13 14:42:45 +0000 powerpc: Remove flag CTLFLAG_TUN from sysctl knob hw.platform Prior to change [1] this flag is useless but harmless. After the change plat_name[] will be fetched from kernel environment after invoking the platform probe function `platform_probe_and_attach()`. The probe function runs at early boot stage prior to `mi_startup()` thus it is too late and pointless to set plat_name[] after the probe. Nathan mentioned that the logic to specify the platform pre-dates the powerpc64 work, and is from the original pre-FDT Book-E bringup from like 2008, so it's irrelevant these days. Instead of fixing setting the sysctl knob hw.platform, let's clean it up now. [1] 3da1cf1e88f8 Extend the meaning of the CTLFLAG_TUN flag to ... Discussed with: nwhitehorn Reviewed by: olce (previous version), jhibbits, #powerpc MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D48897 --- sys/powerpc/powerpc/platform.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/sys/powerpc/powerpc/platform.c b/sys/powerpc/powerpc/platform.c index fc840063e766..6453e47a58f9 100644 --- a/sys/powerpc/powerpc/platform.c +++ b/sys/powerpc/powerpc/platform.c @@ -65,9 +65,9 @@ static platform_t plat_obj; static struct kobj_ops plat_kernel_kops; static struct platform_kobj plat_kernel_obj; -static char plat_name[64] = ""; -SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN, - plat_name, 0, "Platform currently in use"); +static char plat_name[64]; +SYSCTL_CONST_STRING(_hw, OID_AUTO, platform, CTLFLAG_RD, plat_name, + "Platform currently in use"); static struct mem_affinity mem_info[VM_PHYSSEG_MAX + 1]; static int vm_locality_table[MAXMEMDOM * MAXMEMDOM]; @@ -364,16 +364,7 @@ platform_probe_and_attach(void) if (prio > 0) continue; - /* - * Check if this module was specifically requested through - * the loader tunable we provide. - */ - if (strcmp(platp->name,plat_name) == 0) { - plat_def_impl = platp; - break; - } - - /* Otherwise, see if it is better than our current best */ + /* See if it is better than our current best */ if (plat_def_impl == NULL || prio > best_prio) { best_prio = prio; plat_def_impl = platp;