From patchwork Fri Jun 9 18:13:45 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: 13274272 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 0418CC7EE25 for ; Fri, 9 Jun 2023 18:15:11 +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=Vhs3lFNbKvAFT6lLLLhTrs8yEFcykjkcPHQIxRkOiRQ=; b=nrpzsBmmVESzfq NiTj6emVdcDqvWG/kTMdBZgGKOjXxxzNjFKsARbpkunt50EM03dGvPzyWqIfbG/61qvzGCnKu8Pse 2TAwc/6766efiTJ6bEZ2vuZViOJprfJSGGgOOTo8vZbpm7YyvKqXzBV91qv7lpyBKMEihyydDDlph KwboQw1ShK9gX2YOr9UCO97l6POgehjhBoTHiWDrkdhT3JQB4TZ7jAbXvq47BFFpGcdUdmJTo3aYk 3VFK51xTbf2TJyHRIn199N9YjxamGflzOuG44su2yHX+LH5IYMCvk9OCCPpoJrrpe340Sku6JGZUl Vn/bcQSLmKR7KJVCTZeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7gdK-00Dp71-32; Fri, 09 Jun 2023 18:14:46 +0000 Received: from mail-ot1-f47.google.com ([209.85.210.47]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7gdI-00Dp5l-1J for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 18:14:45 +0000 Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6b2d702bd5aso766a34.0 for ; Fri, 09 Jun 2023 11:14:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686334483; x=1688926483; 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=PtmxCGh9l/ae29ZPQBJ2vM6KiVFQXXIcZskQGw0mrU4=; b=Sv0IBgVaeZo9/nbMqBA4a12aq1j6cigtX4qVYElIZX7rezLZqDCvrtjHJolalRa95K Pq7XEsEYXGPkhn86DG2x2OTx+33+2N18z3wMkgiZk8zXNt/ywXHQUz+DjWcoRFmJUxsE T3OZOKU5v2g1LqU/5XKr6zjWBlsguT9SR7jdL+zl8zzHHgBy4F021NAT/ikSSzVuYVTw j2e+39wN5L0R1p1gwQNBUh7cT29QyPD5RwOOYYUf3JGF6fcGaubJVX3hWaLtlU+fgokx /47x3witPKgiAyhYTq8n8ViwPbnjRYbkDeEjPWNLdgdE4myWip5pt+JyQxJJcYXAP3fO Aj+g== X-Gm-Message-State: AC+VfDwWRsuliMAJRb+IiH7r2e8AgPKRQIOw1e4KEzCJNG61D9OkRtVT mvGfskd29pipjOhl2MZRAMV1JRU4+w== X-Google-Smtp-Source: ACHHUZ6RvrtAt54LttRWOzlIW+s7GqGRsjyJDdSvjjJuJmoFtUQvFOm9Py2c+QqhjPR1kKbASiRQkg== X-Received: by 2002:a92:c6d0:0:b0:33b:94d:b60b with SMTP id v16-20020a92c6d0000000b0033b094db60bmr2229408ilm.14.1686334462312; Fri, 09 Jun 2023 11:14:22 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id i18-20020a02b692000000b00418507eef02sm1069799jam.31.2023.06.09.11.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:14:21 -0700 (PDT) Received: (nullmailer pid 1681129 invoked by uid 1000); Fri, 09 Jun 2023 18:14:15 -0000 From: Rob Herring Date: Fri, 09 Jun 2023 12:13:45 -0600 Subject: [PATCH v2 1/4] MAINTAINERS: Add Marvell mvebu clock drivers MIME-Version: 1.0 Message-Id: <20230327-mvebu-clk-fixes-v2-1-8333729ee45d@kernel.org> References: <20230327-mvebu-clk-fixes-v2-0-8333729ee45d@kernel.org> In-Reply-To: <20230327-mvebu-clk-fixes-v2-0-8333729ee45d@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-20230609_111444_449021_2E52A894 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. 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. Reviewed-by: Andrew Lunn Signed-off-by: Rob Herring --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7e0b87d5aa2e..5656a729f2e4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2364,6 +2364,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 Fri Jun 9 18:13:46 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: 13274271 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 BEB39C7EE45 for ; Fri, 9 Jun 2023 18:15:02 +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=gGGuVfn3j4LY2Tq1ZWhnc3xga/SUJZDMjMzBMiRL4Ug=; b=NpqPiT4Qe0VHRl nwM1uldBkZXm1OK9jXHoHRZXU1s8mK6+WfcZrsFAI+GCOREGDymivPYC9WjDcHZI0/ZZsBqEfbmwS WvJNpUMMC+j/uN2Q83AMBI58LVIR1b8EALyA0SYPyWFV5tf1J/+1Cid0OXuGQ8U6w0EPeV96nmhze yWbavaKrEMOywodU/VDgogYs4vtDau6b3/C8mNMQiSH2LvJzHcG2LVONEcdOgpAGywO9bGChtkL/6 5Xx339l9UNH8DKGfeProsjuafeCRLWo3YjyCyf6ut1/o6jojnmZotZtcrBL+zMJpHgsn3vno/bV1U IEckWIrAfa+bkliOt+jQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7gd7-00Dp2J-2a; Fri, 09 Jun 2023 18:14:33 +0000 Received: from mail-io1-f45.google.com ([209.85.166.45]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7gd0-00Doxv-0j for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 18:14:27 +0000 Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-77acb944bdfso91470739f.0 for ; Fri, 09 Jun 2023 11:14:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686334464; x=1688926464; 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=W+YPUEMI65QN7DU7S8/VjzArfzenyEsCNlHNh4xFonc=; b=XkHMPYbHP1h3Jo6om4HmIyFuD5M01LsuR912UnEZydtSFKgriWzJuen+Eig49vgIFL u+Y7fRbroz7DcEylAme/M6DLmrR1uh/chEsJlg9Qh+xokBkmlXDjckgoXhNWwD9+nThl Ckl1oJqr9lHu05rd+nnBfEmnXH1gAAA/kug6Goh7rAnSrUzsmzWMgdxQmkGrEoVrbp5+ g5egDczGWx31uxvfNYcogla9/89G+lhdysdv+2ElammsU5Ja/nZ1GbHwTJFGcKHjqhvq kUVefv6JMbyXgaNxVnlBk24wDt/jlg+mceoko0dMcnglLezMJlC+4w/08NrHQqqfoIDv hnmQ== X-Gm-Message-State: AC+VfDx32zLajF76n/dd1JOPVntTrMtSDiMp847w/J3u5T8umCzZSM5C bOy6bnfw5Rq17pKWTquWlQ== X-Google-Smtp-Source: ACHHUZ4C+IBXDQp4zLtR7Kw9J1XTAY9/7wVyOEfDxyKbxhtoAD7TsbOxGxnTy5ECj4+2dLIaDXCTig== X-Received: by 2002:a05:6602:184b:b0:76c:898c:9b10 with SMTP id d11-20020a056602184b00b0076c898c9b10mr2485982ioi.0.1686334464556; Fri, 09 Jun 2023 11:14:24 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id x5-20020a6bda05000000b0077024f8772esm1216735iob.51.2023.06.09.11.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:14:23 -0700 (PDT) Received: (nullmailer pid 1681131 invoked by uid 1000); Fri, 09 Jun 2023 18:14:15 -0000 From: Rob Herring Date: Fri, 09 Jun 2023 12:13:46 -0600 Subject: [PATCH v2 2/4] clk: mvebu: Use of_get_cpu_hwid() to read CPU ID MIME-Version: 1.0 Message-Id: <20230327-mvebu-clk-fixes-v2-2-8333729ee45d@kernel.org> References: <20230327-mvebu-clk-fixes-v2-0-8333729ee45d@kernel.org> In-Reply-To: <20230327-mvebu-clk-fixes-v2-0-8333729ee45d@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-20230609_111426_264685_162197B4 X-CRM114-Status: GOOD ( 18.32 ) 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 --- If the DTS files are fixed, then they will not work with the existing code. This change should work for both existing and fixed DTS files. Therefore, 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 Fri Jun 9 18:13:47 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: 13274269 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 B981DC7EE29 for ; Fri, 9 Jun 2023 18:14:55 +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=DbliRbYCq2Oz2l M2adtr2sAsOGtuK0tv8znORDAcf1wuySLzlHg/UUDUpX2pQ8/gPXmlwZylcvzRWlBnqC1g26WU8Pn jr3EvpVGlgtDPRlSkVyz9ySheCxm/vXVh0dmLjTRxP2ytfPJGacWdT3BavplNDHn9euHXyyvalEaX cEAVhSlqjksrS2yBijEowbimRw4Z6TKFS1K9jeHejRi8qZf6w7e+ySL2ldyqEc1WabU5025KhLp4s +Fke3N5p1CzlEdWH0kIgmCqCSoPxFkCjkvlm+jGWhvDUf1+rhfbN09dm2ZsmJITWp8IGpScvnvyVG oeKMaP29+CDM8gpHMzzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7gd8-00Dp2d-15; Fri, 09 Jun 2023 18:14:34 +0000 Received: from mail-io1-f47.google.com ([209.85.166.47]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7gd2-00Doz8-1B for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 18:14:29 +0000 Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-777a9d7efabso90121439f.0 for ; Fri, 09 Jun 2023 11:14:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686334467; x=1688926467; 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=g6T6hHZKFfG4tDrWgCJrn3KiU6IHEghMtiDE1fp3aJN51+VJe6LQhCpVKXRW12/t1r Fo70gjq+agGwVI4NtuhYhVUJzThSunvRb3HShEjVkVQD4QTK6uMrNKcmN4bDIav8AUYx aDbGVK5V5lfhK43yXVelKRNF2HElgIaZ4LVZ5xs//2pi3wylbebiZq+y8FA2nYlD+On+ CrdKA3tDp9CiGWKBAPN4RNxAIuWTbXJUb4zOnFBEZnAaZ+pxxP5Bt25CqZHYBYe6ZMvT RKwEulgpUvmHy8WiQsci/KpW6lqp5f6iGlfuU2z+PfhO3lNIOgLejQPEoNd0vi5TobEM MBDg== X-Gm-Message-State: AC+VfDxSO5kqIbrLEDLYdjAe7oWFhidii6hoeDfekxBYU+pA7oAiHcsm ApMkcdSAKDAHfmklb0bAZDPyxLlgGg== X-Google-Smtp-Source: ACHHUZ79dCkknd9S8Dmk8waSkwLRk4KiJg4v0cTkG2Eo4R+dz6RcXvl1Z+9Kd2mqw/rD2ad51NDMAA== X-Received: by 2002:a92:cd43:0:b0:33e:6837:c5fe with SMTP id v3-20020a92cd43000000b0033e6837c5femr2257114ilq.9.1686334467190; Fri, 09 Jun 2023 11:14:27 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id z9-20020a92cec9000000b0033a6e7ee4e3sm1223860ilq.1.2023.06.09.11.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:14:26 -0700 (PDT) Received: (nullmailer pid 1681133 invoked by uid 1000); Fri, 09 Jun 2023 18:14:15 -0000 From: Rob Herring Date: Fri, 09 Jun 2023 12:13:47 -0600 Subject: [PATCH v2 3/4] clk: mvebu: Iterate over possible CPUs instead of DT CPU nodes MIME-Version: 1.0 Message-Id: <20230327-mvebu-clk-fixes-v2-3-8333729ee45d@kernel.org> References: <20230327-mvebu-clk-fixes-v2-0-8333729ee45d@kernel.org> In-Reply-To: <20230327-mvebu-clk-fixes-v2-0-8333729ee45d@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-20230609_111428_405238_6BA8C914 X-CRM114-Status: GOOD ( 14.79 ) 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); From patchwork Fri Jun 9 18:13:48 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: 13274270 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 9DFA4C7EE25 for ; Fri, 9 Jun 2023 18:15:03 +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=BT7ee5bbCOxyBXqyoVISKXzkTmDXCEA46T0vnm8nBtA=; b=CBsmD1MUmrkf4n lHQbXVxPESSU2UpmOkCBmiyvYO29gKyJ0MtMrJ40/2GKQCk3x+6/KmFjnIHpmDk+Ic4uMsggyzWy7 SW8H903MZ3FW+2ELF5eNKKetTdpyZQv0tyKIKno2IATQWKc++NjM0Qq6wlw1A+2mGrXWft5Zv/Ums WML/j74eZw77bUVNn+lDF2mr5Q6CRg252ph0q9ZjqYvyj8XApmkQ/UHfCecrChpEyuj7vmIhdoQdS EF0X8DxpSGzVB6KPnlMGHxnmrSNeUMv0GPNddLZLiee0ngZIWC4eNyN924uwQvbO3ktN02D8nsVbV fLWeIEzbni3rklWKl7Tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7gcz-00DoyS-32; Fri, 09 Jun 2023 18:14:25 +0000 Received: from mail-io1-f50.google.com ([209.85.166.50]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7gcx-00Dox0-37 for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 18:14:25 +0000 Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-77ac14ff51bso85597939f.3 for ; Fri, 09 Jun 2023 11:14:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686334460; x=1688926460; 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=wUoI1otyq64V4OASVoH2qZ32EO4bebljBzF+Ld6+3L8=; b=PJ4nZjuLgpF8M/UV1M5OFGOmDmiVO1MJ0hRm24lcvaONVRmpaeANhpmGU00kQyScl9 H8nvy0TWdhFzUR28lsVNZV+s8VXYOHoOhd24O3nTMEO8S2ZaQ0z7ODiThc5UQfu/lJfS 9YOalbqx2vHmBDUpNchU7AbxyIuFzxSMvlvUR7OkweFgJxPN8Dm2Y/DGCZRRAt5MeBqx q7vA3Um2cg64F9dlMao0+BbD0niFQ6WQaa8lg7r9Xi/13iNQz+9+e2swGIU0f3/rx4ft Wb7kfuCHxfSLBRttiQ8ry6n5pxQvr2BYKUpKsR5jB1qNtpdEtyNeRehfEhso1ZfZ4Z7v zRsQ== X-Gm-Message-State: AC+VfDydv3j99TBoqisDFcmb19LfxrJRpF0BMjtV8HgYOVJefauXWgIz LLOBpWPrBZ7DUXnPPXasrA== X-Google-Smtp-Source: ACHHUZ7avp6M8UuFQ9TiyWiTQa1MXln3O/GpP7V72IkCtX4OMsKNx1Tat1zvWXXVbv5Ss/EtNsYBgQ== X-Received: by 2002:a5e:df0b:0:b0:777:b4af:32a3 with SMTP id f11-20020a5edf0b000000b00777b4af32a3mr2346005ioq.14.1686334459878; Fri, 09 Jun 2023 11:14:19 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id l18-20020a02a892000000b0040f9af9237asm1114745jam.41.2023.06.09.11.14.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:14:19 -0700 (PDT) Received: (nullmailer pid 1681135 invoked by uid 1000); Fri, 09 Jun 2023 18:14:15 -0000 From: Rob Herring Date: Fri, 09 Jun 2023 12:13:48 -0600 Subject: [PATCH v2 4/4] clk: mvebu: Use of_address_to_resource() MIME-Version: 1.0 Message-Id: <20230327-mvebu-clk-fixes-v2-4-8333729ee45d@kernel.org> References: <20230327-mvebu-clk-fixes-v2-0-8333729ee45d@kernel.org> In-Reply-To: <20230327-mvebu-clk-fixes-v2-0-8333729ee45d@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-20230609_111424_001172_1B600517 X-CRM114-Status: GOOD ( 11.50 ) 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 Replace of_get_property() and of_translate_address() calls with a single call to of_address_to_resource(). Signed-off-by: Rob Herring --- drivers/clk/mvebu/armada_ap_cp_helper.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/clk/mvebu/armada_ap_cp_helper.c b/drivers/clk/mvebu/armada_ap_cp_helper.c index 6a930f697ee5..e7005de66327 100644 --- a/drivers/clk/mvebu/armada_ap_cp_helper.c +++ b/drivers/clk/mvebu/armada_ap_cp_helper.c @@ -16,15 +16,13 @@ char *ap_cp_unique_name(struct device *dev, struct device_node *np, const char *name) { - const __be32 *reg; - u64 addr; + struct resource res; /* Do not create a name if there is no clock */ if (!name) return NULL; - reg = of_get_property(np, "reg", NULL); - addr = of_translate_address(np, reg); + of_address_to_resource(np, 0, &res); return devm_kasprintf(dev, GFP_KERNEL, "%llx-%s", - (unsigned long long)addr, name); + (unsigned long long)res.start, name); }