USB Driver Issues

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

igortf
Posts: 14
Joined: Tue Mar 27, 2018 8:27 pm

USB Driver Issues

Tue Mar 19, 2019 12:38 pm

Hello,

I am using a custom board with SAMA5D27C-D5M SIP and Linux4Sam (Kernel 4.9-98 with full real-time patch 76). I verified some problems with the USB when I remove a mass storage device without umount. Sometimes I have a watchdog, others some access violation (both in kernel and user space). Is there a known problem with the USB driver? How can I debug this problem since its effects seem so random?

Thanks in advance,
Igor Franco
blue_z
Location: USA
Posts: 1848
Joined: Thu Apr 19, 2007 10:15 pm

Re: USB Driver Issues

Wed Mar 20, 2019 9:06 pm

What makes you think this is a "USB driver issue" rather than something else such as filesystem issue?
Why not track down what these "access violation"s mean?

Regards
igortf
Posts: 14
Joined: Tue Mar 27, 2018 8:27 pm

Re: USB Driver Issues

Tue Mar 26, 2019 9:24 pm

Hello blue_z,

I think it is the driver because I am connecting and disconnecting the USB device before the mounting. So, there isn't any filesystem yet. And the access violation doesn't have anything useful. It seems to be something invading memory. I tested without the Real Time and I still had problems. One of the tests resulted in the follow error:

Code: Select all

usb 1-1: new high-speed USB device number 97 using atmel-ehci
usb 1-1: New USB device found, idVendor=13fe, idProduct=4200
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: USB DISK 2.0
usb 1-1: Manufacturer:
usb 1-1: SerialNumber: 270088257A551B53
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access              USB DISK 2.0     PMAP PQ: 0 ANSI: 6
sd 0:0:0:0: [sda] 15130624 512-byte logical blocks: (7.75 GB/7.21 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] No Caching mode page found
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk
usb 1-1: USB disconnect, device number 97
Internal error: Oops - undefined instruction: 0 [#1] ARM
Modules linked in:
CPU: 0 PID: 388 Comm: OPCUAServer Not tainted 4.9.98-rt76-g9302106 #50
Hardware name: Atmel SAMA5
task: c303c380 task.stack: c306e000
PC is at __schedule+0x268/0x304
LR is at put_prev_task_fair+0x18/0x28
pc : [<c05fb9a0>]    lr : [<c013e5b8>]    psr: 600d0093
sp : c306fec8  ip : 00000001  fp : c306fee4
r10: 00000000  r9 : c09f8d80  r8 : 00000000
r7 : c0a0d7c0  r6 : 00009632  r5 : c303c380  r4 : c0a07c00
r3 : c09f8da8  r2 : 00151ad4  r1 : 600d0093  r0 : 00000000
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 22640059  DAC: 00000051
Process OPCUAServer (pid: 388, stack limit = 0xc306e208)
Stack: (0xc306fec8 to 0xc3070000)
fec0:                   c303c380 c306e000 00000000 b34dee00 00000001 0000c350
fee0: c306fef4 c05fba8c c306ff28 c306e000 00000000 c05ffbb8 0000c350 00000000
ff00: 00000001 c015af20 000f4240 000f4240 00000000 c015bb10 0000c350 00000000
ff20: 00100590 00000000 c25aff29 c11f1e58 c3041f28 00000000 d18c2cc1 000000b1
ff40: d18b6971 000000b1 c015af98 c0b72a00 00000001 c306ff54 c306ff54 00000001
ff60: 00000000 00000000 c303c380 b34dee00 005ab870 00000051 b34dee00 005ab870
ff80: 000000a2 c01076c4 c306e000 c015bc50 00000000 000f4240 0000008e b34dedf8
ffa0: b34dee00 c01074e0 b34dedf8 b34dee00 b34dedf8 b34dee00 00000002 00000002
ffc0: b34dedf8 b34dee00 005ab870 000000a2 0043302c b34defa0 bef2eaa4 00000000
ffe0: 00000002 b34dedf0 b6ec9bb9 b6ec9bc0 600d0030 b34dedf8 ebffff3a e28dd024
[<c05fb9a0>] (__schedule) from [<c05fba8c>] (schedule+0x50/0xd4)
[<c05fba8c>] (schedule) from [<c05ffbb8>] (do_nanosleep.constprop.5+0x84/0x144)
[<c05ffbb8>] (do_nanosleep.constprop.5) from [<c015bb10>] (hrtimer_nanosleep+0x90/0x12c)
[<c015bb10>] (hrtimer_nanosleep) from [<c015bc50>] (SyS_nanosleep+0xa4/0xd4)
[<c015bc50>] (SyS_nanosleep) from [<c01074e0>] (ret_fast_syscall+0x0/0x50)
Code: eaffffda e2893028 e5849158 f5d3f000 (20012f9f)
---[ end trace 16a6ed339b8503b7 ]---
Internal error: Oops - undefined instruction: 0 [#2] ARM
Modules linked in:
CPU: 0 PID: 388 Comm: OPCUAServer Tainted: G      D         4.9.98-rt76-g9302106 #50
Hardware name: Atmel SAMA5
task: c303c380 task.stack: c306e000
PC is at __schedule+0x268/0x304
LR is at pick_next_task_rt+0x3c/0x144
pc : [<c05fb9a0>]    lr : [<c013f024>]    psr: 600d0093
sp : c306fd48  ip : 00000001  fp : c306fd64
r10: c303c380  r9 : c09f8d80  r8 : 00000000
r7 : c0a0d7c0  r6 : 00000000  r5 : c0a07c00  r4 : c0038d80
r3 : c09f8da8  r2 : 00151ad5  r1 : 800d0093  r0 : 00000000
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 22640059  DAC: 00000051
Process OPCUAServer (pid: 388, stack limit = 0xc306e208)
Stack: (0xc306fd48 to 0xc3070000)
fd40:                   c303c380 c306fb94 00000000 c3b48000 c306fd80 c303c550
fd60: c306fd74 c0139494 00000000 00000001 c306fee4 c011969c 00000002 00000001
fd80: c306fd80 c306fd80 c014f780 c0b9c184 c0a09970 c306fe78 600d0093 0000000b
fda0: 00000000 c303c380 c306fee4 c010ad68 c306e208 0000000b 00000004 c306fe78
fdc0: c05fb9a0 20012f9f 00000000 c010b638 c306e000 c01010d0 00000006 00000000
fde0: 00000004 00000000 00030001 c05fb9a0 c1156284 00000000 c303c380 00000001
fe00: c0cc210c c01456fc c1154dbc 00000016 ffffffff 00000000 c303c380 c303c380
fe20: c1154dbc c0b7cca8 c0a0d7d0 00000000 c303c380 00000000 00000000 600d0093
fe40: c0a0d7c0 00000001 00000001 c0143f00 c303c3b0 c0a0d818 c0a0d7c0 c013d080
fe60: c05fb9a4 00000000 c010bad8 00000000 20000000 c010b638 00000000 600d0093
fe80: 00151ad4 c09f8da8 c0a07c00 c303c380 00009632 c0a0d7c0 00000000 c09f8d80
fea0: 00000000 c306fee4 00000001 c306fec8 c013e5b8 c05fb9a0 600d0093 ffffffff
fec0: 00000051 bf000000 c303c380 c306e000 00000000 b34dee00 00000001 0000c350
fee0: c306fef4 c05fba8c c306ff28 c306e000 00000000 c05ffbb8 0000c350 00000000
ff00: 00000001 c015af20 000f4240 000f4240 00000000 c015bb10 0000c350 00000000
ff20: 00100590 00000000 c306ff28 c11f1e58 00000000 00000000 d18c2cc1 000000b1
ff40: d18b6971 000000b1 c015af98 c0b72a00 00000000 c306ff54 c306ff54 00000001
ff60: 00000000 00000000 00000000 b34dee00 005ab870 00000051 b34dee00 005ab870
ff80: 000000a2 c01076c4 c306e000 c015bc50 00000000 000f4240 0000008e b34dedf8
ffa0: b34dee00 c01074e0 b34dedf8 b34dee00 b34dedf8 b34dee00 00000002 00000002
ffc0: b34dedf8 b34dee00 005ab870 000000a2 0043302c b34defa0 bef2eaa4 00000000
ffe0: 00000002 b34dedf0 b6ec9bb9 b6ec9bc0 600d0030 b34dedf8 ebffff3a e28dd024
[<c05fb9a0>] (__schedule) from [<c0139494>] (do_task_dead+0x68/0x6c)
[<c0139494>] (do_task_dead) from [<c011969c>] (do_exit+0x614/0x9b0)
[<c011969c>] (do_exit) from [<c010ad68>] (die+0x29c/0x2a8)
[<c010ad68>] (die) from [<c01010d0>] (do_undefinstr+0xbc/0x234)
[<c01010d0>] (do_undefinstr) from [<c010b638>] (__und_svc_finish+0x0/0x48)
Exception stack(0xc306fe78 to 0xc306fec0)
fe60:                                                       00000000 600d0093
fe80: 00151ad4 c09f8da8 c0a07c00 c303c380 00009632 c0a0d7c0 00000000 c09f8d80
fea0: 00000000 c306fee4 00000001 c306fec8 c013e5b8 c05fb9a0 600d0093 ffffffff
[<c010b638>] (__und_svc_finish) from [<c05fb9a0>] (__schedule+0x268/0x304)
[<c05fb9a0>] (__schedule) from [<c05fba8c>] (schedule+0x50/0xd4)
[<c05fba8c>] (schedule) from [<c05ffbb8>] (do_nanosleep.constprop.5+0x84/0x144)
[<c05ffbb8>] (do_nanosleep.constprop.5) from [<c015bb10>] (hrtimer_nanosleep+0x90/0x12c)
[<c015bb10>] (hrtimer_nanosleep) from [<c015bc50>] (SyS_nanosleep+0xa4/0xd4)
[<c015bc50>] (SyS_nanosleep) from [<c01074e0>] (ret_fast_syscall+0x0/0x50)
Code: eaffffda e2893028 e5849158 f5d3f000 (20012f9f)
---[ end trace 16a6ed339b8503b8 ]---
Fixing recursive fault but reboot is needed!
Unable to handle kernel NULL pointer dereference at virtual address 00000504
pgd = c0004000
[00000504] *pgd=00000000
Internal error: Oops: 17 [#3] ARM
Modules linked in:
CPU: 0 PID: 388 Comm: OPCUAServer Tainted: G      D         4.9.98-rt76-g9302106 #50
Hardware name: Atmel SAMA5
task: c303c380 task.stack: c306e000
PC is at do_raw_spin_trylock+0x8/0x58
LR is at _raw_spin_lock_irq+0x44/0x74
pc : [<c01492f4>]    lr : [<c0600130>]    psr: 600d0093
sp : c306fba0  ip : c306e000  fp : c306fd64
r10: c303c380  r9 : 00000000  r8 : c1159e40
r7 : c0119128  r6 : 00000504  r5 : c0123b30  r4 : 00000514
r3 : c303c380  r2 : 00000000  r1 : 00000000  r0 : 00000504
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 22640059  DAC: 00000051
Process OPCUAServer (pid: 388, stack limit = 0xc306e208)
Stack: (0xc306fba0 to 0xc3070000)
fba0: 00000514 c0600130 00000001 00000000 c0123b30 c303c380 c303c380 00000000
fbc0: c1159ec0 c0123b30 00000001 00000000 c0119128 ffffffff 00000051 bf000000
fbe0: c303c380 c0a09970 c306fcf8 0000000b 0000000b c0119128 00000002 c014f7b0
fc00: 600d0093 00000000 c014f780 c0b9c184 c0a09970 c306fcf8 600d0093 0000000b
fc20: 00000000 c303c380 c306fd64 c010ad68 c306e208 0000000b 00000004 c306fcf8
fc40: c05fb9a0 20012f9f 00000000 c010b638 c306e000 c01010d0 00000006 c03361c4
fc60: 00000004 00000000 00030001 c05fb9a0 c03361c4 c144ce7c c144ce7c 00080040
fc80: c01e3a94 c01e3b24 c144ce10 c30597d0 c144ce7c 00000000 600d0093 00000000
fca0: 600d0093 00000001 ffffffff 00000000 00000003 c0a0d7c0 c0a0d7c0 00000001
fcc0: c3b49b30 c0a0d818 e51ced26 0000000a 600d0093 00000000 600d0093 00000001
fce0: c05fb9a4 00000000 c010bad8 00000000 20000000 c010b638 00000000 800d0093
fd00: 00151ad5 c09f8da8 c0038d80 c0a07c00 00000000 c0a0d7c0 00000000 c09f8d80
fd20: c303c380 c306fd64 00000001 c306fd48 c013f024 c05fb9a0 600d0093 ffffffff
fd40: 00000051 bf000000 c303c380 c306fb94 00000000 c3b48000 c306fd80 c303c550
fd60: c306fd74 c0139494 00000000 00000001 c306fee4 c011969c 00000002 00000001
fd80: c306fd80 c306fd80 c014f780 c0b9c184 c0a09970 c306fe78 600d0093 0000000b
fda0: 00000000 c303c380 c306fee4 c010ad68 c306e208 0000000b 00000004 c306fe78
fdc0: c05fb9a0 20012f9f 00000000 c010b638 c306e000 c01010d0 00000006 00000000
fde0: 00000004 00000000 00030001 c05fb9a0 c1156284 00000000 c303c380 00000001
fe00: c0cc210c c01456fc c1154dbc 00000016 ffffffff 00000000 c303c380 c303c380
fe20: c1154dbc c0b7cca8 c0a0d7d0 00000000 c303c380 00000000 00000000 600d0093
fe40: c0a0d7c0 00000001 00000001 c0143f00 c303c3b0 c0a0d818 c0a0d7c0 c013d080
fe60: c05fb9a4 00000000 c010bad8 00000000 20000000 c010b638 00000000 600d0093
fe80: 00151ad4 c09f8da8 c0a07c00 c303c380 00009632 c0a0d7c0 00000000 c09f8d80
fea0: 00000000 c306fee4 00000001 c306fec8 c013e5b8 c05fb9a0 600d0093 ffffffff
fec0: 00000051 bf000000 c303c380 c306e000 00000000 b34dee00 00000001 0000c350
fee0: c306fef4 c05fba8c c306ff28 c306e000 00000000 c05ffbb8 0000c350 00000000
ff00: 00000001 c015af20 000f4240 000f4240 00000000 c015bb10 0000c350 00000000
ff20: 00100590 00000000 c306ff28 c11f1e58 00000000 00000000 d18c2cc1 000000b1
ff40: d18b6971 000000b1 c015af98 c0b72a00 00000000 c306ff54 c306ff54 00000001
ff60: 00000000 00000000 00000000 b34dee00 005ab870 00000051 b34dee00 005ab870
ff80: 000000a2 c01076c4 c306e000 c015bc50 00000000 000f4240 0000008e b34dedf8
ffa0: b34dee00 c01074e0 b34dedf8 b34dee00 b34dedf8 b34dee00 00000002 00000002
ffc0: b34dedf8 b34dee00 005ab870 000000a2 0043302c b34defa0 bef2eaa4 00000000
ffe0: 00000002 b34dedf0 b6ec9bb9 b6ec9bc0 600d0030 b34dedf8 ebffff3a e28dd024
[<c01492f4>] (do_raw_spin_trylock) from [<c0600130>] (_raw_spin_lock_irq+0x44/0x74)
[<c0600130>] (_raw_spin_lock_irq) from [<c0123b30>] (exit_signals+0xdc/0x1f4)
[<c0123b30>] (exit_signals) from [<c0119128>] (do_exit+0xa0/0x9b0)
[<c0119128>] (do_exit) from [<c010ad68>] (die+0x29c/0x2a8)
[<c010ad68>] (die) from [<c01010d0>] (do_undefinstr+0xbc/0x234)
[<c01010d0>] (do_undefinstr) from [<c010b638>] (__und_svc_finish+0x0/0x48)
Exception stack(0xc306fcf8 to 0xc306fd40)
fce0:                                                       00000000 800d0093
fd00: 00151ad5 c09f8da8 c0038d80 c0a07c00 00000000 c0a0d7c0 00000000 c09f8d80
fd20: c303c380 c306fd64 00000001 c306fd48 c013f024 c05fb9a0 600d0093 ffffffff
[<c010b638>] (__und_svc_finish) from [<c05fb9a0>] (__schedule+0x268/0x304)
[<c05fb9a0>] (__schedule) from [<c0139494>] (do_task_dead+0x68/0x6c)
[<c0139494>] (do_task_dead) from [<c011969c>] (do_exit+0x614/0x9b0)
[<c011969c>] (do_exit) from [<c010ad68>] (die+0x29c/0x2a8)
[<c010ad68>] (die) from [<c01010d0>] (do_undefinstr+0xbc/0x234)
[<c01010d0>] (do_undefinstr) from [<c010b638>] (__und_svc_finish+0x0/0x48)
Exception stack(0xc306fe78 to 0xc306fec0)
fe60:                                                       00000000 600d0093
fe80: 00151ad4 c09f8da8 c0a07c00 c303c380 00009632 c0a0d7c0 00000000 c09f8d80
fea0: 00000000 c306fee4 00000001 c306fec8 c013e5b8 c05fb9a0 600d0093 ffffffff
[<c010b638>] (__und_svc_finish) from [<c05fb9a0>] (__schedule+0x268/0x304)
[<c05fb9a0>] (__schedule) from [<c05fba8c>] (schedule+0x50/0xd4)
[<c05fba8c>] (schedule) from [<c05ffbb8>] (do_nanosleep.constprop.5+0x84/0x144)
[<c05ffbb8>] (do_nanosleep.constprop.5) from [<c015bb10>] (hrtimer_nanosleep+0x90/0x12c)
[<c015bb10>] (hrtimer_nanosleep) from [<c015bc50>] (SyS_nanosleep+0xa4/0xd4)
[<c015bc50>] (SyS_nanosleep) from [<c01074e0>] (ret_fast_syscall+0x0/0x50)
Code: ebffff90 eaffffe6 e3a02000 e92d4010 (e5904000)
---[ end trace 16a6ed339b8503b9 ]---
Fixing recursive fault but reboot is needed!
Unable to handle kernel NULL pointer dereference at virtual address 00000504
pgd = c0004000
[00000504] *pgd=00000000
Internal error: Oops: 17 [#4] ARM
Modules linked in:
CPU: 0 PID: 388 Comm: OPCUAServer Tainted: G      D         4.9.98-rt76-g9302106 #50
Hardware name: Atmel SAMA5
task: c303c380 task.stack: c306e000
PC is at do_raw_spin_trylock+0x8/0x58
LR is at _raw_spin_lock_irq+0x44/0x74
pc : [<c01492f4>]    lr : [<c0600130>]    psr: 600d0193
sp : c306f9b8  ip : c306e000  fp : c306fd64
r10: c303c380  r9 : 00000017  r8 : c1159e40
r7 : c0119128  r6 : 00000504  r5 : c0123b30  r4 : 00000514
r3 : c303c380  r2 : 00000000  r1 : 00000000  r0 : 00000504
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 22640059  DAC: 00000051
Process OPCUAServer (pid: 388, stack limit = 0xc306e208)
Stack: (0xc306f9b8 to 0xc3070000)
f9a0:                                                       00000514 c0600130
f9c0: 00000001 00000000 c0123b30 c303c380 c303c380 00000000 c1159ec0 c0123b30
f9e0: 00000001 00000000 c0119128 ffffffff 00000051 bf000000 c303c380 c0a09970
fa00: c306fb50 0000000b 0000000b c0119128 00000002 c014f7b0 600d0193 00000000
fa20: c014f780 c0b9c184 c0a09970 c306fb50 600d0193 0000000b 00000017 c303c380
fa40: c306fd64 c010ad68 c306e208 0000000b 00000504 c306fb50 00000017 00000000
fa60: 00000504 c306e000 c303c380 c01133e4 00000017 c010f18c c118f000 c0b9bd93
fa80: c306fbf4 c01462e0 00000001 c0a09b74 00000017 c010eee4 00000504 c306fb50
faa0: c306e000 c303c380 c306fd64 c01012f0 c118f610 00000000 c118f5e0 0000001b
fac0: c118f000 c0b9bd93 c118f8f0 c06003cc c3e23540 00000000 600d0193 00000001
fae0: 00000001 c2004200 c306e000 c303c380 c306fbf4 c01462e0 00000001 00000080
fb00: 00000000 c0150b74 00000000 00000000 c0600420 c207a078 c0150b74 c207a068
fb20: c207a078 c0600040 00000001 00000000 c0150b74 00000084 c01492f4 600d0093
fb40: ffffffff c306fb84 c1159e40 c010b4f8 00000504 00000000 00000000 c303c380
fb60: 00000514 c0123b30 00000504 c0119128 c1159e40 00000000 c303c380 c306fd64
fb80: c306e000 c306fba0 c0600130 c01492f4 600d0093 ffffffff 00000051 bf000000
fba0: 00000514 c0600130 00000001 00000000 c0123b30 c303c380 c303c380 00000000
fbc0: c1159ec0 c0123b30 00000001 00000000 c0119128 ffffffff 00000051 bf000000
fbe0: c303c380 c0a09970 c306fcf8 0000000b 0000000b c0119128 00000002 c014f7b0
fc00: 600d0093 00000000 c014f780 c0b9c184 c0a09970 c306fcf8 600d0093 0000000b
fc20: 00000000 c303c380 c306fd64 c010ad68 c306e208 0000000b 00000004 c306fcf8
fc40: c05fb9a0 20012f9f 00000000 c010b638 c306e000 c01010d0 00000006 c03361c4
fc60: 00000004 00000000 00030001 c05fb9a0 c03361c4 c144ce7c c144ce7c 00080040
fc80: c01e3a94 c01e3b24 c144ce10 c30597d0 c144ce7c 00000000 600d0093 00000000
fca0: 600d0093 00000001 ffffffff 00000000 00000003 c0a0d7c0 c0a0d7c0 00000001
fcc0: c3b49b30 c0a0d818 e51ced26 0000000a 600d0093 00000000 600d0093 00000001
fce0: c05fb9a4 00000000 c010bad8 00000000 20000000 c010b638 00000000 800d0093
fd00: 00151ad5 c09f8da8 c0038d80 c0a07c00 00000000 c0a0d7c0 00000000 c09f8d80
fd20: c303c380 c306fd64 00000001 c306fd48 c013f024 c05fb9a0 600d0093 ffffffff
fd40: 00000051 bf000000 c303c380 c306fb94 00000000 c3b48000 c306fd80 c303c550
fd60: c306fd74 c0139494 00000000 00000001 c306fee4 c011969c 00000002 00000001
fd80: c306fd80 c306fd80 c014f780 c0b9c184 c0a09970 c306fe78 600d0093 0000000b
fda0: 00000000 c303c380 c306fee4 c010ad68 c306e208 0000000b 00000004 c306fe78
fdc0: c05fb9a0 20012f9f 00000000 c010b638 c306e000 c01010d0 00000006 00000000
fde0: 00000004 00000000 00030001 c05fb9a0 c1156284 00000000 c303c380 00000001
fe00: c0cc210c c01456fc c1154dbc 00000016 ffffffff 00000000 c303c380 c303c380
fe20: c1154dbc c0b7cca8 c0a0d7d0 00000000 c303c380 00000000 00000000 600d0093
fe40: c0a0d7c0 00000001 00000001 c0143f00 c303c3b0 c0a0d818 c0a0d7c0 c013d080
fe60: c05fb9a4 00000000 c010bad8 00000000 20000000 c010b638 00000000 600d0093
fe80: 00151ad4 c09f8da8 c0a07c00 c303c380 00009632 c0a0d7c0 00000000 c09f8d80
fea0: 00000000 c306fee4 00000001 c306fec8 c013e5b8 c05fb9a0 600d0093 ffffffff
fec0: 00000051 bf000000 c303c380 c306e000 00000000 b34dee00 00000001 0000c350
fee0: c306fef4 c05fba8c c306ff28 c306e000 00000000 c05ffbb8 0000c350 00000000
ff00: 00000001 c015af20 000f4240 000f4240 00000000 c015bb10 0000c350 00000000
ff20: 00100590 00000000 c306ff28 c11f1e58 00000000 00000000 d18c2cc1 000000b1
ff40: d18b6971 000000b1 c015af98 c0b72a00 00000000 c306ff54 c306ff54 00000001
ff60: 00000000 00000000 00000000 b34dee00 005ab870 00000051 b34dee00 005ab870
ff80: 000000a2 c01076c4 c306e000 c015bc50 00000000 000f4240 0000008e b34dedf8
ffa0: b34dee00 c01074e0 b34dedf8 b34dee00 b34dedf8 b34dee00 00000002 00000002
ffc0: b34dedf8 b34dee00 005ab870 000000a2 0043302c b34defa0 bef2eaa4 00000000
ffe0: 00000002 b34dedf0 b6ec9bb9 b6ec9bc0 600d0030 b34dedf8 ebffff3a e28dd024
[<c01492f4>] (do_raw_spin_trylock) from [<c0600130>] (_raw_spin_lock_irq+0x44/0x74)
[<c0600130>] (_raw_spin_lock_irq) from [<c0123b30>] (exit_signals+0xdc/0x1f4)
[<c0123b30>] (exit_signals) from [<c0119128>] (do_exit+0xa0/0x9b0)
[<c0119128>] (do_exit) from [<c010ad68>] (die+0x29c/0x2a8)
[<c010ad68>] (die) from [<c01133e4>] (__do_kernel_fault.part.0+0x64/0x200)
[<c01133e4>] (__do_kernel_fault.part.0) from [<c010f18c>] (do_bad_area+0x0/0x8c)
[<c010f18c>] (do_bad_area) from [<c010eee4>] (do_page_fault+0x0/0x2a8)
[<c010eee4>] (do_page_fault) from [<c06003cc>] (_raw_spin_unlock+0x20/0x24)
[<c06003cc>] (_raw_spin_unlock) from [<00000000>] (  (null))
Code: ebffff90 eaffffe6 e3a02000 e92d4010 (e5904000)
---[ end trace 16a6ed339b8503ba ]---
Fixing recursive fault but reboot is needed!
Unable to handle kernel NULL pointer dereference at virtual address 00000504
pgd = c0004000
[00000504] *pgd=00000000
Internal error: Oops: 17 [#5] ARM
Modules linked in:
CPU: 0 PID: 388 Comm: OPCUAServer Tainted: G      D         4.9.98-rt76-g9302106 #50
Hardware name: Atmel SAMA5
task: c303c380 task.stack: c306e000
PC is at do_raw_spin_trylock+0x8/0x58
LR is at _raw_spin_lock_irq+0x44/0x74
pc : [<c01492f4>]    lr : [<c0600130>]    psr: 600d0193
sp : c306f7d0  ip : c306e000  fp : c306fd64
r10: c303c380  r9 : 00000017  r8 : c1159e40
r7 : c0119128  r6 : 00000504  r5 : c0123b30  r4 : 00000514
r3 : c303c380  r2 : 00000000  r1 : 00000000  r0 : 00000504
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 22640059  DAC: 00000051
Process OPCUAServer (pid: 388, stack limit = 0xc306e208)
Stack: (0xc306f7d0 to 0xc3070000)
f7c0:                                     00000514 c0600130 00000001 00000000
f7e0: c0123b30 c303c380 c303c380 00000000 c1159ec0 c0123b30 00000001 00000000
f800: c0119128 ffffffff 00000051 bf000000 c303c380 c0a09970 c306f968 0000000b
f820: 0000000b c0119128 00000002 c014f7b0 600d0193 00000000 c014f780 c0b9c184
f840: c0a09970 c306f968 600d0193 0000000b 00000017 c303c380 c306fd64 c010ad68
f860: c306e208 0000000b 00000504 c306f968 00000017 00000000 00000504 c306e000
f880: c303c380 c01133e4 00000017 c010f18c 200d0193 00000000 00001004 200d0193
f8a0: c3e252bc c0a09b74 00000017 c010eee4 00000504 c306f968 c306e000 c303c380
f8c0: c306fd64 c01012f0 00001004 c3e25000 c3e25378 00001004 00000001 c043d944
f8e0: 00000000 c3e253cc c2004600 00000000 600d0193 00000001 00000001 c2004200
f900: c306e000 c303c380 c306fa0c c01462e0 00000001 00000080 00000000 c0150b74
f920: 00000000 00000000 c0600420 c2068e78 c0150b74 c2068e68 c2068e78 c0600040
f940: 00000001 00000000 c0150b74 00000084 c01492f4 600d0193 ffffffff c306f99c
f960: c1159e40 c010b4f8 00000504 00000000 00000000 c303c380 00000514 c0123b30
f980: 00000504 c0119128 c1159e40 00000017 c303c380 c306fd64 c306e000 c306f9b8
f9a0: c0600130 c01492f4 600d0193 ffffffff 00000051 bf000000 00000514 c0600130
f9c0: 00000001 00000000 c0123b30 c303c380 c303c380 00000000 c1159ec0 c0123b30
f9e0: 00000001 00000000 c0119128 ffffffff 00000051 bf000000 c303c380 c0a09970
fa00: c306fb50 0000000b 0000000b c0119128 00000002 c014f7b0 600d0193 00000000
fa20: c014f780 c0b9c184 c0a09970 c306fb50 600d0193 0000000b 00000017 c303c380
fa40: c306fd64 c010ad68 c306e208 0000000b 00000504 c306fb50 00000017 00000000
fa60: 00000504 c306e000 c303c380 c01133e4 00000017 c010f18c c118f000 c0b9bd93
fa80: c306fbf4 c01462e0 00000001 c0a09b74 00000017 c010eee4 00000504 c306fb50
faa0: c306e000 c303c380 c306fd64 c01012f0 c118f610 00000000 c118f5e0 0000001b
fac0: c118f000 c0b9bd93 c118f8f0 c06003cc c3e23540 00000000 600d0193 00000001
fae0: 00000001 c2004200 c306e000 c303c380 c306fbf4 c01462e0 00000001 00000080
fb00: 00000000 c0150b74 00000000 00000000 c0600420 c207a078 c0150b74 c207a068
fb20: c207a078 c0600040 00000001 00000000 c0150b74 00000084 c01492f4 600d0093
fb40: ffffffff c306fb84 c1159e40 c010b4f8 00000504 00000000 00000000 c303c380
fb60: 00000514 c0123b30 00000504 c0119128 c1159e40 00000000 c303c380 c306fd64
fb80: c306e000 c306fba0 c0600130 c01492f4 600d0093 ffffffff 00000051 bf000000
fba0: 00000514 c0600130 00000001 00000000 c0123b30 c303c380 c303c380 00000000
fbc0: c1159ec0 c0123b30 00000001 00000000 c0119128 ffffffff 00000051 bf000000
fbe0: c303c380 c0a09970 c306fcf8 0000000b 0000000b c0119128 00000002 c014f7b0
fc00: 600d0093 00000000 c014f780 c0b9c184 c0a09970 c306fcf8 600d0093 0000000b
fc20: 00000000 c303c380 c306fd64 c010ad68 c306e208 0000000b 00000004 c306fcf8
fc40: c05fb9a0 20012f9f 00000000 c010b638 c306e000 c01010d0 00000006 c03361c4
fc60: 00000004 00000000 00030001 c05fb9a0 c03361c4 c144ce7c c144ce7c 00080040
fc80: c01e3a94 c01e3b24 c144ce10 c30597d0 c144ce7c 00000000 600d0093 00000000
fca0: 600d0093 00000001 ffffffff 00000000 00000003 c0a0d7c0 c0a0d7c0 00000001
fcc0: c3b49b30 c0a0d818 e51ced26 0000000a 600d0093 00000000 600d0093 00000001
fce0: c05fb9a4 00000000 c010bad8 00000000 20000000 c010b638 00000000 800d0093
fd00: 00151ad5 c09f8da8 c0038d80 c0a07c00 00000000 c0a0d7c0 00000000 c09f8d80
fd20: c303c380 c306fd64 00000001 c306fd48 c013f024 c05fb9a0 600d0093 ffffffff
fd40: 00000051 bf000000 c303c380 c306fb94 00000000 c3b48000 c306fd80 c303c550
fd60: c306fd74 c0139494 00000000 00000001 c306fee4 c011969c 00000002 00000001
fd80: c306fd80 c306fd80 c014f780 c0b9c184 c0a09970 c306fe78 600d0093 0000000b
fda0: 00000000 c303c380 c306fee4 c010ad68 c306e208 0000000b 00000004 c306fe78
fdc0: c05fb9a0 20012f9f 00000000 c010b638 c306e000 c01010d0 00000006 00000000
fde0: 00000004 00000000 00030001 c05fb9a0 c1156284 00000000 c303c380 00000001
fe00: c0cc210c c01456fc c1154dbc 00000016 ffffffff 00000000 c303c380 c303c380
fe20: c1154dbc c0b7cca8 c0a0d7d0 00000000 c303c380 00000000 00000000 600d0093
fe40: c0a0d7c0 00000001 00000001 c0143f00 c303c3b0 c0a0d818 c0a0d7c0 c013d080
fe60: c05fb9a4 00000000 c010bad8 00000000 20000000 c010b638 00000000 600d0093
fe80: 00151ad4 c09f8da8 c0a07c00 c303c380 00009632 c0a0d7c0 00000000 c09f8d80
fea0: 00000000 c306fee4 00000001 c306fec8 c013e5b8 c05fb9a0 600d0093 ffffffff
fec0: 00000051 bf000000 c303c380 c306e000 00000000 b34dee00 00000001 0000c350
fee0: c306fef4 c05fba8c c306ff28 c306e000 00000000 c05ffbb8 0000c350 00000000
ff00: 00000001 c015af20 000f4240 000f4240 00000000 c015bb10 0000c350 00000000
ff20: 00100590 00000000 c306ff28 c11f1e58 00000000 00000000 d18c2cc1 000000b1
ff40: d18b6971 000000b1 c015af98 c0b72a00 00000000 c306ff54 c306ff54 00000001
ff60: 00000000 00000000 00000000 b34dee00 005ab870 00000051 b34dee00 005ab870
ff80: 000000a2 c01076c4 c306e000 c015bc50 00000000 000f4240 0000008e b34dedf8
ffa0: b34dee00 c01074e0 b34dedf8 b34dee00 b34dedf8 b34dee00 00000002 00000002
ffc0: b34dedf8 b34dee00 005ab870 000000a2 0043302c b34defa0 bef2eaa4 00000000
ffe0: 00000002 b34dedf0 b6ec9bb9 b6ec9bc0 600d0030 b34dedf8 ebffff3a e28dd024
[<c01492f4>] (do_raw_spin_trylock) from [<c0600130>] (_raw_spin_lock_irq+0x44/0x74)
[<c0600130>] (_raw_spin_lock_irq) from [<c0123b30>] (exit_signals+0xdc/0x1f4)
[<c0123b30>] (exit_signals) from [<c0119128>] (do_exit+0xa0/0x9b0)
[<c0119128>] (do_exit) from [<c010ad68>] (die+0x29c/0x2a8)
[<c010ad68>] (die) from [<c01133e4>] (__do_kernel_fault.part.0+0x64/0x200)
[<c01133e4>] (__do_kernel_fault.part.0) from [<c010f18c>] (do_bad_area+0x0/0x8c)
[<c010f18c>] (do_bad_area) from [<c010eee4>] (do_page_fault+0x0/0x2a8)
[<c010eee4>] (do_page_fault) from [<c3e253cc>] (0xc3e253cc)
Code: ebffff90 eaffffe6 e3a02000 e92d4010 (e5904000)
---[ end trace 16a6ed339b8503bb ]---
Fixing recursive fault but reboot is needed!
Unable to handle kernel NULL pointer dereference at virtual address 00000504
pgd = c0004000
[00000504] *pgd=00000000
Internal error: Oops: 17 [#6] ARM
Modules linked in:
CPU: 0 PID: 388 Comm: OPCUAServer Tainted: G      D         4.9.98-rt76-g9302106 #50
Hardware name: Atmel SAMA5
task: c303c380 task.stack: c306e000
PC is at do_raw_spin_trylock+0x8/0x58
LR is at _raw_spin_lock_irq+0x44/0x74
pc : [<c01492f4>]    lr : [<c0600130>]    psr: 600d0193
sp : c306f5e8  ip : c306e000  fp : c306fd64
r10: c303c380  r9 : 00000017  r8 : c1159e40
r7 : c0119128  r6 : 00000504  r5 : c0123b30  r4 : 00000514
r3 : c303c380  r2 : 00000000  r1 : 00000000  r0 : 00000504
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 22640059  DAC: 00000051
Process OPCUAServer (pid: 388, stack limit = 0xc306e208)
Stack: (0xc306f5e8 to 0xc3070000)
f5e0:                   00000514 c0600130 00000001 00000000 c0123b30 c303c380
f600: c303c380 00000000 c1159ec0 c0123b30 00000001 00000000 c0119128 ffffffff
f620: 00000051 bf000000 c303c380 c0a09970 c306f780 0000000b 0000000b c0119128
f640: 00000002 c014f7b0 600d0193 00000000 c014f780 c0b9c184 c0a09970 c306f780
f660: 600d0193 0000000b 00000017 c303c380 c306fd64 c010ad68 c306e208 0000000b
f680: 00000504 c306f780 00000017 00000000 00000504 c306e000 c303c380 c01133e4
f6a0: 00000017 c010f18c 2ad80a77 c0b72980 00000000 ffffffff 7fffffff c0a09b74
f6c0: 00000017 c010eee4 00000504 c306f780 c306e000 c303c380 c306fd64 c01012f0
f6e0: 2ad80a77 000000b2 c2004600 c2004400 c2004600 ffffffff 7fffffff 00000010
f700: c2004600 00000000 600d0193 00000001 00000001 c200420▒RomBOOT
A watchdog occurred after this log. How can I translate this log to understand my problem?

Best regards,
Igor Franco
blue_z
Location: USA
Posts: 1848
Joined: Thu Apr 19, 2007 10:15 pm

Re: USB Driver Issues

Wed Mar 27, 2019 1:11 am

igortf wrote: I think it is the driver because I am connecting and disconnecting the USB device before the mounting.
Then try other types of USB devices, such as a RS-232 adapter or Ethernet adapter or a hub.

igortf wrote: And the access violation doesn't have anything useful.
To what "access violation" are you repeatedly referring?
I see several oops for undefined instruction.
If you think this is tied to USB, then maybe it's a power/voltage-drop issue?
Have you performed memory tests and monitored module/board voltages?
E.G. instead of Linux, run the memory test of U-Boot (that has USB support enabled). Ideally the RAM should be initialized, verify RAM, insert USB device and have U-Boot probe it, verify RAM, remove USB device, probe USB status again, and then verify RAM.

igortf wrote: It seems to be something invading memory.
The kernel text should be marked read-only (i.e. not writable).
See https://www.slideshare.net/prabindh/arm ... techniques
If RAM is getting clobbered, I would suspect DRAM refresh in your circumstance.

Regards
igortf
Posts: 14
Joined: Tue Mar 27, 2018 8:27 pm

Re: USB Driver Issues

Mon Apr 08, 2019 9:42 pm

Hello blue_z,
blue_z wrote:
Wed Mar 27, 2019 1:11 am
Then try other types of USB devices, such as a RS-232 adapter or Ethernet adapter or a hub.
I made some tests with no USB device driver (mass storage, wireless, serial), only with the ATMEL EHCI and AT91 OHCI driver. I still have the watchdog with random locations of kernel oops (as I shown in the previous post).
blue_z wrote:
Wed Mar 27, 2019 1:11 am
To what "access violation" are you repeatedly referring?
Some access violation that occurs in some applications, in user space, that access the kernel devices.
blue_z wrote:
Wed Mar 27, 2019 1:11 am
If you think this is tied to USB, then maybe it's a power/voltage-drop issue?
I put a capacitor in the USB source and monitored with an oscilloscope, everything is normal.
blue_z wrote:
Wed Mar 27, 2019 1:11 am
Have you performed memory tests and monitored module/board voltages?
This type of test was performed and there was no abnormality.

The watchdog occurs when I disconnect the device before the Linux detection. As I said, I removed the mass storage driver and the problem still occurs. I've tried removing all my applications on Linux and the problem takes longer to occur. I am connecting a Kingston USB 3.0 32GB. I tried to remove other drivers without success. Do you know anything else I can do to at least identify where the problem is?

Thanks in advance,
Igor Franco
blue_z
Location: USA
Posts: 1848
Joined: Thu Apr 19, 2007 10:15 pm

Re: USB Driver Issues

Tue Apr 09, 2019 4:10 am

Your vague summations provide little real information.
You're making me guess what "remove driver" and "type of test" actually mean.
I can't tell if you're still convinced that it's a "problem with the USB driver", or whether this could be a HW or SW issue.
I made some tests with no USB device driver (mass storage, wireless, serial), ...
I am connecting a Kingston USB 3.0 32GB.
I suggested testing with other USB devices, and you only report about testing with "no device driver"!

I have no additional advice, essentially because you haven't convinced me that this could not be caused by HW.
FWIW I encounter no issue accessing a 32GB USB 3.0 flash drive attached to a SAMAD2C-XULT running the Linux4SAM 5.7 demo (with 4.9.52 kernel).

Regards

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 5 guests