From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8519C433FE for ; Fri, 8 Oct 2021 11:01:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A24AF61029 for ; Fri, 8 Oct 2021 11:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240165AbhJHLDZ (ORCPT ); Fri, 8 Oct 2021 07:03:25 -0400 Received: from gandalf.ozlabs.org ([150.107.74.76]:34297 "EHLO gandalf.ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240117AbhJHLDY (ORCPT ); Fri, 8 Oct 2021 07:03:24 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4HQlcH5cyHz4xbV; Fri, 8 Oct 2021 22:01:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1633690887; bh=B4qzHAigKKJHhzM+dPDATq6BWHA36ShynfcFOX354Uw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ecgb6jGX08YbAx5B1reNn4h/kU3Gen7kievibOO69w+92xKGfimzG9blAbi2wPVuT bzRQvpw1Gsq6L5OISVmfgRGEMrtpfffTD3SxPCSAMjCA7BaSe9z1Uwt8UhxvwagCXt RG8jZ9yVbHmz/oZlWgdyytG8dpN+zilnWPdwvHzOrKK+z9cUFtnbh9EiaF6DvYThDq y+nA3s2Jr7OnqG1H9G2arDaiYJ9T+Ocn4v009hMVegWkEyhfV3tBa+fnPnVWJ1bKT9 NTxKKbhG9DIb5b2JYg+QufFs7CUHZN2G28KnkHe3XTX54qxanjx0qe1ihehNmLNt3p OX9W1GxfbYAzQ== From: Michael Ellerman To: Rob Herring , Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Cc: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Rafael J. Wysocki" , Frank Rowand , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 07/12] powerpc: Use of_get_cpu_hwid() In-Reply-To: <20211006164332.1981454-8-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> <20211006164332.1981454-8-robh@kernel.org> Date: Fri, 08 Oct 2021 22:01:15 +1100 Message-ID: <8735pbok5g.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org Rob Herring writes: > Replace open coded parsing of CPU nodes' 'reg' property with > of_get_cpu_hwid(). > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Rob Herring > --- > arch/powerpc/kernel/smp.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c > index 9cc7d3dbf439..d96b0e361a73 100644 > --- a/arch/powerpc/kernel/smp.c > +++ b/arch/powerpc/kernel/smp.c > @@ -1313,18 +1313,13 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) > int cpu_to_core_id(int cpu) > { > struct device_node *np; > - const __be32 *reg; > int id = -1; > > np = of_get_cpu_node(cpu, NULL); > if (!np) > goto out; > > - reg = of_get_property(np, "reg", NULL); > - if (!reg) > - goto out; > - > - id = be32_to_cpup(reg); > + id = of_get_cpu_hwid(np, 0); > out: > of_node_put(np); > return id; This looks OK to me. All the systems I can find have a /cpus/#address-cells of 1, so the change to use of_n_addr_cells() in of_get_cpu_hwid() should be fine. I booted it on a bunch of systems with no issues. Acked-by: Michael Ellerman cheers From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0008DC433EF for ; Fri, 8 Oct 2021 11:02:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B847B60FC1 for ; Fri, 8 Oct 2021 11:02:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B847B60FC1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tO0XxnYi5v1K4M1Kmcp8a5qxKDpimZg2AWurdsg5ZT4=; b=sO178XRPghDi8Q CjsCt9ajbKEB6iK6D3RjLGug4T4etk1eJxp6k3BDQkhA9d8Uq7xFJkInjZQjZrjQYiFKz4ILvWL+N Ab9NBxwgUFA9l3ejYipb5oz9v685pkFt4DYplqVREttn9fXKF8dvkP5hy3QBUvXGYU0QeGfmxLWjJ g3cfbDzffpRTbtGyhUXXLBKgVzZ+KRgRocZoD1NfdM5gJNFjzXlkXTORXBrMUnZAR3L+e791mg18K XDx03MmgzSdWAGi1qimTxT+0mv/VGbUxHr/YS5fd/tsTLwj2JJN8KBEPHPdsPqG77Zbb/X4uBFtOE LbNWLq/l8jhXGGPmFYtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYndQ-002UuR-4X; Fri, 08 Oct 2021 11:01:52 +0000 Received: from gandalf.ozlabs.org ([2404:9400:2:0:216:3eff:fee2:21ea]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYndD-002Usi-5h; Fri, 08 Oct 2021 11:01:40 +0000 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4HQlcH5cyHz4xbV; Fri, 8 Oct 2021 22:01:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1633690887; bh=B4qzHAigKKJHhzM+dPDATq6BWHA36ShynfcFOX354Uw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ecgb6jGX08YbAx5B1reNn4h/kU3Gen7kievibOO69w+92xKGfimzG9blAbi2wPVuT bzRQvpw1Gsq6L5OISVmfgRGEMrtpfffTD3SxPCSAMjCA7BaSe9z1Uwt8UhxvwagCXt RG8jZ9yVbHmz/oZlWgdyytG8dpN+zilnWPdwvHzOrKK+z9cUFtnbh9EiaF6DvYThDq y+nA3s2Jr7OnqG1H9G2arDaiYJ9T+Ocn4v009hMVegWkEyhfV3tBa+fnPnVWJ1bKT9 NTxKKbhG9DIb5b2JYg+QufFs7CUHZN2G28KnkHe3XTX54qxanjx0qe1ihehNmLNt3p OX9W1GxfbYAzQ== From: Michael Ellerman To: Rob Herring , Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Cc: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Rafael J. Wysocki" , Frank Rowand , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 07/12] powerpc: Use of_get_cpu_hwid() In-Reply-To: <20211006164332.1981454-8-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> <20211006164332.1981454-8-robh@kernel.org> Date: Fri, 08 Oct 2021 22:01:15 +1100 Message-ID: <8735pbok5g.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_040139_384171_8F449781 X-CRM114-Status: GOOD ( 15.88 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Rob Herring writes: > Replace open coded parsing of CPU nodes' 'reg' property with > of_get_cpu_hwid(). > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Rob Herring > --- > arch/powerpc/kernel/smp.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c > index 9cc7d3dbf439..d96b0e361a73 100644 > --- a/arch/powerpc/kernel/smp.c > +++ b/arch/powerpc/kernel/smp.c > @@ -1313,18 +1313,13 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) > int cpu_to_core_id(int cpu) > { > struct device_node *np; > - const __be32 *reg; > int id = -1; > > np = of_get_cpu_node(cpu, NULL); > if (!np) > goto out; > > - reg = of_get_property(np, "reg", NULL); > - if (!reg) > - goto out; > - > - id = be32_to_cpup(reg); > + id = of_get_cpu_hwid(np, 0); > out: > of_node_put(np); > return id; This looks OK to me. All the systems I can find have a /cpus/#address-cells of 1, so the change to use of_n_addr_cells() in of_get_cpu_hwid() should be fine. I booted it on a bunch of systems with no issues. Acked-by: Michael Ellerman cheers _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Date: Fri, 08 Oct 2021 22:01:15 +1100 Subject: [OpenRISC] [PATCH 07/12] powerpc: Use of_get_cpu_hwid() In-Reply-To: <20211006164332.1981454-8-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> <20211006164332.1981454-8-robh@kernel.org> Message-ID: <8735pbok5g.fsf@mpe.ellerman.id.au> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org Rob Herring writes: > Replace open coded parsing of CPU nodes' 'reg' property with > of_get_cpu_hwid(). > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: linuxppc-dev at lists.ozlabs.org > Signed-off-by: Rob Herring > --- > arch/powerpc/kernel/smp.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c > index 9cc7d3dbf439..d96b0e361a73 100644 > --- a/arch/powerpc/kernel/smp.c > +++ b/arch/powerpc/kernel/smp.c > @@ -1313,18 +1313,13 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) > int cpu_to_core_id(int cpu) > { > struct device_node *np; > - const __be32 *reg; > int id = -1; > > np = of_get_cpu_node(cpu, NULL); > if (!np) > goto out; > > - reg = of_get_property(np, "reg", NULL); > - if (!reg) > - goto out; > - > - id = be32_to_cpup(reg); > + id = of_get_cpu_hwid(np, 0); > out: > of_node_put(np); > return id; This looks OK to me. All the systems I can find have a /cpus/#address-cells of 1, so the change to use of_n_addr_cells() in of_get_cpu_hwid() should be fine. I booted it on a bunch of systems with no issues. Acked-by: Michael Ellerman cheers From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2954C433FE for ; Fri, 8 Oct 2021 11:02:07 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C706461027 for ; Fri, 8 Oct 2021 11:02:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C706461027 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HQld91HC1z3c59 for ; Fri, 8 Oct 2021 22:02:05 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=ecgb6jGX; dkim-atps=neutral Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee2:21ea]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HQlcR42fRz2ynt for ; Fri, 8 Oct 2021 22:01:27 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=ecgb6jGX; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4HQlcH5cyHz4xbV; Fri, 8 Oct 2021 22:01:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1633690887; bh=B4qzHAigKKJHhzM+dPDATq6BWHA36ShynfcFOX354Uw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ecgb6jGX08YbAx5B1reNn4h/kU3Gen7kievibOO69w+92xKGfimzG9blAbi2wPVuT bzRQvpw1Gsq6L5OISVmfgRGEMrtpfffTD3SxPCSAMjCA7BaSe9z1Uwt8UhxvwagCXt RG8jZ9yVbHmz/oZlWgdyytG8dpN+zilnWPdwvHzOrKK+z9cUFtnbh9EiaF6DvYThDq y+nA3s2Jr7OnqG1H9G2arDaiYJ9T+Ocn4v009hMVegWkEyhfV3tBa+fnPnVWJ1bKT9 NTxKKbhG9DIb5b2JYg+QufFs7CUHZN2G28KnkHe3XTX54qxanjx0qe1ihehNmLNt3p OX9W1GxfbYAzQ== From: Michael Ellerman To: Rob Herring , Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH 07/12] powerpc: Use of_get_cpu_hwid() In-Reply-To: <20211006164332.1981454-8-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> <20211006164332.1981454-8-robh@kernel.org> Date: Fri, 08 Oct 2021 22:01:15 +1100 Message-ID: <8735pbok5g.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Florian Fainelli , Scott Branden , "Rafael J. Wysocki" , linux-sh@vger.kernel.org, Ray Jui , "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar , Paul Mackerras , Borislav Petkov , bcm-kernel-feedback-list@broadcom.com, Thomas Gleixner , Frank Rowand , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Rob Herring writes: > Replace open coded parsing of CPU nodes' 'reg' property with > of_get_cpu_hwid(). > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Rob Herring > --- > arch/powerpc/kernel/smp.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c > index 9cc7d3dbf439..d96b0e361a73 100644 > --- a/arch/powerpc/kernel/smp.c > +++ b/arch/powerpc/kernel/smp.c > @@ -1313,18 +1313,13 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) > int cpu_to_core_id(int cpu) > { > struct device_node *np; > - const __be32 *reg; > int id = -1; > > np = of_get_cpu_node(cpu, NULL); > if (!np) > goto out; > > - reg = of_get_property(np, "reg", NULL); > - if (!reg) > - goto out; > - > - id = be32_to_cpup(reg); > + id = of_get_cpu_hwid(np, 0); > out: > of_node_put(np); > return id; This looks OK to me. All the systems I can find have a /cpus/#address-cells of 1, so the change to use of_n_addr_cells() in of_get_cpu_hwid() should be fine. I booted it on a bunch of systems with no issues. Acked-by: Michael Ellerman cheers From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABC75C433F5 for ; Fri, 8 Oct 2021 11:03:51 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 78B9360F22 for ; Fri, 8 Oct 2021 11:03:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 78B9360F22 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MBm2oj6bxfniqigHbW8MNtsUH1n86Ge0raSEXoj32gc=; b=cZJLcJkAtLZx6o llHSOAHrli7bo4O/wre08L5Yyy7tkeCydR7Q76izBykVsexMsNsENNqHz3G2EojA9HUYH+6PmLXjf ArVDtmEf8XDBPzQwpcqRYFU5I5XG6n7w29wnxPyZv641G5vTW+2kdtE1HEPCeRjHtpLSqCY+GCOKG fkSDIdVsmontPTmDHnvVg+XnVtU4J2GokUwA1kVU/jihUfWjfc5vuq3aeZAmNpS3pGHg7yr8tO8zF x2TRkGJbNXoP9FyeN8Q4Tj1AWf+ne1UM1E2uIjAfSvpFQVLvGfh2VniXctjTxIv6sdwu6XOaWtrw8 Jrd2sFLcO5C8EpN8jsyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYndH-002Uth-80; Fri, 08 Oct 2021 11:01:43 +0000 Received: from gandalf.ozlabs.org ([2404:9400:2:0:216:3eff:fee2:21ea]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYndD-002Usi-5h; Fri, 08 Oct 2021 11:01:40 +0000 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4HQlcH5cyHz4xbV; Fri, 8 Oct 2021 22:01:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1633690887; bh=B4qzHAigKKJHhzM+dPDATq6BWHA36ShynfcFOX354Uw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ecgb6jGX08YbAx5B1reNn4h/kU3Gen7kievibOO69w+92xKGfimzG9blAbi2wPVuT bzRQvpw1Gsq6L5OISVmfgRGEMrtpfffTD3SxPCSAMjCA7BaSe9z1Uwt8UhxvwagCXt RG8jZ9yVbHmz/oZlWgdyytG8dpN+zilnWPdwvHzOrKK+z9cUFtnbh9EiaF6DvYThDq y+nA3s2Jr7OnqG1H9G2arDaiYJ9T+Ocn4v009hMVegWkEyhfV3tBa+fnPnVWJ1bKT9 NTxKKbhG9DIb5b2JYg+QufFs7CUHZN2G28KnkHe3XTX54qxanjx0qe1ihehNmLNt3p OX9W1GxfbYAzQ== From: Michael Ellerman To: Rob Herring , Russell King , James Morse , Catalin Marinas , Will Deacon , Guo Ren , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , x86@kernel.org, Greg Kroah-Hartman Cc: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Rafael J. Wysocki" , Frank Rowand , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 07/12] powerpc: Use of_get_cpu_hwid() In-Reply-To: <20211006164332.1981454-8-robh@kernel.org> References: <20211006164332.1981454-1-robh@kernel.org> <20211006164332.1981454-8-robh@kernel.org> Date: Fri, 08 Oct 2021 22:01:15 +1100 Message-ID: <8735pbok5g.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_040139_384171_8F449781 X-CRM114-Status: GOOD ( 15.88 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rob Herring writes: > Replace open coded parsing of CPU nodes' 'reg' property with > of_get_cpu_hwid(). > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Rob Herring > --- > arch/powerpc/kernel/smp.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c > index 9cc7d3dbf439..d96b0e361a73 100644 > --- a/arch/powerpc/kernel/smp.c > +++ b/arch/powerpc/kernel/smp.c > @@ -1313,18 +1313,13 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) > int cpu_to_core_id(int cpu) > { > struct device_node *np; > - const __be32 *reg; > int id = -1; > > np = of_get_cpu_node(cpu, NULL); > if (!np) > goto out; > > - reg = of_get_property(np, "reg", NULL); > - if (!reg) > - goto out; > - > - id = be32_to_cpup(reg); > + id = of_get_cpu_hwid(np, 0); > out: > of_node_put(np); > return id; This looks OK to me. All the systems I can find have a /cpus/#address-cells of 1, so the change to use of_n_addr_cells() in of_get_cpu_hwid() should be fine. I booted it on a bunch of systems with no issues. Acked-by: Michael Ellerman cheers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel