From patchwork Fri Oct 3 15:57:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38340 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 420472057C for ; Fri, 3 Oct 2014 15:57:30 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id a1sf866082wgh.1 for ; Fri, 03 Oct 2014 08:57:29 -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 :in-reply-to:references: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=V7uXIYaXWnd8o1L/TjYw//K2bRzNmV//jwPxd8xmm3s=; b=MJ374f2c5NsWU7QttzLXn+vR40SAS5ZX22uuV2S5X93oq8TqIBsRgpSu+7tMMJFxiP v5qul1DAPLUfP7XUgtBhQeCBzccP64l3dIsJBg+9JEiruN6f2A/8vFthSFInoyq5lp0/ OznPyaaN5E3hOAMauAAQMqf3zRtVyb6W9fDfHH6N90EJikl2pZziXEmm3wDT5dsBdhm+ sjxGhOXAuX0Hxrnluh509ysxEkwKVtc9Ao5EFDPUMAJ/vwIQAMTONfp7ctjMWSJsLERG mtJliOlQfY4Yt2eFxdeC7QFZ6IaPurSoAowkrYEZGwgUwbw+5ewmZLOhLtGZdbaOzIdr UNnQ== X-Gm-Message-State: ALoCoQk87uX9Dh4+lBkJnIncgYb/di4BXRdGVFGMh9VoBn+PZyaTjjmz7nlXOk1LNXvojJj/luGU X-Received: by 10.112.157.193 with SMTP id wo1mr142494lbb.19.1412351849442; Fri, 03 Oct 2014 08:57:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.107 with SMTP id lv11ls381852lac.14.gmail; Fri, 03 Oct 2014 08:57:29 -0700 (PDT) X-Received: by 10.112.155.230 with SMTP id vz6mr4144390lbb.99.1412351849310; Fri, 03 Oct 2014 08:57:29 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx.google.com with ESMTPS id kf3si11842765lbc.68.2014.10.03.08.57.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 08:57:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id mc6so1323546lab.16 for ; Fri, 03 Oct 2014 08:57:29 -0700 (PDT) X-Received: by 10.153.6.36 with SMTP id cr4mr7031583lad.40.1412351848940; Fri, 03 Oct 2014 08:57:28 -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 of9csp254355lbb; Fri, 3 Oct 2014 08:57:28 -0700 (PDT) X-Received: by 10.68.189.3 with SMTP id ge3mr7930960pbc.128.1412351847110; Fri, 03 Oct 2014 08:57:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zs4si7576523pbb.69.2014.10.03.08.57.26 for ; Fri, 03 Oct 2014 08:57:27 -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 S1754357AbaJCP5X (ORCPT + 1 other); Fri, 3 Oct 2014 11:57:23 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:58776 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754350AbaJCP5W (ORCPT ); Fri, 3 Oct 2014 11:57:22 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93FvLqh032078; Fri, 3 Oct 2014 10:57:21 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93FvL57010396; Fri, 3 Oct 2014 10:57:21 -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 10:57:20 -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 s93FvKGU019828; Fri, 3 Oct 2014 10:57:20 -0500 From: Felipe Balbi To: Greg KH CC: , Felipe Balbi Subject: [PATCH v3.10-stable 2/3] usb: dwc3: core: fix ordering for PHY suspend Date: Fri, 3 Oct 2014 10:57:20 -0500 Message-ID: <1412351841-28107-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1412351841-28107-1-git-send-email-balbi@ti.com> References: <1412351841-28107-1-git-send-email-balbi@ti.com> 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.215.43 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 dc99f16f076559235c92d3eb66d03d1310faea08 upstream We can't suspend the PHYs before dwc3_core_exit_mode() has been called, that's because the host and/or device sides might still need to communicate with the far end link partner. Fixes: 8ba007a (usb: dwc3: core: enable the USB2 and USB3 phy in probe) Cc: # v3.9+ Suggested-by: Alan Stern 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..8f26d2d 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(&pdev->dev); + pm_runtime_disable(&pdev->dev); + return 0; }