From patchwork Fri Oct 3 16:08:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38343 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C6D812057C for ; Fri, 3 Oct 2014 16:08:46 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf883449lab.10 for ; Fri, 03 Oct 2014 09:08:45 -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:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=ZBA5mX2QMJziwWGGomBIRDbUwCpYymvgsHkXrKxpxSo=; b=fXivL46A6L+s9AnjJ0bZSG+eNgq7HUOAJnhOR5jNf485dCF1gr3Ajjy8MfyQqot7RX IHsadSwnInwOh52XjshjDFyE17x/USqEP2hUed3d+8Iz8HrO2F7Z+0sVKw6Kt+IXWNc3 xTy4CSKpMmkKUp6EnTCOFXTorZ1M0p0nh64qjzAsvNAfqzw3VgQHnQhh7HjWHKnFBob5 oGgpFGsQPgkVK0PJq0HRJHLnSDkRoyh/kiI4SS7+O7MDR2F1k2D96UaTDACxuup+9dch /mq3Kt1OFb8h+QRjLKfE5DIFzYyQLH+yjv24/lIW4XWiXfBLZwCWXUe/IhFaE2ciLiDC r9Vw== X-Gm-Message-State: ALoCoQnvkl4pQe1vaky5oRBU7WTMWiLvM2/QkvL90qgBco+oR4nzNHtG18CNO5nU+1/sMyE0tioI X-Received: by 10.152.2.97 with SMTP id 1mr1154465lat.6.1412352525625; Fri, 03 Oct 2014 09:08:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.170 with SMTP id l10ls355408lah.18.gmail; Fri, 03 Oct 2014 09:08:45 -0700 (PDT) X-Received: by 10.152.18.165 with SMTP id x5mr7215408lad.42.1412352525357; Fri, 03 Oct 2014 09:08:45 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx.google.com with ESMTPS id h5si11815539laf.110.2014.10.03.09.08.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 09:08:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id l4so1276420lbv.10 for ; Fri, 03 Oct 2014 09:08:44 -0700 (PDT) X-Received: by 10.153.7.73 with SMTP id da9mr5602128lad.56.1412352524310; Fri, 03 Oct 2014 09:08:44 -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 of9csp256481lbb; Fri, 3 Oct 2014 09:08:43 -0700 (PDT) X-Received: by 10.68.102.132 with SMTP id fo4mr8079375pbb.96.1412352522655; Fri, 03 Oct 2014 09:08:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gg1si7629914pac.50.2014.10.03.09.08.42 for ; Fri, 03 Oct 2014 09:08:42 -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 S1753225AbaJCQIl (ORCPT + 1 other); Fri, 3 Oct 2014 12:08:41 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:38503 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489AbaJCQIk (ORCPT ); Fri, 3 Oct 2014 12:08:40 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93G8elS031063; Fri, 3 Oct 2014 11:08:40 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93G8eQd000571; Fri, 3 Oct 2014 11:08:40 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 3 Oct 2014 11:08:40 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93G8d8o010668; Fri, 3 Oct 2014 11:08:39 -0500 From: Felipe Balbi To: Greg KH CC: , Felipe Balbi Subject: [PATCH v3.14-stable 1/3] usb: dwc3: core: fix order of PM runtime calls Date: Fri, 3 Oct 2014 11:08:41 -0500 Message-ID: <1412352523-31144-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT MIME-Version: 1.0 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.179 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 a49217a..8c9c4cf 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -586,9 +586,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_sync(&pdev->dev); - pm_runtime_disable(&pdev->dev); - dwc3_debugfs_exit(dwc); switch (dwc->dr_mode) { @@ -611,6 +608,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; }