From patchwork Wed Sep 3 21:41:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 36663 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 203F0202E4 for ; Wed, 3 Sep 2014 21:41:18 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hq11sf26449613vcb.11 for ; Wed, 03 Sep 2014 14:41:17 -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=L0AJYwGqK3Nt9S7iEMo4r2Em50BM18A+j8PTgJ3/K1Y=; b=L+3k8/JYEryJDcG6V2Rq8jm7J877jV2ng6defUXJX97+80/KGcIyOsHbqp1K2qtpu2 J5jn0vZsLZ2e5M0OHqHjlCoq8g2Xvdu2cAQxCm4DlLjeS6G3Qcfca6uYr64Y9nnEOkOF zcrDo9kPMcgfoVfjeIunU1v5ON6/p3ZHMej60LgS7GzwAnDQ7Pz4aaUVmt1mWZHQ8Gg7 mL7PhOEpRED5yfbPfi5PtGqVM3iOrfF7KXadWZAF6VNEBUBskM1x5QaG7iP020ju6ILn iaEVwyNGShDiMnARsC+1JmQ30x0hEBGdDrWNi9pIMkVwwMmjmZA1ihpIkC9AnpyGLgMu iujQ== X-Gm-Message-State: ALoCoQni1V+MfHwuEj8tMSYdLV9gd41xTMz6/m+ZeKuvlA5HYhcn/Ya7K/Wczs123ZmNmbOE+hMm X-Received: by 10.236.108.172 with SMTP id q32mr190481yhg.0.1409780477898; Wed, 03 Sep 2014 14:41:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.39.231 with SMTP id v94ls21965qgv.16.gmail; Wed, 03 Sep 2014 14:41:17 -0700 (PDT) X-Received: by 10.52.73.202 with SMTP id n10mr72237vdv.86.1409780477771; Wed, 03 Sep 2014 14:41:17 -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 ry3si4493740vcb.27.2014.09.03.14.41.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 14:41:17 -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 id10so9628455vcb.16 for ; Wed, 03 Sep 2014 14:41:17 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr151215vcn.16.1409780477614; Wed, 03 Sep 2014 14:41:17 -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 uj3csp742278vcb; Wed, 3 Sep 2014 14:41:17 -0700 (PDT) X-Received: by 10.70.21.202 with SMTP id x10mr396113pde.92.1409780476722; Wed, 03 Sep 2014 14:41:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si13478088pas.101.2014.09.03.14.41.16 for ; Wed, 03 Sep 2014 14:41:16 -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 S1755993AbaICVlP (ORCPT + 1 other); Wed, 3 Sep 2014 17:41:15 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:53650 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752553AbaICVlO (ORCPT ); Wed, 3 Sep 2014 17:41:14 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s83LfBPI012799; Wed, 3 Sep 2014 16:41:11 -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 s83LfBWb026431; Wed, 3 Sep 2014 16:41:11 -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; Wed, 3 Sep 2014 16:41:11 -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 s83LfAiH004615; Wed, 3 Sep 2014 16:41:10 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Alan Stern , Felipe Balbi , Subject: [PATCH 1/2] usb: dwc3: core: fix order of PM runtime calls Date: Wed, 3 Sep 2014 16:41:02 -0500 Message-ID: <1409780463-29635-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.1.563.g66f467c 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.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: , 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 b769c1f..a664d5b 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -804,15 +804,15 @@ static int dwc3_remove(struct platform_device *pdev) phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy); - pm_runtime_put_sync(&pdev->dev); - pm_runtime_disable(&pdev->dev); - dwc3_debugfs_exit(dwc); dwc3_core_exit_mode(dwc); dwc3_event_buffers_cleanup(dwc); dwc3_free_event_buffers(dwc); dwc3_core_exit(dwc); + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + return 0; }