From patchwork Mon Mar 27 18:43:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13189935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A931EC6FD1D for ; Mon, 27 Mar 2023 18:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ynFPFnaV1KLp24epa4jObZmtvPjdkw0sbcgKlMZyYds=; b=UlFVswQVxOca3k me7Ebf0F7L4lxpi4c5NnLJZ1kmUdGOyT61TLXKQCdOtz2DB+hI9RnRFPjVt/JeJ2m7+UJ5Rs/a0ud anXb9wCoe6fwW6g1wGWXGoICuZXvgOnqwLZzFmT+K5UVgMDzSn6AtQV8fOW/0DnfxsLNlHsMxwXY/ /pww9UuFzEcGuZHE7yns/lT7lRI8zAfVZ0mMaGh5e/DUhzSmrOxJ/qQ4vNamKv/gI35IySiE9z1oX ZO8xH7wT6OX1hBLXekzQ0et5CO4o2+jPahfa/Ub/UCUrC2XQr8TxLP72rHOBMROcp57Q6D7ccB2Ig Sq/3R+GpUygeq0Yc/5Iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgroe-00C5TV-1P; Mon, 27 Mar 2023 18:43:36 +0000 Received: from mail-oi1-f180.google.com ([209.85.167.180]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgroU-00C5PW-1G for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 18:43:27 +0000 Received: by mail-oi1-f180.google.com with SMTP id r16so7023857oij.5 for ; Mon, 27 Mar 2023 11:43:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679942604; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kEGgZynpOWxMMcgnhx5oPKpn1kXWJspMTBnhIlRJRTE=; b=kjOSgsqKUvPpJsGmzVb9gu8uNQt/oJ4dZ0/CZxvis2pfP/v+NOnaAmIQe5JsTjQ5Ss Nvy2fkiYGjlV2mdLYQyxSttSf9HnUGJulsfpBCOY1K9f6+qgFSKzdx2JKEIw1dIeOy+s ZrzA4Gc1QYB7mbPQdg0iBXc6idj3qMCiSgbXXKZIP0OtziUKJ48Uz1WqQmNPuqShGYgr c+c71LHcRFt5+ThNJErfAJGnyQ60e3/yMM1/ggb2Yx7qzw0q9A2je3wNQoiVGz1Z80kM tNr3wYUcsUOo+e5NgsUJH85THccTXSWuIKTyRQJqJXcozXBJyuTrCm+GHMl6QCFuyTmE 50Yg== X-Gm-Message-State: AO0yUKVAG78X4M4O8z2mPoVD47UaMnOsKYL6e3+bY0/vUdLMwq0NUhVU QdECxA/T4K8VUqZiyRfDRA== X-Google-Smtp-Source: AK7set97PHnpHnNcJd0YvHu98kxp/1+R4hE13vkhtRYsN9y0C0ya9L6PqEFAa2u7vAGLV9IfWhm4tg== X-Received: by 2002:a05:6808:1389:b0:37f:936d:b5d9 with SMTP id c9-20020a056808138900b0037f936db5d9mr7045261oiw.12.1679942603966; Mon, 27 Mar 2023 11:43:23 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id s9-20020a4a9689000000b005255e556399sm11758101ooi.43.2023.03.27.11.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 11:43:23 -0700 (PDT) Received: (nullmailer pid 250777 invoked by uid 1000); Mon, 27 Mar 2023 18:43:19 -0000 From: Rob Herring Date: Mon, 27 Mar 2023 13:43:18 -0500 Subject: [PATCH 1/3] MAINTAINERS: Add Marvell mvebu clock drivers MIME-Version: 1.0 Message-Id: <20230327-mvebu-clk-fixes-v1-1-438de1026efd@kernel.org> References: <20230327-mvebu-clk-fixes-v1-0-438de1026efd@kernel.org> In-Reply-To: <20230327-mvebu-clk-fixes-v1-0-438de1026efd@kernel.org> To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org X-Mailer: b4 0.13-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_114326_433057_E2F41A86 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org drivers/clk/mvebu/ is missing a maintainers entry. Add it to the existing entry for the Marvell mvebu platforms. Signed-off-by: Rob Herring Reviewed-by: Andrew Lunn --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8d5bc223f305..b9d04f781524 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2356,6 +2356,7 @@ F: arch/arm/configs/mvebu_*_defconfig F: arch/arm/mach-mvebu/ F: arch/arm64/boot/dts/marvell/armada* F: arch/arm64/boot/dts/marvell/cn913* +F: drivers/clk/mvebu/ F: drivers/cpufreq/armada-37xx-cpufreq.c F: drivers/cpufreq/armada-8k-cpufreq.c F: drivers/cpufreq/mvebu-cpufreq.c From patchwork Mon Mar 27 18:43:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13189934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D89B2C77B6C for ; Mon, 27 Mar 2023 18:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QA/aMYUAGQgteanJP3Ms7oLh8EbSeKyM9kx60ZqzyXE=; b=GXTRPN56QKHljC H5nhNqzyAkmw8uN88wfqrbZjOyygxAoDdjMMVKC4uXTK9PfzUGiFpW3QSZiGXZ5uKdCTEaj8Oibmm 83o+j47dBw5iJccM4VCUrDlgEVInKyFgATVshSZ/tygBa/KOvYMVfVlHXyp1v6A4fEF+4t4o3zNuo FGAG19JJldu4vz3E7QUkVQdBqWrUQcWtlMcWwFUs0UbTIeskQf0zMykVQ+Fkw0Bz23Q846dE58pDI HgVMM2r8p2riYAekjwccRCJOagWguNFE3rzGALQj4mtRdqsxp7pTiYX6IL7p/jZ2N4Wq8etM7G9nh u903dCuGDAOQym++EwMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgroc-00C5Sl-1A; Mon, 27 Mar 2023 18:43:34 +0000 Received: from mail-oo1-f48.google.com ([209.85.161.48]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgroR-00C5Og-1z for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 18:43:24 +0000 Received: by mail-oo1-f48.google.com with SMTP id n3-20020a4ad403000000b0053351dadc20so1487947oos.13 for ; Mon, 27 Mar 2023 11:43:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679942601; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7mYF/p73swKVMGgtJSK6eBueBgSxph1TeoNqsitRFwA=; b=Za1SB8g9IyT75s49krDg9n00Lr7zXul6lfBTt4SCOI+lK/9G1voUv/wVJOyDZqYOLn bwdSrIBBQgVWBVggnO2Jx6JdROkvYUd0t4o8gO1dVx9VNy7HgTM0xdhD1nVf36wYKVXr Mn1D/wJhJ62+GxyEACMabGUFniXTXhE1JcIK+HXRIQE27Ut7aQ/v+Xz90Wn6YJQwh2Pj 295V88/rv64Ckupx1PRUxJvHSAjj1XoY/armurHJfgo6FmAZlJblAUwIbVegHf2FhLE8 /Qgd0RqPyzDplN2jmtrISJok/5UuTQMu1+pDIiYaAxm3nikHujvxntJ9AfIbtWdITJra 3nPA== X-Gm-Message-State: AO0yUKXdX1m/kSCEp4CrSi9GXruSfVeOFrPQWSQoILJNSzct8iI+NUpU W/D5LMwYbkx/WVh/U1AIqVDRcYaa1A== X-Google-Smtp-Source: AK7set93rXSYxq6KWYshAjTfCfw3AeV65pKHZdMYG56Xbhfos4ATeuSH5uZ8XV3z5yG6pRXhevkRtQ== X-Received: by 2002:a4a:2c86:0:b0:525:2b54:d6a4 with SMTP id o128-20020a4a2c86000000b005252b54d6a4mr5858648ooo.0.1679942601498; Mon, 27 Mar 2023 11:43:21 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id u63-20020a4a5742000000b0051aa196ac82sm11759997ooa.14.2023.03.27.11.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 11:43:21 -0700 (PDT) Received: (nullmailer pid 250779 invoked by uid 1000); Mon, 27 Mar 2023 18:43:19 -0000 From: Rob Herring Date: Mon, 27 Mar 2023 13:43:19 -0500 Subject: [PATCH 2/3] clk: mvebu: Use of_get_cpu_hwid() to read CPU ID MIME-Version: 1.0 Message-Id: <20230327-mvebu-clk-fixes-v1-2-438de1026efd@kernel.org> References: <20230327-mvebu-clk-fixes-v1-0-438de1026efd@kernel.org> In-Reply-To: <20230327-mvebu-clk-fixes-v1-0-438de1026efd@kernel.org> To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org X-Mailer: b4 0.13-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_114323_670047_DA4F7FEB X-CRM114-Status: GOOD ( 16.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use of_get_cpu_hwid() rather than the open coded reading of the CPU nodes "reg" property. The existing code is in fact wrong as the "reg" address cells size is 2 cells for arm64. The existing code happens to work because the DTS files are wrong as well. Signed-off-by: Rob Herring --- Note this should be marked for stable so that if/when the DTS files are fixed, then at least stable kernels will work. This is untested, so I didn't mark for stable. --- drivers/clk/mvebu/ap-cpu-clk.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/clk/mvebu/ap-cpu-clk.c b/drivers/clk/mvebu/ap-cpu-clk.c index 71bdd7c3ff03..d8a7a4c90d54 100644 --- a/drivers/clk/mvebu/ap-cpu-clk.c +++ b/drivers/clk/mvebu/ap-cpu-clk.c @@ -253,12 +253,12 @@ static int ap_cpu_clock_probe(struct platform_device *pdev) */ nclusters = 1; for_each_of_cpu_node(dn) { - int cpu, err; + u64 cpu; - err = of_property_read_u32(dn, "reg", &cpu); - if (WARN_ON(err)) { + cpu = of_get_cpu_hwid(dn, 0); + if (WARN_ON(cpu == OF_BAD_ADDR)) { of_node_put(dn); - return err; + return -EINVAL; } /* If cpu2 or cpu3 is enabled */ @@ -288,12 +288,12 @@ static int ap_cpu_clock_probe(struct platform_device *pdev) struct clk_init_data init; const char *parent_name; struct clk *parent; - int cpu, err; + u64 cpu; - err = of_property_read_u32(dn, "reg", &cpu); - if (WARN_ON(err)) { + cpu = of_get_cpu_hwid(dn, 0); + if (WARN_ON(cpu == OF_BAD_ADDR)) { of_node_put(dn); - return err; + return -EINVAL; } cluster_index = cpu & APN806_CLUSTER_NUM_MASK; From patchwork Mon Mar 27 18:43:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13189933 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BDF4C77B60 for ; Mon, 27 Mar 2023 18:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G3HFGl3zj0okVT8vis/toZhJBbjQbHwd9mKAY8WG1/8=; b=xuMlwMiNYFOSVV RrmtUxFN50N1aHFCvPm5F/zXkUD68cPMI5foOxfhcWw1YI9+QGR405DE/EAX1CRlzAm4m0XGc09Tb JocAoJX+EOF0KbPyng+SOxN/cEJL+/sOeLoj6yuwRm6htMF8YL+JGcdewkwSCyL2T214FXvS2C6dk qEUBgFuR4xgmZZZDP2a0uV2DgghlcrOoiNCxXZR7Et21ROmdcKy1RjMFllVa2hEeaSVdTSYgUOGQS mkDgdl7B4mF0v9V2YyVELLmoH9p4HRKmgxN2jx3oD5n6jUyUDivkyDDzAYA58M8kYUp93/DGLj48a 6gTibTYb3hdDndjC7+xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgrod-00C5T6-19; Mon, 27 Mar 2023 18:43:35 +0000 Received: from mail-oi1-f174.google.com ([209.85.167.174]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgroU-00C5PN-03 for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 18:43:27 +0000 Received: by mail-oi1-f174.google.com with SMTP id r16so7023844oij.5 for ; Mon, 27 Mar 2023 11:43:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679942603; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pE6BrZSZEIfHJZnlEnBPUpJidRJVROMBg6S+6nxssKs=; b=5TgC8rtd9a+YV0na8pinozKNbm1fQLvTAq0rAfXjdtEFpw5pCPy39Z0X7YTR7hnvTl wgOKkLorfC2XULA1E5BBAWRyiE5Z6Wa9atcXdEp0PxZ1bpw8PtaUKXCo4XPWKzGXGCvh Pw3rt0pqpywpipFKL0lZoH+gFteXYIQiT5bx7tg75zJOtq6zZbWfYM/WP2gbUH32AKx2 JX9AcpWoYq1+NZ/ihhCpgfM4TbZuy0bkEyUJ8AZI20uJSUIdtKlG5akL6ErspALJJ/tO d4jmEiolHvjcqBql2KtVieVTLIbP/v1SC/3kAhhRo3Qo2h+G5hE3JGJ/U5PxL8gaXwgR h8SQ== X-Gm-Message-State: AAQBX9dHF2DRZooNpwQpUb8mnWU+UoyPlGkB1XoU8ByJhetqS6I2jFQ5 4sWUB6MjJZeTDyjtQUwnOQ== X-Google-Smtp-Source: AKy350Yoe4hgpUKbCUxvQlP6BHpmdYrkR/97D44BpHvO6gg9kj9r4j/ALflcwvzpNOeozVL7I6D0Jw== X-Received: by 2002:aca:919:0:b0:388:f3b6:edb0 with SMTP id 25-20020aca0919000000b00388f3b6edb0mr3671558oij.51.1679942602755; Mon, 27 Mar 2023 11:43:22 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id q204-20020a4a33d5000000b0053853156b5csm11154922ooq.8.2023.03.27.11.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 11:43:22 -0700 (PDT) Received: (nullmailer pid 250781 invoked by uid 1000); Mon, 27 Mar 2023 18:43:19 -0000 From: Rob Herring Date: Mon, 27 Mar 2023 13:43:20 -0500 Subject: [PATCH 3/3] clk: mvebu: Iterate over possible CPUs instead of DT CPU nodes MIME-Version: 1.0 Message-Id: <20230327-mvebu-clk-fixes-v1-3-438de1026efd@kernel.org> References: <20230327-mvebu-clk-fixes-v1-0-438de1026efd@kernel.org> In-Reply-To: <20230327-mvebu-clk-fixes-v1-0-438de1026efd@kernel.org> To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org X-Mailer: b4 0.13-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_114326_061569_39587204 X-CRM114-Status: GOOD ( 14.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rework iterating over DT CPU nodes to iterate over possible CPUs instead. There's no need to walk the DT CPU nodes again. Possible CPUs is equal to the number of CPUs defined in the DT. Using the "reg" value for an array index is fragile as it assumes "reg" is 0-N which often is not the case. Signed-off-by: Rob Herring --- drivers/clk/mvebu/clk-cpu.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c index c2af3395cf13..db2b38c21304 100644 --- a/drivers/clk/mvebu/clk-cpu.c +++ b/drivers/clk/mvebu/clk-cpu.c @@ -168,8 +168,8 @@ static void __init of_cpu_clk_setup(struct device_node *node) struct cpu_clk *cpuclk; void __iomem *clock_complex_base = of_iomap(node, 0); void __iomem *pmu_dfs_base = of_iomap(node, 1); - int ncpus = 0; - struct device_node *dn; + int ncpus = num_possible_cpus(); + int cpu; if (clock_complex_base == NULL) { pr_err("%s: clock-complex base register not set\n", @@ -181,9 +181,6 @@ static void __init of_cpu_clk_setup(struct device_node *node) pr_warn("%s: pmu-dfs base register not set, dynamic frequency scaling not available\n", __func__); - for_each_of_cpu_node(dn) - ncpus++; - cpuclk = kcalloc(ncpus, sizeof(*cpuclk), GFP_KERNEL); if (WARN_ON(!cpuclk)) goto cpuclk_out; @@ -192,19 +189,14 @@ static void __init of_cpu_clk_setup(struct device_node *node) if (WARN_ON(!clks)) goto clks_out; - for_each_of_cpu_node(dn) { + for_each_possible_cpu(cpu) { struct clk_init_data init; struct clk *clk; char *clk_name = kzalloc(5, GFP_KERNEL); - int cpu, err; if (WARN_ON(!clk_name)) goto bail_out; - err = of_property_read_u32(dn, "reg", &cpu); - if (WARN_ON(err)) - goto bail_out; - sprintf(clk_name, "cpu%d", cpu); cpuclk[cpu].parent_name = of_clk_get_parent_name(node, 0);