[linux-dvb] [PATCH] transform udelay to mdelay

Thierry Merle thierry.merle at free.fr
Tue Aug 26 21:18:52 CEST 2008

following the conversation on the v4l-dvb-maitainer ML:
Thierry Merle a écrit :
> Hi Martin
> Martin Michlmayr a écrit :
>> budget.ko fails to build on ARM with:
>> ERROR: "__bad_udelay" [drivers/media/dvb/ttpci/budget.ko] undefined!
>> make[1]: *** [__modpost] Error 1
>> __bad_udelay is specifically designed on ARM to fail when udelay is
>> called in a bad way.  arch/arm/include/asm/delay.h has this to say
>> about __bad_udelay:
>> /*
>>  * This function intentionally does not exist; if you see references to
>>  * it, it means that you're calling udelay() with an out of range value.
>>  *
>>  * With currently imposed limits, this means that we support a max delay
>>  * of 2000us. Further limits: HZ<=1000 and bogomips<=3355
>>  */
>> extern void __bad_udelay(void);
>> Can you check why your driver is calling udelay() with a value > 2000?
> Right, I experienced the same problem with the em28xx (from mcentral.de)
> driver compilation on my NSLU2 target.
> I guess you are doing the same thing for this driver.
> The solution was to use mdelay when possible.
> It solves the compilation on these low-power-consuming-but-high-capacities targets.
> Here are all the udelay with value greater than 2000 in v4l-dvb/:
> linux/drivers/media/dvb/b2c2/flexcop-fe-tuner.c:                       
> udelay(12500);
> linux/drivers/media/dvb/bt8xx/dst.c:            udelay(3000);
> linux/drivers/media/dvb/bt8xx/dst.c:            udelay(3000);
> linux/drivers/media/dvb/ttpci/budget-patch.c:                  
> udelay(12500);
> linux/drivers/media/dvb/ttpci/budget.c:                 udelay(12500);
> linux/drivers/media/video/bt8xx/bttv-cards.c:   udelay(2500);
> I attached a patch that replaces all these calls to mdelay, and additional udelay if
> necessary.
> I cannot test it since I do not own any of these devices so this is just a proposal.
> Cheers,
> Thierry
Here is the patch I proposed, this should be harmless but I have no
device to test them.


Signed-off-by: Thierry Merle <thierry.merle at free.fr>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: udelay_to_mdelay.patch
Type: text/x-patch
Size: 2712 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20080826/4b4194b5/attachment.bin 

More information about the linux-dvb mailing list