From patchwork Fri Oct 3 16:08:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38344 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 4E37720F2E for ; Fri, 3 Oct 2014 16:08:47 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf887862lab.7 for ; Fri, 03 Oct 2014 09:08:45 -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=OjbPY+5inm1xjN4ZCMgtH+Fcjuc2P05adVYhHw3A7jI=; b=JQZPulnIYdmekGzkHywJGFTMc8OCp1MOg7lqQrOUYFB4AlW4UyxzsPIOCBNiJh8oXG 1ZRgLJS+6I1pRjTprqPorLzHwklo7TOi7hKBXnobawm404NHcYMyG7WTBVSMpGsIbnok gSrK3jVykVyScHdiOfU38Fk2s8uybBSngP/Hwbo+yb+3Qya2AnFm/Jm6jf6TTXrTHhr/ iCoe2bn97NbVsmGs4enMN3Taw3+RGdd8DQODqVjzbCeb9co/t3fApmvgIA82StF7EjI7 TGOoHvXb3SV1dzRtKywS2N8uGh4KHDQsXUJlUmoFVtqJeKPpoAZL6tbxbHi64CdFr1TM v+kg== X-Gm-Message-State: ALoCoQnu1vpDdszfWTDJBg3KtdHqazzXqw0HzOAzwNbiXqOvGPkOy4GGkRH7DOKRoHVXlFozzj+x X-Received: by 10.180.74.14 with SMTP id p14mr1988120wiv.6.1412352525795; Fri, 03 Oct 2014 09:08:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.166 with SMTP id an6ls396784lac.71.gmail; Fri, 03 Oct 2014 09:08:45 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr6657244lbb.12.1412352525549; Fri, 03 Oct 2014 09:08:45 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by mx.google.com with ESMTPS id rs4si8473027lbb.12.2014.10.03.09.08.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 09:08:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so1236080lbv.40 for ; Fri, 03 Oct 2014 09:08:45 -0700 (PDT) X-Received: by 10.152.7.73 with SMTP id h9mr6827525laa.27.1412352525432; Fri, 03 Oct 2014 09:08:45 -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 of9csp256485lbb; Fri, 3 Oct 2014 09:08:44 -0700 (PDT) X-Received: by 10.66.100.231 with SMTP id fb7mr2775273pab.147.1412352523429; Fri, 03 Oct 2014 09:08:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gg1si7629914pac.50.2014.10.03.09.08.42 for ; Fri, 03 Oct 2014 09:08:43 -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 S1753233AbaJCQIm (ORCPT + 1 other); Fri, 3 Oct 2014 12:08:42 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:38505 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489AbaJCQIl (ORCPT ); Fri, 3 Oct 2014 12:08:41 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93G8fsj031066; Fri, 3 Oct 2014 11:08:41 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93G8eNM019460; Fri, 3 Oct 2014 11:08:40 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 3 Oct 2014 11:08:40 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93G8efC010550; Fri, 3 Oct 2014 11:08:40 -0500 From: Felipe Balbi To: Greg KH CC: , Felipe Balbi Subject: [PATCH v3.14-stable 2/3] usb: dwc3: core: fix ordering for PHY suspend Date: Fri, 3 Oct 2014 11:08:42 -0500 Message-ID: <1412352523-31144-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1412352523-31144-1-git-send-email-balbi@ti.com> References: <1412352523-31144-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.217.181 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 8c9c4cf..f074755 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -583,9 +583,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->dr_mode) { @@ -606,6 +603,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_sync(&pdev->dev);