ARM: prima2: return rather than panic on missing DT nodes
Subsystems (2)
PATCH 1/1 ARM: prima2: return rather than panic on missing DT nodes
From: Rob Herring <[email protected]>
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.
--- arch/arm/mach-prima2/pm.c | 2 +- arch/arm/mach-prima2/rstc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-prima2/pm.c +1 -1
@@ -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
arch/arm/mach-prima2/rstc.c +1 -1
@@ -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)
Signature · 1 line
1.8.1.2
PATCH 1/1 ARM: prima2: return rather than panic on missing DT nodes
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.
Quoted 18 lines · Rob Herring
From: Rob Herring <[email protected]>
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 <[email protected]>Cc Barry Song <[email protected]>--- arch/arm/mach-prima2/pm.c | 2 +- arch/arm/mach-prima2/rstc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-prima2/pm.c +0
-0
arch/arm/mach-prima2/pm.c static int __init sirfsoc_of_pwrc_init(void) · line 102
Quoted 1 line
arch/arm/mach-prima2/pm.c +0
-0@@ -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
Quoted 21 lines
arch/arm/mach-prima2/pm.c +1
-1np =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 arch/arm/mach-prima2/rstc.c +1
-1@@ -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)
PATCH 1/1 ARM: prima2: return rather than panic on missing DT nodes
Quoted 32 lines · Srinivas KANDAGATLA
Hi Rob,
I was just testing
multi_v7_defconfigand noticed that the code is still doingearly_initcallandpostcore_initcalls. Which IMO is NOK for multiplatforms.I was just about to send my patch and just noticed your patch.
Quoted 18 lines · Rob Herring
From: Rob Herring <[email protected]>
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 <[email protected]>Cc Barry Song <[email protected]>--- arch/arm/mach-prima2/pm.c | 2 +- arch/arm/mach-prima2/rstc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-prima2/pm.c +0
-0arch/arm/mach-prima2/pm.c static int __init sirfsoc_of_pwrc_init(void) · line 102
Quoted 1 line
arch/arm/mach-prima2/pm.c +0
-0@@ -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.
Quoted 2 lines
I think the correct fix for this is to move all the
postcore_initcallsandearly_initcallsto 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
PATCH 1/1 ARM: prima2: return rather than panic on missing DT nodes
2013/5/17 Rob Herring <[email protected]>:
Quoted 34 lines
Quoted 32 lines · Srinivas KANDAGATLA
Hi Rob,
I was just testing
multi_v7_defconfigand noticed that the code is still doingearly_initcallandpostcore_initcalls. Which IMO is NOK for multiplatforms.I was just about to send my patch and just noticed your patch.
Quoted 18 lines · Rob Herring
From: Rob Herring <[email protected]>
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 <[email protected]>Cc Barry Song <[email protected]>--- arch/arm/mach-prima2/pm.c | 2 +- arch/arm/mach-prima2/rstc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-prima2/pm.c +0
-0arch/arm/mach-prima2/pm.c static int __init sirfsoc_of_pwrc_init(void) · line 102
Quoted 1 line
arch/arm/mach-prima2/pm.c +0
-0@@ -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.
Quoted 5 lines
Quoted 2 lines
I think the correct fix for this is to move all the
postcore_initcallsandearly_initcallsto 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.
Quoted 3 lines
Rob
-barry
PATCH 1/1 ARM: prima2: return rather than panic on missing DT nodes
Quoted 2 lines · Barry Song
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>
PATCH 1/1 ARM: prima2: return rather than panic on missing DT nodes
In reply to Rob Herring2013/5/17 Rob Herring <[email protected]>:
Quoted 9 lines
Quoted 7 lines · Srinivas KANDAGATLA
Hi Rob,
I was just testing
multi_v7_defconfigand noticed that the code is still doingearly_initcallandpostcore_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.
Quoted 25 lines
Quoted 25 lines · Rob Herring
Quoted 18 lines
From: Rob Herring <[email protected]>
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 <[email protected]>Cc Barry Song <[email protected]>--- arch/arm/mach-prima2/pm.c | 2 +- arch/arm/mach-prima2/rstc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-prima2/pm.c +0
-0arch/arm/mach-prima2/pm.c static int __init sirfsoc_of_pwrc_init(void) · line 102
Quoted 1 line
arch/arm/mach-prima2/pm.c +0
-0@@ -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.
Quoted 5 lines
Quoted 2 lines
I think the correct fix for this is to move all the
postcore_initcallsandearly_initcallsto 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.
Quoted 3 lines
Rob
-barry