lkml.org 
[lkml]   [2023]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH V1 1/5] irqchip/loongson-eiointc: Fix returned value on parsing MADT
On Fri, 24 Mar 2023 06:08:50 +0000,
Jianmin Lv <lvjianmin@loongson.cn> wrote:
>
> In pch_pic_parse_madt(), a NULL parent pointer will be
> returned from acpi_get_vec_parent() for second pch-pic domain
> related to second bridge while calling eiointc_acpi_init() at
> first time, where the parent of it has not been initialized
> yet, and will be initialized during second time calling
> eiointc_acpi_init(). So, it's reasonable to return zero so
> that failure of acpi_table_parse_madt() will be avoided, or else
> acpi_cascade_irqdomain_init() will return and initialization of
> followed pch_msi domain will be skipped.
>
> Although it does not matter when pch_msi_parse_madt() returns
> -EINVAL if no invalid parent is found, it's also reasonable to
> return zero for that.
>
> Change-Id: I4d278534999ec3e5c8db6d40155ba2665d9de86f
> Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
> ---
> drivers/irqchip/irq-loongson-eiointc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c
> index d15fd38c1756..62a632d73991 100644
> --- a/drivers/irqchip/irq-loongson-eiointc.c
> +++ b/drivers/irqchip/irq-loongson-eiointc.c
> @@ -343,7 +343,7 @@ static int __init pch_pic_parse_madt(union acpi_subtable_headers *header,
> if (parent)
> return pch_pic_acpi_init(parent, pchpic_entry);
>
> - return -EINVAL;
> + return 0;

Why can't you detect this particular case instead of blindly
suppressing the error?

M.

--
Without deviation from the norm, progress is not possible.

\
 
 \ /
  Last update: 2023-03-27 01:16    [W:0.063 / U:1.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site