Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933005AbbLBSUG (ORCPT ); Wed, 2 Dec 2015 13:20:06 -0500 Received: from down.free-electrons.com ([37.187.137.238]:46265 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755287AbbLBSUE (ORCPT ); Wed, 2 Dec 2015 13:20:04 -0500 Date: Wed, 2 Dec 2015 19:20:02 +0100 From: Alexandre Belloni To: Peter Rosin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: Regression, was [PATCH 4/4] USB: host: ohci-at91: merge loops in ohci_hcd_at91_drv_probe Message-ID: <20151202182002.GF22136@piout.net> References: <565DD61C.5010904@lysator.liu.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <565DD61C.5010904@lysator.liu.se> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4005 Lines: 94 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 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 --- 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", &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, &flags); @@ -552,8 +553,6 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) } } - pdev->dev.platform_data = pdata; - device_init_wakeup(&pdev->dev, 1); return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev); } -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/