From patchwork Thu Sep 4 19:04:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Zimmerman X-Patchwork-Id: 36758 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 263D320CBB for ; Thu, 4 Sep 2014 19:06:25 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id va2sf54366845obc.7 for ; Thu, 04 Sep 2014 12:06:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=eswzNqW9yFMXetIaDUNxgrIJjz7RdiNciySfOYEBnpQ=; b=MdQAhWw+b6WfeN2CSZ5YIIqSyPunlZQkh/MGl+auMsekK/bIKeTfvllcUC/Titm7i8 7Puo61+qF0pf7Rw6IjLqGESkhNknhQbZ4AUEsjl3eHMC4StamK3Ng7p8HVb4VAwRgkSZ 3vcxojWnHCpT1noOVnvqcsNcNtmcF6JJkk5cxnFw8hiLa6dF8S3RvXsE2rcqVaoCc7TR t25TjAWUvRPQqaOPxDuPqtjuI/zWQ/Uxo0nb4VYm1ZpwpvVQ71VWRCkKA3MdrQxrbN+W E7h8rcY5V1f5DvBJFtTYyeJ584/4wOJAtByCMYrEldSMcVYKZi5QA37xwFMH3FiJUf0L Gs/A== X-Gm-Message-State: ALoCoQkDqyQYu89Qnt55tHXh+0rfZhWNf/5b5YDApfxorXLxYN213A0TDzgkdjPWdKA1iqowCAl2 X-Received: by 10.50.25.41 with SMTP id z9mr3684438igf.2.1409857584574; Thu, 04 Sep 2014 12:06:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.9 with SMTP id 9ls401489qgy.52.gmail; Thu, 04 Sep 2014 12:06:24 -0700 (PDT) X-Received: by 10.220.186.196 with SMTP id ct4mr3631604vcb.51.1409857584421; Thu, 04 Sep 2014 12:06:24 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id vx5si6492407vcb.0.2014.09.04.12.06.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 12:06:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hy4so11317328vcb.10 for ; Thu, 04 Sep 2014 12:06:24 -0700 (PDT) X-Received: by 10.220.175.17 with SMTP id v17mr6374986vcz.0.1409857584217; Thu, 04 Sep 2014 12:06:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp885214vcb; Thu, 4 Sep 2014 12:06:23 -0700 (PDT) X-Received: by 10.70.133.136 with SMTP id pc8mr12243152pdb.0.1409857583393; Thu, 04 Sep 2014 12:06:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wx5si5248184pbc.143.2014.09.04.12.06.18 for ; Thu, 04 Sep 2014 12:06:18 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755164AbaIDTGN (ORCPT + 2 others); Thu, 4 Sep 2014 15:06:13 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.44.111]:55341 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755063AbaIDTGL (ORCPT ); Thu, 4 Sep 2014 15:06:11 -0400 Received: from us01secmta1.synopsys.com (us01secmta1.synopsys.com [10.9.203.100]) by smtprelay.synopsys.com (Postfix) with ESMTP id C7D7A24E004E; Thu, 4 Sep 2014 12:06:10 -0700 (PDT) Received: from us01secmta1.internal.synopsys.com (us01secmta1.internal.synopsys.com [127.0.0.1]) by us01secmta1.internal.synopsys.com (Service) with ESMTP id BB63927113; Thu, 4 Sep 2014 12:06:10 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by us01secmta1.internal.synopsys.com (Service) with ESMTP id 921A027102; Thu, 4 Sep 2014 12:06:10 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 84541740; Thu, 4 Sep 2014 12:06:10 -0700 (PDT) Received: from us01dwvnc004.internal.synopsys.com (us01dwvnc004.internal.synopsys.com [10.15.114.106]) by mailhost.synopsys.com (Postfix) with ESMTP id 7853D73F; Thu, 4 Sep 2014 12:06:10 -0700 (PDT) Received: from us01dwvnc004.internal.synopsys.com (localhost [127.0.0.1]) by us01dwvnc004.internal.synopsys.com (8.13.1/8.12.3) with ESMTP id s84J6APf005303; Thu, 4 Sep 2014 12:06:10 -0700 Received: (from paulz@localhost) by us01dwvnc004.internal.synopsys.com (8.13.1/8.13.1/Submit) id s84J65IT005302; Thu, 4 Sep 2014 12:06:05 -0700 From: Paul Zimmerman To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, r.baldyga@samsung.com, Marek Szyprowski , Paul Zimmerman Subject: [PATCH RESEND v3 09/12] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Date: Thu, 4 Sep 2014 12:04:31 -0700 Message-Id: <1409857474-4497-10-git-send-email-paulz@synopsys.com> X-Mailer: git-send-email 1.7.0.5 In-Reply-To: <1409857474-4497-1-git-send-email-paulz@synopsys.com> References: <1409857474-4497-1-git-send-email-paulz@synopsys.com> Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: paul.zimmerman@synopsys.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Marek Szyprowski This patch fixes kernel panic/interrupt storm/etc issues if bootloader left s3c-hsotg module in enabled state. Now interrupt handler is enabled only after proper configuration of hardware registers. Signed-off-by: Marek Szyprowski Signed-off-by: Robert Baldyga Signed-off-by: Paul Zimmerman Reviewed-by: Felipe Balbi --- drivers/usb/dwc2/gadget.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 55238b0..2c9f0f5 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3456,13 +3456,6 @@ static int s3c_hsotg_probe(struct platform_device *pdev) hsotg->irq = ret; - ret = devm_request_irq(&pdev->dev, hsotg->irq, s3c_hsotg_irq, 0, - dev_name(dev), hsotg); - if (ret < 0) { - dev_err(dev, "cannot claim IRQ\n"); - goto err_clk; - } - dev_info(dev, "regs %p, irq %d\n", hsotg->regs, hsotg->irq); hsotg->gadget.max_speed = USB_SPEED_HIGH; @@ -3500,6 +3493,17 @@ static int s3c_hsotg_probe(struct platform_device *pdev) s3c_hsotg_hw_cfg(hsotg); s3c_hsotg_init(hsotg); + ret = devm_request_irq(&pdev->dev, hsotg->irq, s3c_hsotg_irq, 0, + dev_name(dev), hsotg); + if (ret < 0) { + s3c_hsotg_phy_disable(hsotg); + clk_disable_unprepare(hsotg->clk); + regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), + hsotg->supplies); + dev_err(dev, "cannot claim IRQ\n"); + goto err_clk; + } + /* hsotg->num_of_eps holds number of EPs other than ep0 */ if (hsotg->num_of_eps == 0) {