From patchwork Mon Oct 13 13:49:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38652 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 875922039B for ; Mon, 13 Oct 2014 13:51:20 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf4176437lab.10 for ; Mon, 13 Oct 2014 06:51:19 -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=3YSFOYrljQmgjb2pbOwvQDVreM80KjNptDDaqpqVwuo=; b=gELjUYK6rLXNDxvKX+j5AL6PEk4DfkmZy0ig6Q0YgUZWVRrx2E63nEUJETgX31XGzj +jJoYmbU7TmC3eQv1wWaeFmBz6PIKJB0Sz1PMtPRky/CkTsHsTgpt/MkllxU+QJR+RgJ jAY3spRiImcRC4cZ0Icf0pzOmS7ign94841mGCClylePACPniDDbqd6JxQQIyfPPheHp E8YbwQVBOemCxQmVW4rjDjwNkWz6GYZIYCM5BHVRZ3joOkAZXIaignQivF4LzkBXbHWC QxAzPmjud+ue4cdcMLZydFGJ4Qnu3VRESqVSM3BJwDg4H147XUlyfqt/1bBDCae3ZO+O vODA== X-Gm-Message-State: ALoCoQn3gC4nMru/zT20QV8Nx14GtWFkM1FS1mRkk3nu2oVfoBN7i4z843ynTSDF5saJKITAZmYR X-Received: by 10.152.6.9 with SMTP id w9mr109860law.7.1413208279448; Mon, 13 Oct 2014 06:51:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.40 with SMTP id p8ls411974lah.106.gmail; Mon, 13 Oct 2014 06:51:19 -0700 (PDT) X-Received: by 10.112.204.69 with SMTP id kw5mr3298230lbc.90.1413208279342; Mon, 13 Oct 2014 06:51:19 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id t10si22292689lat.82.2014.10.13.06.51.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 06:51:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id q1so6689631lam.4 for ; Mon, 13 Oct 2014 06:51:19 -0700 (PDT) X-Received: by 10.152.7.145 with SMTP id j17mr23886545laa.67.1413208279274; Mon, 13 Oct 2014 06:51:19 -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 c5csp217662lbz; Mon, 13 Oct 2014 06:51:18 -0700 (PDT) X-Received: by 10.70.119.105 with SMTP id kt9mr23694399pdb.7.1413208247267; Mon, 13 Oct 2014 06:50:47 -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.46 for ; Mon, 13 Oct 2014 06:50:47 -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 S932107AbaJMNuo (ORCPT + 1 other); Mon, 13 Oct 2014 09:50:44 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:57500 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754910AbaJMNuP (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-00043h-VI; 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 ordering for PHY suspend Date: Mon, 13 Oct 2014 15:49:36 +0200 Message-Id: <1413208209-15396-23-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.215.45 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 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) Suggested-by: Alan Stern Signed-off-by: Felipe Balbi Signed-off-by: Jiri Slaby --- 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 3ff8bba6503b..6adf845fe3a0 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -581,9 +581,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) { @@ -604,6 +601,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);