linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* i.MX28 fixes
@ 2011-01-21 10:57 Sascha Hauer
  2011-01-21 10:57 ` [PATCH 1/3] ARM i.MX28: fix bit operation Sascha Hauer
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Sascha Hauer @ 2011-01-21 10:57 UTC (permalink / raw)
  To: linux-arm-kernel

The following patches fix some issues with the i.MX28 clock support.

The following changes since commit c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470:

  Linux 2.6.38-rc1 (2011-01-18 15:14:02 -0800)

are available in the git repository at:
  none ..BRANCH.NOT.VERIFIED..

Sascha Hauer (3):
      ARM i.MX28: fix bit operation
      ARM i.MX28: use correct register for setting the rate
      ARM i.MX23/28: remove secondary field from struct clk. It's unused

 arch/arm/mach-mxs/clock-mx28.c         |    4 ++--
 arch/arm/mach-mxs/clock.c              |    2 --
 arch/arm/mach-mxs/include/mach/clock.h |    2 --
 3 files changed, 2 insertions(+), 6 deletions(-)

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

* [PATCH 1/3] ARM i.MX28: fix bit operation
  2011-01-21 10:57 i.MX28 fixes Sascha Hauer
@ 2011-01-21 10:57 ` Sascha Hauer
  2011-01-24  9:29   ` Shawn Guo
  2011-01-21 10:57 ` [PATCH 2/3] ARM i.MX28: use correct register for setting the rate Sascha Hauer
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Sascha Hauer @ 2011-01-21 10:57 UTC (permalink / raw)
  To: linux-arm-kernel

reg | (1 << clk->enable_shift) always evaluates to true. Switch it
to & which makes much more sense

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mxs/clock-mx28.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 56312c0..4146b38 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -355,7 +355,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate)		\
 	} else {							\
 		reg &= ~BM_CLKCTRL_##dr##_DIV;				\
 		reg |= div << BP_CLKCTRL_##dr##_DIV;			\
-		if (reg | (1 << clk->enable_shift)) {			\
+		if (reg & (1 << clk->enable_shift)) {			\
 			pr_err("%s: clock is gated\n", __func__);	\
 			return -EINVAL;					\
 		}							\
-- 
1.7.2.3

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

* [PATCH 2/3] ARM i.MX28: use correct register for setting the rate
  2011-01-21 10:57 i.MX28 fixes Sascha Hauer
  2011-01-21 10:57 ` [PATCH 1/3] ARM i.MX28: fix bit operation Sascha Hauer
@ 2011-01-21 10:57 ` Sascha Hauer
  2011-01-21 10:57 ` [PATCH 3/3] ARM i.MX23/28: remove secondary field from struct clk. It's unused Sascha Hauer
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2011-01-21 10:57 UTC (permalink / raw)
  To: linux-arm-kernel

_CLK_SET_RATE does not only handle the cpu clock but also other
clocks, so do not hardcode the HW_CLKCTRL_CPU register.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mxs/clock-mx28.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 4146b38..44acd9c 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -360,7 +360,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate)		\
 			return -EINVAL;					\
 		}							\
 	}								\
-	__raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU);		\
+	__raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr);		\
 									\
 	for (i = 10000; i; i--)						\
 		if (!(__raw_readl(CLKCTRL_BASE_ADDR +			\
-- 
1.7.2.3

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

* [PATCH 3/3] ARM i.MX23/28: remove secondary field from struct clk. It's unused
  2011-01-21 10:57 i.MX28 fixes Sascha Hauer
  2011-01-21 10:57 ` [PATCH 1/3] ARM i.MX28: fix bit operation Sascha Hauer
  2011-01-21 10:57 ` [PATCH 2/3] ARM i.MX28: use correct register for setting the rate Sascha Hauer
@ 2011-01-21 10:57 ` Sascha Hauer
  2011-01-21 12:26 ` i.MX28 fixes Sergei Shtylyov
  2011-01-24  9:16 ` Shawn Guo
  4 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2011-01-21 10:57 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mxs/clock.c              |    2 --
 arch/arm/mach-mxs/include/mach/clock.h |    2 --
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-mxs/clock.c b/arch/arm/mach-mxs/clock.c
index e7d2269..a7093c8 100644
--- a/arch/arm/mach-mxs/clock.c
+++ b/arch/arm/mach-mxs/clock.c
@@ -57,7 +57,6 @@ static void __clk_disable(struct clk *clk)
 		if (clk->disable)
 			clk->disable(clk);
 		__clk_disable(clk->parent);
-		__clk_disable(clk->secondary);
 	}
 }
 
@@ -68,7 +67,6 @@ static int __clk_enable(struct clk *clk)
 
 	if (clk->usecount++ == 0) {
 		__clk_enable(clk->parent);
-		__clk_enable(clk->secondary);
 
 		if (clk->enable)
 			clk->enable(clk);
diff --git a/arch/arm/mach-mxs/include/mach/clock.h b/arch/arm/mach-mxs/include/mach/clock.h
index 041e276..592c9ab 100644
--- a/arch/arm/mach-mxs/include/mach/clock.h
+++ b/arch/arm/mach-mxs/include/mach/clock.h
@@ -29,8 +29,6 @@ struct clk {
 	int id;
 	/* Source clock this clk depends on */
 	struct clk *parent;
-	/* Secondary clock to enable/disable with this clock */
-	struct clk *secondary;
 	/* Reference count of clock enable/disable */
 	__s8 usecount;
 	/* Register bit position for clock's enable/disable control. */
-- 
1.7.2.3

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

* i.MX28 fixes
  2011-01-21 10:57 i.MX28 fixes Sascha Hauer
                   ` (2 preceding siblings ...)
  2011-01-21 10:57 ` [PATCH 3/3] ARM i.MX23/28: remove secondary field from struct clk. It's unused Sascha Hauer
@ 2011-01-21 12:26 ` Sergei Shtylyov
  2011-01-24  9:16 ` Shawn Guo
  4 siblings, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2011-01-21 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 21-01-2011 13:57, Sascha Hauer wrote:

> The following patches fix some issues with the i.MX28 clock support.

> The following changes since commit c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470:

>    Linux 2.6.38-rc1 (2011-01-18 15:14:02 -0800)

> are available in the git repository at:
>    none ..BRANCH.NOT.VERIFIED..

    Not pushed?

WBR, Sergei

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

* [PATCH 1/3] ARM i.MX28: fix bit operation
  2011-01-24  9:29   ` Shawn Guo
@ 2011-01-24  7:27     ` Sascha Hauer
  0 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2011-01-24  7:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 24, 2011 at 05:29:28PM +0800, Shawn Guo wrote:
> Hi Sascha,
> 
> On Fri, Jan 21, 2011 at 11:57:52AM +0100, Sascha Hauer wrote:
> > reg | (1 << clk->enable_shift) always evaluates to true. Switch it
> > to & which makes much more sense
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  arch/arm/mach-mxs/clock-mx28.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
> > index 56312c0..4146b38 100644
> > --- a/arch/arm/mach-mxs/clock-mx28.c
> > +++ b/arch/arm/mach-mxs/clock-mx28.c
> > @@ -355,7 +355,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate)		\
> >  	} else {							\
> >  		reg &= ~BM_CLKCTRL_##dr##_DIV;				\
> >  		reg |= div << BP_CLKCTRL_##dr##_DIV;			\
> > -		if (reg | (1 << clk->enable_shift)) {			\
> > +		if (reg & (1 << clk->enable_shift)) {			\
> >  			pr_err("%s: clock is gated\n", __func__);	\
> >  			return -EINVAL;					\
> >  		}							\
> > -- 
> > 1.7.2.3
> > 
> > 
> Would you mind fixing the same issue in clock-mx23.c name##_set_rate()?
>

No, here it is:

8<---------------------------

[PATCH] ARM i.MX23: use correct register for setting the rate

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mxs/clock-mx23.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
index b1a362e..7206924 100644
--- a/arch/arm/mach-mxs/clock-mx23.c
+++ b/arch/arm/mach-mxs/clock-mx23.c
@@ -304,7 +304,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate)		\
 	reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr);		\
 	reg &= ~BM_CLKCTRL_##dr##_DIV;					\
 	reg |= div << BP_CLKCTRL_##dr##_DIV;				\
-	if (reg | (1 << clk->enable_shift)) {				\
+	if (reg & (1 << clk->enable_shift)) {				\
 		pr_err("%s: clock is gated\n", __func__);		\
 		return -EINVAL;						\
 	}								\
-- 
1.7.2.3

-- 
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 related	[flat|nested] 8+ messages in thread

* i.MX28 fixes
  2011-01-21 10:57 i.MX28 fixes Sascha Hauer
                   ` (3 preceding siblings ...)
  2011-01-21 12:26 ` i.MX28 fixes Sergei Shtylyov
@ 2011-01-24  9:16 ` Shawn Guo
  4 siblings, 0 replies; 8+ messages in thread
From: Shawn Guo @ 2011-01-24  9:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 21, 2011 at 11:57:51AM +0100, Sascha Hauer wrote:
> The following patches fix some issues with the i.MX28 clock support.
> 
> The following changes since commit c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470:
> 
>   Linux 2.6.38-rc1 (2011-01-18 15:14:02 -0800)
> 
> are available in the git repository at:
>   none ..BRANCH.NOT.VERIFIED..
> 
> Sascha Hauer (3):
>       ARM i.MX28: fix bit operation
>       ARM i.MX28: use correct register for setting the rate
>       ARM i.MX23/28: remove secondary field from struct clk. It's unused

All acked-by: Shawn Guo <shawn.guo@freescale.com>

> 
>  arch/arm/mach-mxs/clock-mx28.c         |    4 ++--
>  arch/arm/mach-mxs/clock.c              |    2 --
>  arch/arm/mach-mxs/include/mach/clock.h |    2 --
>  3 files changed, 2 insertions(+), 6 deletions(-)
> 
> 
> 

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

* [PATCH 1/3] ARM i.MX28: fix bit operation
  2011-01-21 10:57 ` [PATCH 1/3] ARM i.MX28: fix bit operation Sascha Hauer
@ 2011-01-24  9:29   ` Shawn Guo
  2011-01-24  7:27     ` Sascha Hauer
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn Guo @ 2011-01-24  9:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sascha,

On Fri, Jan 21, 2011 at 11:57:52AM +0100, Sascha Hauer wrote:
> reg | (1 << clk->enable_shift) always evaluates to true. Switch it
> to & which makes much more sense
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/mach-mxs/clock-mx28.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
> index 56312c0..4146b38 100644
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -355,7 +355,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate)		\
>  	} else {							\
>  		reg &= ~BM_CLKCTRL_##dr##_DIV;				\
>  		reg |= div << BP_CLKCTRL_##dr##_DIV;			\
> -		if (reg | (1 << clk->enable_shift)) {			\
> +		if (reg & (1 << clk->enable_shift)) {			\
>  			pr_err("%s: clock is gated\n", __func__);	\
>  			return -EINVAL;					\
>  		}							\
> -- 
> 1.7.2.3
> 
> 
Would you mind fixing the same issue in clock-mx23.c name##_set_rate()?

Regards,
Shawn

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

end of thread, other threads:[~2011-01-24  9:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-21 10:57 i.MX28 fixes Sascha Hauer
2011-01-21 10:57 ` [PATCH 1/3] ARM i.MX28: fix bit operation Sascha Hauer
2011-01-24  9:29   ` Shawn Guo
2011-01-24  7:27     ` Sascha Hauer
2011-01-21 10:57 ` [PATCH 2/3] ARM i.MX28: use correct register for setting the rate Sascha Hauer
2011-01-21 10:57 ` [PATCH 3/3] ARM i.MX23/28: remove secondary field from struct clk. It's unused Sascha Hauer
2011-01-21 12:26 ` i.MX28 fixes Sergei Shtylyov
2011-01-24  9:16 ` Shawn Guo

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).