All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: mxs: fix clock base address missing
  2011-01-26 22:26 [PATCH] ARM: mxs: fix clock base address missing Shawn Guo
@ 2011-01-26 15:58 ` Sascha Hauer
  2011-01-27 23:19   ` Shawn Guo
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2011-01-26 15:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 27, 2011 at 06:26:36AM +0800, Shawn Guo wrote:
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
>  arch/arm/mach-mxs/clock-mx23.c |    2 +-
>  arch/arm/mach-mxs/clock-mx28.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
> index b1a362e..a0296a4 100644
> --- a/arch/arm/mach-mxs/clock-mx23.c
> +++ b/arch/arm/mach-mxs/clock-mx23.c
> @@ -347,7 +347,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent)	\
>  {									\
>  	if (parent != clk->parent) {					\
>  		__raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit,		\
> -			 HW_CLKCTRL_CLKSEQ_TOG);			\
> +			 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG);	\
>  		clk->parent = parent;					\
>  	}								\
>  									\

While at it you could also add some parameter checking to this function.
Implemented like this it behaves rather randomly.

Sascha

> diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
> index 56312c0..44c1754 100644
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -483,7 +483,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent)	\
>  {									\
>  	if (parent != clk->parent) {					\
>  		__raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit,		\
> -			 HW_CLKCTRL_CLKSEQ_TOG);			\
> +			 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG);	\
>  		clk->parent = parent;					\
>  	}								\
>  									\
> -- 
> 1.7.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH] ARM: mxs: fix clock base address missing
@ 2011-01-26 22:26 Shawn Guo
  2011-01-26 15:58 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Shawn Guo @ 2011-01-26 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
 arch/arm/mach-mxs/clock-mx23.c |    2 +-
 arch/arm/mach-mxs/clock-mx28.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
index b1a362e..a0296a4 100644
--- a/arch/arm/mach-mxs/clock-mx23.c
+++ b/arch/arm/mach-mxs/clock-mx23.c
@@ -347,7 +347,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent)	\
 {									\
 	if (parent != clk->parent) {					\
 		__raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit,		\
-			 HW_CLKCTRL_CLKSEQ_TOG);			\
+			 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG);	\
 		clk->parent = parent;					\
 	}								\
 									\
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 56312c0..44c1754 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -483,7 +483,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent)	\
 {									\
 	if (parent != clk->parent) {					\
 		__raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit,		\
-			 HW_CLKCTRL_CLKSEQ_TOG);			\
+			 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG);	\
 		clk->parent = parent;					\
 	}								\
 									\
-- 
1.7.1

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

* [PATCH] ARM: mxs: fix clock base address missing
  2011-01-27 23:19   ` Shawn Guo
@ 2011-01-27 15:31     ` Sascha Hauer
  2011-01-28 21:32       ` Shawn Guo
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2011-01-27 15:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 28, 2011 at 07:19:30AM +0800, Shawn Guo wrote:
> On Wed, Jan 26, 2011 at 04:58:58PM +0100, Sascha Hauer wrote:
> > On Thu, Jan 27, 2011 at 06:26:36AM +0800, Shawn Guo wrote:
> > > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > > ---
> > >  arch/arm/mach-mxs/clock-mx23.c |    2 +-
> > >  arch/arm/mach-mxs/clock-mx28.c |    2 +-
> > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
> > > index b1a362e..a0296a4 100644
> > > --- a/arch/arm/mach-mxs/clock-mx23.c
> > > +++ b/arch/arm/mach-mxs/clock-mx23.c
> > > @@ -347,7 +347,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent)	\
> > >  {									\
> > >  	if (parent != clk->parent) {					\
> > >  		__raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit,		\
> > > -			 HW_CLKCTRL_CLKSEQ_TOG);			\
> > > +			 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG);	\
> > >  		clk->parent = parent;					\
> > >  	}								\
> > >  									\
> > 
> > While at it you could also add some parameter checking to this function.
> > Implemented like this it behaves rather randomly.
> > 
> The parameters have been well checked by clk_set_parent().  What
> kind of extra checking are you expecting?

clk_set_parent checks whether valid clocks are passed as arguments, but
not whether parent is a valid parent for this particular clock.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH] ARM: mxs: fix clock base address missing
  2011-01-26 15:58 ` Sascha Hauer
@ 2011-01-27 23:19   ` Shawn Guo
  2011-01-27 15:31     ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Shawn Guo @ 2011-01-27 23:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 26, 2011 at 04:58:58PM +0100, Sascha Hauer wrote:
> On Thu, Jan 27, 2011 at 06:26:36AM +0800, Shawn Guo wrote:
> > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > ---
> >  arch/arm/mach-mxs/clock-mx23.c |    2 +-
> >  arch/arm/mach-mxs/clock-mx28.c |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
> > index b1a362e..a0296a4 100644
> > --- a/arch/arm/mach-mxs/clock-mx23.c
> > +++ b/arch/arm/mach-mxs/clock-mx23.c
> > @@ -347,7 +347,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent)	\
> >  {									\
> >  	if (parent != clk->parent) {					\
> >  		__raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit,		\
> > -			 HW_CLKCTRL_CLKSEQ_TOG);			\
> > +			 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG);	\
> >  		clk->parent = parent;					\
> >  	}								\
> >  									\
> 
> While at it you could also add some parameter checking to this function.
> Implemented like this it behaves rather randomly.
> 
The parameters have been well checked by clk_set_parent().  What
kind of extra checking are you expecting?

Regards,
Shawn

> Sascha
> 
> > diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
> > index 56312c0..44c1754 100644
> > --- a/arch/arm/mach-mxs/clock-mx28.c
> > +++ b/arch/arm/mach-mxs/clock-mx28.c
> > @@ -483,7 +483,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent)	\
> >  {									\
> >  	if (parent != clk->parent) {					\
> >  		__raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit,		\
> > -			 HW_CLKCTRL_CLKSEQ_TOG);			\
> > +			 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG);	\
> >  		clk->parent = parent;					\
> >  	}								\
> >  									\
> > -- 
> > 1.7.1
> > 
> > 
> > 
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

* [PATCH] ARM: mxs: fix clock base address missing
  2011-01-27 15:31     ` Sascha Hauer
@ 2011-01-28 21:32       ` Shawn Guo
  0 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2011-01-28 21:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 27, 2011 at 04:31:24PM +0100, Sascha Hauer wrote:
> On Fri, Jan 28, 2011 at 07:19:30AM +0800, Shawn Guo wrote:
> > On Wed, Jan 26, 2011 at 04:58:58PM +0100, Sascha Hauer wrote:
> > > On Thu, Jan 27, 2011 at 06:26:36AM +0800, Shawn Guo wrote:
> > > > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > > > ---
> > > >  arch/arm/mach-mxs/clock-mx23.c |    2 +-
> > > >  arch/arm/mach-mxs/clock-mx28.c |    2 +-
> > > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
> > > > index b1a362e..a0296a4 100644
> > > > --- a/arch/arm/mach-mxs/clock-mx23.c
> > > > +++ b/arch/arm/mach-mxs/clock-mx23.c
> > > > @@ -347,7 +347,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent)	\
> > > >  {									\
> > > >  	if (parent != clk->parent) {					\
> > > >  		__raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit,		\
> > > > -			 HW_CLKCTRL_CLKSEQ_TOG);			\
> > > > +			 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG);	\
> > > >  		clk->parent = parent;					\
> > > >  	}								\
> > > >  									\
> > > 
> > > While at it you could also add some parameter checking to this function.
> > > Implemented like this it behaves rather randomly.
> > > 
> > The parameters have been well checked by clk_set_parent().  What
> > kind of extra checking are you expecting?
> 
> clk_set_parent checks whether valid clocks are passed as arguments, but
> not whether parent is a valid parent for this particular clock.
> 
OK. I will address it in another patch, as it's a different subject.

Regards,
Shawn

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

end of thread, other threads:[~2011-01-28 21:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26 22:26 [PATCH] ARM: mxs: fix clock base address missing Shawn Guo
2011-01-26 15:58 ` Sascha Hauer
2011-01-27 23:19   ` Shawn Guo
2011-01-27 15:31     ` Sascha Hauer
2011-01-28 21:32       ` Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.