* [PATCH] ARM: prima2: return rather than panic on missing DT nodes
@ 2013-05-16 15:50 Rob Herring
2013-05-16 17:00 ` Srinivas KANDAGATLA
0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2013-05-16 15:50 UTC (permalink / raw)
To: linux-arm-kernel
From: Rob Herring <rob.herring@calxeda.com>
Missing nodes is a normal condition in multi-platform kernels when we boot
on other platforms. So remove the panic and just return if we don't find
a DT node.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Barry Song <baohua.song@csr.com>
---
arch/arm/mach-prima2/pm.c | 2 +-
arch/arm/mach-prima2/rstc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c
index 9936c18..a8003e2 100644
--- a/arch/arm/mach-prima2/pm.c
+++ b/arch/arm/mach-prima2/pm.c
@@ -102,7 +102,7 @@ static int __init sirfsoc_of_pwrc_init(void)
np = of_find_matching_node(NULL, pwrc_ids);
if (!np)
- panic("unable to find compatible pwrc node in dtb\n");
+ return -ENODEV;
/*
* pwrc behind rtciobrg is not located in memory space
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index 435019c..6d7d9db 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -29,7 +29,7 @@ static int __init sirfsoc_of_rstc_init(void)
np = of_find_matching_node(NULL, rstc_ids);
if (!np)
- panic("unable to find compatible rstc node in dtb\n");
+ return -ENODEV;
sirfsoc_rstc_base = of_iomap(np, 0);
if (!sirfsoc_rstc_base)
--
1.8.1.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] ARM: prima2: return rather than panic on missing DT nodes
2013-05-16 15:50 [PATCH] ARM: prima2: return rather than panic on missing DT nodes Rob Herring
@ 2013-05-16 17:00 ` Srinivas KANDAGATLA
2013-05-16 20:18 ` Rob Herring
0 siblings, 1 reply; 6+ messages in thread
From: Srinivas KANDAGATLA @ 2013-05-16 17:00 UTC (permalink / raw)
To: linux-arm-kernel
Hi Rob,
I was just testing multi_v7_defconfig and noticed that the code is still
doing early_initcall and postcore_initcalls. Which IMO is NOK for
multiplatforms.
I was just about to send my patch and just noticed your patch.
On 16/05/13 16:50, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
>
> Missing nodes is a normal condition in multi-platform kernels when we boot
> on other platforms. So remove the panic and just return if we don't find
> a DT node.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Barry Song <baohua.song@csr.com>
> ---
> arch/arm/mach-prima2/pm.c | 2 +-
> arch/arm/mach-prima2/rstc.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c
> index 9936c18..a8003e2 100644
> --- a/arch/arm/mach-prima2/pm.c
> +++ b/arch/arm/mach-prima2/pm.c
> @@ -102,7 +102,7 @@ static int __init sirfsoc_of_pwrc_init(void)
>
First thing is the mach code should not even attempt to run this
function in first place.
I think the correct fix for this is to move all the postcore_initcalls
and early_initcalls to callbacks in MACHINE.
Thanks,
srini
> np = of_find_matching_node(NULL, pwrc_ids);
> if (!np)
> - panic("unable to find compatible pwrc node in dtb\n");
> + return -ENODEV;
>
> /*
> * pwrc behind rtciobrg is not located in memory space
> diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
> index 435019c..6d7d9db 100644
> --- a/arch/arm/mach-prima2/rstc.c
> +++ b/arch/arm/mach-prima2/rstc.c
> @@ -29,7 +29,7 @@ static int __init sirfsoc_of_rstc_init(void)
>
> np = of_find_matching_node(NULL, rstc_ids);
> if (!np)
> - panic("unable to find compatible rstc node in dtb\n");
> + return -ENODEV;
>
> sirfsoc_rstc_base = of_iomap(np, 0);
> if (!sirfsoc_rstc_base)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: prima2: return rather than panic on missing DT nodes
2013-05-16 17:00 ` Srinivas KANDAGATLA
@ 2013-05-16 20:18 ` Rob Herring
2013-05-17 0:30 ` Barry Song
2013-05-17 0:31 ` Barry Song
0 siblings, 2 replies; 6+ messages in thread
From: Rob Herring @ 2013-05-16 20:18 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 16, 2013 at 12:00 PM, Srinivas KANDAGATLA
<srinivas.kandagatla@st.com> wrote:
> Hi Rob,
>
> I was just testing multi_v7_defconfig and noticed that the code is still
> doing early_initcall and postcore_initcalls. Which IMO is NOK for
> multiplatforms.
>
> I was just about to send my patch and just noticed your patch.
>
>
> On 16/05/13 16:50, Rob Herring wrote:
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> Missing nodes is a normal condition in multi-platform kernels when we boot
>> on other platforms. So remove the panic and just return if we don't find
>> a DT node.
>>
>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>> Cc: Barry Song <baohua.song@csr.com>
>> ---
>> arch/arm/mach-prima2/pm.c | 2 +-
>> arch/arm/mach-prima2/rstc.c | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c
>> index 9936c18..a8003e2 100644
>> --- a/arch/arm/mach-prima2/pm.c
>> +++ b/arch/arm/mach-prima2/pm.c
>> @@ -102,7 +102,7 @@ static int __init sirfsoc_of_pwrc_init(void)
>>
> First thing is the mach code should not even attempt to run this
> function in first place.
>
> I think the correct fix for this is to move all the postcore_initcalls
> and early_initcalls to callbacks in MACHINE.
Agreed, but that may cause some init ordering issues. So I'll leave
that to someone that knows this platform and can test it.
Rob
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: prima2: return rather than panic on missing DT nodes
2013-05-16 20:18 ` Rob Herring
@ 2013-05-17 0:30 ` Barry Song
2013-05-17 6:35 ` Srinivas KANDAGATLA
2013-05-17 0:31 ` Barry Song
1 sibling, 1 reply; 6+ messages in thread
From: Barry Song @ 2013-05-17 0:30 UTC (permalink / raw)
To: linux-arm-kernel
2013/5/17 Rob Herring <robherring2@gmail.com>:
> On Thu, May 16, 2013 at 12:00 PM, Srinivas KANDAGATLA
> <srinivas.kandagatla@st.com> wrote:
>> Hi Rob,
>>
>> I was just testing multi_v7_defconfig and noticed that the code is still
>> doing early_initcall and postcore_initcalls. Which IMO is NOK for
>> multiplatforms.
>>
>> I was just about to send my patch and just noticed your patch.
>>
>>
>> On 16/05/13 16:50, Rob Herring wrote:
>>> From: Rob Herring <rob.herring@calxeda.com>
>>>
>>> Missing nodes is a normal condition in multi-platform kernels when we boot
>>> on other platforms. So remove the panic and just return if we don't find
>>> a DT node.
>>>
>>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>>> Cc: Barry Song <baohua.song@csr.com>
>>> ---
>>> arch/arm/mach-prima2/pm.c | 2 +-
>>> arch/arm/mach-prima2/rstc.c | 2 +-
>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c
>>> index 9936c18..a8003e2 100644
>>> --- a/arch/arm/mach-prima2/pm.c
>>> +++ b/arch/arm/mach-prima2/pm.c
>>> @@ -102,7 +102,7 @@ static int __init sirfsoc_of_pwrc_init(void)
>>>
>> First thing is the mach code should not even attempt to run this
>> function in first place.
>>
>> I think the correct fix for this is to move all the postcore_initcalls
>> and early_initcalls to callbacks in MACHINE.
>
> Agreed, but that may cause some init ordering issues. So I'll leave
> that to someone that knows this platform and can test it.
what if i really want the system to panic early when these is no pwrc
node? then we can check the machine , if it is sirf, we panic the
kernel. that results in ugly source codes.
np = of_find_matching_node(NULL, pwrc_ids);
if (!np)
- panic("unable to find compatible pwrc node in dtb\n");
+ return -ENODEV;
then it turns out that moving the codes to callbacks of machine is the
right way. i will take care the init ordering issues.
>
> Rob
>
-barry
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: prima2: return rather than panic on missing DT nodes
2013-05-16 20:18 ` Rob Herring
2013-05-17 0:30 ` Barry Song
@ 2013-05-17 0:31 ` Barry Song
1 sibling, 0 replies; 6+ messages in thread
From: Barry Song @ 2013-05-17 0:31 UTC (permalink / raw)
To: linux-arm-kernel
2013/5/17 Rob Herring <robherring2@gmail.com>:
> On Thu, May 16, 2013 at 12:00 PM, Srinivas KANDAGATLA
> <srinivas.kandagatla@st.com> wrote:
>> Hi Rob,
>>
>> I was just testing multi_v7_defconfig and noticed that the code is still
>> doing early_initcall and postcore_initcalls. Which IMO is NOK for
>> multiplatforms.
>>
>> I was just about to send my patch and just noticed your patch.
will you send? i can test.
>>
>>
>> On 16/05/13 16:50, Rob Herring wrote:
>>> From: Rob Herring <rob.herring@calxeda.com>
>>>
>>> Missing nodes is a normal condition in multi-platform kernels when we boot
>>> on other platforms. So remove the panic and just return if we don't find
>>> a DT node.
>>>
>>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>>> Cc: Barry Song <baohua.song@csr.com>
>>> ---
>>> arch/arm/mach-prima2/pm.c | 2 +-
>>> arch/arm/mach-prima2/rstc.c | 2 +-
>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c
>>> index 9936c18..a8003e2 100644
>>> --- a/arch/arm/mach-prima2/pm.c
>>> +++ b/arch/arm/mach-prima2/pm.c
>>> @@ -102,7 +102,7 @@ static int __init sirfsoc_of_pwrc_init(void)
>>>
>> First thing is the mach code should not even attempt to run this
>> function in first place.
>>
>> I think the correct fix for this is to move all the postcore_initcalls
>> and early_initcalls to callbacks in MACHINE.
>
> Agreed, but that may cause some init ordering issues. So I'll leave
> that to someone that knows this platform and can test it.
what if we want the system to keep the behavior of panic when these is
no pwrc node? then we can check the machine , if it is sirf, we panic
the kernel. that results in ugly source codes.
np = of_find_matching_node(NULL, pwrc_ids);
if (!np) {
if (sirf platform)
panic("unable to find compatible pwrc
node in dtb\n");
else
return -ENODEV;
}
it turns out that moving the codes to callbacks of machine is the
right way. i will take care the init ordering issues.
>
> Rob
>
-barry
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: prima2: return rather than panic on missing DT nodes
2013-05-17 0:30 ` Barry Song
@ 2013-05-17 6:35 ` Srinivas KANDAGATLA
0 siblings, 0 replies; 6+ messages in thread
From: Srinivas KANDAGATLA @ 2013-05-17 6:35 UTC (permalink / raw)
To: linux-arm-kernel
On 17/05/13 01:30, Barry Song wrote:
> then it turns out that moving the codes to callbacks of machine is the
> right way. i will take care the init ordering issues.
Not sure if this helps but, I have done a patch for this yesterday to
fix few more issues when booting with multi_v7_defconfig then the one
pointed out by Rob .
--srini
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ARM-prima2-remove-early-and-postcore-initcalls.patch
Type: text/x-patch
Size: 4362 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130517/156c6278/attachment.bin>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-05-17 6:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-16 15:50 [PATCH] ARM: prima2: return rather than panic on missing DT nodes Rob Herring
2013-05-16 17:00 ` Srinivas KANDAGATLA
2013-05-16 20:18 ` Rob Herring
2013-05-17 0:30 ` Barry Song
2013-05-17 6:35 ` Srinivas KANDAGATLA
2013-05-17 0:31 ` Barry Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).