From patchwork Fri Oct 3 15:57:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38341 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6E5F82057C for ; Fri, 3 Oct 2014 15:57:32 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf865745lab.5 for ; Fri, 03 Oct 2014 08:57:30 -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=CY82YDP5Ra7SxCywQOILQuV8PsQEd9KAxZceCVwycfY=; b=lAGWhNZYubVzvoFMP7ktPPriN4Qin+/S5p5t96ziVRdaRWfP60qeTOGIZgFVgrw/Y2 gKDj3JVnCI71mhB+rGWRrgINQctNfASQWBFphwFFF/2BoYgCU9TGDtL9JGmA0dpa0dlD JVqM/x5DlPi2DBaPrrfpCSRrr7rOshGfO9ASq0XrQk4URpLVf3SmH/J4g1Lzctc1IK6T Q9lHHXWpmWf2IIXOJWe1qRelzi076YyqbGjn2I3ALidh2CYzWaonFyiR6uf9d6ZaTpKl jyoHt8+tYvpJ/iNlj5wN4+64nDcYa6igO+CeDfqnRDHYB6zJsH4xGqvDHfnkVAwYe1bJ OICw== X-Gm-Message-State: ALoCoQkl8ueI0Q4v9cS3uLPtQxEnTjkrKJM1IvB1D1tuRTQkQ7lmqF+YPXW7Pz6d+c7WY/k2SoJW X-Received: by 10.112.17.3 with SMTP id k3mr1126025lbd.3.1412351850771; Fri, 03 Oct 2014 08:57:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.97 with SMTP id r1ls391025lar.84.gmail; Fri, 03 Oct 2014 08:57:30 -0700 (PDT) X-Received: by 10.112.166.6 with SMTP id zc6mr4849245lbb.31.1412351850490; Fri, 03 Oct 2014 08:57:30 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by mx.google.com with ESMTPS id w5si11886053lae.42.2014.10.03.08.57.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 08:57:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id pv20so1288698lab.6 for ; Fri, 03 Oct 2014 08:57:30 -0700 (PDT) X-Received: by 10.153.7.73 with SMTP id da9mr5529379lad.56.1412351850157; Fri, 03 Oct 2014 08:57:30 -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 of9csp254360lbb; Fri, 3 Oct 2014 08:57:29 -0700 (PDT) X-Received: by 10.66.119.103 with SMTP id kt7mr7855258pab.95.1412351848680; Fri, 03 Oct 2014 08:57:28 -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.28 for ; Fri, 03 Oct 2014 08:57:28 -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 S1754360AbaJCP50 (ORCPT + 1 other); Fri, 3 Oct 2014 11:57:26 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:47000 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754353AbaJCP5X (ORCPT ); Fri, 3 Oct 2014 11:57:23 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93FvM6h030314; Fri, 3 Oct 2014 10:57:22 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93FvMrJ023449; Fri, 3 Oct 2014 10:57:22 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Fri, 3 Oct 2014 10:57:22 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93FvLMx006522; Fri, 3 Oct 2014 10:57:21 -0500 From: Felipe Balbi To: Greg KH CC: , Felipe Balbi Subject: [PATCH v3.10-stable 3/3] usb: dwc3: core: fix ordering for PHY suspend Date: Fri, 3 Oct 2014 10:57:21 -0500 Message-ID: <1412351841-28107-3-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.47 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 8f26d2d..74e7e57 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -603,9 +603,6 @@ static int dwc3_remove(struct platform_device *pdev) { struct dwc3 *dwc = platform_get_drvdata(pdev); - usb_phy_set_suspend(dwc->usb2_phy, 1); - usb_phy_set_suspend(dwc->usb3_phy, 1); - dwc3_debugfs_exit(dwc); switch (dwc->mode) { @@ -626,6 +623,10 @@ static int dwc3_remove(struct platform_device *pdev) dwc3_event_buffers_cleanup(dwc); dwc3_free_event_buffers(dwc); + + usb_phy_set_suspend(dwc->usb2_phy, 1); + usb_phy_set_suspend(dwc->usb3_phy, 1); + dwc3_core_exit(dwc); pm_runtime_put(&pdev->dev);