From patchwork Fri Oct 17 08:10:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38847 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A36821177 for ; Fri, 17 Oct 2014 08:15:08 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf176579lab.7 for ; Fri, 17 Oct 2014 01:15:07 -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: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=2t3m1xijHKhaaEn9DJsqYDOnVRAaIhaXwWNMh5xgeUw=; b=kyFegbmRVR+ukz23peorfjY5UmroYDKD0l0Z+9awG7GD7lD5OheHCUYRP1DQsppvIi CWxWuGpB9HWFfXSsW7vTjXOUQUZ7jL2Fo1F/HgoToH7hl223eWEcx3UCPnRJaZRSriDh 3jWvGhaF97KJyHbT23XInmNF2tbzs5p3B0OzH1sR77oFFnhcSeRvYxqJQJq/13zQoFQ5 OdKegMTBjB1zdKb6Ng5A95+hT4qcCLm7bfNbNWEc1DVwSEGjXQ6birePBsYt8gbe2Fpx xJpk2HG5jc1V+o3zoBr+unr4bHUPF88q2Jf6Mp0EFYiCLJdv8wHtPtWPpE/344WGfrQh uORA== X-Gm-Message-State: ALoCoQmXQucjfAjobB70M1dspvYE5JdLPpbV2cDGd9BBKKve5Grh+ZWeD3LidPCNam1N6k9mzmbD X-Received: by 10.180.83.134 with SMTP id q6mr1749409wiy.7.1413533707063; Fri, 17 Oct 2014 01:15:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.5 with SMTP id f5ls227001lah.62.gmail; Fri, 17 Oct 2014 01:15:06 -0700 (PDT) X-Received: by 10.152.5.201 with SMTP id u9mr7109065lau.24.1413533706940; Fri, 17 Oct 2014 01:15:06 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id od3si872518lbb.84.2014.10.17.01.15.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 01:15:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id q1so255106lam.22 for ; Fri, 17 Oct 2014 01:15:06 -0700 (PDT) X-Received: by 10.152.29.8 with SMTP id f8mr7071085lah.56.1413533706873; Fri, 17 Oct 2014 01:15:06 -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 c5csp184449lbz; Fri, 17 Oct 2014 01:15:06 -0700 (PDT) X-Received: by 10.66.159.134 with SMTP id xc6mr7026985pab.14.1413533656888; Fri, 17 Oct 2014 01:14:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si482018pdp.169.2014.10.17.01.14.16 for ; Fri, 17 Oct 2014 01:14: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 S1753507AbaJQIOO (ORCPT + 1 other); Fri, 17 Oct 2014 04:14:14 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36364 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753839AbaJQIN5 (ORCPT ); Fri, 17 Oct 2014 04:13:57 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 39B13AE4B; Fri, 17 Oct 2014 08:12:01 +0000 (UTC) Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1Xf2df-0000IR-Vg; Fri, 17 Oct 2014 10:11:55 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Felipe Balbi , Jiri Slaby Subject: [PATCH 3.12 121/197] usb: dwc3: core: fix order of PM runtime calls Date: Fri, 17 Oct 2014 10:10:37 +0200 Message-Id: X-Mailer: git-send-email 2.1.1 In-Reply-To: <7d97f39bc813aa9f11fe03d602885f81de07007c.1413533329.git.jslaby@suse.cz> References: <7d97f39bc813aa9f11fe03d602885f81de07007c.1413533329.git.jslaby@suse.cz> In-Reply-To: References: 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.215.49 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 3.12-stable review patch. If anyone has any objections, please let me 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; }