Re: Compile error in ARM architecture

Russell King - ARM Linux <[email protected]>
Newsgroups gmane.linux.ports.arm.general
Message-ID <[email protected]>
On Fri, Dec 11, 2009 at 07:41:21PM +0530, Bala Shanmugam wrote:
> Hi Russel,

Please take extra time with spelling peoples names, thanks.

> I am trying to compile linux kernel for ARM processor.
> I built arm toolchain [arm-linux-gcc] using BuildRoot.
>
> I am getting below compilation errors when I tried to build 2.6.31 and  
> latest 2.6.32-rc8 kernel.
>
> *Error 1:*
> CC [M]  drivers/scsi/advansys.o
> drivers/scsi/advansys.c:72:2: warning: #warning this driver is still not  
> properly converted to the DMA API
> drivers/scsi/advansys.c: In function 'advansys_get_sense_buffer_dma':
> drivers/scsi/advansys.c:8352: error: implicit declaration of function  
> 'dma_cache_sync'
>
> This error is because arm architecture doesn't support dma_cache_sync.
> Is it OK not to invoke it in arm?

We don't support the non-coherent DMA API on ARM yet - there seems to
only be one user of it, and I don't think anyone actually uses this
driver on ARM.

> *Error 2:*
> ERROR: "__bad_udelay" [sound/pci/ali5451/snd-ali5451.ko] undefined!
> ERROR: "__bad_udelay" [drivers/video/savage/savagefb.ko] undefined!
> ERROR: "__bad_udelay" [drivers/scsi/nsp32.ko] undefined!
> ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined!
> ERROR: "__bad_udelay" [drivers/net/sungem.ko] undefined!
> ERROR: "__bad_udelay" [drivers/net/irda/donauboe.ko] undefined!
> ERROR: "__bad_udelay" [drivers/gpu/drm/radeon/radeon.ko] undefined!
> ERROR: "__bad_udelay" [drivers/atm/he.ko] undefined!
>
> udelay(int) function accepts value < 2000 in arm.  x86 supports < 20000.
> As above module uses udelay with value > 2000 an undefined function  
> [__bad_udelay] become part of these modules and above error is thrown.

Because of the limited nature of the calculation (which is basically
a fast divide by multiplying and shifting the result) for udelay() we
have a smaller upper limit.  As stated in the ARM udelay:

 * With currently imposed limits, this means that we support a max delay
 * of 2000us. Further limits: HZ<=1000 and bogomips<=3355

We certainly can't shave off a factor of 10 since that would mean we'd
have to refuse to run on any platform with a calculated bogomips in
excess of 335 - and we already have platforms in excess of these.

At the end of the day, large delays should not be done using udelay().
That's what mdelay() is for - m meaning millisecond.  Therefore, the
drivers wanting these millisecond delays should be using the proper
interface for long delays - that being mdelay().

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.