From patchwork Mon Sep 8 09:45:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 36952 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 742C320491 for ; Mon, 8 Sep 2014 09:46:09 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id q108sf16749097qgd.0 for ; Mon, 08 Sep 2014 02:46:09 -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=WALMPCkJE6voA/GvyNCD8bquk6mpHIIO+GI2dN9PH54=; b=VTTWdo4D8OnO05xIgqK9AUDgg/F/zshEQ62GergIvX2w6IV9xA4iqEKTVGVT3johoB gwxOuHRZqRQROZvu4Rcm019wgjISdbFdhpxpzKMf7uJ121h7g03/hSaIULDInomeJYk3 BXoRbks0K4wxuI/nWjH5yKZbXdgT6uwKwzblvQUxYNnQJp7BBO4BWj4St+eiNEbwRz7q 3jLJjKbBxaBjL+VyLwT/Dsz4wrgwXZnjIaPMmzKTgJoTKCjXHb1P1K4/GY2QsbQoL2XY kiUvb6PW857iAJOH8E8GQdZIV/lWiNkxh1AlfZWIIER9gv6x71D0qZPYJgRxqVGAqnPL 506g== X-Gm-Message-State: ALoCoQn23RTl+KR3Tj14rOHJpB4yZbYXEj61LcnHrWIxywegtS57HQh5+VMcQm3+Pc2/1V+c/I5t X-Received: by 10.236.84.137 with SMTP id s9mr82219yhe.56.1410169569340; Mon, 08 Sep 2014 02:46:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.176 with SMTP id t45ls1682336qgt.60.gmail; Mon, 08 Sep 2014 02:46:09 -0700 (PDT) X-Received: by 10.220.114.66 with SMTP id d2mr9589117vcq.27.1410169569271; Mon, 08 Sep 2014 02:46:09 -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 h4si4342461vdx.8.2014.09.08.02.46.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Sep 2014 02:46:09 -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 hy4so522576vcb.29 for ; Mon, 08 Sep 2014 02:46:09 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr6741vcy.45.1410169569140; Mon, 08 Sep 2014 02:46:09 -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 uj3csp106478vcb; Mon, 8 Sep 2014 02:46:08 -0700 (PDT) X-Received: by 10.68.195.131 with SMTP id ie3mr3338456pbc.145.1410169568247; Mon, 08 Sep 2014 02:46:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gv6si16769046pac.113.2014.09.08.02.46.07 for ; Mon, 08 Sep 2014 02:46:08 -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 S1754153AbaIHJqE (ORCPT + 2 others); Mon, 8 Sep 2014 05:46:04 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:55181 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754136AbaIHJqB (ORCPT ); Mon, 8 Sep 2014 05:46:01 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NBK002FBTSOJ170@mailout4.samsung.com>; Mon, 08 Sep 2014 18:46:00 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-c0-540d7ad8e5b8 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 63.9B.04943.8DA7D045; Mon, 08 Sep 2014 18:46:00 +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 <0NBK001BQTRY5140@mmp1.samsung.com>; Mon, 08 Sep 2014 18:46:00 +0900 (KST) From: Robert Baldyga To: gregkh@linuxfoundation.org Cc: Paul.Zimmerman@synopsys.com, balbi@ti.com, linux-usb@vger.kernel.org, stable@vger.kernel.org, Marek Szyprowski , Robert Baldyga Subject: [PATCH stable 5/6] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Date: Mon, 08 Sep 2014 11:45:31 +0200 Message-id: <1410169532-16212-6-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1410169532-16212-1-git-send-email-r.baldyga@samsung.com> References: <1410169532-16212-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t9jAd0bVbwhBss6BC0O3q+3aF68ns1i 0bJWZou1R+6yWzx6uJXV4sHhnewWCzY+YnRg99g/dw27R9+WVYweW/Z/ZvQ4fmM7k8fnTXIB rFFcNimpOZllqUX6dglcGfPu9rEUPOepODzDoYHxAlcXIyeHhICJxIvtJ1kgbDGJC/fWs3Ux cnEICSxilHgz6RA7hNPOJDFzejMzSBWbgI7Elu8TGEFsEQE5iSe3/4DFmQV2Mko8nwdmCwuk S3xfdBbMZhFQlTje8I8NxOYVcJU49uQFO8Q2OYmTxyazgticAm4SR69dZgKxhYBq7s3pZ53A yLuAkWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRnBIPZPawbiyweIQowAHoxIPL8dlnhAh 1sSy4srcQ4wSHMxKIrzBObwhQrwpiZVVqUX58UWlOanFhxilOViUxHkPtFoHCgmkJ5akZqem FqQWwWSZODilGhiPvRKX67yUpPY44cDa/ewuPrs2nvabrXrqCkvuG/nzbdHVxpWOJpUF0cyR 22dfXLviw4qfcdvLNXZuLbj3+8HxuvMX9ijNmCl1X7/tVkEPxzX7tO8BiR0Zmqt/JyxktjjJ 8Sz7lUCad+x3pdqzFQpn4gLU7VxPha85IqXNsWX9qTz913ueHbmlxFKckWioxVxUnAgAgGtZ +iUCAAA= 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. 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) {