* Re: [PATCH] e4000: fix PLL calc error in 32-bit arch [not found] <1378138669-22302-1-git-send-email-crope@iki.fi> @ 2013-09-02 16:26 ` Antti Palosaari 2013-09-02 19:08 ` Jan Taegert 2013-09-02 19:14 ` Jacek Konieczny 0 siblings, 2 replies; 3+ messages in thread From: Antti Palosaari @ 2013-09-02 16:26 UTC (permalink / raw) Cc: linux-media, Jacek Konieczny, Torsten Seyffarth, Jan Taegert, Damien CABROL Testers? Here is tree: http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/e4000_fix_3.11 I assume all of you have been running 32-bit arch as that bug is related to 32-bit overflow. regards Antti On 09/02/2013 07:17 PM, Antti Palosaari wrote: > Fix long-lasting error that causes tuning failure to some frequencies > on 32-bit arch. > > Special thanks goes to Damien CABROL who finally find root of the bug. > Also big thanks to Jacek Konieczny for donating non-working device. > > Reported-by: Jacek Konieczny <jajcus@jajcus.net> > Reported-by: Torsten Seyffarth <t.seyffarth@gmx.de> > Reported-by: Jan Taegert <jantaegert@gmx.net> > Reported-by: Damien CABROL <cabrol.damien@free.fr> > Tested-by: Damien CABROL <cabrol.damien@free.fr> > Signed-off-by: Antti Palosaari <crope@iki.fi> > --- > drivers/media/tuners/e4000.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c > index 1b33ed3..a88f757 100644 > --- a/drivers/media/tuners/e4000.c > +++ b/drivers/media/tuners/e4000.c > @@ -232,7 +232,7 @@ static int e4000_set_params(struct dvb_frontend *fe) > * or more. > */ > f_VCO = c->frequency * e4000_pll_lut[i].mul; > - sigma_delta = 0x10000UL * (f_VCO % priv->cfg->clock) / priv->cfg->clock; > + sigma_delta = div_u64(0x10000ULL * (f_VCO % priv->cfg->clock), priv->cfg->clock); > buf[0] = f_VCO / priv->cfg->clock; > buf[1] = (sigma_delta >> 0) & 0xff; > buf[2] = (sigma_delta >> 8) & 0xff; > -- http://palosaari.fi/ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] e4000: fix PLL calc error in 32-bit arch 2013-09-02 16:26 ` [PATCH] e4000: fix PLL calc error in 32-bit arch Antti Palosaari @ 2013-09-02 19:08 ` Jan Taegert 2013-09-02 19:14 ` Jacek Konieczny 1 sibling, 0 replies; 3+ messages in thread From: Jan Taegert @ 2013-09-02 19:08 UTC (permalink / raw) To: Antti Palosaari Cc: linux-media, Jacek Konieczny, Torsten Seyffarth, Damien CABROL Thanks! Works like a charm here with TerraTec Cinergy T Stick RC (Rev. 3). And you're right, I'm running 32-bit. Regards, jan. Am 02.09.2013 18:26, schrieb Antti Palosaari: > Testers? > > Here is tree: > http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/e4000_fix_3.11 > > > I assume all of you have been running 32-bit arch as that bug is related > to 32-bit overflow. > > regards > Antti > > > On 09/02/2013 07:17 PM, Antti Palosaari wrote: >> Fix long-lasting error that causes tuning failure to some frequencies >> on 32-bit arch. >> >> Special thanks goes to Damien CABROL who finally find root of the bug. >> Also big thanks to Jacek Konieczny for donating non-working device. >> >> Reported-by: Jacek Konieczny <jajcus@jajcus.net> >> Reported-by: Torsten Seyffarth <t.seyffarth@gmx.de> >> Reported-by: Jan Taegert <jantaegert@gmx.net> >> Reported-by: Damien CABROL <cabrol.damien@free.fr> >> Tested-by: Damien CABROL <cabrol.damien@free.fr> >> Signed-off-by: Antti Palosaari <crope@iki.fi> >> --- >> drivers/media/tuners/e4000.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c >> index 1b33ed3..a88f757 100644 >> --- a/drivers/media/tuners/e4000.c >> +++ b/drivers/media/tuners/e4000.c >> @@ -232,7 +232,7 @@ static int e4000_set_params(struct dvb_frontend *fe) >> * or more. >> */ >> f_VCO = c->frequency * e4000_pll_lut[i].mul; >> - sigma_delta = 0x10000UL * (f_VCO % priv->cfg->clock) / >> priv->cfg->clock; >> + sigma_delta = div_u64(0x10000ULL * (f_VCO % priv->cfg->clock), >> priv->cfg->clock); >> buf[0] = f_VCO / priv->cfg->clock; >> buf[1] = (sigma_delta >> 0) & 0xff; >> buf[2] = (sigma_delta >> 8) & 0xff; >> > > ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] e4000: fix PLL calc error in 32-bit arch 2013-09-02 16:26 ` [PATCH] e4000: fix PLL calc error in 32-bit arch Antti Palosaari 2013-09-02 19:08 ` Jan Taegert @ 2013-09-02 19:14 ` Jacek Konieczny 1 sibling, 0 replies; 3+ messages in thread From: Jacek Konieczny @ 2013-09-02 19:14 UTC (permalink / raw) To: Antti Palosaari Cc: linux-media, Torsten Seyffarth, Jan Taegert, Damien CABROL On Mon, 02 Sep 2013 19:26:21 +0300 Antti Palosaari <crope@iki.fi> wrote: > Testers? > > Here is tree: > http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/e4000_fix_3.11 > > I assume all of you have been running 32-bit arch as that bug is > related to 32-bit overflow. I have no device to test now. But, yes, I was using 32-bit arch. Thanks to you and Damien for finding and fixing this. Greets, Jacek ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-02 19:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1378138669-22302-1-git-send-email-crope@iki.fi>
2013-09-02 16:26 ` [PATCH] e4000: fix PLL calc error in 32-bit arch Antti Palosaari
2013-09-02 19:08 ` Jan Taegert
2013-09-02 19:14 ` Jacek Konieczny
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox