From patchwork Mon Nov 6 08:06:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wiehler X-Patchwork-Id: 161859 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2505785vqu; Mon, 6 Nov 2023 00:08:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IElpFcHYoEKMfb1eLveZyGiolzrvu3miv5KDLDE031w+gwR2HcCFz5GPIUyTsd2ih24nFkJ X-Received: by 2002:a17:90a:d796:b0:280:cd5f:bf8e with SMTP id z22-20020a17090ad79600b00280cd5fbf8emr12491725pju.18.1699258111073; Mon, 06 Nov 2023 00:08:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699258111; cv=pass; d=google.com; s=arc-20160816; b=bUXfxX0vs/IAARo+/B+7/iERZS1nX74Zk9HuWriVSs2ny3jW7W8oCJogbse1Ftenvi Kcn4mpvK1D2swgGTn8n6m788id8M6dmbRUCeWzmiIZOIHXezmoDgzsns7pwgoDYWpG7N sFYLhawuqmUZHNhNnDIlRh3fL+6HyiLPVtlICL47nj9FE7I2INSYZqn+qP+Eb6GuF/sk mJUJoG8UpKpVHT1iNFXFUZ+aDEoQYrl7UiuPW8C1JRByZsmzK0vsALZGIebZPaY+JUKY lYS5oV0nsGoRgUuogmf0+V3ClbiEp8eQHPvWcrMmbDGl5zn8POwvztLgSCGgE5sVWd+q EFSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=lnN4oJmgV8AQzjnmkTCKGAkwbd2OzxkbjPRfXusZ2/8=; fh=zQ9VUUYYQ5rgsng17GIgCxXnIxwFBUp5AvGIBh/lfGQ=; b=YipFxi92PBFGMH6iUmUEpqMgIYY3B+HQUO6XQJJLrF9Q6L4oh1NGxlsoatu4jzzcTc CUeQF4S2f3qLJwNAnmVHofUQnV/ar4NUF7bI2iCAZW0oJVuAfsuWpWXlbUdWDkyGdcwK X9XBmi37CKAdV12gYaqzG0//vaqnVyn9tw8H/Bx320FFUzeINOLfqkzjjfsPpR55T+AO W2AhRukvKJSYhERm2qlkbXJgjKIsmSBef7XXcMnL3lbUqKRzTH07/oquavRBXcMwgIn1 GeYpV014p1amnogzxROCzeChn0tkNTej63qFy1FirCym4kMQ8dcNkv6aNYyvBCTzTDj+ irgg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nokia.com header.s=selector2 header.b=MDV+HGhn; 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-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nokia.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id my8-20020a17090b4c8800b0026d034f6baesi7824691pjb.117.2023.11.06.00.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 00:08:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@nokia.com header.s=selector2 header.b=MDV+HGhn; 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-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nokia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 485EA80C2478; Mon, 6 Nov 2023 00:08:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231165AbjKFIIZ (ORCPT + 35 others); Mon, 6 Nov 2023 03:08:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbjKFIIW (ORCPT ); Mon, 6 Nov 2023 03:08:22 -0500 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2105.outbound.protection.outlook.com [40.107.104.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 509A7DB for ; Mon, 6 Nov 2023 00:08:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jABnNf5cr3gnnXwfCcnpXYQtZnwVkS+8SCj6xoBWAacgtmXtR68L2oD+OSnIAN6jiNPX0nqpzW4Oq1otb11ZcWUgTzyofSDecIb91u3zxH9AbwFnUYxX5/UyzUN2nMopSnHsrwFc+/AkTTothY9bzxKMAF1cKGcEuVTTFH8AjEqZuM/fs2bfgzgImuThVs0awwLzRIk5Z8idr/Egp4yHyq3dUtanju+5/dUAKusPRjxo6+FUMtSq4MqdzgtAwyc0M6hS2bdTdy0swSA4Zk0sqTLFZ670DamkiAYDPyI/LdEYmC9i2cCUi0Nq/QED4l2qmCkYTQGnXGC7f+3bcjIRCQ== 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=lnN4oJmgV8AQzjnmkTCKGAkwbd2OzxkbjPRfXusZ2/8=; b=lp6LHNSfjxwXKqmPgXkWPBgPG6z4zND5Vm+Stx9AvHuki0JGab2I/pxvZhHDl/2X5raA0HIwPTUXhsABYRpREWwkfTu8TZmK5oWwgSJMk/xyjPl5/haz+h40W3HeIYP9k/1B4DLkW+cNid0gWpVjr0Z9vPug55cHKWyQIAPFQQoiEgthuGWWaVACnxwgqoRhSpLdx/hssowZAdAc10Hs7Z219Zwr0Hqxy7ELVImpUyMGPAnemTKnsGOCmlD51GTzlm9yInCQiVN/eJkzv1D2DeQ2eZMGd7bA86TU2tjWjpnq2aE/05WjWq1QLA2m8BEZnBQ9oGvcdgD4AD0QY5pU0A== 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=lnN4oJmgV8AQzjnmkTCKGAkwbd2OzxkbjPRfXusZ2/8=; b=MDV+HGhnIPxrDO1MqHJVH/jGcqSVckdpOTBVKumEkdDKNlj9gYRTS3AiIuMPbwKvkvCcbPj2wu8XUOg6FYwj4AiLH6uS83W2spJ/I6KYrbcqAEHtiQ/XC85lrU06JegIXlTXEs9zl2HAdvtESQ8gIgqwCPvfaBf7a0rsn6DlO/uOvG4yHv0fEzy9eyKpF4U/KPkcigXZXSVzLLyO9xlaRbSefygEvxD0yHCVFbMWclqcRgnF4y12VQnPwH05COorbRmQIvyH8Ac74+SO939P7GQ0sIm8+J1sk1T8CN5Rim48UyVZy9Hl9Opsr8o3F5BVdmT17NSjk0TBH9hREgOe9A== 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 AS1PR07MB8565.eurprd07.prod.outlook.com (2603:10a6:20b:481::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 08:08:15 +0000 Received: from AM7PR07MB6705.eurprd07.prod.outlook.com ([fe80::bd44:ff70:6237:b6ea]) by AM7PR07MB6705.eurprd07.prod.outlook.com ([fe80::bd44:ff70:6237:b6ea%4]) with mapi id 15.20.6954.028; Mon, 6 Nov 2023 08:08:14 +0000 From: Stefan Wiehler To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wiehler Subject: [PATCH] arm: topology: Fix missing clock-frequency property warning Date: Mon, 6 Nov 2023 09:06:21 +0100 Message-Id: <20231106080621.12452-1-stefan.wiehler@nokia.com> X-Mailer: git-send-email 2.31.0 X-ClientProxiedBy: FR4P281CA0301.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f6::13) To AM7PR07MB6705.eurprd07.prod.outlook.com (2603:10a6:20b:1a2::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR07MB6705:EE_|AS1PR07MB8565:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f9684ae-b26d-45e6-8c67-08dbde9f86ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LGe2+y4PR/JE1SeBTrufz0eP+3XB1WwIU7aq/WwhHI/JlBdjmbSalHOBaWbYdWqJKuWKvaNiObPtvjoRb1BnmoLeTQs79CGK7CaUQwkKJhRqu2JvbP5roetovhRx99VLB/NRnPsytIAV0/JgPwJ1Z/4fl213UvzWAIE3NOf2OaldDAIpJ+stYbsoVoLxuunG13alOKnTZ4cEu5tVgjcJZIW5AoR/rm45/8L2AU8snfaudUwqj6G6lOfSpcgz9LmQKATb/fYlLtY6M2cibrwiYoQak8yBgFsb9V1pmis6z7mCx0QkYlUPRVOKqJ8ksdX35jjp2z77quFtlQMMN5WXb33mQuEzQxL4/7UBKrVvwxRNOGwWzXymCG0/WD8vRVpAq+IamkhpaAw3cWAnIqxhl84Hd1YwQeirpLgCcapK3rsHvWePauw+dhtTFnIR2ymqbj8MTqXj7qT+T0YZf6/6ZQs29ymgqmhTtELWn/W00QvwVCdfTgFWQPLBShni2sz+SVGnB65/E5TiCUaKsC2Ngdga0J7jZMwzWUYxTRrVaETBVR0NopVAoyVqSpHKuJDSNLlxf1zu//XZuFeZe1EiJ/3B8a6A/RShsovp30IP6tp23e7SmZZuVnO7zPqxvKnuiBM+wfDoBJ+IWq1YAAiP/6je8iyQqwyAChwupeiC/v91msFpxuilj4rySYcQOWpr7LfFivQinqOWh9fMD4Ac/Q== 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)(346002)(136003)(366004)(39860400002)(396003)(230273577357003)(230173577357003)(230922051799003)(64100799003)(186009)(1800799009)(451199024)(6512007)(2616005)(6486002)(6506007)(478600001)(52116002)(6666004)(38100700002)(36756003)(86362001)(82960400001)(5660300002)(44832011)(66556008)(66946007)(66476007)(83380400001)(2906002)(41300700001)(107886003)(26005)(1076003)(38350700005)(8936002)(6916009)(8676002)(316002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tgHhpSeVuQiq52JiplZImkwrhXmjq8fqDt2kb4l/n61X117P9h0BzlLuyE1Q4zcwF96VGuVSDBKacbZ402pJjF90cidMi/QtPiLovusTZ6LE7J+fWWF0bZpwisD4yKRuj1sD1N+HOSsud6C16OV8/xtWx1xVgTyigbHMmOg5s/qhZPklk8nIXoy+TJ8VdiovERXM9YjxNQ94sj9VUUhLZMVepugYfz6+TQZCGRlgHaqEUCJ567rctuTXxu50bPcUg4cjSWx6bmVZXTJrEeKB1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o2a90mCsC8ZeG9JkMxqVm+SHk1DuEz8SYrSW0Wogi8TgCX/NU/hwNyok+RVTC97u05yTGYWEYA6NTjC/UveGC320IjqDzhpmmWHB3qvCth++pAneXuj9EaYTB/3WQzJAKko0QmuPiSHbS0o8iHWJEeVB7b5ec9RYXxWO954wWPMOw2qBdf+RitYxjgf31noDCuMQLJ3s+z+mh/8XIRPWYj7sIbFi36QjOZ5H/PKXIWkOHmp+QMdvJpNHWqrjzNV8A39H49VFSq87sro4WhA== X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f9684ae-b26d-45e6-8c67-08dbde9f86ec X-MS-Exchange-CrossTenant-AuthSource: AM7PR07MB6705.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 08:08:14.8652 (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: NDjLL3SWtJ1jgQE8chSrnkHLRlT8KT368Qney6net7huWJBb3t7p7aA8W+0Kict46MsPm7fuDXy0cBOeTV9WiHrLWLvazTFpSXEtFLRLxVY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR07MB8565 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 00:08:30 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781801273107521871 X-GMAIL-MSGID: 1781801273107521871 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); } /*