* [PATCH] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list
@ 2011-10-06 20:39 Paul Walmsley
2011-10-06 20:43 ` Tony Lindgren
2011-10-06 22:35 ` Russell King - ARM Linux
0 siblings, 2 replies; 6+ messages in thread
From: Paul Walmsley @ 2011-10-06 20:39 UTC (permalink / raw)
To: linux-arm-kernel
Commit d6504acd2125984c61dce24727dd3842d0144015 ("OMAP2+: hwmod:
remove OMAP_CHIP*") tests the inverse condition of what it should be
testing for the return value from omap_hwmod_register(). This causes
several IP blocks to not be registered on several OMAP3 family devices.
Fixing that bug also unmasked another bug, originally reported by
Chase Maupin <chase.maupin@ti.com> and then subsequently by Abhilash K
V <abhilash.kv@ti.com>, which caused SmartReflex IP blocks to be
registered on SoCs that don't support them.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Chase Maupin <chase.maupin@ti.com>
Cc: Abhilash K V <abhilash.kv@ti.com>
---
This fixes a pretty embarrassing "brown paper bag" bug of mine in one of
the cleanup patches. Tony, it would be good if you could send this to
Arnd ASAP and merge into your cleanup branch. Tested on 3430SDP, 37XX
EVM, and OMAP3503.
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index ab35acb..53b6706 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -13,6 +13,8 @@
*
* XXX these should be marked initdata for multi-OMAP kernels
*/
+#include <linux/err.h>
+
#include <plat/omap_hwmod.h>
#include <mach/irqs.h>
#include <plat/cpu.h>
@@ -3161,8 +3163,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
&omap3xxx_i2c1_hwmod,
&omap3xxx_i2c2_hwmod,
&omap3xxx_i2c3_hwmod,
- &omap34xx_sr1_hwmod,
- &omap34xx_sr2_hwmod,
/* gpio class */
&omap3xxx_gpio1_hwmod,
@@ -3240,7 +3240,7 @@ int __init omap3xxx_hwmod_init(void)
/* Register hwmods common to all OMAP3 */
r = omap_hwmod_register(omap3xxx_hwmods);
- if (!r)
+ if (IS_ERR_VALUE(r))
return r;
rev = omap_rev();
@@ -3265,7 +3265,7 @@ int __init omap3xxx_hwmod_init(void)
};
r = omap_hwmod_register(h);
- if (!r)
+ if (IS_ERR_VALUE(r))
return r;
/*
--
1.7.6.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list
2011-10-06 20:39 [PATCH] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list Paul Walmsley
@ 2011-10-06 20:43 ` Tony Lindgren
2011-10-06 22:35 ` Russell King - ARM Linux
1 sibling, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2011-10-06 20:43 UTC (permalink / raw)
To: linux-arm-kernel
* Paul Walmsley <paul@pwsan.com> [111006 13:05]:
>
> Commit d6504acd2125984c61dce24727dd3842d0144015 ("OMAP2+: hwmod:
> remove OMAP_CHIP*") tests the inverse condition of what it should be
> testing for the return value from omap_hwmod_register(). This causes
> several IP blocks to not be registered on several OMAP3 family devices.
>
> Fixing that bug also unmasked another bug, originally reported by
> Chase Maupin <chase.maupin@ti.com> and then subsequently by Abhilash K
> V <abhilash.kv@ti.com>, which caused SmartReflex IP blocks to be
> registered on SoCs that don't support them.
>
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Chase Maupin <chase.maupin@ti.com>
> Cc: Abhilash K V <abhilash.kv@ti.com>
> ---
>
> This fixes a pretty embarrassing "brown paper bag" bug of mine in one of
> the cleanup patches. Tony, it would be good if you could send this to
> Arnd ASAP and merge into your cleanup branch. Tested on 3430SDP, 37XX
> EVM, and OMAP3503.
OK thanks, applying into fixes-part2 branch.
Regards,
Tony
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list
2011-10-06 20:39 [PATCH] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list Paul Walmsley
2011-10-06 20:43 ` Tony Lindgren
@ 2011-10-06 22:35 ` Russell King - ARM Linux
2011-10-06 23:19 ` Paul Walmsley
2011-10-06 23:24 ` [PATCH v2] " Paul Walmsley
1 sibling, 2 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-10-06 22:35 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Oct 06, 2011 at 02:39:28PM -0600, Paul Walmsley wrote:
> @@ -3240,7 +3240,7 @@ int __init omap3xxx_hwmod_init(void)
>
> /* Register hwmods common to all OMAP3 */
> r = omap_hwmod_register(omap3xxx_hwmods);
> - if (!r)
> + if (IS_ERR_VALUE(r))
> return r;
>
> rev = omap_rev();
> @@ -3265,7 +3265,7 @@ int __init omap3xxx_hwmod_init(void)
> };
>
> r = omap_hwmod_register(h);
> - if (!r)
> + if (IS_ERR_VALUE(r))
> return r;
What _really_ is the return value meaning of omap_hwmod_register() ?
If it's zero for success, negative for error codes, then don't be
clever and try to use IS_ERR_VALUE() for that - just use a standard
< 0 test instead.
You only need to use IS_ERR_VALUE() for stuff that may return negative
errno values _and_ which may return valid addresses which may be
misinterpreted as negative numbers.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list
2011-10-06 22:35 ` Russell King - ARM Linux
@ 2011-10-06 23:19 ` Paul Walmsley
2011-10-06 23:24 ` [PATCH v2] " Paul Walmsley
1 sibling, 0 replies; 6+ messages in thread
From: Paul Walmsley @ 2011-10-06 23:19 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 6 Oct 2011, Russell King - ARM Linux wrote:
> On Thu, Oct 06, 2011 at 02:39:28PM -0600, Paul Walmsley wrote:
> > @@ -3240,7 +3240,7 @@ int __init omap3xxx_hwmod_init(void)
> >
> > /* Register hwmods common to all OMAP3 */
> > r = omap_hwmod_register(omap3xxx_hwmods);
> > - if (!r)
> > + if (IS_ERR_VALUE(r))
> > return r;
> >
> > rev = omap_rev();
> > @@ -3265,7 +3265,7 @@ int __init omap3xxx_hwmod_init(void)
> > };
> >
> > r = omap_hwmod_register(h);
> > - if (!r)
> > + if (IS_ERR_VALUE(r))
> > return r;
>
> What _really_ is the return value meaning of omap_hwmod_register() ?
>
> If it's zero for success, negative for error codes, then don't be
> clever and try to use IS_ERR_VALUE() for that - just use a standard
> < 0 test instead.
>
> You only need to use IS_ERR_VALUE() for stuff that may return negative
> errno values _and_ which may return valid addresses which may be
> misinterpreted as negative numbers.
Thanks, that's a good point - fixed.
- Paul
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list
2011-10-06 22:35 ` Russell King - ARM Linux
2011-10-06 23:19 ` Paul Walmsley
@ 2011-10-06 23:24 ` Paul Walmsley
2011-10-06 23:29 ` Tony Lindgren
1 sibling, 1 reply; 6+ messages in thread
From: Paul Walmsley @ 2011-10-06 23:24 UTC (permalink / raw)
To: linux-arm-kernel
Commit d6504acd2125984c61dce24727dd3842d0144015 ("OMAP2+: hwmod:
remove OMAP_CHIP*") tests the inverse condition of what it should be
testing for the return value from omap_hwmod_register(). This causes
several IP blocks to not be registered on several OMAP3 family devices.
Fixing that bug also unmasked another bug, originally reported by
Chase Maupin <chase.maupin@ti.com> and then subsequently by Abhilash K
V <abhilash.kv@ti.com>, which caused SmartReflex IP blocks to be
registered on SoCs that don't support them.
Thanks to Russell King - ARM Linux <linux@arm.linux.org.uk> for comments
on a previous version of the patch.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Chase Maupin <chase.maupin@ti.com>
Cc: Abhilash K V <abhilash.kv@ti.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
---
This version incorporates some comments from RMK.
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index ab35acb..0771dc6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3161,8 +3161,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
&omap3xxx_i2c1_hwmod,
&omap3xxx_i2c2_hwmod,
&omap3xxx_i2c3_hwmod,
- &omap34xx_sr1_hwmod,
- &omap34xx_sr2_hwmod,
/* gpio class */
&omap3xxx_gpio1_hwmod,
@@ -3240,7 +3238,7 @@ int __init omap3xxx_hwmod_init(void)
/* Register hwmods common to all OMAP3 */
r = omap_hwmod_register(omap3xxx_hwmods);
- if (!r)
+ if (r < 0)
return r;
rev = omap_rev();
@@ -3265,7 +3263,7 @@ int __init omap3xxx_hwmod_init(void)
};
r = omap_hwmod_register(h);
- if (!r)
+ if (r < 0)
return r;
/*
--
1.7.6.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list
2011-10-06 23:24 ` [PATCH v2] " Paul Walmsley
@ 2011-10-06 23:29 ` Tony Lindgren
0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2011-10-06 23:29 UTC (permalink / raw)
To: linux-arm-kernel
* Paul Walmsley <paul@pwsan.com> [111006 15:50]:
>
> Commit d6504acd2125984c61dce24727dd3842d0144015 ("OMAP2+: hwmod:
> remove OMAP_CHIP*") tests the inverse condition of what it should be
> testing for the return value from omap_hwmod_register(). This causes
> several IP blocks to not be registered on several OMAP3 family devices.
>
> Fixing that bug also unmasked another bug, originally reported by
> Chase Maupin <chase.maupin@ti.com> and then subsequently by Abhilash K
> V <abhilash.kv@ti.com>, which caused SmartReflex IP blocks to be
> registered on SoCs that don't support them.
>
> Thanks to Russell King - ARM Linux <linux@arm.linux.org.uk> for comments
> on a previous version of the patch.
>
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Chase Maupin <chase.maupin@ti.com>
> Cc: Abhilash K V <abhilash.kv@ti.com>
> Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
> ---
>
> This version incorporates some comments from RMK.
Thanks, updating in fixes-part2.
Tony
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-06 23:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 20:39 [PATCH] ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list Paul Walmsley
2011-10-06 20:43 ` Tony Lindgren
2011-10-06 22:35 ` Russell King - ARM Linux
2011-10-06 23:19 ` Paul Walmsley
2011-10-06 23:24 ` [PATCH v2] " Paul Walmsley
2011-10-06 23:29 ` Tony Lindgren
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).