Unable to handle kernel paging request at virtual address 0x7e005070 Solution

Source: Internet
Author: User

It's a bit of a title party's taste ~


An error is reported when readl () and INL () read I/O Ports.




This problem was encountered when I wrote the demo driver to the RTC...



This is a problem caused by the virtual memory technology. Physical addresses cannot be used directly. (However, the CMOS driver I wrote to the PC last time seems to use physical addresses. What is Buji island)


The solution is to call the ioremap function to convert the physical address and remap the IO port to the virtual address.


Once equipped with ioremap (and iounmap), a device driver can access any I/O memory address, whether or not it is directly mapped to virtual address space. remember, though, that addresses returned from ioremap shocould not be dereferenced directly; instead, accessor functions provided by the kernel shoshould be used. before we get into those functions, we 'd better review the ioremap prototypes and introduce a few details that we passed over in the previous chapter.


The functions are called according to the following definition:

#include <asm/io.h>void *ioremap(unsigned long phys_addr, unsigned long size);void *ioremap_nocache(unsigned long phys_addr, unsigned long size);void iounmap(void * addr);



First of all, you notice the new function ioremap_nocache. we didn't cover it in chapter 8, because its meaning is definitely hardware related. quoting from one of the kernel headers: "It's useful if some control registers are in such an area, and write combining or read caching is not desirable. "Actually, the function's implementation
Is identical to ioremap on most computer platforms: In situations where all of I/O memory is already visible through noncacheable addresses, there's no reason to implement a separate, noncaching version of ioremap.


Here I use ioremap again, everything work correctly...








Unable to handle kernel paging request at virtual address 0x7e005070 Solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.