doesn't ioremap() retrun contigious addressess...?

Prabhu nath gprabhunath at gmail.com
Thu Feb 28 06:11:36 EST 2013


Yes, ioremap() maps the given physical address to contiguous Kernel virtual
address above high_memory and returns the first address of the mapped
kernel virtual address.

Regards,
Prabhu



On Thu, Feb 28, 2013 at 4:06 PM, sandeep kumar <coolsandyforyou at gmail.com>wrote:

>
> Hi All
> Please find a piece of code that i wrote in my driver,
>
> void __iomem *tcpm_base = ioremap_nocache(0x03900000, SZ_16KB);
>             printk("Virtual addresss %x\n",tcpm_base);
>             if(tcpm_base!=NULL)
>             {
>             printk("Jiffies %x %ld\n\n\n\n", jiffies, jiffies);
>             for(i=0;i<(SZ_16KB-1);i++)
>             src = readl(tcpm_base+i);
>             printk("%d\n",src);
>             printk("Jiffies %x %ld\n\n\n\n", jiffies, jiffies);
>             }
>             else
>                 printk("unable to map \n");
>
>
> When i execute this code, i am seeing a kernel panic telling
> ----- LOG --------
> "Virtual addresss ea880000"
> "Unable to handle kernel paging request at virtual address ea890000"
> -----LOG-----
>
> If you observe,
> virtual address of  tcpm_base is ea880000.
> if ioremap() returns all contigious memory, There should be no
> dereferencing of "ea890000"(the max address should be ea88fffe)
>
> But in kernel logs show, it is dereferencing that address.
>
> My question now is...
> doesn't ioremap() returns contigious address space?
>
>
> With regards,
> Sandeep Kumar Anantapalli,
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130228/af9cabc3/attachment.html 


More information about the Kernelnewbies mailing list