linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mpc5200/gpt: tiny fix for gpt period limitation
@ 2009-11-11  8:47 Albrecht Dreß
  0 siblings, 0 replies; 7+ messages in thread
From: Albrecht Dreß @ 2009-11-11  8:47 UTC (permalink / raw)
  To: grant.likely; +Cc: linuxppc-dev



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

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

* [PATCH] mpc5200/gpt: tiny fix for gpt period limitation
@ 2009-11-11  8:49 Albrecht Dreß
  2009-11-12 21:15 ` Grant Likely
  0 siblings, 1 reply; 7+ messages in thread
From: Albrecht Dreß @ 2009-11-11  8:49 UTC (permalink / raw)
  To: grant.likely; +Cc: linuxppc-dev

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

Signed-off-by: Albrecht Dre=DF <albrecht.dress@arcor.de>
---

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

diff --git a/arch/powerpc/include/asm/mpc52xx.h b/arch/powerpc/include/asm/=
mpc52xx.h
index 707ab75..933fb8f 100644
--- a/arch/powerpc/include/asm/mpc52xx.h
+++ b/arch/powerpc/include/asm/mpc52xx.h
@@ -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
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platf=
orms/52xx/mpc52xx_gpt.c
index 2c3fa13..77572ab 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -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

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

* Re: [PATCH] mpc5200/gpt: tiny fix for gpt period limitation
  2009-11-11  8:49 [PATCH] mpc5200/gpt: tiny fix for gpt period limitation Albrecht Dreß
@ 2009-11-12 21:15 ` Grant Likely
  2009-11-12 21:44   ` Wolfram Sang
  2009-11-13  9:25   ` Albrecht Dreß
  0 siblings, 2 replies; 7+ messages in thread
From: Grant Likely @ 2009-11-12 21:15 UTC (permalink / raw)
  To: Albrecht Dreß; +Cc: linuxppc-dev

On Wed, Nov 11, 2009 at 1:49 AM, Albrecht Dre=DF <albrecht.dress@arcor.de> =
wrote:
> This patch fixes a limitation of the 5200's period.
>
> Signed-off-by: Albrecht Dre=DF <albrecht.dress@arcor.de>

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.

> ---
>
> =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(-)
>
> diff --git a/arch/powerpc/include/asm/mpc52xx.h b/arch/powerpc/include/as=
m/mpc52xx.h
> index 707ab75..933fb8f 100644
> --- a/arch/powerpc/include/asm/mpc52xx.h
> +++ b/arch/powerpc/include/asm/mpc52xx.h
> @@ -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,
> +extern int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, u64 per=
iod,
> =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);
>
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/pla=
tforms/52xx/mpc52xx_gpt.c
> index 2c3fa13..77572ab 100644
> --- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
> +++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
> @@ -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*/
> -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;
> @@ -400,7 +400,7 @@ int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *=
gpt, int period,
> =A0 =A0 =A0 =A0 * arithmatic is done here to preserve the precision until=
 the value
> =A0 =A0 =A0 =A0 * is scaled back down into the u32 range. =A0Period is in=
 'ns', bus
> =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 *=
/
>
> =A0 =A0 =A0 =A0/* 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 ei=
ne ganz pers=F6nliche Freude!
> E-Card Marke Eigenbau: HIER KLICKEN: http://www.arcor.de/rd/footer.ecard
>



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

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

* Re: [PATCH] mpc5200/gpt: tiny fix for gpt period limitation
  2009-11-12 21:15 ` Grant Likely
@ 2009-11-12 21:44   ` Wolfram Sang
  2009-11-13  0:21     ` Grant Likely
  2009-11-13  9:25   ` Albrecht Dreß
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2009-11-12 21:44 UTC (permalink / raw)
  To: Grant Likely; +Cc: Albrecht Dreß, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

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

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH] mpc5200/gpt: tiny fix for gpt period limitation
  2009-11-12 21:44   ` Wolfram Sang
@ 2009-11-13  0:21     ` Grant Likely
  0 siblings, 0 replies; 7+ messages in thread
From: Grant Likely @ 2009-11-13  0:21 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Albrecht Dreß, linuxppc-dev

On Thu, Nov 12, 2009 at 2:44 PM, Wolfram Sang <w.sang@pengutronix.de> wrote=
:
>> 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
> 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.

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

* Re: [PATCH] mpc5200/gpt: tiny fix for gpt period limitation
@ 2009-11-13  9:24 Albrecht Dreß
  0 siblings, 0 replies; 7+ messages in thread
From: Albrecht Dreß @ 2009-11-13  9:24 UTC (permalink / raw)
  To: grant.likely; +Cc: linuxppc-dev

Hi Grant:

Thanks a lot for pushing the stuff to 'test'.

> 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

I'm sorry for that confusion!  I actually merged this patch into <http://li=
sts.ozlabs.org/pipermail/linuxppc-dev/2009-November/077715.html>:

<quote>
Note: The patch does also include the tiny GPT api changes from
<http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-November/077647.html>.
</quote>

Actually, this was not *really* the truth...

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

...because I now see the following diff between your test branch and my loc=
al version:

<snip>
adress@pc-adr2:/opt/eldk-4.2/usr/src/linux-2.6-secretlab$ diff -uBb arch/po=
werpc/platforms/52xx/mpc52xx_gpt.c ../linux-2.6-secretlab__/arch/powerpc/pl=
atforms/52xx/mpc52xx_gpt.c
--- arch/powerpc/platforms/52xx/mpc52xx_gpt.c   2009-11-13 09:31:40.0000000=
00 +0100
+++ ../linux-2.6-secretlab__/arch/powerpc/platforms/52xx/mpc52xx_gpt.c  200=
9-11-12 14:37:39.000000000 +0100
@@ -414,9 +414,10 @@
        /* Determine the number of clocks in the requested period.  64 bit
         * 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. */
+        * frequency is in Hz.  The maximum timeout @33MHz IPB clock is ~13=
0
+        * seconds*/
        clocks =3D period * (u64)gpt->ipb_freq;
-       do_div(clocks, 1000000000); /* Scale it down to ns range */
+       do_div(clocks, 1000000000ULL); /* Scale it down to ns range */
=20
        /* This device cannot handle a clock count greater than 32 bits */
        if (clocks > 0xffffffff)
@@ -460,7 +461,7 @@
 /**
  * mpc52xx_gpt_start_timer - Set and enable the GPT timer
  * @gpt: Pointer to gpt private data structure
- * @period: period of timer in ns; max. ~130s @ 33MHz IPB clock
+ * @period: period of timer in ns
  * @continuous: set to 1 to make timer continuous free running
  *
  * An interrupt will be generated every time the timer fires
</snip>

Again, I'm really sorry for the chaos!  Apparently, submitting patches afte=
r two glasses of red wine is a questionable idea... :-/

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

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

* Re: [PATCH] mpc5200/gpt: tiny fix for gpt period limitation
  2009-11-12 21:15 ` Grant Likely
  2009-11-12 21:44   ` Wolfram Sang
@ 2009-11-13  9:25   ` Albrecht Dreß
  1 sibling, 0 replies; 7+ messages in thread
From: Albrecht Dreß @ 2009-11-13  9:25 UTC (permalink / raw)
  To: w.sang, grant.likely; +Cc: linuxppc-dev

Hi Wolfram:

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

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

end of thread, other threads:[~2009-11-13  9:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11  8:49 [PATCH] mpc5200/gpt: tiny fix for gpt period limitation Albrecht Dreß
2009-11-12 21:15 ` Grant Likely
2009-11-12 21:44   ` Wolfram Sang
2009-11-13  0:21     ` Grant Likely
2009-11-13  9:25   ` Albrecht Dreß
  -- strict thread matches above, loose matches on Subject: below --
2009-11-13  9:24 Albrecht Dreß
2009-11-11  8:47 Albrecht Dreß

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