From patchwork Mon Jun 23 07:51:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 32334 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 74D4A203AC for ; Mon, 23 Jun 2014 07:54:27 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf22302710pdb.8 for ; Mon, 23 Jun 2014 00:54:26 -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=SOvvc8aZ01IMr5JSGWr9yHVCWWbqKswMEpPZiwIkQxwLEGcjeUMCS7WYfE3Np3Trks MZr7sGdfETuEU33otYotBuGUXqOU7SnO12Pr7T8tJUKB/A7Q3TEHL10PnbB5dS7ORp7d RsVWGQ1C/Jtm4MJAna+2s6hBiayfvrqXhF8rBs1k7+FisC086gvXQqcaGPzk/08IudYs UurDzrsvZuaSeet0Z7rHtnlNK8dODadvBDMNKclcZzXrsU0t9UzRwk2wvVvEh4A1Cofw JWNq41DSIeQHGQ8xNCW10mwVYlURgTdjN+Zsc0zhXlmqib30QJQJ2xoUi2CP4WC9u7Jo 7EGw== X-Gm-Message-State: ALoCoQmK2YNJ4lmvSgJqHwpeOUW3UYNOoOMPG8yFKhSQE0VwY/NsrfrAlU/UZVLRdXNVWOn+tnkr X-Received: by 10.68.253.66 with SMTP id zy2mr8950330pbc.1.1403510066743; Mon, 23 Jun 2014 00:54:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.139 with SMTP id c11ls1729866qgd.66.gmail; Mon, 23 Jun 2014 00:54:26 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr17856974vcm.11.1403510066648; Mon, 23 Jun 2014 00:54:26 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id rs3si359267vdb.61.2014.06.23.00.54.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 00:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id lf12so5513248vcb.4 for ; Mon, 23 Jun 2014 00:54:26 -0700 (PDT) X-Received: by 10.58.69.76 with SMTP id c12mr1862172veu.35.1403510066580; Mon, 23 Jun 2014 00:54:26 -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 tc5csp112391vcb; Mon, 23 Jun 2014 00:54:26 -0700 (PDT) X-Received: by 10.66.153.80 with SMTP id ve16mr26883526pab.143.1403510065866; Mon, 23 Jun 2014 00:54:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id er3si20643108pbb.61.2014.06.23.00.54.25; Mon, 23 Jun 2014 00:54:25 -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 S1752703AbaFWHyW (ORCPT + 9 others); Mon, 23 Jun 2014 03:54:22 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:51027 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752653AbaFWHyT (ORCPT ); Mon, 23 Jun 2014 03:54:19 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N7M00B7N3AF3N30@mailout3.samsung.com>; Mon, 23 Jun 2014 16:54:15 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-7c-53a7dd278a7c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B1.B1.04943.72DD7A35; Mon, 23 Jun 2014 16:54:15 +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 <0N7M00JX335V68O0@mmp2.samsung.com>; Mon, 23 Jun 2014 16:54:15 +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 09/11] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Date: Mon, 23 Jun 2014 09:51:28 +0200 Message-id: <1403509890-14103-10-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1403509890-14103-1-git-send-email-r.baldyga@samsung.com> References: <1403509890-14103-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJLMWRmVeSWpSXmKPExsVy+t9jQV31u8uDDVqv8lnMetnOYnHwfr1F 8+L1bBaXd81hs1i0rJXZYu2Ru+wW26dMZ7J4cHgnuwOHx/65a9g9+rasYvTYsv8zo8fxG9uZ PD5vkgtgjeKySUnNySxLLdK3S+DKWLf2FUvBc56K4wfeMDUwXuDqYuTkkBAwkbiyoJcNwhaT uHBvPZDNxSEkMJ1RYual91BOO5PEmpcPGEGq2AR0JLZ8nwBmiwgISKx/cYkdpIhZ4ASjRMf/ C2CjhAWSJO6v2QtWxCKgKrHl1FIwm1fATaJj2yZmiHVyEiePTWYFsTmB4utvLmQHsYUEXCUW nZ7GPoGRdwEjwypG0dSC5ILipPRcQ73ixNzi0rx0veT83E2M4AB7JrWDcWWDxSFGAQ5GJR5e DbflwUKsiWXFlbmHGCU4mJVEeBsbgEK8KYmVValF+fFFpTmpxYcYpTlYlMR5D7RaBwoJpCeW pGanphakFsFkmTg4pRoYJ11wi36meO/QNwn5lfZLrpukCVz/JzZJ+sadx4+iZ4cdehO9WFtQ 8+Q8rvt3stf0b+7ccNDEMKDlacU5+c1v7/Gpf0h4/ZV7YbmiRYHJ3lqZL0wHtZUK5SUfbpHa sfrLsmlP3a4/1spdetUxctaEci7HvP7Nsnpun92Wr/610GNfub9swdZph5RYijMSDbWYi4oT AeGAmIwsAgAA 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.173 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) {