From patchwork Fri Jan 5 13:00:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wiehler X-Patchwork-Id: 185391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6202886dyb; Fri, 5 Jan 2024 05:02:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkzQz51UJkOCHAQixC8n9f//A75RnWI3yEL8jsOHDgpcuoZpKVCNFz97xKKyBNi1of87I8 X-Received: by 2002:a05:6358:52ce:b0:175:5850:782 with SMTP id z14-20020a05635852ce00b0017558500782mr2263638rwz.35.1704459735762; Fri, 05 Jan 2024 05:02:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704459735; cv=pass; d=google.com; s=arc-20160816; b=oysvHOHsy1Ld59z1xs01xczhyYgYsNzmi49bJQxSuM45KaF1/AEXZqPsGV6M1rBLu0 z2h2eNRhAyrcq2tQ6iv/r9Am5rBRGcxqB5kLWsCkEFo+A0Itb4zWY/pXIj7f9PwP+tXd 1awya8QgfUK2DS+YkvpAUmA/cPg3JGmfKlVTzBa554L4fNu2zxJr+brEtx6lsz5QR0SW BRVCvtJtM10Nk26PrMi2J6NYjHZ0QMUTUtEtf3/VZpoSuc+UoHr+penl9SDhFPK6AKwT mfLmIKP7EhhHBiwK1fq2u/hXJcl1pHga4mxFIMmpuliaU9LAFy8kVEsTTO2gkCr4sCXU uyIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature; bh=LTYjn6ZRFWRT2GcMarkHWIalYyRKHt9eVBV0oXaBeF8=; fh=zQ9VUUYYQ5rgsng17GIgCxXnIxwFBUp5AvGIBh/lfGQ=; b=N6rdew6dH1ZenzI/68/s4jta/biBxYlWU4s5UIdZQAu3N549+w9N1IJSbIoKbLY1ZL NDZeY5bmPe+4dbH8U0emYaUwQbEGQNcvB4Ywzvq+ynUV/z5Ly9opz1IG1OLJLYU26Q/z 0N/AtOWyUH2/aukZHeGthBmRt0KPBTNXC8tw1YlX4dObjXDWQDhx2OUaLkBM8XKRIS5L gxYaLXIbk6W5w6JuRFCuRKajtVYc/EXy33tvrL4YERsOs3KoJb/8Oqj58D2Ac6Tkuzd9 o4Lii9ENQBdAqDlHH1MwqCYqfHVgZBrXJrc/CvsMUDCBenSCbzEjZW/fNey45LRJu8/g yYaw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nokia.com header.s=selector2 header.b=ZaiWlGJe; arc=pass (i=1 spf=pass spfdomain=nokia.com dkim=pass dkdomain=nokia.com dmarc=pass fromdomain=nokia.com); spf=pass (google.com: domain of linux-kernel+bounces-17849-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17849-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nokia.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d134-20020a63368c000000b005cee028d0b7si804670pga.358.2024.01.05.05.02.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 05:02:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17849-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@nokia.com header.s=selector2 header.b=ZaiWlGJe; arc=pass (i=1 spf=pass spfdomain=nokia.com dkim=pass dkdomain=nokia.com dmarc=pass fromdomain=nokia.com); spf=pass (google.com: domain of linux-kernel+bounces-17849-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17849-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nokia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EE64FB240B3 for ; Fri, 5 Jan 2024 13:01:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 044A22D626; Fri, 5 Jan 2024 13:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nokia.com header.i=@nokia.com header.b="ZaiWlGJe" X-Original-To: linux-kernel@vger.kernel.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2104.outbound.protection.outlook.com [40.107.247.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1CB52D614 for ; Fri, 5 Jan 2024 13:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nokia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=arbbog46fQaMO8DgDcWx+iN/jw31f0omWnOzmETwDmOi0Ttl4UT7xHZtt/fIB+qjcGLvNnx0353q4DIVYH/t2K6KMVpMEFpiIbQw5eRcTxd6O0pN+93rMFPcWvemaJ6B4ICisrcR3XZuNPTusfZeHMgiEg4JOSHFMNF+btEc/ukJLto/2li3uwsb3RrSDJFwF/h0f8dWfBzU7LINlRrlvNIQkgYueerV2wL2+i/qEtpk3r2SSW2YNQkDegHvC8bRA1PFV9d8fjlyrU7+QzWHQdSZdBSNGF9otuuC7ydd33eoiz6P2TzijpWiRG5QKbOen7gdzGjjHAD/wS0VaP0vAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LTYjn6ZRFWRT2GcMarkHWIalYyRKHt9eVBV0oXaBeF8=; b=X+wAXM/Eai6Cr4kbhla78oE04wve5xup2LPwtPLnQ3fI6j6cpKdO9JD9h08dRk/zTxZxx3Q4MLsf9pfuEIf9P08hEo4LlMt4l8HH9CZ8HStXM/z+u7O5lFeiX7vj8szZyPD2rtD1+mY4zSfL0XcLJUDLFJg9tEi5oKbZ3NpuvsThYcDS0kf4Tw4UQGJD9/6lEvaR1q3+HUkrXhp3OFJC6KRXVGILhQf1zu/LGVLGtiM0wchMn8E9coFz7M56BkfWvXEoc1rc+J5Bas58NcyEmogJpW0WYK1q7EAIaFaV7e4IEfFmbq1deBMUV3C0VQ5ba9EQn1Lg1v89atFIdQwYOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LTYjn6ZRFWRT2GcMarkHWIalYyRKHt9eVBV0oXaBeF8=; b=ZaiWlGJeWrJa8Z1NYjbxCWWp6Z4JoMx4OCo0Wi4bh/FNxPLvonTSZNAvfDBGf+oXERtB3trTPt5adaKBj4ZPbmxzoZCP3C2qFk1U4dW5zMdfS6ZWyFl+H9+/vW/+1yosPTcVKz0/Um8A2k9GWUejmAzsO3BNczKG7O5HVgVPZqAkEAGI2nr71u+le9X77sZNwmijy9teb+KJ7nngFXg0YD+AaQRMGxMM0DKLyRH8XW8tqGssvM9gTm9rD5zKWgBDxrYLgryahOBRaEu1STrsVt4Tc40EZTFpTL3qv7SSuSKXdZsM1G6EkJuT8axYYF4GE9koy5yUpdrluHostXVHTQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com; Received: from AM7PR07MB6705.eurprd07.prod.outlook.com (2603:10a6:20b:1a2::10) by DBAPR07MB6552.eurprd07.prod.outlook.com (2603:10a6:10:18d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16; Fri, 5 Jan 2024 13:01:37 +0000 Received: from AM7PR07MB6705.eurprd07.prod.outlook.com ([fe80::67ef:e773:9ef2:a653]) by AM7PR07MB6705.eurprd07.prod.outlook.com ([fe80::67ef:e773:9ef2:a653%5]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 13:01:37 +0000 From: Stefan Wiehler To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wiehler Subject: [PATCH RESEND] arm: topology: Fix missing clock-frequency property warning Date: Fri, 5 Jan 2024 14:00:50 +0100 Message-ID: <20240105130114.3499559-1-stefan.wiehler@nokia.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: FR2P281CA0070.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9a::9) To AM7PR07MB6705.eurprd07.prod.outlook.com (2603:10a6:20b:1a2::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR07MB6705:EE_|DBAPR07MB6552:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ef32067-f961-4c10-6d4a-08dc0dee73c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S3uCrqqqTETTD4++f9XB2Q3rh/Ak/TMnDeYcnU9x43Jz3+tP9qow3plmDSmPrmOWjSoaDBXA2Fwg0cHzgO7Fk3BpUUD4rA4f9bNqMfTnbcmRYzcGelaJBi8bRH84ojeSGFnYFRG++kWntCwQpiHbh6UqE7mxbB3Lja2RreY5nJB5J1CN0PiVhHfkijj9Q+VlBvc81prO0DwrE1VUVdhZnba9y0rBhjHY/eYdPkFaKUldnE5wchzG63dycXdN/DQWT6GDvxSaF80gsANWidyHHqm/nuDpcEa7wZc55QAoqgO1aWu4qs/289LoCa+cXLuUsrYX7DcHERGjI8+SwlDaUTq0/z7iWDpSm4RmLUnFmWd+DpAr2pJxJ1cOHjs7AJs20ev0UvyCDlOMBIiSN5TC5Q4xPErznmaGFb7RILPJ7qHNX/cd4vOOUqD/6laUzCyWYAcCYeFrZk3Rif0Cq5a3DQP1EjhMP05gCeU6ajsCouisu0PUFr5wIybO7VLiBz18aXvdQdpkjvjheqcdQqIBKJyyH5FqeHjj29cpKgXVQaWmO7/NDpJw0mP8OE2yG+2c3rSL3SxjnSTrZsslASJfDiXn/WY73Bee90XMuNAzQbZxr7dqPv1fNU3/w2ORI6tKO6TSzxWKTKu69c/9OlDsOJeoEq7lCL3eymI9w/uS4KBEZOBWqHTteJ1SIyeeUE3GuEfJzK8een6LVeVNdkl/Dg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR07MB6705.eurprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(39860400002)(346002)(366004)(230273577357003)(230922051799003)(230173577357003)(1800799012)(64100799003)(451199024)(186009)(8936002)(8676002)(44832011)(4326008)(82960400001)(316002)(66946007)(66476007)(66556008)(6916009)(2906002)(36756003)(41300700001)(38350700005)(5660300002)(86362001)(2616005)(83380400001)(1076003)(26005)(6666004)(107886003)(478600001)(38100700002)(6486002)(6512007)(52116002)(6506007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0ypJ2AyHbLm8lruwpXg1sxkP29jPycmDmcfqb4qc01qRPHDvSgBRciltKLils9Hsxq9hoKpJIcCvVHDu4PfaBDqpuXttaxh7HJE4/B5g5yLJBwNY3yAMH7l7VMLPxCGtckHPZ+0OYz0PqV8ZouaePaYllJPXaiqY601WXQu1v06nGza0GnZ4+1PWy3VbgBp5XnUOUzn38ZnowvUnznvp+OvMj2xKKnoF/90IvyOdh2NwRskHILyfFyMZx/QbrOXkrNDM7B0gIR8JcMaXutKmHjDQ3Sed6nUqBPBBaqxBbyExP1J6pskt+yBAi8GC4q2ALSl9YAF4JcxyBk1JPX+4fu345ta+uQtcxa51nZrb2m1w/ZK00aGdpGRzmVQMnuItW/NlfLTqIaWtDknSU5xo8KBGCkeyCthg/AU3QarhBuQttJKYYzNxLG2UrPD3AwX64gsi3qvNSWpnqjvfMuUXdEkqufP4zAPk43azfmr1Wrh69nNsPwIAfHwmO+bzDPGlg80mofj+O9BG2vMBBVCXfValYiAr+U5/xWW4RXKr53orU5CWQqe2FmqWd9PerwOs1VQ6EoVvs/pC/hK3WClAwW2B5tWlzV21N9WQu7/iyXV8nEheSL68UZDx2NP0NXVo1oXIvtLjOo+5j8rRClyDmRH+FFwr6vGckAnzsKmXGlmGEvJLXfbqSguGEUbv8JuejbALGZpBncQQ5kc5YjLXx/VWnXiPxzKxuHu8vuLxIJGLnGX/CM+BG0DfuZKvfRKdu+A/5UT/Gled/O985oTh3PcU9RmhRnZ1kPz7jxvJTkFHlsjjWV/7xbPtnYI9tHxYuB4LUThsMS9hG01LgFtzHgxGtj5YHQN8YWbAjiUxVgrs5ZC3ELEeDUBIui/tSAMbBdi4TUL59xaBJjueTxS2T3/l+2uVKYEC8iSvfyWnIQDl7NvjzsgN+UYMtLFf9D8mV9SMw1BwjNhPT62dXQ2WE5thK9BG+x3vXvmC1Hnj11iK2bAm7J0YOf8dVaivPDQXFz5E+EsEVhJ9GAA4WgzTAHpuyaupqWb3P/NuDvyuTsfGLcdUbK86eIwlhlulLi6EVND7942sU7XEoApPijM0SQmBvk595d1eXgI+5aaEClq+gjyLBQXnBIbpVxmBaWhGDePuvRaUauU1moee5/iSCw87NYy3FE8RhYflUaynl95oR7YyM9tx2naG0ApRrc+81sJgT6N25i8PLxmBJol9ovLRHzQku0o9kXb3rXCQ74HBvqrK0aWfE0CMLUTROoU+ANx5ckqYeJQcgLfR6t5Y/dl3Hlo88BsirzYjgcLMBWdyhsC0G1TW2f6n/SSmjauJcXNrjxOWmMsveJDBoLu+bngzxdhc6h75qW97VQPN5P6CeDcrsqSVEPBpJidQ2V6IYU8YUBY1+a7xRWH9NjDjFIJZRkqEPN2GIm5pvhyHbHwcp8ZsJHoa7UoBlp1r6KMHh7cPJUQsicUNsU1y57B3REpYeR4zJ2tp3Rj7gCFjL4Qi9rYK09i8XTyxZfnD00rtNF9U39603HCRofv6NgarvbJADHtSx7etbaY1pPjPdGqS+vTvc/N9PwqFptAFf1i4pT+li9kqp042gtowspiW/w== X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ef32067-f961-4c10-6d4a-08dc0dee73c9 X-MS-Exchange-CrossTenant-AuthSource: AM7PR07MB6705.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 13:01:37.6852 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eVcm1vLkXj6JKu96VRvLulOfDmSuXAXttu0cfBpzkei6CPvU6Wiez2fDO6tLUHG99e21CaoOsF0NZRoTJqvSFdu0i9fuZawp10tYww4xuX0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR07MB6552 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787255571887999402 X-GMAIL-MSGID: 1787255571887999402 If the clock-frequency property is not set in the cpu node but in the parent /cpus node, the following warning is emitted: /cpus/cpu@X missing clock-frequency property The devicetree specification in section 3.8 however specifies that "properties that have identical values across cpu nodes may be placed in the /cpus node instead. A client program must first examine a specific cpu node, but if an expected property is not found then it should look at the parent /cpus node." Signed-off-by: Stefan Wiehler --- arch/arm/kernel/topology.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index ef0058de432b..32fc1c8d9d11 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -85,15 +85,24 @@ static bool cap_from_dt = true; static void __init parse_dt_topology(void) { const struct cpu_efficiency *cpu_eff; - struct device_node *cn = NULL; + struct device_node *pcn = NULL, *cn = NULL; unsigned long min_capacity = ULONG_MAX; unsigned long max_capacity = 0; unsigned long capacity = 0; int cpu = 0; + const __be32 *common_rate; + int common_rate_len; __cpu_capacity = kcalloc(nr_cpu_ids, sizeof(*__cpu_capacity), GFP_NOWAIT); + pcn = of_find_node_by_path("/cpus"); + if (!pcn) { + pr_err("missing CPU root device node\n"); + return; + } + common_rate = of_get_property(pcn, "clock-frequency", &common_rate_len); + for_each_possible_cpu(cpu) { const __be32 *rate; int len; @@ -121,8 +130,12 @@ static void __init parse_dt_topology(void) rate = of_get_property(cn, "clock-frequency", &len); if (!rate || len != 4) { - pr_err("%pOF missing clock-frequency property\n", cn); - continue; + if (common_rate && common_rate_len == 4) { + rate = common_rate; + } else { + pr_err("%pOF missing clock-frequency property\n", cn); + continue; + } } capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency; @@ -154,6 +167,8 @@ static void __init parse_dt_topology(void) if (cap_from_dt) topology_normalize_cpu_scale(); + + of_node_put(pcn); } /*