[PATCH v5 11/31] powernv/fadump: add fadump support on powernv
Hari Bathini
hbathini at linux.ibm.com
Thu Sep 5 00:33:14 AEST 2019
On 03/09/19 10:01 PM, Hari Bathini wrote:
>
[...]
>>> diff --git a/arch/powerpc/kernel/fadump-common.h b/arch/powerpc/kernel/fadump-common.h
>>> index d2c5b16..f6c52d3 100644
>>> --- a/arch/powerpc/kernel/fadump-common.h
>>> +++ b/arch/powerpc/kernel/fadump-common.h
>>> @@ -140,4 +140,13 @@ static inline int rtas_fadump_dt_scan(struct fw_dump *fadump_config, ulong node)
>>> }
>>> #endif
>>>
>>> +#ifdef CONFIG_PPC_POWERNV
>>> +extern int opal_fadump_dt_scan(struct fw_dump *fadump_config, ulong node);
>>> +#else
>>> +static inline int opal_fadump_dt_scan(struct fw_dump *fadump_config, ulong node)
>>> +{
>>> + return 1;
>>> +}
>>
>> Extending the strange flat device tree calling convention to these
>> functions is not ideal.
>>
>> It would be better I think if they just returned bool true/false for
>> "found it" / "not found", and then early_init_dt_scan_fw_dump() can
>> convert that into the appropriate return value.
>>
>>> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
>>> index f7c8073..b8061fb9 100644
>>> --- a/arch/powerpc/kernel/fadump.c
>>> +++ b/arch/powerpc/kernel/fadump.c
>>> @@ -114,6 +114,9 @@ int __init early_init_dt_scan_fw_dump(unsigned long node, const char *uname,
>>> if (strcmp(uname, "rtas") == 0)
>>> return rtas_fadump_dt_scan(&fw_dump, node);
>>>
>>> + if (strcmp(uname, "ibm,opal") == 0)
>>> + return opal_fadump_dt_scan(&fw_dump, node);
>>> +
>>
>> ie this would become:
>>
>> if (strcmp(uname, "ibm,opal") == 0 && opal_fadump_dt_scan(&fw_dump, node))
>> return 1;
>>
>
> Yeah. Will update accordingly...
On second thoughts, we don't need a return type at all here. fw_dump struct and callbacks are
populated based on what we found in the DT. And irrespective of what we found in DT, we got
to return `1` once the particular depth and node is processed..
- Hari
More information about the Linuxppc-dev
mailing list