Re: usb: chipidea: hdc: kernel panic during shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 23, 2016 at 09:17:02PM +0200, Stefan Wahren wrote:
> Hi,
> 
> i'm using a iMX233-OLinuXino board and the kernel panics during shutdown with
> 4.8.0-rc2-next-20160819:
> 
> [  420.040000] ci_hdrc ci_hdrc.0: remove, state 1
> [  420.050000] usb usb1: USB disconnect, device number 1
> [  420.060000] usb 1-1: USB disconnect, device number 2
> [  420.060000] usb 1-1.1: USB disconnect, device number 3
> [  420.090000] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-ci_hdrc.0-1.1,
> smsc95xx USB 2.0 Ethernet
> [  420.290000] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
> [  420.300000] Unable to handle kernel NULL pointer dereference at virtual
> address 00000118
> [  420.300000] pgd = c2ea4000
> [  420.300000] [00000118] *pgd=00000000
> [  420.300000] Internal error: Oops: 5 [#1] ARM
> [  420.300000] Modules linked in:
> [  420.300000] CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted
> 4.8.0-rc2-next-20160819 #1
> [  420.300000] Hardware name: Freescale MXS (Device Tree)
> [  420.300000] task: c3490000 task.stack: c348e000
> [  420.300000] PC is at usb_hcd_irq+0x0/0x34
> [  420.300000] LR is at ci_irq+0x58/0x12c
> [  420.300000] pc : [<c042969c>]    lr : [<c0448afc>]    psr: a0000093
> [  420.300000] sp : c348fd20  ip : c348fcd8  fp : c3704624
> [  420.300000] r10: c3708300  r9 : c3602010  r8 : 60000013
> [  420.300000] r7 : 00000094  r6 : 20000013  r5 : c3549600  r4 : c3602010
> [  420.300000] r3 : 000012a0  r2 : 08080000  r1 : 00000000  r0 : 00000094
> [  420.300000] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment
> none
> [  420.300000] Control: 0005317f  Table: 42ea4000  DAC: 00000051
> [  420.300000] Process systemd-shutdow (pid: 1, stack limit = 0xc348e190)
> [  420.300000] Stack: (0xc348fd20 to 0xc3490000)
> [  420.300000] fd20: c3549610 c3549600 20000013 c006bfac c3549600 00000000
> 00000094 c3602010
> [  420.300000] fd40: c370e2e0 c36f4e80 c36f4e80 00000005 c370e2e0 c006c098
> c348fd70 c3704410
> [  420.300000] fd60: c370e2e0 c039cd68 00000005 a0000013 c36f4e00 c370e2e0
> a0000013 c039ce0c
> [  420.300000] fd80: c354b844 c348fe5c 00000000 c08d604c c3704624 c370e2e0
> 00000001 c3704410
> [  420.300000] fda0: c08bc194 c08ad460 c354b844 c348fe5c 00000000 c08d604c
> be829c58 c03997e8
> [  420.300000] fdc0: c3704444 c3704410 c08ad460 c0399954 c3402a4c c3704410
> c08ad460 c0398d64
> [  420.300000] fde0: c3704410 c354b810 c112ebf4 c0396e2c c3490000 00000007
> 00000006 c348fe5c
> [  420.300000] fe00: c3704400 c3704410 c354b810 c354b844 c348fe5c c039bb90
> c3704400 c3708090
> [  420.300000] fe20: c354b810 c039c118 00000000 c044941c c354b800 c044e6f8
> c354b810 c03a47fc
> [  420.300000] fe40: c354b810 c354b410 c112ebf4 c039b578 c354b810 c0397410
> 00000002 c08ad22c
> [  420.300000] fe60: c342fa20 c354b81c 4321fedc c0866838 cdef0123 f3f82200
> c000a484 c348e000
> [  420.300000] fe80: 00000000 c00427f4 4321fedc c0042a10 00000000 00000000
> c348fec8 00000029
> [  420.300000] fea0: c2e2d488 00000000 c34b9c28 00000002 c00690fc 00000000
> 00000000 c0132e0c
> [  420.300000] fec0: 00000000 00000000 be8291f8 00000004 be829f8a 00000010
> be829224 00000005
> [  420.300000] fee0: be8292c4 0000000f 7f5fb9f8 00000001 be828d3c c08629b4
> c348ffb0 00053177
> [  420.300000] ff00: 000007ff 000f0f24 c2e2d480 00000000 00000000 00000000
> 00000000 00000000
> [  420.300000] ff20: 00000000 00000000 00000001 00000000 00000029 c348fec8
> 00000005 00000000
> [  420.300000] ff40: 00000000 0004001e 00000005 be82924c 00000005 be82924c
> c348e000 00000000
> [  420.300000] ff60: 7f60e854 c0132f24 c348ff88 00000000 c2e2d480 c2e2d480
> 00000000 c0132f70
> [  420.300000] ff80: 00000000 c000a484 00000000 8102d190 8102c118 00000000
> 8102d190 8102c118
> [  420.300000] ffa0: 00000058 c000a2e0 00000000 8102d190 fee1dead 28121969
> cdef0123 f3f82200
> [  420.300000] ffc0: 00000000 8102d190 8102c118 00000058 be829bc4 00000000
> 00000000 be829c58
> [  420.300000] ffe0: 7f60de4c be829b08 7f5ee114 b6e46088 60000010 fee1dead
> 00000000 00000000
> [  420.300000] [<c042969c>] (usb_hcd_irq) from [<c3549600>] (0xc3549600)
> [  420.300000] Code: c077a4d4 c08b802c c08b8040 c08b7fb0 (e5913118)
> [  420.300000] ---[ end trace 5e83b1955a5bd084 ]---
> [  420.620000] systemd-shutdow: 2 output lines suppressed due to ratelimiting
> [  420.620000] Kernel panic - not syncing: Attempted to kill init!
> exitcode=0x0000000b
> [  420.620000]
> [  420.620000] ---[ end Kernel panic - not syncing: Attempted to kill init!
> 

I am afraid the hcd is freed before the interrupt triggered. Would you
please try below changes:

diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index 96ae695..61237a9 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -103,7 +103,7 @@ static const struct ehci_driver_overrides ehci_ci_overrides = {
static irqreturn_t host_irq(struct ci_hdrc *ci)
{
-       return usb_hcd_irq(ci->irq, ci->hcd);
+       return ci->hcd ? usb_hcd_irq(ci->irq, ci->hcd) : IRQ_NONE;
}
	  
static int host_start(struct ci_hdrc *ci)


-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux