All of lore.kernel.org
 help / color / mirror / Atom feed
* media-tree build is broken
@ 2013-03-21 18:16 Frank Schäfer
  2013-03-21 18:58 ` Mauro Carvalho Chehab
  2013-03-22  9:25 ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 5+ messages in thread
From: Frank Schäfer @ 2013-03-21 18:16 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

...
Kernel: arch/x86/boot/bzImage is ready  (#2)
ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!
make[1]: *** [__modpost] Fehler 1
make: *** [modules] Fehler 2


Mauro, I assume this is caused by one of the recent Siano patches ?

Regards,
Frank

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

* Re: media-tree build is broken
  2013-03-21 18:16 media-tree build is broken Frank Schäfer
@ 2013-03-21 18:58 ` Mauro Carvalho Chehab
  2013-03-22  9:25 ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2013-03-21 18:58 UTC (permalink / raw)
  To: Frank Schäfer; +Cc: Linux Media Mailing List

Em Thu, 21 Mar 2013 19:16:55 +0100
Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:

> ...
> Kernel: arch/x86/boot/bzImage is ready  (#2)
> ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!
> make[1]: *** [__modpost] Fehler 1
> make: *** [modules] Fehler 2
> 
> 
> Mauro, I assume this is caused by one of the recent Siano patches ?

Very likely, there's a u64 division somewhere there without a do_div().

I'll take a look on it later. Thanks for reporting.


-- 

Cheers,
Mauro

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

* Re: media-tree build is broken
  2013-03-21 18:16 media-tree build is broken Frank Schäfer
  2013-03-21 18:58 ` Mauro Carvalho Chehab
@ 2013-03-22  9:25 ` Mauro Carvalho Chehab
  2013-03-22 11:35   ` Gianluca Gennari
  1 sibling, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2013-03-22  9:25 UTC (permalink / raw)
  To: Frank Schäfer; +Cc: Linux Media Mailing List

Em Thu, 21 Mar 2013 19:16:55 +0100
Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:

> ...
> Kernel: arch/x86/boot/bzImage is ready  (#2)
> ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!
> make[1]: *** [__modpost] Fehler 1
> make: *** [modules] Fehler 2
> 
> 
> Mauro, I assume this is caused by one of the recent Siano patches ?

I tried to debug this one, but I couldn't reproduce it here. Not sure why,
but I'm not capable of producing those errors here for a long time.

Maybe the gcc compiler version currently provided with Fedora 18 doesn't
require any library for 64-bit divisions, even when compiling for a
32 bits Kernel.

Anyway, I'm almost sure that the following patch fixes the issue.
Please test.

Regards,
Mauro.

-

PATCH] [media] siano: use do_div() for 64-bits division

As reported by Frank Schäfer <fschaefer.oss@googlemail.com>:
	ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!

Reported-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c
index d965a7a..297f1b2 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -22,6 +22,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
+#include <asm/div64.h>
 
 #include "dmxdev.h"
 #include "dvbdev.h"
@@ -244,6 +245,7 @@ static void smsdvb_update_per_slices(struct smsdvb_client_t *client,
 {
 	struct dvb_frontend *fe = &client->frontend;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+	u64 tmp;
 
 	client->fe_status = sms_to_status(p->is_demod_locked, p->is_rf_locked);
 	c->modulation = sms_to_modulation(p->constellation);
@@ -272,8 +274,9 @@ static void smsdvb_update_per_slices(struct smsdvb_client_t *client,
 	c->post_bit_count.stat[0].uvalue += p->ber_bit_count;
 
 	/* Legacy PER/BER */
-	client->legacy_per = (p->ets_packets * 65535) /
-			     (p->ts_packets + p->ets_packets);
+	tmp = p->ets_packets * 65535;
+	do_div(tmp, p->ts_packets + p->ets_packets);
+	client->legacy_per = tmp;
 }
 
 static void smsdvb_update_dvb_stats(struct smsdvb_client_t *client,
@@ -803,7 +806,7 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr)
 	rc = smsdvb_send_statistics_request(client);
 
 	/* Preferred scale for SNR with legacy API: 0.1 dB */
-	*snr = c->cnr.stat[0].svalue / 100;
+	*snr = ((u32)c->cnr.stat[0].svalue) / 100;
 
 	led_feedback(client);
 


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

* Re: media-tree build is broken
  2013-03-22  9:25 ` Mauro Carvalho Chehab
@ 2013-03-22 11:35   ` Gianluca Gennari
  2013-03-22 12:47     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Gianluca Gennari @ 2013-03-22 11:35 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Frank Schäfer, Linux Media Mailing List

Il 22/03/2013 10:25, Mauro Carvalho Chehab ha scritto:
> Em Thu, 21 Mar 2013 19:16:55 +0100
> Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:
> 
>> ...
>> Kernel: arch/x86/boot/bzImage is ready  (#2)
>> ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!
>> make[1]: *** [__modpost] Fehler 1
>> make: *** [modules] Fehler 2
>>
>>
>> Mauro, I assume this is caused by one of the recent Siano patches ?
> 
> I tried to debug this one, but I couldn't reproduce it here. Not sure why,
> but I'm not capable of producing those errors here for a long time.
> 
> Maybe the gcc compiler version currently provided with Fedora 18 doesn't
> require any library for 64-bit divisions, even when compiling for a
> 32 bits Kernel.
> 
> Anyway, I'm almost sure that the following patch fixes the issue.
> Please test.

Hi Mauro, Frank,
I can confirm the patch fixes the compilation problem.
Tested on a 32 bit Ubuntu 10.04, compiling the latest media_build tree.

Regards,
Gianluca


> 
> Regards,
> Mauro.
> 
> -
> 
> PATCH] [media] siano: use do_div() for 64-bits division
> 
> As reported by Frank Schäfer <fschaefer.oss@googlemail.com>:
> 	ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!
> 
> Reported-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> 
> diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c
> index d965a7a..297f1b2 100644
> --- a/drivers/media/common/siano/smsdvb-main.c
> +++ b/drivers/media/common/siano/smsdvb-main.c
> @@ -22,6 +22,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  #include <linux/module.h>
>  #include <linux/slab.h>
>  #include <linux/init.h>
> +#include <asm/div64.h>
>  
>  #include "dmxdev.h"
>  #include "dvbdev.h"
> @@ -244,6 +245,7 @@ static void smsdvb_update_per_slices(struct smsdvb_client_t *client,
>  {
>  	struct dvb_frontend *fe = &client->frontend;
>  	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
> +	u64 tmp;
>  
>  	client->fe_status = sms_to_status(p->is_demod_locked, p->is_rf_locked);
>  	c->modulation = sms_to_modulation(p->constellation);
> @@ -272,8 +274,9 @@ static void smsdvb_update_per_slices(struct smsdvb_client_t *client,
>  	c->post_bit_count.stat[0].uvalue += p->ber_bit_count;
>  
>  	/* Legacy PER/BER */
> -	client->legacy_per = (p->ets_packets * 65535) /
> -			     (p->ts_packets + p->ets_packets);
> +	tmp = p->ets_packets * 65535;
> +	do_div(tmp, p->ts_packets + p->ets_packets);
> +	client->legacy_per = tmp;
>  }
>  
>  static void smsdvb_update_dvb_stats(struct smsdvb_client_t *client,
> @@ -803,7 +806,7 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr)
>  	rc = smsdvb_send_statistics_request(client);
>  
>  	/* Preferred scale for SNR with legacy API: 0.1 dB */
> -	*snr = c->cnr.stat[0].svalue / 100;
> +	*snr = ((u32)c->cnr.stat[0].svalue) / 100;
>  
>  	led_feedback(client);
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: media-tree build is broken
  2013-03-22 11:35   ` Gianluca Gennari
@ 2013-03-22 12:47     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2013-03-22 12:47 UTC (permalink / raw)
  To: gennarone; +Cc: Frank Schäfer, Linux Media Mailing List

Em Fri, 22 Mar 2013 12:35:19 +0100
Gianluca Gennari <gennarone@gmail.com> escreveu:

> Il 22/03/2013 10:25, Mauro Carvalho Chehab ha scritto:
> > Em Thu, 21 Mar 2013 19:16:55 +0100
> > Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:
> > 
> >> ...
> >> Kernel: arch/x86/boot/bzImage is ready  (#2)
> >> ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!
> >> make[1]: *** [__modpost] Fehler 1
> >> make: *** [modules] Fehler 2
> >>
> >>
> >> Mauro, I assume this is caused by one of the recent Siano patches ?
> > 
> > I tried to debug this one, but I couldn't reproduce it here. Not sure why,
> > but I'm not capable of producing those errors here for a long time.
> > 
> > Maybe the gcc compiler version currently provided with Fedora 18 doesn't
> > require any library for 64-bit divisions, even when compiling for a
> > 32 bits Kernel.
> > 
> > Anyway, I'm almost sure that the following patch fixes the issue.
> > Please test.
> 
> Hi Mauro, Frank,
> I can confirm the patch fixes the compilation problem.
> Tested on a 32 bit Ubuntu 10.04, compiling the latest media_build tree.

Thanks! I'll add a tested-by on the patch.

Regards,
Mauro

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

end of thread, other threads:[~2013-03-22 12:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 18:16 media-tree build is broken Frank Schäfer
2013-03-21 18:58 ` Mauro Carvalho Chehab
2013-03-22  9:25 ` Mauro Carvalho Chehab
2013-03-22 11:35   ` Gianluca Gennari
2013-03-22 12:47     ` Mauro Carvalho Chehab

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.