Hi Greg,

I noticed that the kmalloc call uses the GFP_DMA flag.  I am not sure if
that is a problem.  FYI, I have also attempted to implemented DMA for
use with the FEC driver as the driver hooks into DMA interrupts for
callbacks when send/receive events occur.  I don't know for certain that
the DMA is working yet, but I do know that the dma init routine is
called before the FEC init routine.

Here is a snippet of the function where kmalloc fails:

int __init fec_init(void)
{
   unsigned long offset;
   printk("ColdFire internal FEC driver version %s\n", VERSION);
   memset(&fec_priv_fec0, 0, sizeof (struct fec_priv));
#ifdef   FEC_2
   memset(&fec_priv_fec1, 0, sizeof (struct fec_priv));
#endif
   // -------- Memory allocation--------
   printk("FEC init - kmalloc size %d bytes\n", FEC_RX_BUF_NUMBER *
FEC_MAXBUF_SIZE + 15);
   fec_rxbuf_fec0 = kmalloc(FEC_RX_BUF_NUMBER * FEC_MAXBUF_SIZE + 15,
GFP_DMA);
   printk("FEC init - kmalloc result 0x%X\n", (unsigned int)fec_rxbuf_fec0);
   if (!fec_rxbuf_fec0)
      return -ENOMEM;
...
...

Greg Ungerer wrote:
> Hi Dave,
>
> Dave Meador wrote:
>> kmalloc is returning 0 when I try to allocate 24335 bytes inside a FEC
>> driver that I am porting to coldfire uclinux 547x.  I have enabled the
>> kernel feature "[*] Allow allocating large blocks (> 1MB) of memory" to
>> see if this fixes my problem, but no joy.
>>
>> Does anyone have an idea of what I can do to get past this?
>
> Can you show the code?
>
> Regards
> Greg
>
>> Here is a snippet of my kernel output when loading:
>> ...
>> ColdFire internal UART serial driver                             
>> ttyS0 at MMIO 0x10008600 (irq = 99) is a ColdFire UART           
>> ttyS1 at MMIO 0x10008700 (irq = 100) is a ColdFire UART          
>> ttyS2 at MMIO 0x10008800 (irq = 101) is a ColdFire UART          
>> RAMDISK driver initialized: 1 RAM disks of 2048K size 1024 blocksize
>> loop: loaded (max 8 devices)                                      
>> ColdFire internal FEC driver version 0.11a                        
>> FEC init - kmalloc request size 24335
>> bytes                                FEC init - kmalloc result
>> 0x0                                      ...
>> _______________________________________________
>> uClinux-dev mailing list
>> [email protected]
>> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
>> This message was resent by [email protected]
>> To unsubscribe see:
>> http://mailman.uclinux.org/mailman/options/uclinux-dev
>>
>
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to