From nobody Tue Feb 18 15:15: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 4Yy34k0ZZMz5nlZn; Tue, 18 Feb 2025 15:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yy34k01f0z3X5q; Tue, 18 Feb 2025 15:15:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739891750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p8x3n1ViuAvC3AC/eLsnjfOhdsKufi6meVcVzNSppWU=; b=HiCy2WDtYC6RCRt7+0o6CZ+ZAOtvij/1UURZTg5hmZEZhyAbBnR6MiTbW2yvU5Gbjw2jOx U24QgCauIQSAjYv/9Y0OVA0OG3pP2qkHGjZ56DEBxMy6cqg88Vr6esrXecEL7fkg70at/Y QOD3z8wVu37ImXa+npaYePbLMfMlIMZ2XCpXQUGDfnRx6LCafWxCZ7rsZ7TVk1T5S6/7SN VxJZno3lqiDUBbMkFlAcvYpp6QFM2YustIETdkRWclpDyks2eMc4lM2Ekk5UYw7VwcWvS8 zf3ANnp2J+UZX9irPbjbEMr1/EBNII7CEMqf/HucLUA0ig0f5+iKDmW1C/cg+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739891750; a=rsa-sha256; cv=none; b=tPV0xW1ryRETjEx1CTCYrQrY3JsT3dPcbxKPxJsexnZ05xNC5P6Gpk9i6DeEsihavn6wSp EabliBs8vbIv/fWgLCS6zUHSQ0wShlByn4QUvMxUrrswQMiS7gN95IMIVCyh4It8imAw7r HUjA/GikHWrUlx8zYUgRhtpuug51BCNKOVfo+ZbHSwpgGpN6S2VsHQmszo1ToEHnyN9OiW RDF0QuXFr/ZbehvRe53ckaXRjWyn2AFCx8OoEQy7iC4pYAlYyJKM10IdAZ3vO/dfoII5Wv tDW+/c5P3h9VUzADbz+2+p2iwBQtW4xzxYEeRHWyZNm35aZW2bwE/PlNjuXikg== 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=1739891750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p8x3n1ViuAvC3AC/eLsnjfOhdsKufi6meVcVzNSppWU=; b=mHGDZkFXOxgUwujDGDGUnqJBiG9QUhlDn2dp0ilnd6CqZAkfNyOQTT+NaidabY/mhXku+t a+fZGeMJorwt5VEqtlOTp6v0wc9xjmJh/YMOG0olRnWrmd6iX30Lwhil7Gev79fSqHqYf3 jF8W/cAViGoSNGzu92zfMPkn20c1mIxEACc/sqCgK0pEJk/W899chjRj+EgC7KhP8CzGXM Wi+gDx5sNGifHLVwZLptUMh7ylY0Vw99yzN2T7g5l1c9G0lZmke5zoRIClc354kyE/ZKtS 0vS3g6FCjGqyYqdwiLhS1RFvLhTotf1or7LUcMC8Ol3TZHHn/veV+4TTNm074Q== 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 4Yy34j6Wmkz8jH; Tue, 18 Feb 2025 15:15: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 51IFFnlm041563; Tue, 18 Feb 2025 15:15:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IFFnr1041559; Tue, 18 Feb 2025 15:15:49 GMT (envelope-from git) Date: Tue, 18 Feb 2025 15:15:49 GMT Message-Id: <202502181515.51IFFnr1041559@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: 7775f4c5c752 - stable/14 - powerpc: Remove flag CTLFLAG_TUN from sysctl knob hw.platform 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: 7775f4c5c75221cd9b2aadf12fb1d9a329c08be4 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7775f4c5c75221cd9b2aadf12fb1d9a329c08be4 commit 7775f4c5c75221cd9b2aadf12fb1d9a329c08be4 Author: Zhenlei Huang AuthorDate: 2025-02-13 14:42:45 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-18 15:14:49 +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 (cherry picked from commit b61fbbed73ea3bf0c84589b56cca160c46a3739d) --- 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;