From patchwork Tue Sep 9 08:44:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 37054 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BE14420566 for ; Tue, 9 Sep 2014 08:51:08 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id hy4sf5426776vcb.8 for ; Tue, 09 Sep 2014 01:51:08 -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=ENBB8HnUqNJ7GkIaqGlrYLY82J8N+oVkEvu3wxZJuqg=; b=A/TyVasyY3cmNKavCJj7ydcXrh52j8uRXLtVGxKZvoV4u1VyK79a06BtjG7dEX+QU4 +zNN9hhrRCZEhMr2aL1v9LSqt9hcYIlHoVvniYIDUTTo8LeBHNH3DF0Jew3zCSv3Cmzi lD2lw1Peh5p80QVtm14BmPyxJdZiAb+UxUZYAYBd0H9FdKjGSaAdTAwD56MAIbGynoKT A1vnPLbRUZ0G/8g/DGZsLLXT2Fvm16/ah708B1yNw8y386Cp6ruP2ccqFD45lPt3AtLT M4mS3JKL5bY4CKUZUU6tTS0X4KGapx+J3EtLS1zU4zVYs97yzOmps8DiyjIf0jWOAjTy ximA== X-Gm-Message-State: ALoCoQkvCoeL/gYgkrQgqlF1BxBdA+CtnroAKIAbP5XjIj9VQeLYCez74v8rlQdz40j+LWtbaVTG X-Received: by 10.224.45.133 with SMTP id e5mr20991181qaf.3.1410252668556; Tue, 09 Sep 2014 01:51:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.211 with SMTP id z77ls2099042qgz.54.gmail; Tue, 09 Sep 2014 01:51:08 -0700 (PDT) X-Received: by 10.52.239.108 with SMTP id vr12mr12475511vdc.30.1410252668473; Tue, 09 Sep 2014 01:51:08 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id fd7si4947726vcb.71.2014.09.09.01.51.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 01:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so16818422vcb.30 for ; Tue, 09 Sep 2014 01:51:08 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr29895754vcn.16.1410252668382; Tue, 09 Sep 2014 01:51:08 -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 uj3csp251798vcb; Tue, 9 Sep 2014 01:51:07 -0700 (PDT) X-Received: by 10.70.128.47 with SMTP id nl15mr55936968pdb.93.1410252667469; Tue, 09 Sep 2014 01:51:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hb1si15538625pbd.67.2014.09.09.01.51.05 for ; Tue, 09 Sep 2014 01:51:07 -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 S1756114AbaIIIvC (ORCPT + 26 others); Tue, 9 Sep 2014 04:51:02 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:65021 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932230AbaIIIon (ORCPT ); Tue, 9 Sep 2014 04:44:43 -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 <0NBM00IXCLMHEXB0@mailout2.samsung.com>; Tue, 09 Sep 2014 17:44:41 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-cd-540ebdf91012 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 61.9B.04943.9FDBE045; Tue, 09 Sep 2014 17:44:41 +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 <0NBM00GF4LLTCSA0@mmp2.samsung.com>; Tue, 09 Sep 2014 17:44:41 +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, Marek Szyprowski , Robert Baldyga Subject: [PATCH 5/6] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Date: Tue, 09 Sep 2014 10:44:12 +0200 Message-id: <1410252253-13687-6-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1410252253-13687-1-git-send-email-r.baldyga@samsung.com> References: <1410252253-13687-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t9jQd2fe/lCDJZ0yFscvF9v0bx4PZvF 5V1z2CwWLWtltlh75C67xaOHW1ktHhzeye7A7rF/7hp2j74tqxg9tuz/zOhx/MZ2Jo/Pm+QC WKO4bFJSczLLUov07RK4Mnr2rmYseM5T8bx/LXsD4wWuLkZODgkBE4mdvXOZIWwxiQv31rOB 2EIC0xklFr9P6mLkArLbmSRudPxlBEmwCehIbPk+AcwWEZCXuL7xJgtIEbPAPkaJ6Z+2sYMk hAUSJK6e/AQ0iYODRUBV4ueVapAwr4CrxL6zK1kglslJnDw2mRXE5hRwk5jf2w+12FWi88la xgmMvAsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBIfUM6kdjCsbLA4xCnAwKvHwZgTz hQixJpYVV+YeYpTgYFYS4b2yGyjEm5JYWZValB9fVJqTWnyIUZqDRUmc90CrdaCQQHpiSWp2 ampBahFMlomDU6qBsZ5pyiKhjkL2u5N4eA60HNDnP/vDlvf8SZbM/VfVCiflPlYJNeTTVHhQ ELZ0onbHTWlGy1uB29J6vn2T3FvQoeD+fO7GT98W3nrqsjXn2o+3njqbl70tYubjqfBsX3W+ ZmNErb69TlUNz8azSfFap04tYNQSdHmjX3Oi+FCM+LbrjpvlPu+8qsRSnJFoqMVcVJwIALPE kwglAgAA 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.171 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 474eae2..43fd3d5 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3441,13 +3441,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; @@ -3495,6 +3488,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) {