Re: Regression, was [PATCH 4/4] USB: host: ohci-at91: merge loops in ohci_hcd_at91_drv_probe
Hi Peter, On 01/12/2015 at 18:17:16 +0100, Peter Rosin wrote : > [] (ohci_hcd_at91_overcurrent_irq) from [] > (handle_irq_event_percpu+0x78/0x140) > [] (handle_irq_event_percpu) from [] > (handle_irq_event+0x2c/0x40) > [] (handle_irq_event) from [] > (handle_simple_irq+0x6c/0x80) > [] (handle_simple_irq) from [] > (generic_handle_irq+0x2c/0x3c) > [] (generic_handle_irq) from [] > (gpio_irq_handler+0xa4/0x12c) > [] (gpio_irq_handler) from [] > (generic_handle_irq+0x2c/0x3c) > [] (generic_handle_irq) from [] > (__handle_domain_irq+0x54/0xa8) > [] (__handle_domain_irq) from [] (__irq_svc+0x40/0x54) > [] (__irq_svc) from [] (__setup_irq+0x248/0x530) > [] (__setup_irq) from [] (request_threaded_irq+0xc4/0x144) > [] (request_threaded_irq) from [] > (ohci_hcd_at91_drv_probe+0x460/0x518) > [] (ohci_hcd_at91_drv_probe) from [] > (platform_drv_probe+0x44/0xa4) > [] (platform_drv_probe) from [] > (driver_probe_device+0x1fc/0x43c) > [] (driver_probe_device) from [] > (__driver_attach+0x8c/0x90) > [] (__driver_attach) from [] (bus_for_each_dev+0x6c/0xa0) > [] (bus_for_each_dev) from [] (bus_add_driver+0x1d0/0x268) > [] (bus_add_driver) from [] (driver_register+0x78/0xf8) > [] (driver_register) from [] (do_one_initcall+0xb8/0x1f0) > [] (do_one_initcall) from [] > (kernel_init_freeable+0x138/0x1d8) > [] (kernel_init_freeable) from [] (kernel_init+0x8/0xe8) > [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) > Code: e5916058 e1a08000 e3a04000 e2865008 (e5b50004) > ---[ end trace e66fbc480972ac43 ]--- > Kernel panic - not syncing: Fatal exception in interrupt > ---[ end Kernel panic - not syncing: Fatal exception in interrupt I think I understood what happens. Can you try the following patch? 8<-- >From 402f8444bc92d218edc63dcc3c87459981a56c31 Mon Sep 17 00:00:00 2001 From: Alexandre BelloniDate: Wed, 2 Dec 2015 18:49:34 +0100 Subject: [PATCH] USB: host: ohci-at91: fix a crash in ohci_hcd_at91_overcurrent_irq Signed-off-by: Alexandre Belloni --- drivers/usb/host/ohci-at91.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 342ffd140122..8c6e15bd6ff0 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -473,6 +473,8 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) if (!pdata) return -ENOMEM; + pdev->dev.platform_data = pdata; + if (!of_property_read_u32(np, "num-ports", )) pdata->ports = ports; @@ -483,6 +485,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) */ if (i >= pdata->ports) { pdata->vbus_pin[i] = -EINVAL; + pdata->overcurrent_pin[i] = -EINVAL; continue; } @@ -513,10 +516,8 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) } at91_for_each_port(i) { - if (i >= pdata->ports) { - pdata->overcurrent_pin[i] = -EINVAL; - continue; - } + if (i >= pdata->ports) + break; pdata->overcurrent_pin[i] = of_get_named_gpio_flags(np, "atmel,oc-gpio", i, ); @@ -552,8 +553,6 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) } } - pdev->dev.platform_data = pdata; - device_init_wakeup(>dev, 1); return usb_hcd_at91_probe(_at91_hc_driver, pdev); } -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Regression, was [PATCH 4/4] USB: host: ohci-at91: merge loops in ohci_hcd_at91_drv_probe
Hi Alexandre, On 2015-12-02 19:20, Alexandre Belloni wrote: > Hi Peter, > > On 01/12/2015 at 18:17:16 +0100, Peter Rosin wrote : >> [] (ohci_hcd_at91_overcurrent_irq) from [] >> (handle_irq_event_percpu+0x78/0x140) >> [] (handle_irq_event_percpu) from [] >> (handle_irq_event+0x2c/0x40) >> [] (handle_irq_event) from [] >> (handle_simple_irq+0x6c/0x80) >> [] (handle_simple_irq) from [] >> (generic_handle_irq+0x2c/0x3c) >> [] (generic_handle_irq) from [] >> (gpio_irq_handler+0xa4/0x12c) >> [] (gpio_irq_handler) from [] >> (generic_handle_irq+0x2c/0x3c) >> [] (generic_handle_irq) from [] >> (__handle_domain_irq+0x54/0xa8) >> [] (__handle_domain_irq) from [] (__irq_svc+0x40/0x54) >> [] (__irq_svc) from [] (__setup_irq+0x248/0x530) >> [] (__setup_irq) from [] >> (request_threaded_irq+0xc4/0x144) >> [] (request_threaded_irq) from [] >> (ohci_hcd_at91_drv_probe+0x460/0x518) >> [] (ohci_hcd_at91_drv_probe) from [] >> (platform_drv_probe+0x44/0xa4) >> [] (platform_drv_probe) from [] >> (driver_probe_device+0x1fc/0x43c) >> [] (driver_probe_device) from [] >> (__driver_attach+0x8c/0x90) >> [] (__driver_attach) from [] (bus_for_each_dev+0x6c/0xa0) >> [] (bus_for_each_dev) from [] >> (bus_add_driver+0x1d0/0x268) >> [] (bus_add_driver) from [] (driver_register+0x78/0xf8) >> [] (driver_register) from [] (do_one_initcall+0xb8/0x1f0) >> [] (do_one_initcall) from [] >> (kernel_init_freeable+0x138/0x1d8) >> [] (kernel_init_freeable) from [] (kernel_init+0x8/0xe8) >> [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) >> Code: e5916058 e1a08000 e3a04000 e2865008 (e5b50004) >> ---[ end trace e66fbc480972ac43 ]--- >> Kernel panic - not syncing: Fatal exception in interrupt >> ---[ end Kernel panic - not syncing: Fatal exception in interrupt > > I think I understood what happens. Can you try the following patch? Seems to work here. Excellent! > 8<-- > From 402f8444bc92d218edc63dcc3c87459981a56c31 Mon Sep 17 00:00:00 2001 > From: Alexandre Belloni> Date: Wed, 2 Dec 2015 18:49:34 +0100 > Subject: [PATCH] USB: host: ohci-at91: fix a crash in > ohci_hcd_at91_overcurrent_irq > > Signed-off-by: Alexandre Belloni Reported-by: Peter Rosin Tested-by: Peter Rosin (and bisected-by if anyone cares...) Cheers, Peter -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Regression, was [PATCH 4/4] USB: host: ohci-at91: merge loops in ohci_hcd_at91_drv_probe
Hi! Alexandre Belloni wrote: > ohci_hcd_at91_drv_probe() has four at91_for_each_port. They can be merged > into two loops without changing the driver behaviour. Not so much, I bisected the following panic to the commit matching this patch (e4df92279fd9e01532f65e5ba397877799ed6252). Reverting that commit on top of 4.3 fixes things for me. Cheers, Peter ... ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver ohci-atmel: OHCI Atmel driver Unable to handle kernel NULL pointer dereference at virtual address 000c pgd = c0004000 [000c] *pgd= Internal error: Oops: 5 [#1] ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.2.0-rc6+ #5 Hardware name: Atmel SAMA5 task: c3825ac0 ti: c3826000 task.ti: c3826000 PC is at ohci_hcd_at91_overcurrent_irq+0x18/0xe8 LR is at handle_irq_event_percpu+0x78/0x140 pc : []lr : []psr: 4193 sp : c3827d08 ip : c3000e34 fp : c3a016dc r10: c06e8bbd r9 : c3941880 r8 : 007f r7 : c392be00 r6 : r5 : 0008 r4 : r3 : c02f506c r2 : c3941880 r1 : c392be00 r0 : 007f Flags: nZcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 20004059 DAC: 0015 Process swapper (pid: 1, stack limit = 0xc3826208) Stack: (0xc3827d08 to 0xc3828000) 7d00: c3a01600 c383fb10 007f c00433b0 7d20: c3941880 c383fb10 c4856648 c383fb10 c485664c c3802460 7d40: c38a6044 c00434a4 c3941880 c00458b8 007f c0042bc4 000f c01fe4ac 7d60: ff0a0110 8000 0028 0001 c3802200 7d80: 007f c0042bc4 c06c91d4 c0042dec c004451c 6113 c3827ddc 7da0: 6113 c0013500 c3941880 c3a01600 c3941880 007f 7dc0: c3a01600 6113 007f c3a016dc c3827df0 7de0: c00446b4 c004451c 6113 c383fb10 c00914d0 c3a01600 0080 7e00: c3941880 c02f506c c392be00 c0044954 c392be00 c392be10 c3f77690 7e20: c3a016d0 c060d1e4 c02f5a0c c060d1e4 c392be00 004f 7e40: 0001 0001 c3927178 c070a458 c392be10 c06d7bfc fdfb c06d7bfc 7e60: c06b0f68 c02670ec c02670a8 c070a458 c392be10 7e80: c06ecd78 c02655b4 c02657f4 c06ce538 c392be10 c06d7bfc c392be44 7ea0: c06ce538 0096 c0265880 c06d7bfc c02657f4 c0263880 7ec0: c383ea4c c39168b0 c06d7bfc c39df280 c06ecca0 c0264b80 c060d318 c3a017c0 7ee0: c06d7bfc c06be860 c3a017c0 c06a1468 c0266078 c0267050 c06be860 7f00: c06be860 c00096c8 c3807280 c06fc48c c3839100 c04d9470 7f20: 4140 c00dff9c 0096 c3ffca15 c0031e54 c06b0f44 7f40: c0612f0c c3ffcab1 0006 0006 c06b84b4 0006 7f60: c06b0f60 c06f4140 c06f4140 c06b0f68 c068bda4 0006 0006 7f80: c068b5b0 c04d06ec 7fa0: c04d06f4 c000ff68 7fc0: 7fe0: 0013 8aaa [] (ohci_hcd_at91_overcurrent_irq) from [] (handle_irq_event_percpu+0x78/0x140) [] (handle_irq_event_percpu) from [] (handle_irq_event+0x2c/0x40) [] (handle_irq_event) from [] (handle_simple_irq+0x6c/0x80) [] (handle_simple_irq) from [] (generic_handle_irq+0x2c/0x3c) [] (generic_handle_irq) from [] (gpio_irq_handler+0xa4/0x12c) [] (gpio_irq_handler) from [] (generic_handle_irq+0x2c/0x3c) [] (generic_handle_irq) from [] (__handle_domain_irq+0x54/0xa8) [] (__handle_domain_irq) from [] (__irq_svc+0x40/0x54) [] (__irq_svc) from [] (__setup_irq+0x248/0x530) [] (__setup_irq) from [] (request_threaded_irq+0xc4/0x144) [] (request_threaded_irq) from [] (ohci_hcd_at91_drv_probe+0x460/0x518) [] (ohci_hcd_at91_drv_probe) from [] (platform_drv_probe+0x44/0xa4) [] (platform_drv_probe) from [] (driver_probe_device+0x1fc/0x43c) [] (driver_probe_device) from [] (__driver_attach+0x8c/0x90) [] (__driver_attach) from [] (bus_for_each_dev+0x6c/0xa0) [] (bus_for_each_dev) from [] (bus_add_driver+0x1d0/0x268) [] (bus_add_driver) from [] (driver_register+0x78/0xf8) [] (driver_register) from [] (do_one_initcall+0xb8/0x1f0) [] (do_one_initcall) from [] (kernel_init_freeable+0x138/0x1d8) [] (kernel_init_freeable) from [] (kernel_init+0x8/0xe8) [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) Code: e5916058 e1a08000 e3a04000 e2865008 (e5b50004) ---[ end trace e66fbc480972ac43 ]--- Kernel panic - not syncing: Fatal exception in interrupt ---[ end Kernel panic - not syncing: Fatal exception in interrupt -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html