Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

SCSI module error

Altera_Forum
Honored Contributor II
1,117 Views

I've compiled the base SCSI module (scsi_mod.ko) successfully, but when I try to run it, I get "Allocation of length 1135537 from process 24 failed". 

 

I have a screen capture of my Nios II SDK Shell linked here (http://www.csclub.uwaterloo.ca/~jwistead/error.jpg). 

 

The initialization messages are linked here (http://www.csclub.uwaterloo.ca/~jwistead/preamble.jpg). 

 

I grepped the kernel source, and found the error message at mm\nommu.c, in the do_mmap_pgoff function at line 394. The kmalloc call fails, presumably because the module is requesting a very large chunk of memory. From looking at the kmalloc code (include\linux\slab.h and include\linux\kmalloc_sizes.h), I think I can fix the problem by setting CONFIG_LARGE_ALLOCS=y in arch\nios2nommu\defconfig.  

 

Please let me know if this is an acceptable solution (ie. will there be any harmful side effects), or if there is a better solution.  

 

Thanks, 

jwistead
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
394 Views

I'd recommend looking at the nommu-mmap.txt file, that ships with a standard Linux kernel. I'm not sure if it ships with this uCLinux distro. or not.  

 

There's bound to be some further info. in there to shed light on what's happening during your driver initialization. 

 

Cheers, 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
394 Views

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

From looking at the kmalloc code (include\linux\slab.h and include\linux\kmalloc_sizes.h), I think I can fix the problem by setting CONFIG_LARGE_ALLOCS=y in arch\nios2nommu\defconfig.  Please let me know if this is an acceptable solution (ie. will there be any harmful side effects), or if there is a better solution.[/b] 

--- Quote End ---  

 

This is the only solution, as far as I know. 

Be aware that SCSI module might want DMA-able memory later, which your system does not have. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

I&#39;d recommend looking at the nommu-mmap.txt file, that ships with a standard Linux kernel. I&#39;m not sure if it ships with this uCLinux distro. or not.[/b] 

--- Quote End ---  

 

Currently the uClinux/nios2 kernel is 2.6.9, which does not have this file. But we did have to look at this file for 2.6.11 because of a problem preventing insmod from working.
0 Kudos
Reply