From patchwork Tue Aug 19 08:54:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 35580 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4B43220523 for ; Tue, 19 Aug 2014 09:03:15 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rp18sf3509573iec.8 for ; Tue, 19 Aug 2014 02:03:14 -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=XUuvE0V7ReV/aVtIS74O5VV0/VtcDhZoMlAoYngAYT8=; b=T8EAnxUbMxAdoFo2lDJZ5XuCtQHudlCBRdMa5KiCRHwziQ02v+ER+ckWcJqMcyMNhd 9cdqq6ILXT+RXqX8uuehge6jWrNEO/Oem0aV7vYYfhiaIEt58uQPQ4HdnepR9cCzlDJa u03Tm4mPiS4Bb4epf4hzveCPu32q59obZ9wkTnzSmn4DxUzrFoxoQ4h/OlRoAssBRCl8 zE233CTV3T7oGXQ7a+sLYfD9chLNYLBRCPuM15jrQSAebmaSbWPQBIMVgu0GzTq6MrwY nIDNpIiFlWPhiA7/pfZzBcptIN6WXnWScpBL9yRoYK1UGnMlmZ9TMcv5kgjkR7eSwdrd Wdtg== X-Gm-Message-State: ALoCoQkvJL3ZGWEzTo5oDToS3qzPwnEbbP2QmjJpO7BPbuGajr5RmvtNPBrR8e9sBGJ9G3K5AB/E X-Received: by 10.42.133.200 with SMTP id i8mr20467288ict.14.1408438994844; Tue, 19 Aug 2014 02:03:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.39.148 with SMTP id v20ls1943487qgv.93.gmail; Tue, 19 Aug 2014 02:03:14 -0700 (PDT) X-Received: by 10.220.2.136 with SMTP id 8mr29243939vcj.17.1408438994710; Tue, 19 Aug 2014 02:03:14 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id 7si8361880vcs.68.2014.08.19.02.03.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 02:03:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so7066810vcb.17 for ; Tue, 19 Aug 2014 02:03:14 -0700 (PDT) X-Received: by 10.220.49.10 with SMTP id t10mr608931vcf.34.1408438994638; Tue, 19 Aug 2014 02:03:14 -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 tc5csp221965vcb; Tue, 19 Aug 2014 02:03:13 -0700 (PDT) X-Received: by 10.68.172.162 with SMTP id bd2mr35671338pbc.47.1408438993485; Tue, 19 Aug 2014 02:03:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zr6si25838957pac.49.2014.08.19.02.03.05 for ; Tue, 19 Aug 2014 02:03:06 -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 S1753062AbaHSJAE (ORCPT + 20 others); Tue, 19 Aug 2014 05:00:04 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:55712 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753033AbaHSJAA (ORCPT ); Tue, 19 Aug 2014 05:00:00 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAJ00IF3QBYN410@mailout1.samsung.com>; Tue, 19 Aug 2014 17:59:59 +0900 (KST) X-AuditID: cbfee61b-f79f86d00000144c-4e-53f3120ee006 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id E5.E0.05196.E0213F35; Tue, 19 Aug 2014 17:59:58 +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 <0NAJ0011RQ2NYC00@mmp2.samsung.com>; Tue, 19 Aug 2014 17:59:58 +0900 (KST) From: Robert Baldyga To: Paul.Zimmerman@synopsys.com Cc: gregkh@linuxfoundation.org, balbi@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, m.szyprowski@samsung.com, andrzej.p@samsung.com, Robert Baldyga Subject: [PATCH RESEND v3 09/12] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Date: Tue, 19 Aug 2014 10:54:15 +0200 Message-id: <1408438458-3317-10-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1408438458-3317-1-git-send-email-r.baldyga@samsung.com> References: <1408438458-3317-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJLMWRmVeSWpSXmKPExsVy+t9jQV0+oc/BBs8aLC1mvWxnsTh4v96i efF6NovLu+awWSxa1spssfbIXXaLRw+3slo8OLyT3YHDY//cNewefVtWMXps2f+Z0eP4je1M Hp83yQWwRnHZpKTmZJalFunbJXBlnF2+nLXgOU/F2me7mBsYL3B1MXJySAiYSPw6+oUNwhaT uHBvPZDNxSEkMJ1RYuvC/VBOO5PEyXXr2EGq2AR0JLZ8n8AIYosIyEtc33iTBaSIWeAQo8Sr O8eYQBLCAjkSL2/NZAWxWQRUJS7uvw5m8wq4SuyaeoURYp2cxMljk8HinEDxt/tmgS0QEnCR 2Nx6hm0CI+8CRoZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmbGMEB9kx6B+OqBotDjAIcjEo8 vApfPgYLsSaWFVfmAl3Dwawkwuv44lOwEG9KYmVValF+fFFpTmrxIUZpDhYlcd6DrdaBQgLp iSWp2ampBalFMFkmDk6pBsb5/YwVhgz9B9U1hDPNF3Js3PXn0fEpnbd2lM9mP5TieS1/7XP7 6v2nF3/y6Uj1aZTdveBqkt5sqZ0+DOnpDPkmV/ZWXLgRrs1ZpbKxXTw+7dz1NcFbVJ0NmvQf Ln970IKxYnlxyYpd/rJzC0XTPQR9LmVN2vtn8oO/cd5XLV+Kej+daFv79rgSS3FGoqEWc1Fx IgCKADpyLAIAAA== 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.172 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 1d5e387..619fbff 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) {