[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhSdy05324s1RtBM73v5irR9-c5gU0T6W=UA4chVCgEwvR-yA@mail.gmail.com>
Date: Tue, 8 Jan 2019 17:19:00 +0530
From: Anup Patel <anup@...infault.org>
To: Atish Patra <atish.patra@....com>
Cc: linux-riscv@...ts.infradead.org, Alan Kao <alankao@...estech.com>,
Albert Ou <aou@...s.berkeley.edu>,
Andreas Schwab <schwab@...e.de>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Dmitriy Cherkasov <dmitriy@...-tech.org>,
Jason Cooper <jason@...edaemon.net>,
"linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>,
Marc Zyngier <marc.zyngier@....com>,
Michael Clark <michaeljclark@....com>,
Palmer Dabbelt <palmer@...ive.com>,
Patrick Stählin <me@...ki.ch>,
Thomas Gleixner <tglx@...utronix.de>,
Zong Li <zongbox@...il.com>
Subject: Re: [PATCH v2 4/8] RISC-V: Allow hartid-to-cpuid function to fail.
On Tue, Jan 8, 2019 at 3:08 PM Atish Patra <atish.patra@....com> wrote:
>
> It is perfectly okay to call riscv_hartid_to_cpuid for a
> hartid that is not mapped with an CPU id. It can happen
> if the calling functions retrieves the hartid from DT.
> However, that hartid was never brought online by the firmware
> or kernel for any reasons.
>
> No need to BUG() in the above case. A negative error return
> is sufficient and the calling function should check for the
> return value always.
>
> Signed-off-by: Atish Patra <atish.patra@....com>
> ---
> arch/riscv/kernel/smp.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
> index e407bd4f..ce9a2e73 100644
> --- a/arch/riscv/kernel/smp.c
> +++ b/arch/riscv/kernel/smp.c
> @@ -58,7 +58,6 @@ int riscv_hartid_to_cpuid(int hartid)
> return i;
>
> pr_err("Couldn't find cpu id for hartid [%d]\n", hartid);
> - BUG();
> return i;
> }
>
> --
> 2.7.4
>
Looks good to me.
Reviewed-by: Anup Patel <anup@...infault.org>
Regards,
Anup
Powered by blists - more mailing lists