From patchwork Wed Sep 3 21:41:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 36664 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5457F202E4 for ; Wed, 3 Sep 2014 21:41:22 +0000 (UTC) Received: by mail-oi0-f70.google.com with SMTP id u20sf44449321oif.1 for ; Wed, 03 Sep 2014 14:41:21 -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=6GPf3nYLXXVLneisdd+pzKXuPyHNKEzYED9JBuJVeSA=; b=Lb6iGNVXlNebTsGLXN/8YpK6WLVMB4V8BwWaeWbU6YxOFurj3uGGWnQoUOmmKx4VZv sdH5Zqt4C+qgFbSG7c5ZNP+dNabBEZc0YDMm1gySaZGb5kl66UNHNB06iqHFHkqbXjl0 8rW7PKUh2M/jy7Z/TxhwUdzqGWAiSXyEu7Wvyk77IhiBy1F8TLQ/+nI838BJxnP6dipT uDUUva5U52Dqlmz89ztvwtVSdZysKjPxK2QeGtDxyILr553RPQPKn8317L3pTLiX8CnE 9lfKSBE2+VMPA9UokX1OAlc8HoVH3u46Bti9jjDfIyaH5alRfVnso3krbggWAFd76zqa yZmw== X-Gm-Message-State: ALoCoQksBZ/iT4RtjxKedbEQZgRZm1icK0J2AdVR6q4u2Q5TmIycKo1cVtgbCN2iH8vE2+kmBDz1 X-Received: by 10.182.45.197 with SMTP id p5mr185279obm.2.1409780481935; Wed, 03 Sep 2014 14:41:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.40 with SMTP id y37ls29775qgd.2.gmail; Wed, 03 Sep 2014 14:41:21 -0700 (PDT) X-Received: by 10.220.46.5 with SMTP id h5mr23046vcf.55.1409780481837; Wed, 03 Sep 2014 14:41:21 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id l1si4490659vca.33.2014.09.03.14.41.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 14:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so9503363vcb.20 for ; Wed, 03 Sep 2014 14:41:21 -0700 (PDT) X-Received: by 10.52.164.199 with SMTP id ys7mr113454vdb.42.1409780481742; Wed, 03 Sep 2014 14:41:21 -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.221.45.67 with SMTP id uj3csp742283vcb; Wed, 3 Sep 2014 14:41:21 -0700 (PDT) X-Received: by 10.66.138.46 with SMTP id qn14mr125913pab.77.1409780480772; Wed, 03 Sep 2014 14:41:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fo17si13360869pac.161.2014.09.03.14.41.19 for ; Wed, 03 Sep 2014 14:41:20 -0700 (PDT) Received-SPF: none (google.com: linux-usb-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 S932169AbaICVlQ (ORCPT + 2 others); Wed, 3 Sep 2014 17:41:16 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:48659 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755968AbaICVlO (ORCPT ); Wed, 3 Sep 2014 17:41:14 -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 s83LfCPi000689; Wed, 3 Sep 2014 16:41:12 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s83LfCdq026445; Wed, 3 Sep 2014 16:41:12 -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; Wed, 3 Sep 2014 16:41:11 -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 s83LfBJW026076; Wed, 3 Sep 2014 16:41:11 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Alan Stern , Felipe Balbi , Subject: [PATCH 2/2] usb: dwc3: core: fix ordering for PHY suspend Date: Wed, 3 Sep 2014 16:41:03 -0500 Message-ID: <1409780463-29635-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.1.563.g66f467c In-Reply-To: <1409780463-29635-1-git-send-email-balbi@ti.com> References: <1409780463-29635-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@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.220.175 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: , 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index a664d5b..9069984 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -799,15 +799,16 @@ static int dwc3_remove(struct platform_device *pdev) { struct dwc3 *dwc = platform_get_drvdata(pdev); + dwc3_debugfs_exit(dwc); + dwc3_core_exit_mode(dwc); + 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); phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy); - dwc3_debugfs_exit(dwc); - dwc3_core_exit_mode(dwc); - dwc3_event_buffers_cleanup(dwc); - dwc3_free_event_buffers(dwc); dwc3_core_exit(dwc); pm_runtime_put_sync(&pdev->dev);