From patchwork Wed Jul 16 10:22:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 33716 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 11D37201F1 for ; Wed, 16 Jul 2014 10:23:40 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id eb12sf4124232oac.9 for ; Wed, 16 Jul 2014 03:23:39 -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=1ZO8xchyqHONEkh0RoT1hwfMNubxCk73X1IersHQkkQ=; b=UsZC34Ti/4UZxQ8shIkvEp/6lSPnkguRoCHmPmT63byh9TXPZYJtdWlL2RyBYSjWOE sXv0F2nZxiWjHOoFijpszoTecMzuOEiTfNQwlnpNCZ8nqg4hPwzCGp/gQ+wMiT7lNyW3 alD47Qj5zK79SCqTOpMI4m3F+myRd1ouyovBX70icALcJa0IukJitcQMvPq4RGDCgo6+ 7Gr+cn+P2nbcSnXMIazfjL20D5NXwS+dMlDc+tfNUikg0bl1u2BSyXy8I8UbYc+l5mLa kyPY6t9xpnRSfg98+VhOKrOSiOAk6KcS4Yfrci5fvgip038dIsoI8LTTt81lAopwX2w1 7OCw== X-Gm-Message-State: ALoCoQkTIAZ3n1AafGhJOXTSQID6xiN/B7CUuryeHKYhG3dhWCBij5SnGWqSUowzUCdjjllILsuK X-Received: by 10.43.98.71 with SMTP id cn7mr13874508icc.14.1405506219713; Wed, 16 Jul 2014 03:23:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.116 with SMTP id u107ls345067qgd.46.gmail; Wed, 16 Jul 2014 03:23:39 -0700 (PDT) X-Received: by 10.53.5.230 with SMTP id cp6mr2001382vdd.25.1405506219625; Wed, 16 Jul 2014 03:23:39 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id s7si8086228vcl.50.2014.07.16.03.23.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jul 2014 03:23:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id la4so1186722vcb.5 for ; Wed, 16 Jul 2014 03:23:39 -0700 (PDT) X-Received: by 10.52.244.138 with SMTP id xg10mr5810169vdc.40.1405506219552; Wed, 16 Jul 2014 03:23:39 -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.37.5 with SMTP id tc5csp285339vcb; Wed, 16 Jul 2014 03:23:39 -0700 (PDT) X-Received: by 10.70.55.202 with SMTP id u10mr9129613pdp.110.1405506218589; Wed, 16 Jul 2014 03:23:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rn1si14089807pbc.172.2014.07.16.03.23.37; Wed, 16 Jul 2014 03:23:38 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S932622AbaGPKXU (ORCPT + 28 others); Wed, 16 Jul 2014 06:23:20 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:38673 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932418AbaGPKXQ (ORCPT ); Wed, 16 Jul 2014 06:23:16 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N8S00ECDVIQC600@mailout4.samsung.com>; Wed, 16 Jul 2014 19:23:14 +0900 (KST) X-AuditID: cbfee61b-f79f86d00000144c-6d-53c65292885c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BB.68.05196.29256C35; Wed, 16 Jul 2014 19:23:14 +0900 (KST) Received: from AMDC2122.DIGITAL.local ([106.120.53.17]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N8S00MJHVHJNH00@mmp2.samsung.com>; Wed, 16 Jul 2014 19:23:14 +0900 (KST) From: Robert Baldyga To: balbi@ti.com Cc: paulz@synopsys.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, m.szyprowski@samsung.com, andrzej.p@samsung.com, Robert Baldyga Subject: [PATCH v2 09/12] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Date: Wed, 16 Jul 2014 12:22:27 +0200 Message-id: <1405506150-16185-10-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1405506150-16185-1-git-send-email-r.baldyga@samsung.com> References: <1405506150-16185-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBLMWRmVeSWpSXmKPExsVy+t9jQd1JQceCDeb/1LCY9bKdxeLg/XqL 5sXr2Swu75rDZrFoWSuzxdojd9kttk+ZzmTx4PBOdgcOj/1z17B79G1ZxeixZf9nRo/jN7Yz eXzeJBfAGsVlk5Kak1mWWqRvl8CVsW7tK5aC5zwVxw+8YWpgvMDVxcjJISFgIvHj0SIWCFtM 4sK99WwgtpDAdEaJ3weNuxi5gOx2Jonuha/AitgEdCS2fJ/ACGKLCAhIrH9xiR2kiFngBKNE x/8LYN3CAqkSUw+9YQaxWQRUJRq+n2MHsXkF3CQaWxewQ2yTkzh5bDIriM0JFF/zupkdYrOr xPF1y5gmMPIuYGRYxSiaWpBcUJyUnmukV5yYW1yal66XnJ+7iREcXs+kdzCuarA4xCjAwajE w7sh5GiwEGtiWXFl7iFGCQ5mJRFeB/9jwUK8KYmVValF+fFFpTmpxYcYpTlYlMR5D7ZaBwoJ pCeWpGanphakFsFkmTg4pRoYxS4YNCbpq2/+mrLsjGGG7RJxqW17Yzx28Nr3mxeuO7WMceKs a/xbznwrOM3CMuHhqsVPtp7+/X7V7dmuh+xmyx/59eTpZXk34y19tvZz9ky5dtxzP5d0psTC BdsVSlyOdvcv4Kt/92LWbQZupsQlD0Kvi6Tviu82X3X3/ef5PfkH/8dtNH/HIK3EUpyRaKjF XFScCADV2bxWKwIAAA== Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.org 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.174 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 --- 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 def4900..3435711 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3459,13 +3459,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; @@ -3503,6 +3496,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) {