[v2,RESEND] arm: topology: Consider clock-frequency property from parent /cpus node
Message ID | 20230131081949.57917-1-stefan.wiehler@nokia.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2629639wrn; Tue, 31 Jan 2023 00:31:20 -0800 (PST) X-Google-Smtp-Source: AK7set+TSy9SOLAB3jHtJJkgjxqokYMIxjNceDPMVXC7KKmpB+odk83bxTxIUe6olJPqc7sA4cw5 X-Received: by 2002:a05:6402:1388:b0:4a2:1a65:f0c4 with SMTP id b8-20020a056402138800b004a21a65f0c4mr14470267edv.35.1675153880145; Tue, 31 Jan 2023 00:31:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675153880; cv=pass; d=google.com; s=arc-20160816; b=h1Lsbl6F8UqNYJa+Ceanq1a18QyZibcjXJbfrKzgp+4BbYVWR+BVBSTJzJ7bZogF4f J+iY+RtPX7WPbplxT7oMM3r/ozppS/pO+wlaGC8aQn3twGgcwlAw+CGwTJxfZRGAenl5 C01YpzdEpW0ohQbvzcH5YInyRL5pgUUMhljtCIqLtnVfYZAdpTZwKBTkBOxKtJ07wrEo F/I7cX9EI5EwWpnK8HKkbeQ/7IUS0bYkA9zFXDFM3PWE570GGTRWIydrBy46lqYkpv1g fyIvTI0wvVjrp1tcjfFuZg2ALLVegUrs72de9Mhjen7XdyjTfp5LSUdFgVtOvcos+XeR 147Q== 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=83JhzwrKqHOx6vi0FndZIAOlBI2rQ6Zyeq0BF4S9GYI=; b=OtRRM3XWEOVMK6PZK6LPhtVkdo+huzlLBls9mGjh2bEmMu2jNgaLBVd8nt0OWzhNGk MUor3GlQNzxotZKiqo2r7CDq0l+uOnJ4W9BpZq0fMPm3oPt+vwdjnlweQcP0fbE2MVCt XYnoHGeOvJiX1jMoCHHclg7jKmDeKRpl0d3Bf63HYDXPrLmmm2R2jPti8HYWboILRAJ2 FHLObsEyL7JY2QzaIYQnBV5dnC/7gBuKkwvhMiLY9VQm9PHiOY+r/qU2woUS3iQS+SrC Sbzfov3ib/VM/YSxLEWSl2uAX+laEVh02H4gbOA1LmK8FZm4m3QT/3Uk++pj/Tnw/faF 5GoQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nokia.com header.s=selector2 header.b="InAj/Sz/"; 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::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a056402135300b004a20e8fc5cfsi12922348edw.489.2023.01.31.00.30.54; Tue, 31 Jan 2023 00:31:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nokia.com header.s=selector2 header.b="InAj/Sz/"; 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::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nokia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbjAaIUO (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Tue, 31 Jan 2023 03:20:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbjAaIUN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 31 Jan 2023 03:20:13 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2121.outbound.protection.outlook.com [40.107.21.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA623EB64 for <linux-kernel@vger.kernel.org>; Tue, 31 Jan 2023 00:20:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hx12B3OCme3Q/eJeKsSMXSEXsRMfl6f9h5yYy4msIB2kl8mCme96PHqa1uWVeZUE70qabccEmSCbXiG1G5UqsunzyTGbd2f6Taq6wKS1/ZdyNj2CX5xfNIsSC3zwTr7+9IWWvn3BpDS5GrNQXg9WtGvqfvwGhWWYG66zlNgg1KkXSRUIlxOFd25Emrnnkobh/kyajTKuEyyl6b9biMRUIDezAxfRnFZJ8fa34hwFd6nMGpYUQaZrug03gq5FKuA9pr8tBa/EM8yC8VjkkvpEehDGLpoGnAZUL5cM4LRGKVgz7Wkl1kV+qIl+PBLkgWMfJtsjSRMmDLjkPZWwPVWbaw== 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=83JhzwrKqHOx6vi0FndZIAOlBI2rQ6Zyeq0BF4S9GYI=; b=Fd8/oU9QPtgj8it/jQX48hCJRlZG/glPHEhz8sa2dTcEKtuVj1kjsAsoxMhU2fETTAsvJrtbyxMZh8CY1wv2+f5MGMnR2K+lr4YsCfF+HdWVYDYuhjrQzbdBrnl2TIlLimqXSFqQKHuk6MzmIbVVLM1a0KKyQIKKLfgXqoN3c/AztAN3cCIRW1Hc9R0SYppuxCqwTfwu6B9dyYFHSrOmSnScQfQi8rSn0QtNYHqjT6cJOkKciHewhuvQencaIZzGLHZfmRg/H7Ka7FxKHUixO2gEp4lo5RSP4Cpa5fUcLHvv/QbrvPUyz0u4j8JDdOQL2BdESGC+5wLNFwPFf3Sm/g== 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=83JhzwrKqHOx6vi0FndZIAOlBI2rQ6Zyeq0BF4S9GYI=; b=InAj/Sz/Gv7KDQ+VmbdU9RNI5bGqEJn8sBckAFfZSoBLwVpjYGSD9J83RQP4ltSOl2KOJR5vXbnq7EhQB5TuiDFLnUoaR+rVMbq6V5sggreKuXAGTsf5e8BYk5PKVsjMSipOvTJ8Bm67GYQPf7niBCGTMkqWTifMLqCTGPl9EPPXpI/xrfsfLjiHLFWsMSHV53k3F+i6bHkZSarRD0rPTQhqlehSAfgFjTOVUbW9d4xJPzoPwJjs0PMyCQd3oqjeIln3Zxi2pX0ZhTvP9+5FkxlIAHwVQBhj2+BHLpxVPUfbxBorMgbvB4my4mYlByV4wR4JWNMssuqmduxo1FUJ6w== 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 AS2PR07MB9490.eurprd07.prod.outlook.com (2603:10a6:20b:645::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 08:20:09 +0000 Received: from AM7PR07MB6705.eurprd07.prod.outlook.com ([fe80::ae82:d9f7:79fc:ae68]) by AM7PR07MB6705.eurprd07.prod.outlook.com ([fe80::ae82:d9f7:79fc:ae68%5]) with mapi id 15.20.6043.038; Tue, 31 Jan 2023 08:20:09 +0000 From: Stefan Wiehler <stefan.wiehler@nokia.com> To: Russell King <linux@armlinux.org.uk> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wiehler <stefan.wiehler@nokia.com> Subject: [PATCH v2 RESEND] arm: topology: Consider clock-frequency property from parent /cpus node Date: Tue, 31 Jan 2023 09:19:49 +0100 Message-Id: <20230131081949.57917-1-stefan.wiehler@nokia.com> X-Mailer: git-send-email 2.31.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AM0PR03CA0012.eurprd03.prod.outlook.com (2603:10a6:208:14::25) To AM7PR07MB6705.eurprd07.prod.outlook.com (2603:10a6:20b:1a2::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR07MB6705:EE_|AS2PR07MB9490:EE_ X-MS-Office365-Filtering-Correlation-Id: ceb49804-2d26-425f-8001-08db0363f751 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HC6HHw0a7pUqBNx6Llx6+DAHvwa1lWpWQo4hJa/TRa3IbdcfuqzyZXR1mLT5XKdWITU0ub/GHs8JMXTemEwysDNk7gZT/IJeeSjSxLiLsb0yILm5f17AzEV02q67Yf+z0r5rCSU/e9/CdWjm63AgR3jEQu4SH6d3vuJ0K/aqTnUxSHAZV32LOFe8b9sk5f204iEM3u/8ybPisjYa7mD5/ITmJ2zIB501vPBNweqqnBoPoD9Zgm/hvWuQMCGQIC7Dag5ZK19ETSKUqJK2tbvpKMZG64agUC7XqjJlMv6xyJbQT1nXjTvSyIu8G4cMEvoJ/iiJIKhhX68walYnusY2zHsxs1r25QKfrEZhDrPNc9mylpo6+dVWTvtxMAtJxwKxwRN/wljWLTywcAEWUU97uctHqwkGF9M5klT2qOFvmaDvscZmPvvtqkA5JGMxE7Ih0S0N2l5id1WCyYKnKcWvuyM/lvNgmCGKotu+Yj5PkXDJFKqf8MplfQHWnBZ8vCC6DF3nKONvnWhSgojjusdhtjxQxThutGdsP/il/bt8GK7tWieaJzP3FVy0KXq2t4V+MGbfwrjyYCEQzhJgqB2xdR1U5tSRjvwpoe8dHSq0LEvV9zRT89hVgfwM4rZiYhpMXilNZaFLr4+LxYFa7SusgAAyDy1NrZcLXSiytEam+uqGXBxBHEC7zVWsyxMvC3SjHP20B+bCT3jN9TCJVEU0lR3t42GIy6i/5ERJNYf34RVg+HhCRqKwO/xQs4Rv8TrK 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:(13230025)(4636009)(39860400002)(396003)(136003)(366004)(376002)(346002)(451199018)(83380400001)(6916009)(8936002)(41300700001)(316002)(4326008)(8676002)(1076003)(66556008)(107886003)(66946007)(66476007)(6666004)(6506007)(186003)(26005)(478600001)(6512007)(52116002)(6486002)(2616005)(82960400001)(86362001)(44832011)(5660300002)(38350700002)(38100700002)(2906002)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UD2DDNvMI1ummQXNEquKrefqvenyuS7Co9tyQPTC9QfRi3qPN03IpGEAtudMqe8NCWmO7O5O3wsP9c70+3a3vcKJ3PKEXmEhFAB5vudVhcaW5jqpIJSDtvTZy3FlJ242JKbgXHCo3QUNOLZIRz2wEvPQ35lSQ5JOwziiZpSsxgaByhS8x++6YZyP95sYzFsrM3EgKOBm8gZpBDpuGllCHI1pVlKn66yix+epBtDW9NZTUIT5DweCuCnRFfoX3i/F/Vf16lNnIoAeav7zmr7AigGm8vkpzmlxF9Hm9zpf0/zyrlHm+r1OXIA1jWY8R8zxbTU5L2eq1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SpV9F2fxoSyKp0YXvSaiycXMnBRjwviESp/8o0yC/eGFTg8cGGPVvGZj80u3jIGQAqulq0j2AfU4pBw983ZoKyRQqHVFLNDMfoowENM8djYokmZ6GQzRzNeQemGGP46gzUBI6JxdulccOs0sWyUOogLODmMxBd8QthpTdmq6RjQmff35hdMwxxbZ+Cc0HWPzYQGTKi3D3hIOceA== X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: ceb49804-2d26-425f-8001-08db0363f751 X-MS-Exchange-CrossTenant-AuthSource: AM7PR07MB6705.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 08:20:09.0578 (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: jt3gJUH0km0QoJz8oChToDxi4Ulvq3lfdwMeVYcs6SoN4KfWPH0OnL+HekS8Do4k69oes1x9tujHlwZ+aQ0sKW+0dtAm52kbQ49gZTW/kvw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR07MB9490 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756526155042864999?= X-GMAIL-MSGID: =?utf-8?q?1756526155042864999?= |
Series |
[v2,RESEND] arm: topology: Consider clock-frequency property from parent /cpus node
|
|
Commit Message
Stefan Wiehler
Jan. 31, 2023, 8:19 a.m. UTC
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 <stefan.wiehler@nokia.com>
---
- Refactored /cpus node lookup
- Add missing node refcount decrement via of_node_put(); of_get_property() does
not need it
---
arch/arm/kernel/topology.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index ef0058de432b..773c46c07a1c 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -90,10 +90,18 @@ static void __init parse_dt_topology(void) 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); + cn = of_find_node_by_path("/cpus"); + if (!cn) + pr_err("missing CPU root device node\n"); + common_rate = of_get_property(cn, "clock-frequency", &common_rate_len); + of_node_put(cn); + for_each_possible_cpu(cpu) { const __be32 *rate; int len; @@ -121,8 +129,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;