facing problem with io_p2v() function
Hi all,
I am using io_p2v() function in my driver to get the virtual address mapping timer control registers
i am passing address as 0x48304024 as base and after getting the virtual address of it i am reading and writing to it but my any attempt to read the location or write is giving segmentation fault
If i use __pa() to read the corresponding location it returning as 0x98304024 insted of 0x48304024
I dont know where the mapping is going wrong
Even when i tried using ioremap() i got the same kernel panic
Below is the error message
-------------------------------------------------------------------------------------------------------
In init function
Read reg address virt 0xd8304024 and phy 0x98304024 are
Unhandled fault: external abort on non-linefetch (0x1028) at 0xd8304024
Internal error: : 1028 [#1] Modules linked in: omap_timer CPU: 0 Not tainted (2.6.22.1-omap3 #1) PC is at omap_timer_read_register+0x30/0x3c [omap_timer] LR is at release_console_sem+0x1c0/0x1d4 pc : [<bf000160>] lr : [<c005f650>] psr: 60000013
sp : c7f1bea0 ip : c7f1bdd8 fp : c7f1beb4
r10: c8858000 r9 : 00000026 r8 : 00000027
r7 : c06dfdf0 r6 : 00000000 r5 : bf001018 r4 : 00000024 r3 : d8304000 r2 : 00000000 r1 : 60000013 r0 : 0000003d
Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment user
Control: 00c5387f Table: 80694018 DAC: 00000015 Process insmod (pid: 306, stack limit = 0xc7f1a2d0)
Stack: (0xc7f1bea0 to 0xc7f1c000)
bea0: 00000000 bf001018 c7f1bed4 c7f1beb8 bf0001c4 bf00013c 00000000 bf001280
bec0: bf001100 c06dfdf0 c7f1bef4 c7f1bed8 bf0030c4 bf0001b0 00000000 c006b5c4
bee0: c06dfdc4 c06dfc00 c7f1bfa4 c7f1bef8 c007f514 bf00300c 00000000 c0024380
bf00: 000ce008 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bf20: 00000000 00000000 00000000 00000000 00000000 00000000 c886ca30 c07fc200
bf40: 00000000 c8867c88 c88678f0 00000000 00000054 00000054 0000000a c886758f
bf60: c8867cd8 bf00110c c8867cb0 00000024 00000000 c035da98 c0030184 000a81fc
bf80: bebf5d74 00014cdd 00000080 c0029f68 c7f1a000 00000000 00000000 c7f1bfa8
bfa0: c0029dc0 c007e1d8 000a81fc bebf5d74 000ce018 00014cdd 000ce008 00000001
bfc0: 000a81fc bebf5d74 00014cdd 00000080 00000000 bebf5d74 bebf5e54 00000061
bfe0: bebf5a20 bebf5a10 0001e1c0 401d2ec0 60000010 000ce018 00000017 0011b8d8
Backtrace: [<bf000130>] (omap_timer_read_register+0x0/0x3c [omap_timer]) from [<bf0001c4>] (omap_dm_timer_set_l oad+0x20/0x5c [omap_timer]) r5:bf001018 r4:00000000 [<bf0001a4>] (omap_dm_timer_set_load+0x0/0x5c [omap_timer]) from [<bf0030c4>] (omap_gp_timer_init_mo de+0xc4/0xf0 [omap_timer]) r7:c06dfdf0 r6:bf001100 r5:bf001280 r4:00000000 [<bf003000>] (omap_gp_timer_init_mode+0x0/0xf0 [omap_timer]) from [<c007f514>] (sys_init_module+0x13
48/0x1400)
r5:c06dfc00 r4:c06dfdc4
[<c007e1cc>] (sys_init_module+0x0/0x1400) from [<c0029dc0>] (ret_fast_syscall+0x0/0x2c)
Code: e1a01003 e59f000c eb417e8b e5953010 (e7930004)
Segmentation fault
-----------------------------------------------------------------------------------------------------------
Looking forward for the suggestion for the above problem
----- Misbah <><
Signature · 2 lines
View this message in context: http://www.nabble.com/facing-problem-with-io_p2v%28%29-function-tp18965524p18965524.html Sent from the linuxppc-embedded mailing list archive at Nabble.com.
Quoted 76 lines · Misbah khan
Hi all,
I am using
io_p2v()function in my driver to get the virtual address mapping timer control registersi am passing address as
0x48304024as base and after getting the virtual address of it i am reading and writing to it but my any attempt to read the location or write is giving segmentation faultIf i use
__pa()to read the corresponding location it returning as0x98304024insted of0x48304024I dont know where the mapping is going wrong
Even when i tried using
ioremap()i got the same kernel panicBelow is the error message
-------------------------------------------------------------------------------------------------------
In init function
Read reg address virt0xd8304024and phy0x98304024are
Unhandled fault: external abort on non-linefetch (0x1028) at0xd8304024Internal error: : 1028 [#1] Modules linked in: omap_timer CPU: 0 Not tainted (2.6.22.1-omap3 #1) PC is at omap_timer_read_register+0x30/0x3c [omap_timer] LR is at release_console_sem+0x1c0/0x1d4 pc : [<bf000160>] lr : [<c005f650>] psr: 60000013sp :
c7f1bea0ip :c7f1bdd8fp :c7f1beb4
r10:c8858000r9 : 00000026 r8 : 00000027
r7 :c06dfdf0r6 : 00000000 r5 :bf001018r4 : 00000024 r3 :d8304000r2 : 00000000 r1 : 60000013 r0 :0000003d
Flags: nZCv IRQs on FIQs on ModeSVC_32Segment user
Control:00c5387fTable: 80694018 DAC: 00000015 Process insmod (pid: 306, stack limit =0xc7f1a2d0)Stack: (0xc7f1bea0 to 0xc7f1c000)bea0: 00000000
bf001018c7f1bed4c7f1beb8bf0001c4bf00013c00000000bf001280
bec0:bf001100c06dfdf0c7f1bef4c7f1bed8bf0030c4bf0001b000000000c006b5c4
bee0:c06dfdc4c06dfc00c7f1bfa4c7f1bef8c007f514bf00300c00000000c0024380
bf00:000ce00800000000 00000000 00000000 00000000 00000000 00000000 00000000
bf20: 00000000 00000000 00000000 00000000 00000000 00000000c886ca30c07fc200
bf40: 00000000c8867c88c88678f000000000 00000054 000000540000000ac886758f
bf60:c8867cd8bf00110cc8867cb000000024 00000000c035da98c0030184000a81fc
bf80:bebf5d7400014cdd00000080c0029f68c7f1a00000000000 00000000c7f1bfa8
bfa0:c0029dc0c007e1d8000a81fcbebf5d74000ce01800014cdd000ce00800000001
bfc0:000a81fcbebf5d7400014cdd00000080 00000000bebf5d74bebf5e5400000061
bfe0:bebf5a20bebf5a100001e1c0401d2ec060000010000ce018000000170011b8d8Backtrace: [<bf000130>] (omap_timer_read_register+0x0/0x3c [omap_timer]) from [<bf0001c4>] (omap_dm_timer_set_l oad+0x20/0x5c [omap_timer]) r5:bf001018 r4:00000000 [<bf0001a4>] (omap_dm_timer_set_load+0x0/0x5c [omap_timer]) from [<bf0030c4>] (omap_gp_timer_init_mo de+0xc4/0xf0 [omap_timer]) r7:c06dfdf0 r6:bf001100 r5:bf001280 r4:00000000 [<bf003000>] (omap_gp_timer_init_mode+0x0/0xf0 [omap_timer]) from [<c007f514>] (sys_init_module+0x1348/0x1400)
r5:c06dfc00 r4:c06dfdc4
[<c007e1cc>] (sys_init_module+0x0/0x1400) from [<c0029dc0>] (ret_fast_syscall+0x0/0x2c)Code: e1a01003 e59f000c eb417e8b e5953010 (e7930004)
Quoted 9 lines
Segmentation fault
-----------------------------------------------------------------------------------------------------------
Looking forward for the suggestion for the above problem
----- Misbah <><
Did you try the ioremap() function for this?
Quoted 1 line · Misbah khan
Below is the error message
The below panic is not from a powerpc system, it looks like it might be from ARM. I suggest you find an ARM embedded list to ask these questions on.
-Olof