From patchwork Fri Oct 3 16:05:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38342 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 50FD32057C for ; Fri, 3 Oct 2014 16:05:32 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf883049lab.9 for ; Fri, 03 Oct 2014 09:05:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=PTV1UIUowvG46UCde24mpy2HmGKmP1yR9dpXQmtMFBE=; b=HABE8qdMbvYk+FLnbk9lGf1v6pp4RAVWIFvjiqj5GCTShWKdy7xuNogyi0Dy/085gY OCWXLOLs+rJnPkN+8LWI7qQLNwEnt7bVCnquJlNbCEwO7VDhtsbOR1/85BI0x4MeN77T nZTTGfGVdQVS3uACZoz195h1BP9a7lGFlaS1CV3LEi9PaxAJ126MB0kV+/SJiz2REFwC L9GwOMqzPYZs6S8iH/FO4IdZpycLXVRFeM1b6fImUHDDC0Neanjp7IXAArerUA67uLHI p5OfEsTT2NEUGX7eJ8n9Lp3rb4zTG0ULTG7j7RismYe15oGBUwemxBntBfQkdF2JqWCp jnqA== X-Gm-Message-State: ALoCoQnGCtLc1L9PrtBf/8Wd2dq/ZfI2oxcmJtpQSA0bOvnSpyvDsRbU97espba+o5O6FK3u1xMN X-Received: by 10.112.137.230 with SMTP id ql6mr572000lbb.13.1412352331049; Fri, 03 Oct 2014 09:05:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.201 with SMTP id je9ls290863lac.92.gmail; Fri, 03 Oct 2014 09:05:30 -0700 (PDT) X-Received: by 10.152.26.133 with SMTP id l5mr7241920lag.4.1412352330768; Fri, 03 Oct 2014 09:05:30 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx.google.com with ESMTPS id bk7si11873671lbc.71.2014.10.03.09.05.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 09:05:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id z11so1273043lbi.27 for ; Fri, 03 Oct 2014 09:05:30 -0700 (PDT) X-Received: by 10.152.22.137 with SMTP id d9mr6910230laf.29.1412352330658; Fri, 03 Oct 2014 09:05:30 -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.112.130.169 with SMTP id of9csp255885lbb; Fri, 3 Oct 2014 09:05:29 -0700 (PDT) X-Received: by 10.70.129.226 with SMTP id nz2mr1627560pdb.113.1412352328475; Fri, 03 Oct 2014 09:05:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ta5si7576119pac.90.2014.10.03.09.05.27 for ; Fri, 03 Oct 2014 09:05:28 -0700 (PDT) Received-SPF: none (google.com: stable-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 S1753271AbaJCQF1 (ORCPT + 1 other); Fri, 3 Oct 2014 12:05:27 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:56268 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753139AbaJCQF0 (ORCPT ); Fri, 3 Oct 2014 12:05:26 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93G5PXa011047; Fri, 3 Oct 2014 11:05:25 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93G5PaA030957; Fri, 3 Oct 2014 11:05:25 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 3 Oct 2014 11:05:24 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93G5Ose028657; Fri, 3 Oct 2014 11:05:24 -0500 Date: Fri, 3 Oct 2014 11:05:30 -0500 From: Felipe Balbi To: Felipe Balbi CC: Greg KH , Subject: [PATCH v2 v3.10-stable 2/3] usb: dwc3: core: fix ordering for PHY suspend Message-ID: <20141003160530.GF22626@saruman> Reply-To: References: <1412351841-28107-1-git-send-email-balbi@ti.com> <1412351841-28107-2-git-send-email-balbi@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1412351841-28107-2-git-send-email-balbi@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 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: , commit fed33afce0eda44a46ae24d93aec1b5198c0bac4 upstream Currently, we disable pm_runtime before all register accesses are done, this is dangerous and might lead to abort exceptions due to the driver trying to access a register which is clocked by a clock which was long gated. Fix that by moving pm_runtime_put_sync() and pm_runtime_disable() as the last thing we do before returning from our ->remove() method. Fixes: 72246da (usb: Introduce DesignWare USB3 DRD Driver) Cc: # v3.2+ Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 358375e..60ea599 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -606,9 +606,6 @@ static int dwc3_remove(struct platform_device *pdev) usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); - pm_runtime_put(&pdev->dev); - pm_runtime_disable(&pdev->dev); - dwc3_debugfs_exit(dwc); switch (dwc->mode) { @@ -631,6 +628,9 @@ static int dwc3_remove(struct platform_device *pdev) dwc3_free_event_buffers(dwc); dwc3_core_exit(dwc); + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + return 0; }