Re: [PATCH 1/3] usb: gadget: function: phonet: balance usb_ep_disable calls

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

 



On Tuesday 03 February 2015 00:15:19 Felipe Balbi wrote:
> f_phonet's ->set_alt() method will call usb_ep_disable()
> potentially on an endpoint which is already disabled. That's
> something the gadget/function driver must guarantee that it's
> always balanced.
> 
> In order to balance the calls, just make sure the endpoint
> was enabled before by means of checking the validity of
> driver_data.
> 
> Reported-by: Pali Rohár <pali.rohar@xxxxxxxxx>
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> ---

Your patches cause that kernel does not print any error message to n900 screen anymore and reboot 
device in 10 seconds. I did not loaded any external modules.

In qemu I see this crash in early boot:

[    0.500549] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[    0.501068] pgd = c0004000
[    0.501281] [00000000] *pgd=00000000
[    0.501800] Internal error: Oops: 80000005 [#1] PREEMPT ARM
[    0.502197] Modules linked in:
[    0.502593] CPU: 0 PID: 1 Comm: swapper Not tainted 3.19.0-rc5+ #300
[    0.502990] Hardware name: Nokia RX-51 board
[    0.503295] task: cf8a8000 ti: cf8ac000 task.ti: cf8ac000
[    0.503692] PC is at 0x0
[    0.503906] LR is at omap2430_runtime_resume+0x30/0x68
[    0.504333] pc : [<00000000>]    lr : [<c02c910c>]    psr: a0000113
[    0.504333] sp : cf8adda0  ip : 00000001  fp : c0059824
[    0.505004] r10: cf8adde8  r9 : cf9b5884  r8 : cf9b58cc
[    0.505340] r7 : 00000004  r6 : cf93ee10  r5 : c068944c  r4 : cf83a010
[    0.505767] r3 : 00000000  r2 : 00000000  r1 : 00000414  r0 : fa0ab000
[    0.506195] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    0.506683] Control: 10c53c7d  Table: 80004059  DAC: 00000015
[    0.507049] Process swapper (pid: 1, stack limit = 0xcf8ac238)
[    0.507476] Stack: (0xcf8adda0 to 0xcf8ae000)
[    0.507812] dda0: c02c90dc c0021ff4 cf9b5810 c0267de4 00000000 c0269680 00000000 cf9b5810
[    0.508331] ddc0: 00000000 c0269740 cf9b5810 cf9b5810 00000000 c026ac44 c0428350 cfa29410
[    0.508819] dde0: cfb36800 c0428350 cfa29410 cfa2a540 00000000 60000113 cfa2a500 cfa29410
[    0.509307] de00: c063e9f8 0000006c c05fe9f4 c05bc6d4 00000000 c026b114 cfa2c100 cfa29410
[    0.509826] de20: cfa2a500 c026b174 cf83a010 c02c1698 cfa29410 0000006c fa0ab000 ffffffed
[    0.510314] de40: cfa29410 c063e9f8 c063e9f8 c060af98 c05fe9f4 c05bc6d4 00000000 c0263d78
[    0.510833] de60: 00000000 cfa29410 00000000 c02624ec 00000000 cfa29410 c063e9f8 c063e9f8
[    0.511322] de80: 00000000 c0262718 00000000 cfa29410 cfa29444 c0262790 c063e9f8 cf8adea8
[    0.511810] dea0: c0262730 c0261070 cf88cb8c cfa2c230 c063e9f8 c063e9f8 cfb27a80 c0638848
[    0.512298] dec0: 00000000 c0261e20 c04281ec c04281ed 00000000 c063e9f8 cfb3b200 00000000
[    0.512786] dee0: c060af98 c02630c8 c0263cd8 c05e390c cfb3b200 c0008798 c05bc6d4 c004aa44
[    0.513336] df00: c058c09c cfcb6e13 00000000 c0546eb9 a0000113 c058c09c 00000006 00000065
[    0.513854] df20: 00000006 c004aae8 00000065 00000006 00000006 c05bc6d4 cfcb6e03 cfcb6e12
[    0.514373] df40: 00000000 00000006 c05f1fb8 00000006 c05f1fbc c05f1f9c c064d2c0 00000065
[    0.514862] df60: c05fe9f4 c05bccfc 00000006 00000006 c05bc6d4 c0626858 c05fe5c0 c05fe5c0
[    0.515350] df80: 00000000 00000000 00000000 00000000 00000000 c05bcd94 cf8ac000 00000000
[    0.515869] dfa0: c03e1094 c03e109c 00000000 c000dc78 00000000 00000000 00000000 00000000
[    0.516387] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.516906] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[    0.517791] [<c02c910c>] (omap2430_runtime_resume) from [<c0267de4>] 
(pm_generic_runtime_resume+0x2c/0x40)
[    0.518432] [<c0267de4>] (pm_generic_runtime_resume) from [<c0269680>] (__rpm_callback+0x8c/0xdc)
[    0.518981] [<c0269680>] (__rpm_callback) from [<c0269740>] (rpm_callback+0x70/0x88)
[    0.519470] [<c0269740>] (rpm_callback) from [<c026ac44>] (rpm_resume+0x514/0x704)
[    0.519927] [<c026ac44>] (rpm_resume) from [<c026b114>] (__pm_runtime_resume+0x4c/0x90)
[    0.520446] [<c026b114>] (__pm_runtime_resume) from [<c026b174>] (pm_runtime_irq_safe+0x1c/0x74)
[    0.520996] [<c026b174>] (pm_runtime_irq_safe) from [<c02c1698>] (musb_init_controller+0x50/0x60c)
[    0.521545] [<c02c1698>] (musb_init_controller) from [<c0263d78>] (platform_drv_probe+0x48/0x90)
[    0.522094] [<c0263d78>] (platform_drv_probe) from [<c02624ec>] (really_probe+0xac/0x1e0)
[    0.522583] [<c02624ec>] (really_probe) from [<c0262718>] (driver_probe_device+0x30/0x48)
[    0.523101] [<c0262718>] (driver_probe_device) from [<c0262790>] (__driver_attach+0x60/0x84)
[    0.523590] [<c0262790>] (__driver_attach) from [<c0261070>] (bus_for_each_dev+0x50/0x84)
[    0.524078] [<c0261070>] (bus_for_each_dev) from [<c0261e20>] (bus_add_driver+0xac/0x1bc)
[    0.524566] [<c0261e20>] (bus_add_driver) from [<c02630c8>] (driver_register+0x9c/0xe0)
[    0.525054] [<c02630c8>] (driver_register) from [<c0008798>] (do_one_initcall+0x100/0x1b0)
[    0.525573] [<c0008798>] (do_one_initcall) from [<c05bccfc>] (do_basic_setup+0x88/0xc0)
[    0.526062] [<c05bccfc>] (do_basic_setup) from [<c05bcd94>] (kernel_init_freeable+0x60/0xfc)
[    0.526580] [<c05bcd94>] (kernel_init_freeable) from [<c03e109c>] (kernel_init+0x8/0xe4)
[    0.527160] [<c03e109c>] (kernel_init) from [<c000dc78>] (ret_from_fork+0x14/0x3c)
[    0.527679] Code: bad PC value
[    0.528564] ---[ end trace 48473cc804804761 ]---
[    0.528991] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    0.528991] 
[    0.529632] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    0.529632]

-- 
Pali Rohár
pali.rohar@xxxxxxxxx

Attachment: signature.asc
Description: This is a digitally signed message part.


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

  Powered by Linux