<div dir="ltr"><br clear="all"><div style>Hi All</div><div style>Please find a piece of code that i wrote in my driver,</div><div style><div> </div><div><font face="courier new, monospace">void __iomem *tcpm_base = ioremap_nocache(0x03900000, SZ_16KB);</font></div>
<div><font face="courier new, monospace"> printk("Virtual addresss %x\n",tcpm_base);</font></div><div><font face="courier new, monospace"> if(tcpm_base!=NULL)</font></div><div><font face="courier new, monospace"> {</font></div>
<div><font face="courier new, monospace"> printk("Jiffies %x %ld\n\n\n\n", jiffies, jiffies);</font></div><div><font face="courier new, monospace"> for(i=0;i<(SZ_16KB-1);i++)</font></div>
<div><font face="courier new, monospace"> src = readl(tcpm_base+i);</font></div><div><font face="courier new, monospace"> printk("%d\n",src);</font></div><div><font face="courier new, monospace"> printk("Jiffies %x %ld\n\n\n\n", jiffies, jiffies);</font></div>
<div><font face="courier new, monospace"> }</font></div><div><font face="courier new, monospace"> else</font></div><div><font face="courier new, monospace"> printk("unable to map \n");</font></div>
<div><br></div><div><br></div><div style>When i execute this code, i am seeing a kernel panic telling</div><div style>----- LOG --------</div><div style><div><font face="verdana, sans-serif">"Virtual addresss ea880000"</font></div>
<div><font face="verdana, sans-serif">"Unable to handle kernel paging request at virtual address ea890000"</font><br></div><div style><font face="verdana, sans-serif">-----LOG-----</font></div><div style><font face="verdana, sans-serif"><br>
</font></div><div style>If you observe,</div><div style>virtual address of <span style="font-family:'courier new',monospace">tcpm_base is </span><span style="font-family:verdana,sans-serif">ea880000.</span></div>
<div style><span style="font-family:verdana,sans-serif">if ioremap() returns all contigious memory, There should be no dereferencing of "</span><span style="font-family:verdana,sans-serif">ea890000"(the max address should be ea88fffe)</span></div>
<div style><span style="font-family:verdana,sans-serif"><br></span></div><div style><span style="font-family:verdana,sans-serif">But in kernel logs show, it is dereferencing that address.</span></div><div style><span style="font-family:verdana,sans-serif"><br>
</span></div><div style><span style="font-family:verdana,sans-serif">My question now is...</span></div><div style><span style="font-family:verdana,sans-serif">doesn't ioremap() returns contigious address space?</span></div>
<div style><br></div><div style><br></div></div></div>With regards,<br>Sandeep Kumar Anantapalli,<br>
</div>