Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752314AbbBMGux (ORCPT ); Fri, 13 Feb 2015 01:50:53 -0500 Received: from mail-qa0-f51.google.com ([209.85.216.51]:46686 "EHLO mail-qa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbbBMGuw (ORCPT ); Fri, 13 Feb 2015 01:50:52 -0500 MIME-Version: 1.0 In-Reply-To: <54DD65B9.8060806@synopsys.com> References: <1423241438-1682-1-git-send-email-romain.perier@gmail.com> <54DD65B9.8060806@synopsys.com> Date: Fri, 13 Feb 2015 07:50:51 +0100 Message-ID: Subject: Re: [PATCH v2] usb: dwc2: Register interrupt handler only once gadget is correctly initialized From: Romain Perier To: John Youn Cc: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , Linux Kernel Mailing List , "open list:ARM/Rockchip SoC..." Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2805 Lines: 75 No problem Regards, Romain 2015-02-13 3:47 GMT+01:00 John Youn : > On 2/12/2015 4:42 AM, Romain Perier wrote: >> ping >> >> 2015-02-06 17:50 GMT+01:00 Romain Perier : >>> Don't register interrupt handler before usb gadget is correctly initialized. >>> For some embedded platforms which don't have a usb-phy, it crashes the driver >>> because an interrupt is emitted with non-initialized hardware. >>> According to devm_request_irq documentation, an interrupt can be emitted >>> at any time once the interrupt is registered, so we have to care about driver >>> and hardware initialization. >>> >>> Signed-off-by: Romain Perier >>> --- >>> >>> Changes for v2: fix typos in commit log >>> >>> drivers/usb/dwc2/platform.c | 17 +++++++++-------- >>> 1 file changed, 9 insertions(+), 8 deletions(-) >>> >>> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c >>> index ae095f0..b26cf8c 100644 >>> --- a/drivers/usb/dwc2/platform.c >>> +++ b/drivers/usb/dwc2/platform.c >>> @@ -196,14 +196,6 @@ static int dwc2_driver_probe(struct platform_device *dev) >>> return irq; >>> } >>> >>> - dev_dbg(hsotg->dev, "registering common handler for irq%d\n", >>> - irq); >>> - retval = devm_request_irq(hsotg->dev, irq, >>> - dwc2_handle_common_intr, IRQF_SHARED, >>> - dev_name(hsotg->dev), hsotg); >>> - if (retval) >>> - return retval; >>> - >>> res = platform_get_resource(dev, IORESOURCE_MEM, 0); >>> hsotg->regs = devm_ioremap_resource(&dev->dev, res); >>> if (IS_ERR(hsotg->regs)) >>> @@ -237,6 +229,15 @@ static int dwc2_driver_probe(struct platform_device *dev) >>> retval = dwc2_gadget_init(hsotg, irq); >>> if (retval) >>> return retval; >>> + >>> + dev_dbg(hsotg->dev, "registering common handler for irq%d\n", >>> + irq); >>> + retval = devm_request_irq(hsotg->dev, irq, >>> + dwc2_handle_common_intr, IRQF_SHARED, >>> + dev_name(hsotg->dev), hsotg); >>> + if (retval) >>> + return retval; >>> + >>> retval = dwc2_hcd_init(hsotg, irq, params); >>> if (retval) >>> return retval; > > Hi, > > I'm going to be away until Wednesday, Feb 18. I'll take a look at > this and other pending dwc2 patches at that time. > > Regards, > John > > -- 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/