UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
6,222 Views
Registered: ‎02-23-2011

linux driver : Unable to handle kernel paging request for data at address 0x00000000

Jump to solution

Dear All,

I'm trying to write my first device driver for Xilinx ML507 DIP switch

Following is the snap of the code.

unsigned long start=0x81460000; //DIP switch address starts from here
unsigned char __iomem *virtuaddr;
unsigned char* dip_gpio_buffer;
struct resource *rs;

rs = request_mem_region(start,16,"dip_gpio") //inside dip_gpio_init(void)
virtuaddr =ioremap(start,16); //inside dip_gpio_init(void)
*dip_gpio_buffer = ioread32be(virtuaddr);// inside dip_gpio_read(..)

On ML507 console:

/home/FGU # insmod hello.ko //Following 4 lines printed using printk inside dip_gpio_init(void)
[317158215.172014] Successful request_mem_region()!
[317158215.172054] Device name:dip_gpio
[317158215.172078] Flags:80000000
[317158215.182674] Virtual Addr:D1052000

/home/FGU # cat /proc/iomem
81000000-8100ffff : xilinx_emaclite
81460000-8146000f : dip_gpio
84000000-8400000f : uartlite

/home/FGU # cat /proc/vmallocinfo
0xd1040000-0xd1051000   69632 of_iomap+0x38/0x48 ioremap

.
.

0xd1052000-0xd1054000    8192 dip_gpio_init+0x9c/0x128 [hello] ioremap
0xd10a0000-0xd10b1000   69632 xemaclite_of_probe+0x120/0x3e0 ioremap
0xd10c0000-0xd10d1000   69632 xilinx_iic_of_probe+0x140/0x380 ioremap

/home/FGU # cat /dev/dip_gpio
[317158234.882604] Opening hello device at virtual address D1052000
[317158234.887715] Reading hello device D1052000
[317158234.891976] Unable to handle kernel paging request for data at address 0x00000000
[317158234.899805] Faulting instruction address: 0xd103921c
[317158234.905097] Oops: Kernel access of bad area, sig: 11 [#1]

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
7,725 Views
Registered: ‎09-10-2008

Re: linux driver : Unable to handle kernel paging request for data at address 0x00000000

Jump to solution

Looks like the i/o is working to me and something else in your driver is using a null pointer.  Not enough code there to really tell.

View solution in original post

2 Replies
Xilinx Employee
Xilinx Employee
7,726 Views
Registered: ‎09-10-2008

Re: linux driver : Unable to handle kernel paging request for data at address 0x00000000

Jump to solution

Looks like the i/o is working to me and something else in your driver is using a null pointer.  Not enough code there to really tell.

View solution in original post

6,211 Views
Registered: ‎02-23-2011

Re: linux driver : Unable to handle kernel paging request for data at address 0x00000000

Jump to solution

Dear John,

Thanx for your quick reply

 

I found the mistake I made,

As you said somewhere in code using a null pointer.

 

I forgot to initialize the pointer for buffer where I'm storing the read32be() return value..

 

Thanx again thanx for reply

Ravi

0 Kudos