linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] OMAP2: Fix a cpu type check problem.
@ 2010-08-10 12:36 Stanley.Miao
  2010-08-10 14:32 ` Igor Grinberg
  0 siblings, 1 reply; 7+ messages in thread
From: Stanley.Miao @ 2010-08-10 12:36 UTC (permalink / raw)
  To: tony; +Cc: linux-omap

cpu_is_omap3517() and cpu_is_omap3505() are the subgroups of cpu_is_omap34xx(),
so we should check cpu_is_omap3517() and cpu_is_omap3505() first, then check
cpu_is_omap34xx().

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
---
 arch/arm/mach-omap2/clock3xxx_data.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 138646d..dfdce2d 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3417,7 +3417,13 @@ int __init omap3xxx_clk_init(void)
 	struct omap_clk *c;
 	u32 cpu_clkflg = CK_3XXX;
 
-	if (cpu_is_omap34xx()) {
+	if (cpu_is_omap3517()) {
+		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
+		cpu_clkflg |= CK_3517;
+	} else if (cpu_is_omap3505()) {
+		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
+		cpu_clkflg |= CK_3505;
+	} else if (cpu_is_omap34xx()) {
 		cpu_mask = RATE_IN_3XXX;
 		cpu_clkflg |= CK_343X;
 
@@ -3432,12 +3438,6 @@ int __init omap3xxx_clk_init(void)
 			cpu_mask |= RATE_IN_3430ES2PLUS;
 			cpu_clkflg |= CK_3430ES2;
 		}
-	} else if (cpu_is_omap3517()) {
-		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
-		cpu_clkflg |= CK_3517;
-	} else if (cpu_is_omap3505()) {
-		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
-		cpu_clkflg |= CK_3505;
 	}
 
 	if (omap3_has_192mhz_clk())
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] OMAP2: Fix a cpu type check problem.
  2010-08-10 12:36 [PATCH] OMAP2: Fix a cpu type check problem Stanley.Miao
@ 2010-08-10 14:32 ` Igor Grinberg
  2010-08-11  9:20   ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Grinberg @ 2010-08-10 14:32 UTC (permalink / raw)
  To: Stanley.Miao; +Cc: tony, linux-omap

On 08/10/10 15:36, Stanley.Miao wrote:
> cpu_is_omap3517() and cpu_is_omap3505() are the subgroups of cpu_is_omap34xx(),
> so we should check cpu_is_omap3517() and cpu_is_omap3505() first, then check
> cpu_is_omap34xx().
>
> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
>   

Tested-by: Igor Grinberg <grinberg@compulab.co.il>

I've just ran into this yesterday evening.
Having a patch for this on the next day made me :)
Tested on AM3517.

> ---
>  arch/arm/mach-omap2/clock3xxx_data.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
> index 138646d..dfdce2d 100644
> --- a/arch/arm/mach-omap2/clock3xxx_data.c
> +++ b/arch/arm/mach-omap2/clock3xxx_data.c
> @@ -3417,7 +3417,13 @@ int __init omap3xxx_clk_init(void)
>  	struct omap_clk *c;
>  	u32 cpu_clkflg = CK_3XXX;
>  
> -	if (cpu_is_omap34xx()) {
> +	if (cpu_is_omap3517()) {
> +		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> +		cpu_clkflg |= CK_3517;
> +	} else if (cpu_is_omap3505()) {
> +		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> +		cpu_clkflg |= CK_3505;
> +	} else if (cpu_is_omap34xx()) {
>  		cpu_mask = RATE_IN_3XXX;
>  		cpu_clkflg |= CK_343X;
>  
> @@ -3432,12 +3438,6 @@ int __init omap3xxx_clk_init(void)
>  			cpu_mask |= RATE_IN_3430ES2PLUS;
>  			cpu_clkflg |= CK_3430ES2;
>  		}
> -	} else if (cpu_is_omap3517()) {
> -		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> -		cpu_clkflg |= CK_3517;
> -	} else if (cpu_is_omap3505()) {
> -		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> -		cpu_clkflg |= CK_3505;
>  	}
>  
>  	if (omap3_has_192mhz_clk())
>   

-- 
Regards,
Igor.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] OMAP2: Fix a cpu type check problem.
  2010-08-10 14:32 ` Igor Grinberg
@ 2010-08-11  9:20   ` Tony Lindgren
  2010-08-11  9:52     ` Premi, Sanjeev
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2010-08-11  9:20 UTC (permalink / raw)
  To: Igor Grinberg; +Cc: Stanley.Miao, linux-omap

* Igor Grinberg <grinberg@compulab.co.il> [100810 17:25]:
> On 08/10/10 15:36, Stanley.Miao wrote:
> > cpu_is_omap3517() and cpu_is_omap3505() are the subgroups of cpu_is_omap34xx(),
> > so we should check cpu_is_omap3517() and cpu_is_omap3505() first, then check
> > cpu_is_omap34xx().
> >
> > Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> >   
> 
> Tested-by: Igor Grinberg <grinberg@compulab.co.il>
> 
> I've just ran into this yesterday evening.
> Having a patch for this on the next day made me :)
> Tested on AM3517.

Can you please describe what breaks so we can merge this as a fix?

Regards,

Tony
 
> > ---
> >  arch/arm/mach-omap2/clock3xxx_data.c |   14 +++++++-------
> >  1 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
> > index 138646d..dfdce2d 100644
> > --- a/arch/arm/mach-omap2/clock3xxx_data.c
> > +++ b/arch/arm/mach-omap2/clock3xxx_data.c
> > @@ -3417,7 +3417,13 @@ int __init omap3xxx_clk_init(void)
> >  	struct omap_clk *c;
> >  	u32 cpu_clkflg = CK_3XXX;
> >  
> > -	if (cpu_is_omap34xx()) {
> > +	if (cpu_is_omap3517()) {
> > +		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> > +		cpu_clkflg |= CK_3517;
> > +	} else if (cpu_is_omap3505()) {
> > +		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> > +		cpu_clkflg |= CK_3505;
> > +	} else if (cpu_is_omap34xx()) {
> >  		cpu_mask = RATE_IN_3XXX;
> >  		cpu_clkflg |= CK_343X;
> >  
> > @@ -3432,12 +3438,6 @@ int __init omap3xxx_clk_init(void)
> >  			cpu_mask |= RATE_IN_3430ES2PLUS;
> >  			cpu_clkflg |= CK_3430ES2;
> >  		}
> > -	} else if (cpu_is_omap3517()) {
> > -		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> > -		cpu_clkflg |= CK_3517;
> > -	} else if (cpu_is_omap3505()) {
> > -		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> > -		cpu_clkflg |= CK_3505;
> >  	}
> >  
> >  	if (omap3_has_192mhz_clk())
> >   
> 
> -- 
> Regards,
> Igor.
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] OMAP2: Fix a cpu type check problem.
  2010-08-11  9:20   ` Tony Lindgren
@ 2010-08-11  9:52     ` Premi, Sanjeev
  2010-08-11 10:27       ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Premi, Sanjeev @ 2010-08-11  9:52 UTC (permalink / raw)
  To: Tony Lindgren, Igor Grinberg; +Cc: Stanley.Miao, linux-omap@vger.kernel.org

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony Lindgren
> Sent: Wednesday, August 11, 2010 2:50 PM
> To: Igor Grinberg
> Cc: Stanley.Miao; linux-omap@vger.kernel.org
> Subject: Re: [PATCH] OMAP2: Fix a cpu type check problem.
> 
> * Igor Grinberg <grinberg@compulab.co.il> [100810 17:25]:
> > On 08/10/10 15:36, Stanley.Miao wrote:
> > > cpu_is_omap3517() and cpu_is_omap3505() are the subgroups 
> of cpu_is_omap34xx(),
> > > so we should check cpu_is_omap3517() and 
> cpu_is_omap3505() first, then check
> > > cpu_is_omap34xx().
> > >
> > > Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> > >   
> > 
> > Tested-by: Igor Grinberg <grinberg@compulab.co.il>
> > 
> > I've just ran into this yesterday evening.
> > Having a patch for this on the next day made me :)
> > Tested on AM3517.
> 
> Can you please describe what breaks so we can merge this as a fix?
> 

cpu_is_34xx() will be true for all OMAP3 based devices including
AM3517. So, if we want to perform operations specific to AM3517, the
check for AM3517 should be done first else you match for 34xx would
return true; and you wouldn't go far enough to check for am3517.

~sanjeev

> Regards,
> 
> Tony
>  
> > > ---
> > >  arch/arm/mach-omap2/clock3xxx_data.c |   14 +++++++-------
> > >  1 files changed, 7 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
> b/arch/arm/mach-omap2/clock3xxx_data.c
> > > index 138646d..dfdce2d 100644
> > > --- a/arch/arm/mach-omap2/clock3xxx_data.c
> > > +++ b/arch/arm/mach-omap2/clock3xxx_data.c
> > > @@ -3417,7 +3417,13 @@ int __init omap3xxx_clk_init(void)
> > >  	struct omap_clk *c;
> > >  	u32 cpu_clkflg = CK_3XXX;
> > >  
> > > -	if (cpu_is_omap34xx()) {
> > > +	if (cpu_is_omap3517()) {
> > > +		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> > > +		cpu_clkflg |= CK_3517;
> > > +	} else if (cpu_is_omap3505()) {
> > > +		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> > > +		cpu_clkflg |= CK_3505;
> > > +	} else if (cpu_is_omap34xx()) {
> > >  		cpu_mask = RATE_IN_3XXX;
> > >  		cpu_clkflg |= CK_343X;
> > >  
> > > @@ -3432,12 +3438,6 @@ int __init omap3xxx_clk_init(void)
> > >  			cpu_mask |= RATE_IN_3430ES2PLUS;
> > >  			cpu_clkflg |= CK_3430ES2;
> > >  		}
> > > -	} else if (cpu_is_omap3517()) {
> > > -		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> > > -		cpu_clkflg |= CK_3517;
> > > -	} else if (cpu_is_omap3505()) {
> > > -		cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS;
> > > -		cpu_clkflg |= CK_3505;
> > >  	}
> > >  
> > >  	if (omap3_has_192mhz_clk())
> > >   
> > 
> > -- 
> > Regards,
> > Igor.
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe 
> linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] OMAP2: Fix a cpu type check problem.
  2010-08-11  9:52     ` Premi, Sanjeev
@ 2010-08-11 10:27       ` Tony Lindgren
  2010-08-11 11:36         ` Igor Grinberg
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2010-08-11 10:27 UTC (permalink / raw)
  To: Premi, Sanjeev; +Cc: Igor Grinberg, Stanley.Miao, linux-omap@vger.kernel.org

* Premi, Sanjeev <premi@ti.com> [100811 12:45]:
> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org 
> > [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony Lindgren
> > Sent: Wednesday, August 11, 2010 2:50 PM
> > To: Igor Grinberg
> > Cc: Stanley.Miao; linux-omap@vger.kernel.org
> > Subject: Re: [PATCH] OMAP2: Fix a cpu type check problem.
> > 
> > * Igor Grinberg <grinberg@compulab.co.il> [100810 17:25]:
> > > On 08/10/10 15:36, Stanley.Miao wrote:
> > > > cpu_is_omap3517() and cpu_is_omap3505() are the subgroups 
> > of cpu_is_omap34xx(),
> > > > so we should check cpu_is_omap3517() and 
> > cpu_is_omap3505() first, then check
> > > > cpu_is_omap34xx().
> > > >
> > > > Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> > > >   
> > > 
> > > Tested-by: Igor Grinberg <grinberg@compulab.co.il>
> > > 
> > > I've just ran into this yesterday evening.
> > > Having a patch for this on the next day made me :)
> > > Tested on AM3517.
> > 
> > Can you please describe what breaks so we can merge this as a fix?
> > 
> 
> cpu_is_34xx() will be true for all OMAP3 based devices including
> AM3517. So, if we want to perform operations specific to AM3517, the
> check for AM3517 should be done first else you match for 34xx would
> return true; and you wouldn't go far enough to check for am3517.

Understood, but we need some concrete error like "otherwise booting
xyz board fails with non-working USB" or similar.

Tony

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] OMAP2: Fix a cpu type check problem.
  2010-08-11 10:27       ` Tony Lindgren
@ 2010-08-11 11:36         ` Igor Grinberg
  2010-08-12 11:40           ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Grinberg @ 2010-08-11 11:36 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Premi, Sanjeev, Stanley.Miao, linux-omap@vger.kernel.org

On 08/11/10 13:27, Tony Lindgren wrote:
> * Premi, Sanjeev <premi@ti.com> [100811 12:45]:
>   
>>> -----Original Message-----
>>> From: linux-omap-owner@vger.kernel.org 
>>> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony Lindgren
>>> Sent: Wednesday, August 11, 2010 2:50 PM
>>> To: Igor Grinberg
>>> Cc: Stanley.Miao; linux-omap@vger.kernel.org
>>> Subject: Re: [PATCH] OMAP2: Fix a cpu type check problem.
>>>
>>> * Igor Grinberg <grinberg@compulab.co.il> [100810 17:25]:
>>>       
>>>> On 08/10/10 15:36, Stanley.Miao wrote:
>>>>         
>>>>> cpu_is_omap3517() and cpu_is_omap3505() are the subgroups 
>>>>>           
>>> of cpu_is_omap34xx(),
>>>       
>>>>> so we should check cpu_is_omap3517() and 
>>>>>           
>>> cpu_is_omap3505() first, then check
>>>       
>>>>> cpu_is_omap34xx().
>>>>>
>>>>> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
>>>>>   
>>>>>           
>>>> Tested-by: Igor Grinberg <grinberg@compulab.co.il>
>>>>
>>>> I've just ran into this yesterday evening.
>>>> Having a patch for this on the next day made me :)
>>>> Tested on AM3517.
>>>>         
>>> Can you please describe what breaks so we can merge this as a fix?
>>>
>>>       
>> cpu_is_34xx() will be true for all OMAP3 based devices including
>> AM3517. So, if we want to perform operations specific to AM3517, the
>> check for AM3517 should be done first else you match for 34xx would
>> return true; and you wouldn't go far enough to check for am3517.
>>     
> Understood, but we need some concrete error like "otherwise booting
> xyz board fails with non-working USB" or similar.
>   

Otherwise, All AM35XX (Sitara) clocks do not get registered and device
drivers
(ti_hecc, etc...) that depend on those clocks are failing to get the
clock and
end up with non working device.

> Tony
>
>   

-- 
Regards,
Igor.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] OMAP2: Fix a cpu type check problem.
  2010-08-11 11:36         ` Igor Grinberg
@ 2010-08-12 11:40           ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2010-08-12 11:40 UTC (permalink / raw)
  To: Igor Grinberg; +Cc: Premi, Sanjeev, Stanley.Miao, linux-omap@vger.kernel.org

* Igor Grinberg <grinberg@compulab.co.il> [100811 14:29]:
> On 08/11/10 13:27, Tony Lindgren wrote:
> > * Premi, Sanjeev <premi@ti.com> [100811 12:45]:
> >   
> >>> -----Original Message-----
> >>> From: linux-omap-owner@vger.kernel.org 
> >>> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Tony Lindgren
> >>> Sent: Wednesday, August 11, 2010 2:50 PM
> >>> To: Igor Grinberg
> >>> Cc: Stanley.Miao; linux-omap@vger.kernel.org
> >>> Subject: Re: [PATCH] OMAP2: Fix a cpu type check problem.
> >>>
> >>> * Igor Grinberg <grinberg@compulab.co.il> [100810 17:25]:
> >>>       
> >>>> On 08/10/10 15:36, Stanley.Miao wrote:
> >>>>         
> >>>>> cpu_is_omap3517() and cpu_is_omap3505() are the subgroups 
> >>>>>           
> >>> of cpu_is_omap34xx(),
> >>>       
> >>>>> so we should check cpu_is_omap3517() and 
> >>>>>           
> >>> cpu_is_omap3505() first, then check
> >>>       
> >>>>> cpu_is_omap34xx().
> >>>>>
> >>>>> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> >>>>>   
> >>>>>           
> >>>> Tested-by: Igor Grinberg <grinberg@compulab.co.il>
> >>>>
> >>>> I've just ran into this yesterday evening.
> >>>> Having a patch for this on the next day made me :)
> >>>> Tested on AM3517.
> >>>>         
> >>> Can you please describe what breaks so we can merge this as a fix?
> >>>
> >>>       
> >> cpu_is_34xx() will be true for all OMAP3 based devices including
> >> AM3517. So, if we want to perform operations specific to AM3517, the
> >> check for AM3517 should be done first else you match for 34xx would
> >> return true; and you wouldn't go far enough to check for am3517.
> >>     
> > Understood, but we need some concrete error like "otherwise booting
> > xyz board fails with non-working USB" or similar.
> >   
> 
> Otherwise, All AM35XX (Sitara) clocks do not get registered and device
> drivers
> (ti_hecc, etc...) that depend on those clocks are failing to get the
> clock and
> end up with non working device.

Thanks, adding to omap-fixes with updated description.

Tony

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-08-12 11:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10 12:36 [PATCH] OMAP2: Fix a cpu type check problem Stanley.Miao
2010-08-10 14:32 ` Igor Grinberg
2010-08-11  9:20   ` Tony Lindgren
2010-08-11  9:52     ` Premi, Sanjeev
2010-08-11 10:27       ` Tony Lindgren
2010-08-11 11:36         ` Igor Grinberg
2010-08-12 11:40           ` 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).