Skip to contentSkip to conversation

mpc5200/gpt: tiny fix for gpt period limitation

PATCH In review Albrecht Dre� 3 participants 5 messages Nov 11, 2009 – Nov 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc5200/gpt: tiny fix for gpt period limitation

This patch fixes a limitation of the 5200's period.

---

 arch/powerpc/include/asm/mpc52xx.h        |    2 +-
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/= renamed from arch/powerpc/include/asm/mpc52xx.h +0 -0

mpc52xx.h
index 707ab75..933fb8f 100644

arch/powerpc/include/asm/mpc52xx.h +0 -1
@@ -279,7 +279,7 @@ extern void mpc52xx_restart(char *cmd);
 /* mpc52xx_gpt.c */
 struct mpc52xx_gpt_priv;
 extern struct mpc52xx_gpt_priv *mpc52xx_gpt_from_irq(int irq);
-extern int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, int perio=

d,
+extern int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, u64 perio= d,

                             int continuous);

extern void mpc52xx_gpt_stop_timer(struct mpc52xx_gpt_priv *gpt);
=20

arch/powerpc/platf= renamed from arch/powerpc/platforms/52xx/mpc52xx_gpt.c +0 -0

orms/52xx/mpc52xx_gpt.c
index 2c3fa13..77572ab 100644

arch/powerpc/platforms/52xx/mpc52xx_gpt.c +2 -2
@@ -378,12 +378,12 @@ EXPORT_SYMBOL(mpc52xx_gpt_from_irq);
 /**
  * mpc52xx_gpt_start_timer - Set and enable the GPT timer
  * @gpt: Pointer to gpt private data structure
- * @period: period of timer
+ * @period: period of timer in ns; max. ~130s @ 33MHz IPB clock
  * @continuous: set to 1 to make timer continuous free running
  *
  * An interrupt will be generated every time the timer fires
  */
-int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, int period,
+int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, u64 period,
                             int continuous)
 {
        u32 clear, set;
@@ -400,7 +400,7 @@ int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gp=

t, int period,
* arithmatic is done here to preserve the precision until the valu=
e
* is scaled back down into the u32 range. Period is in 'ns', bus
* frequency is in Hz. */
- clocks =3D (u64)period * (u64)gpt->ipb_freq;

+       clocks =3D period * (u64)gpt->ipb_freq;
        do_div(clocks, 1000000000); /* Scale it down to ns range */
=20
        /* This device cannot handle a clock count greater than 32 bits */

Jetzt NEU: Do it youself E-Cards bei Arcor.de!
Stellen Sie Ihr eigenes Unikat zusammen und machen Sie dem Empf=E4nger eine=
ganz pers=F6nliche Freude!
E-Card Marke Eigenbau: HIER KLICKEN: http://www.arcor.de/rd/footer.ecard

#1 lore raw
Quoted 3 lines · On Wed, Nov 11, 2009 at 1:49 AM, Albrecht Dre=DF <[email protected]> =…

This patch fixes a limitation of the 5200's period.

Okay, I've applied this and patches 1 & 2 from your series. I'm waiting for a reply from Wim to know whether or not I should also pick up patch 3. BUT, you're on my shit list. Patch 2 in your series conflicts with this patch. I had to fix it up by hand. This patch should have been part of the series, or at least base the series on this patch. Take a look in my -test branch and make sure I fixed it right.

g.

arch/powerpc/include/as=

Quoted 7 lines

---

=A0arch/powerpc/include/asm/mpc52xx.h =A0 =A0 =A0 =A0| =A0 =A02 +- =A0arch/powerpc/platforms/52xx/mpc52xx_gpt.c | =A0 =A06 +++--- =A02 files changed, 4 insertions(+), 4 deletions(-)

arch/powerpc/include/as= renamed from arch/powerpc/include/asm/mpc52xx.h +0 -0

m/mpc52xx.h

Quoted 8 lines

index 707ab75..933fb8f 100644

arch/powerpc/include/asm/mpc52xx.h +0 -0
@@ -279,7 +279,7 @@ extern void mpc52xx_restart(char *cmd);

=A0/* mpc52xx_gpt.c */
=A0struct mpc52xx_gpt_priv;
=A0extern struct mpc52xx_gpt_priv *mpc52xx_gpt_from_irq(int irq); -extern int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, int per=

iod,

Quoted 1 line

+extern int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, u64 per=

iod,

arch/powerpc/pla=

Quoted 4 lines

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 int continuous); =A0extern void mpc52xx_gpt_stop_timer(struct mpc52xx_gpt_priv *gpt);

arch/powerpc/pla= renamed from arch/powerpc/platforms/52xx/mpc52xx_gpt.c +0 -0

tforms/52xx/mpc52xx_gpt.c

arch/powerpc/platforms/52xx/mpc52xx_gpt.c int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *=

Quoted 19 lines

index 2c3fa13..77572ab 100644

arch/powerpc/platforms/52xx/mpc52xx_gpt.c +0 -0
@@ -378,12 +378,12 @@ EXPORT_SYMBOL(mpc52xx_gpt_from_irq);

=A0/**
=A0* mpc52xx_gpt_start_timer - Set and enable the GPT timer =A0* @gpt: Pointer to gpt private data structure
- * @period: period of timer
+ * @period: period of timer in ns; max. ~130s @ 33MHz IPB clock =A0* @continuous: set to 1 to make timer continuous free running =A0*
=A0* An interrupt will be generated every time the timer fires =A0*/

arch/powerpc/platforms/52xx/mpc52xx_gpt.c +1 -1
-int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, int period,
+int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, u64 period,

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 int continuous) =A0{
=A0 =A0 =A0 =A0u32 clear, set;

arch/powerpc/platforms/52xx/mpc52xx_gpt.c +0 -0
@@ -400,7 +400,7 @@ int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *=

gpt, int period,

Quoted 1 line

=A0 =A0 =A0 =A0 * arithmatic is done here to preserve the precision until=

the value

Quoted 1 line

=A0 =A0 =A0 =A0 * is scaled back down into the u32 range. =A0Period is in=

'ns', bus

Quoted 4 lines

=A0 =A0 =A0 =A0 * frequency is in Hz. */
- =A0 =A0 =A0 clocks =3D (u64)period * (u64)gpt->ipb_freq;
+ =A0 =A0 =A0 clocks =3D period * (u64)gpt->ipb_freq;
=A0 =A0 =A0 =A0do_div(clocks, 1000000000); /* Scale it down to ns range *=

/

Quoted 2 lines

=A0 =A0 =A0 =A0/* This device cannot handle a clock count greater than 32=

bits */

Quoted 4 lines

Jetzt NEU: Do it youself E-Cards bei Arcor.de!
Stellen Sie Ihr eigenes Unikat zusammen und machen Sie dem Empf=E4nger ei=

ne ganz pers=F6nliche Freude!

Quoted 2 lines

E-Card Marke Eigenbau: HIER KLICKEN: http://www.arcor.de/rd/footer.ecard

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

#2 lore raw
Quoted 1 line

up patch 3. BUT, you're on my shit list. Patch 2 in your series

Huh, are you in a bad mood today? IMHO he addressed some valid issues; and we all had to start somewhere regarding the workflow. I know that manually adapting patches is annoying, but this wording sounds quite strong...

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#3 lore raw

On Thu, Nov 12, 2009 at 2:44 PM, Wolfram Sang <[email protected]> wrote= :

Quoted 3 lines
Quoted 1 line

up patch 3. =A0BUT, you're on my shit list. =A0Patch 2 in your series

Huh, are you in a bad mood today? IMHO he addressed some valid issues; an=

d we

Quoted 2 lines

all had to start somewhere regarding the workflow. I know that manually adapting patches is annoying, but this wording sounds quite strong...

Albrecht has been around for a bit now. He does good work, responds to comments, and in general shows good taste. This particular case was just a bit sloppy. The patch was damaged on the mailing list and it conflicted with his other patches. I know he knows better.

Albrecht, I'm not actually mad at you, and I'm sorry for the harsh working. The patch series is good work. I wouldn't have picked it up if it was otherwise. I'm just a little annoyed about something I know you can handle better. I don't bear any ill will.

Cheers,
g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

#4 lore raw
In reply to Wolfram Sang

Hi Wolfram:

Quoted 3 lines
Quoted 1 line

up patch 3. BUT, you're on my shit list. Patch 2 in your series

=20
Huh, are you in a bad mood today? IMHO he addressed some valid issues; an=

d

Actually, Grant is right here, as I confused two things, see my other reply=
...

Thanks, Albrecht.

Jetzt NEU: Do it youself E-Cards bei Arcor.de!
Stellen Sie Ihr eigenes Unikat zusammen und machen Sie dem Empf=E4nger eine=
ganz pers=F6nliche Freude!
E-Card Marke Eigenbau: HIER KLICKEN: http://www.arcor.de/rd/footer.ecard