From patchwork Mon Oct 13 13:49:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38650 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9CFA12039B for ; Mon, 13 Oct 2014 13:51:03 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e51sf4278074eek.7 for ; Mon, 13 Oct 2014 06:51:02 -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=nATfEqK8IIhNbgk3L7Lg5N3Y6Hw/JFCEldnT6gdq7lQ=; b=RuFXo9QuOXAsxMwTr4DzqToLbkrujCdBrvbRxWDOa3kSXMJ7slqoHkB47CZxviIMG6 xoX3miRfNiTjKjzo4vejjPb1gqq3wRehcbpQkhAtXrgwQiDpms/S+c0/Se6W9pXY8I27 J4KHylMwVjE1EQSlZGYQiLQsN24iMbbrK1LqviaxKEc+c4/dESNfgXBD6MuhzWwwik/S xs79hYNLcAeZ4FVOzCtRaZJwYZwuNpRHQAVpBpXePYY04arraz9WdUlMiJb/Uo7IEZtg A4jEPcBgyoMvAwDp3J9gU10stb7i5yDUslh+SQmSGC7jcMcyUJ2p3IBZ+VJajXCI/Ays Ct1g== X-Gm-Message-State: ALoCoQnfSAmkBadsak80RlkC8A4NbDIv2i6GZZkJmdQ+/SKP3kB80DAP3vxW0aEfc92fIu3fPxtB X-Received: by 10.180.96.101 with SMTP id dr5mr198708wib.0.1413208262837; Mon, 13 Oct 2014 06:51:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.169 with SMTP id r9ls419854laj.57.gmail; Mon, 13 Oct 2014 06:51:02 -0700 (PDT) X-Received: by 10.112.11.225 with SMTP id t1mr3286636lbb.89.1413208262716; Mon, 13 Oct 2014 06:51:02 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id s6si22219426las.121.2014.10.13.06.51.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 06:51:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id w7so6376317lbi.22 for ; Mon, 13 Oct 2014 06:51:02 -0700 (PDT) X-Received: by 10.112.190.69 with SMTP id go5mr23977765lbc.32.1413208262635; Mon, 13 Oct 2014 06:51:02 -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.84.229 with SMTP id c5csp217608lbz; Mon, 13 Oct 2014 06:51:02 -0700 (PDT) X-Received: by 10.70.109.208 with SMTP id hu16mr1706724pdb.153.1413208238103; Mon, 13 Oct 2014 06:50:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si10368565pat.185.2014.10.13.06.50.37 for ; Mon, 13 Oct 2014 06:50:38 -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 S1754912AbaJMNuf (ORCPT + 1 other); Mon, 13 Oct 2014 09:50:35 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:57502 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754909AbaJMNuP (ORCPT ); Mon, 13 Oct 2014 09:50:15 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1Xdg0n-00043d-Uy; Mon, 13 Oct 2014 15:50:09 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Felipe Balbi , Jiri Slaby Subject: [patch added to the 3.12 stable tree] usb: dwc3: core: fix order of PM runtime calls Date: Mon, 13 Oct 2014 15:49:35 +0200 Message-Id: <1413208209-15396-22-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1413208209-15396-1-git-send-email-jslaby@suse.cz> References: <1413208209-15396-1-git-send-email-jslaby@suse.cz> 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: 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.217.177 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: Felipe Balbi This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== 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) Signed-off-by: Felipe Balbi Signed-off-by: Jiri Slaby --- 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 474162e9d01d..3ff8bba6503b 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -584,9 +584,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->dr_mode) { @@ -609,6 +606,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; }