From patchwork Tue Sep 9 08:48: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: 37051 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 527B120C93 for ; Tue, 9 Sep 2014 08:48:52 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf81540971obc.8 for ; Tue, 09 Sep 2014 01:48:51 -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=uVXhkK+wHQQP+wbe4clEDbweFe31El4hvCxtsg97Tg4=; b=jhxmeIjJHSSyqVIzqPJheA64TLLJLcz56q7VvfudC2wm4LllxXZCDrpXatJRry/8ZH 1/w5JI0m5J6YZVkb8IP1achD+VpmThDnMTuLo7+j87ddczVhU3CtUZsnTr52cqcIYNRu fSpBDEosUbRcW5Qv/is73OxfAdEJFBMNgSQaLBBG97ifS18jrqyx52od58upKY2dqxNR JtnD+Gc0wCnS0YK6BGKzxmxftQRT1HJAuxOlMUG3cc37AcSvFAgyxREZUCgptkyUg1nd f+wjcHtpeGVwEYAok3+fZYSQhptF6B9WVnMpUxgliiyp4stmjeiqHRzW6ZYHfGbpO7Mc GBJw== X-Gm-Message-State: ALoCoQkA87DNgoaYji39wII5lRfyRHp4LEeX3JH1V0sGRrDPk01oNIXxsmBZ9aQ3SIPCRJpnenh3 X-Received: by 10.42.58.138 with SMTP id i10mr21441306ich.18.1410252531917; Tue, 09 Sep 2014 01:48:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.247 with SMTP id c110ls1366105qga.32.gmail; Tue, 09 Sep 2014 01:48:51 -0700 (PDT) X-Received: by 10.52.146.17 with SMTP id sy17mr24952988vdb.29.1410252531830; Tue, 09 Sep 2014 01:48:51 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id d4si466992vcz.2.2014.09.09.01.48.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 01:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hy4so2032407vcb.29 for ; Tue, 09 Sep 2014 01:48:51 -0700 (PDT) X-Received: by 10.221.44.69 with SMTP id uf5mr29768988vcb.4.1410252531745; Tue, 09 Sep 2014 01:48:51 -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 uj3csp251549vcb; Tue, 9 Sep 2014 01:48:51 -0700 (PDT) X-Received: by 10.68.129.5 with SMTP id ns5mr24096766pbb.4.1410252530442; Tue, 09 Sep 2014 01:48:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rr5si22243014pab.9.2014.09.09.01.48.50 for ; Tue, 09 Sep 2014 01:48:50 -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 S932378AbaIIIsr (ORCPT + 2 others); Tue, 9 Sep 2014 04:48:47 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:65457 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932276AbaIIIsp (ORCPT ); Tue, 9 Sep 2014 04:48:45 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NBM00I4HLT8EXC0@mailout2.samsung.com>; Tue, 09 Sep 2014 17:48:44 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-57-540ebeecf8d7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 48.BC.04943.CEEBE045; Tue, 09 Sep 2014 17:48:44 +0900 (KST) Received: from AMDC2122.DIGITAL.local ([106.120.53.17]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NBM00JXYLSK8KA0@mmp1.samsung.com>; Tue, 09 Sep 2014 17:48:44 +0900 (KST) From: Robert Baldyga To: gregkh@linuxfoundation.org Cc: Paul.Zimmerman@synopsys.com, balbi@ti.com, stable@vger.kernel.org, linux-usb@vger.kernel.org, Marek Szyprowski , Robert Baldyga Subject: [PATCH stable 5/6] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Date: Tue, 09 Sep 2014 10:48:15 +0200 Message-id: <1410252496-13814-6-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1410252496-13814-1-git-send-email-r.baldyga@samsung.com> References: <1410252496-13814-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t9jAd03+/hCDHqfC1scvF9v0bx4PZvF omWtzBZrj9xlt3j0cCurxYPDO9ktFmx8xOjA7rF/7hp2j74tqxg9tuz/zOhx/MZ2Jo/Pm+QC WKO4bFJSczLLUov07RK4Mlrv/GQs6OOteNNznrmB8RNXFyMnh4SAicTqH8vZIWwxiQv31rN1 MXJxCAksYpRY/PUTlNPOJLHlwnpGkCo2AR2JLd8ngNkiAnIST27/YQYpYhbYySjxbPY2JpCE sEC6xPdFZ5lBbBYBVYl7H28A2RwcvAKuEl++lkFsk5M4eWwyK0iYU8BNYsFldZCwEFDF7KmP 2Scw8i5gZFjFKJpakFxQnJSea6hXnJhbXJqXrpecn7uJERxSz6R2MK5ssDjEKMDBqMTDmxHM FyLEmlhWXJl7iFGCg1lJhNdyL1CINyWxsiq1KD++qDQntfgQozQHi5I474FW60AhgfTEktTs 1NSC1CKYLBMHp1QD4+ZHD8yuz3f8K3K+fRu7W9n3+QnCl724N9VclVu3+kZD4v/UcKG5Lndf GRpMDr0nXSJ2LOTXvdx9S8Nepbt3qIbpPf4vvdv5cnbtT8sstaftLpt3Gx5l0XEqWt/5pbMr 9/3TuqCdBnsPFlbdy9zue0TU8Z9cZMlLzUnJiy4tP6XwgOnQrGv6a5VYijMSDbWYi4oTAapp hewlAgAA 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: patch@linaro.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.170 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. Cc: # 3.16.x 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 1c2b8dd..2d48ffb 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3444,13 +3444,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; @@ -3498,6 +3491,17 @@ static int s3c_hsotg_probe(struct platform_device *pdev) s3c_hsotg_init(hsotg); s3c_hsotg_hw_cfg(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) {