Issues with ioremap

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


Hello,
I have a ARM926 based development board. I am trying to remap 23 MB of
IO memory using ioremap and access with the code snippet below, mm
throws an exception most of the times -
#define MRAM_SIZE 23068672

    while(1)
    {
        offset = test_random() % MRAM_SIZE;
        virt_addr = mmem + offset;
        page = virt_to_page (virt_addr);
        get_page(page);
        /* do something */
        put_page(page);
    }
Exception in linux-kernel ver - 3.1-
[  116.390625] [<bf0120a4>] (test_init+0xa4/0x114 [test]) from
[<c0008770>] (do_one_initcall+0x94/0x16c)
[  116.390625] [<c0008770>] (do_one_initcall+0x94/0x16c) from
[<c0043f50>] (sys_init_module+0xd8c/0xfdc)
[  116.390625] [<c0043f50>] (sys_init_module+0xd8c/0xfdc) from
[<c0009280>] (ret_fast_syscall+0x0/0x2c)
[  116.390625] Code: e7933280 e3130902 0a000008 e594301c (e5932010)

0xa4 is in test_init (include/linux/mm.h:386).
381            /*
382             * This is safe only because
383             * __split_huge_page_refcount can't run under
384             * get_page().
385             */
386            VM_BUG_ON(atomic_read(&page->first_page->_count) < 0);
387            atomic_inc(&page->first_page->_count);
388        }
389    }


Exception in linux-kernel ver - 3.4.3 -
[  108.640625] [<c0063ce4>] (__get_page_tail+0x20/0xb0) from
[<bf012084>] (test_init+0x84/0x100 [test])
[  108.640625] [<bf012084>] (test_init+0x84/0x100 [test]) from
[<c0008770>] (do_one_initcall+0x94/0x16c)
[  108.640625] [<c0008770>] (do_one_initcall+0x94/0x16c) from
[<c0045330>] (sys_init_module+0x70/0x18c)
[  108.640625] [<c0045330>] (sys_init_module+0x70/0x18c) from
[<c0009320>] (ret_fast_syscall+0x0/0x2c)
[  108.640625] Code: 0a000023 e590001c e1530000 0a000020 (e5902010)

Is there a limitation on the size of memory that can be mapped using
ioremap? Looks like, first_page is not configured correctly for memory
mapped using ioremap.
This is a shared memory used by a network device to read and write ip
packets. Can someone please confirm? Any pointers on how to debug and
fix this issue are much appreciated.

Thank you!
Regards, Pratik

[Note: I tried using iotable but situation does not improve.]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[Other Archives]     [Linux Kernel Newbies]     [Linux Driver Development]     [Linux Kbuild]     [Fedora Kernel]     [Linux Kernel Testers]     [Linux SH]     [Linux Omap]     [Linux Tape]     [Linux Input]     [Linux Kernel Janitors]     [Linux Kernel Packagers]     [Linux Doc]     [Linux Man Pages]     [Linux API]     [Linux Memory Management]     [Linux Modules]     [Linux Standards]     [Kernel Announce]     [Netdev]     [Git]     [Linux PCI]     Linux CAN Development     [Linux I2C]     [Linux RDMA]     [Linux NUMA]     [Netfilter]     [Netfilter Devel]     [SELinux]     [Bugtraq]     [FIO]     [Linux Perf Users]     [Linux Serial]     [Linux PPP]     [Linux ISDN]     [Linux Next]     [Kernel Stable Commits]     [Linux Tip Commits]     [Kernel MM Commits]     [Linux Security Module]     [AutoFS]     [Filesystem Development]     [Ext3 Filesystem]     [Linux bcache]     [Ext4 Filesystem]     [Linux BTRFS]     [Linux CEPH Filesystem]     [Linux XFS]     [XFS]     [Linux NFS]     [Linux CIFS]     [Ecryptfs]     [Linux NILFS]     [Linux Cachefs]     [Reiser FS]     [Initramfs]     [Linux FB Devel]     [Linux OpenGL]     [DRI Devel]     [Fastboot]     [Linux RT Users]     [Linux RT Stable]     [eCos]     [Corosync]     [Linux Clusters]     [LVS Devel]     [Hot Plug]     [Linux Virtualization]     [KVM]     [KVM PPC]     [KVM ia64]     [Linux Containers]     [Linux Hexagon]     [Linux Cgroups]     [Util Linux]     [Wireless]     [Linux Bluetooth]     [Bluez Devel]     [Ethernet Bridging]     [Embedded Linux]     [Barebox]     [Linux MMC]     [Linux IIO]     [Sparse]     [Smatch]     [Linux Arch]     [x86 Platform Driver]     [Linux ACPI]     [Linux IBM ACPI]     [LM Sensors]     [CPU Freq]     [Linux Power Management]     [Linmodems]     [Linux DCCP]     [Linux SCTP]     [ALSA Devel]     [Linux USB]     [Linux PA RISC]     [Linux Samsung SOC]     [MIPS Linux]     [IBM S/390 Linux]     [ARM Linux]     [ARM Kernel]     [ARM MSM]     [Tegra Devel]     [Sparc Linux]     [Linux Security]     [Linux Sound]     [Linux Media]     [Video 4 Linux]     [Linux IRDA Users]     [Linux for the blind]     [Linux RAID]     [Linux ATA RAID]     [Device Mapper]     [Linux SCSI]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Linux IDE]     [Linux SMP]     [Linux AXP]     [Linux Alpha]     [Linux M68K]     [Linux ia64]     [Linux 8086]     [Linux x86_64]     [Linux Config]     [Linux Apps]     [Linux MSDOS]     [Linux X.25]     [Linux Crypto]     [DM Crypt]     [Linux Trace Users]     [Linux Btrace]     [Linux Watchdog]     [Utrace Devel]     [Linux C Programming]     [Linux Assembly]     [Dash]     [DWARVES]     [Hail Devel]     [Linux Kernel Debugger]     [Linux gcc]     [Gcc Help]     [X.Org]     [Wine]

Add to Google Powered by Linux

[Older Kernel Discussion]     [Yosemite National Park Forum]     [Large Format Photos]     [Gimp]     [Yosemite Photos]     [Stuff]