Omap3630, rtserial, xeno_16550A: crash on insmod
Dear Xenomai-Developers/Users,
I am trying to get xenomai running on an omap3630 device (gumstix overo). xenomai 2.6.0/kernel: linux-omap3-2.6.38 / i-pipe patch 2.6.38.8-arm-1.18.04
I would like to use the UART devices in a RT-application,
and I was following the following guidelines:
http://www.xenomai.org/index.php/16550A
I had to do some changes to Kconfig in arch/arm/mach-omap2:Kconfig, so that the omap_serial driver would not be compiled-in and so that
I could actually disable the driver with setserial
(and correspondingly had to make some changes here and there because the
devices are now called /dev/ttySx and not /dev/ttyOx, as in theomap_serial driver...)
dmesg then reports:
serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 72) is a ST16654 serial8250.1: ttyS1 at MMIO 0x4806c000 (irq = 73) is a ST16654 serial8250.2: ttyS2 at MMIO 0x49020000 (irq = 74) is a ST16654 serial8250.3: ttyS3 at MMIO 0x49042000 (irq = 80) is a ST16654
Anyway, finally I was able to the following:
Quoted 2 lines
setserial
/dev/ttyS0uart none
modprobexeno_16550Amem=0x4806a000 irq=72 baud_base=3000000
(parameters same as here:
http://www.mail-archive.com/[email protected]
)
And then I immediately get the following Error:
--------------------
Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa06a002
Internal error: : 1028 [#1] last sysfs file: /sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:aaaa/... .../block/mmcblk0/size Modules linked in: xeno_16550A(+) ipv6 libertas_sdio libertas option ads7846 cfg80211 usb_wwan lib80211 usbserial firmware_class CPU: 0 Not tainted (2.6.38 #1) PC is at init_module+0x170/0x284 [xeno_16550A] LR is at init_module+0x11c/0x284 [xeno_16550A] pc : [<bf0f0170>] lr : [<bf0f011c>] psr: 60000013
sp : dda0ff28 ip : 4806a000 fp : bf0ece4c
r10: bf0eced0 r9 : bf0ece6c r8 : bf0ece90
r7 : defeb380 r6 : 00000000 r5 : 00000000 r4 : defeb38c r3 : 00000000 r2 : fa06a000 r1 : 00000001 r0 : fa06a000
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: 9e558019 DAC: 00000015 Process insmod (pid: 4467, stack limit = 0xdda0e2f0)
Stack: (0xdda0ff28 to 0xdda10000)
<snip>
[<bf0f0170>] (init_module+0x170/0x284 [xeno_16550A]) from [<c003a494>] (do_one_initcall+0xc8/0x19c) [<c003a494>] (do_one_initcall+0xc8/0x19c) from [<c0096f98>] (sys_init_module+0x94/0x1b4) [<c0096f98>] (sys_init_module+0x94/0x1b4) from [<c0040400>] (ret_fast_syscall+0x0/0x30)
Code: 1a000002 e5d23002 f57ff05f ea000003 (e5d23002) ---[ end trace 260381790a98f885 ]--- overo Internal error: : 1028 [#1] overo last sysfs file: /sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc0/ mmc0:aaaa/block/mmcblk0/size overo Process insmod (pid: 4467, stack limit = 0xdda0e2f0)
Segmentation fault
----------------------
Has anyone seen something similar?
Is this possibly a bug in the xeno16550A driver module, or perhaps a bug in the omap3 kernel?
How can I debug this? (is there a way to run gdb on insmod?)
Any help with this issue is highly appreciated.
Regards
Manfred
Quoted 26 lines · Manfred
Dear Xenomai-Developers/Users,
I am trying to get xenomai running on an omap3630 device (gumstix overo). xenomai 2.6.0/kernel: linux-omap3-2.6.38 / i-pipe patch 2.6.38.8-arm-1.18.04
I would like to use the UART devices in a RT-application,
and I was following the following guidelines:
http://www.xenomai.org/index.php/16550AI had to do some changes to
Kconfigin arch/arm/mach-omap2:Kconfig, so that theomap_serialdriver would not be compiled-in and so that
I could actually disable the driver with setserial
(and correspondingly had to make some changes here and there because the
devices are now called/dev/ttySxand not/dev/ttyOx, as in theomap_serialdriver...)dmesg then reports:
serial8250.0: ttyS0 at MMIO0x4806a000(irq = 72) is a ST16654 serial8250.1: ttyS1 at MMIO0x4806c000(irq = 73) is a ST16654 serial8250.2: ttyS2 at MMIO0x49020000(irq = 74) is a ST16654 serial8250.3: ttyS3 at MMIO0x49042000(irq = 80) is a ST16654Anyway, finally I was able to the following:
Quoted 2 lines
setserial
/dev/ttyS0uart none
modprobexeno_16550Amem=0x4806a000 irq=72 baud_base=3000000
Quoted 8 lines
(parameters same as here:
http://www.mail-archive.com/[email protected]
)And then I immediately get the following Error:
--------------------
Unhandled fault: external abort on non-linefetch (0x1028) at0xfa06a002
The address is not aligned on a 4 bytes boundary, and clearly in the ioremap/vmalloc range, so, disassemble the module code and check what happens at bf0f0170 (you have to add the module load address as from /proc/modules to the addresses obtained when disassembling the .ko file), if you see an "ldrh" there, then something went wrong with the mapping of hardware registers. If you see an "ldr", then you get an unaligned access.
Quoted 1 line
pc : [<bf0f0170>] lr : [<bf0f011c>] psr: 60000013
Signature · 1 line
Gilles.
Quoted 10 lines · Manfred
Dear Xenomai-Developers/Users,
I am trying to get xenomai running on an omap3630 device (gumstix overo). xenomai 2.6.0/kernel: linux-omap3-2.6.38 / i-pipe patch 2.6.38.8-arm-1.18.04
I would like to use the UART devices in a RT-application,
and I was following the following guidelines:
http://www.xenomai.org/index.php/16550A
Quoted 6 lines
I had to do some changes to
Kconfigin arch/arm/mach-omap2:Kconfig, so that theomap_serialdriver would not be compiled-in and so that
I could actually disable the driver with setserial
(and correspondingly had to make some changes here and there because the
devices are now called/dev/ttySxand not/dev/ttyOx, as in theomap_serialdriver...)
I wonder why that's all necessary. On x86, just just do "setserial /dev/ttyS0 uart none" before loading 16550A. Why is the name a problem?
Quoted 14 lines
dmesg then reports:
serial8250.0: ttyS0 at MMIO0x4806a000(irq = 72) is a ST16654 serial8250.1: ttyS1 at MMIO0x4806c000(irq = 73) is a ST16654 serial8250.2: ttyS2 at MMIO0x49020000(irq = 74) is a ST16654 serial8250.3: ttyS3 at MMIO0x49042000(irq = 80) is a ST16654Anyway, finally I was able to the following:
Quoted 2 lines
setserial
/dev/ttyS0uart none
modprobexeno_16550Amem=0x4806a000 irq=72 baud_base=3000000(parameters same as here:
http://www.mail-archive.com/[email protected]
)
Quoted 5 lines
And then I immediately get the following Error:
--------------------
Unhandled fault: external abort on non-linefetch (0x1028) at0xfa06a002Internal error: : 1028 [#1]
Hm, address might be unaligned. Maybe you need a regshift=2... and some other quirks as well.
Wolfgang.
Ok, so this is my first attempt on trying to debug a kernel module, so please bear with me:
First, I repeated what I did before:
1.) setserial /dev/ttyS0 uart none
2.)modprobe xeno_16550A mem=0x4806a000 irq=72 baud_base=3000000
3.) dmesg->error message with:
Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa06a002
Obtain Address-offset Ad1=0xfa06a002
4.) get address-offset Ad0 from less /proc/modules:
xeno_16550A 14280 1 - Loading 0xbf104000
5.) obtain Ad2=Ad1+Ad0 (google says: 0xbf104000 + 0xfa06a002 = 0x1B916E002) 6.) search for the last octet in the dissassembled kernel-module:
objdump -d -S /lib/modules/2.6.38/kernel/drivers/xenomai/serial/xeno_16550A.ko
Quoted 1 line
xeno16550A.diss
grep -i B916E002 xeno16550A.diss
7.) --> does not return anything? did I get something wrong?
Thanks for your help.
Quoted 47 lines · Gilles Chanteperdrix
Quoted 26 lines · Manfred
Dear Xenomai-Developers/Users,
I am trying to get xenomai running on an omap3630 device (gumstix overo). xenomai 2.6.0/kernel: linux-omap3-2.6.38 / i-pipe patch 2.6.38.8-arm-1.18.04
I would like to use the UART devices in a RT-application,
and I was following the following guidelines:
http://www.xenomai.org/index.php/16550AI had to do some changes to
Kconfigin arch/arm/mach-omap2:Kconfig, so that theomap_serialdriver would not be compiled-in and so that
I could actually disable the driver with setserial
(and correspondingly had to make some changes here and there because the
devices are now called/dev/ttySxand not/dev/ttyOx, as in theomap_serialdriver...)dmesg then reports:
serial8250.0: ttyS0 at MMIO0x4806a000(irq = 72) is a ST16654 serial8250.1: ttyS1 at MMIO0x4806c000(irq = 73) is a ST16654 serial8250.2: ttyS2 at MMIO0x49020000(irq = 74) is a ST16654 serial8250.3: ttyS3 at MMIO0x49042000(irq = 80) is a ST16654Anyway, finally I was able to the following:
Quoted 2 lines
setserial
/dev/ttyS0uart none
modprobexeno_16550Amem=0x4806a000 irq=72 baud_base=3000000Quoted 8 lines
(parameters same as here:
http://www.mail-archive.com/[email protected]
)And then I immediately get the following Error:
--------------------
Unhandled fault: external abort on non-linefetch (0x1028) at0xfa06a002The address is not aligned on a 4 bytes boundary, and clearly in the ioremap/vmalloc range, so, disassemble the module code and check what happens at
bf0f0170(you have to add the module load address as from/proc/modulesto the addresses obtained when disassembling the .ko file), if you see an "ldrh" there, then something went wrong with the mapping of hardware registers. If you see an "ldr", then you get an unaligned access.Quoted 1 line
pc : [<bf0f0170>] lr : [<bf0f011c>] psr: 60000013
Quoted 12 lines · Manfred
Ok, so this is my first attempt on trying to debug a kernel module, so
please bear with me:
First, I repeated what I did before:1.) setserial
/dev/ttyS0uart none2.)modprobe
xeno_16550Amem=0x4806a000 irq=72 baud_base=30000003.)
dmesg->errormessage with:Unhandled fault: external abort on non-linefetch (
0x1028) at0xfa06a002
Quoted 8 lines
Obtain Address-offset Ad1=0xfa06a002
4.) get address-offset Ad0 from less
/proc/modules:
xeno_16550A14280 1 - Loading0xbf1040005.) obtain Ad2=Ad1+Ad0 (google says:
0xbf104000+0xfa06a002=0x1B916E002)
The adress of the fault instruction is the value of the PC register, quoting my previous mail:
Quoted 1 line
Quoted 1 line
check what happens at
bf0f0170
Signature · 1 line
Gilles.