RE: ioremap bug? (was RE: DSPBRIDGE: segmentation fault after reloading dspbridge several times due to a memory leak.)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin,
Some more isolation:
The l-o master branch does not have an issue, only the pm branch seems to have the problem - probably some commit(s?) missing in pm branch. Since bridge is based off the pm branch, wont make sense to regress on it :(.

> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@xxxxxxxxxxxxxxxxxxx]
> Sent: Thursday, March 12, 2009 7:27 PM
> To: Menon, Nishanth
> Cc: Guzman Lugo, Fernando; linux-omap@xxxxxxxxxxxxxxx; Kanigeri, Hari;
> Woodruff, Richard; Lakhani, Amish; Gupta, Ramesh; Ameya Palande
> Subject: Re: ioremap bug? (was RE: DSPBRIDGE: segmentation fault after
> reloading dspbridge several times due to a memory leak.)

> Which of these physical addresses causes an increasing virtual
> address?  The addresses in the 0x48xxxxxx (L4, L4_WKUP) range should
> just trigger static mapping via the arch-specific ioremap, so those
> should always map to the same virt address.
> 
> Could you do the experiment with a smaller number of mappings?  Maybe
> just one at a time of the non L4 mappings?  Probably starting with
> only the BASE,SIZE mapping.
> 
Attached is the patch for pm branch. 
Codebase:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
git checkout -b pm --track origin/pm
git branch iotest-pm
git apply 0001-MISC-dummy-driver-to-test-ioremap.patch

make omap_3430sdp_defconfig
make uImage && make modules

bootargs: console=ttyS0,115200n8 noinitrd ip=dhcp root=/dev/nfs rw nfsroot=<server>:<fsPath>,nolock,wsize=1024,rsize=1024 mem=64M

I reorganized the driver from the previous version I had send, so that we can provide base address,size and number of io_remaps to try as module params. And tested with the following shell script:
#!/bin/bash
slee()
{
        echo "Sleep "
#sleep 5
}
try=1
while [ $try -lt 13 ]; do
	  i=0
        while [ $i -lt 100 ]; do
                echo "insmod $i base=0x87000000 size=0x600000 try=$try"
                insmod  ./dummy.ko base=0x87000000 size=0x600000 try=$try
                if [ $? -ne 0 ]; then
                        echo "QUIT IN INSMOD $i"
                        exit 1;
                fi
                slee
                echo "rmmod $i"
                rmmod dummy
                if [ $? -ne 0 ]; then
                        echo "QUIT IN RMMOD $i"
                        exit 1;
                fi
                i=`expr $i + 1`
                slee
        done
        try=$(( $try + 1 ))
done

Result:
insmod 21 base=0x87000000 size=0x600000 try=1
vmap allocation failed: use vmalloc=<size> to increase size.
Map[0] - virt=0x00000000 phy=0x87000000 size=0x00600000
Allocation failed idx=0
insmod: cannot insert `./dummy.ko': Cannot allocate memory (-1): Cannot allocate memory
QUIT IN INSMOD 21

In terms of virtual addresses generated:
0xCD800000
0xCE000000
0xCE800000
0xCF000000
0xCF800000
0xD0000000
0xD0800000
0xD1000000
...
[iteration 20] 0xD7800000

The next one fails.

The same patch will apply on linux-omap master branch also, but patching drivers/misc/Makefile will break with my patch - need to trivial hand merge it..

commitIDs tested against:
linux-omap master: cc2b459c066361098704c586f3134c3c3ac13be3 (the entire script runs through)
linux-omap pm: 4f422d583e2e233c19eb20754b8cfad6ed9e460a (the script fails around 21st iteration with try=1)

Regards,
Nishanth Menon

Attachment: 0001-MISC-dummy-driver-to-test-ioremap.patch
Description: 0001-MISC-dummy-driver-to-test-ioremap.patch


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux