From patchwork Mon Apr 1 13:54:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 2371051 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B8569DFB7B for ; Mon, 1 Apr 2013 14:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758257Ab3DAOAP (ORCPT ); Mon, 1 Apr 2013 10:00:15 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:43915 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758271Ab3DAN5s (ORCPT ); Mon, 1 Apr 2013 09:57:48 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKK008POXGBGS80@mailout2.samsung.com>; Mon, 01 Apr 2013 22:57:47 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 92.2C.12250.B5299515; Mon, 01 Apr 2013 22:57:47 +0900 (KST) X-AuditID: cbfee691-b7f5f6d000002fda-f6-5159925bec4b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6D.67.13494.B5299515; Mon, 01 Apr 2013 22:57:47 +0900 (KST) Received: from vivekkumarg-linuxpc.sisodomain.com ([107.108.214.169]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MKK00JXCXD41C70@mmp1.samsung.com>; Mon, 01 Apr 2013 22:57:47 +0900 (KST) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, balbi@ti.com, stern@rowland.harvard.edu, sarah.a.sharp@linux.intel.com, rob.herring@calxeda.com, kgene.kim@samsung.com, kishon@ti.com, dianders@chromium.org, t.figa@samsung.com, p.paneri@samsung.com Subject: [PATCH v3 03/11] usb: dwc3: Enable runtime pm only after PHYs are initialized Date: Mon, 01 Apr 2013 19:24:02 +0530 Message-id: <1364824448-14732-4-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1364824448-14732-1-git-send-email-gautam.vivek@samsung.com> References: <1364824448-14732-1-git-send-email-gautam.vivek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRmVeSWpSXmKPExsWyRsSkWjd6UmSgwfHHchYH79dbnF12kM2i efF6NoveBVfZLC487WGzuLxrDpvF7CX9LBYzzu9jsli0rJXZ4vyWTiaLwysOMFk0nzjFbDHh 9wU2i/UzXrM48Hks+HyF3WN2w0UWj3knAz32z10D5N39wejRt2UVo8fxG9uZPD5vkgvgiOKy SUnNySxLLdK3S+DK+LfmA0vBSe6Krr5O5gbGi5xdjJwcEgImEmtXH2CDsMUkLtxbD2RzcQgJ LGWUmLH+BStM0Yrtm1ghEosYJVa1PmWEcKYwSdz7f5cRpIpNQFei6e0uIJuDQ0QgTmLzBGGQ MLNAF5PE0qPiIGFhgQiJ/g25IGEWAVWJf7vbwObzCnhIbP8+GeoIBYk3t58xg9icAp4SH7Yu ZgKxhYBq2q+eALtBQuARu8TJA7vZIQYJSHybfIgFZL6EgKzEpgPMEHMkJQ6uuMEygVF4ASPD KkbR1ILkguKk9CJTveLE3OLSvHS95PzcTYzAKDr979nEHYz3D1gfYkwGGjeRWUo0OR8YhXkl 8YbGZkYWpiamxkbmlmakCSuJ86q3WAcKCaQnlqRmp6YWpBbFF5Xm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jlS/Gz01wvGSyWrvqVer9Hy38t2 wUR9A+/+GXvmW7blfa89OffV9XCbnvm9sTduqdcwsCmxFGckGmoxFxUnAgC1Mmz1FQMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Allow dwc3 to enable auto power management only after its PHYs are initialized so that any further PHY handling by dwc3's runtime power management callbacks is fine. Signed-off-by: Vivek Gautam --- drivers/usb/dwc3/core.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 3a6993c..e250828 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -491,15 +491,6 @@ static int dwc3_probe(struct platform_device *pdev) dwc->needs_fifo_resize = of_property_read_bool(node, "tx-fifo-resize"); - /* Setting device state as 'suspended' initially, - * to make sure we know device state prior to - * pm_runtime_enable - */ - pm_runtime_set_suspended(dev); - pm_runtime_enable(dev); - pm_runtime_get_sync(dev); - pm_runtime_forbid(dev); - dwc3_cache_hwparams(dwc); ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE); @@ -521,6 +512,15 @@ static int dwc3_probe(struct platform_device *pdev) goto err1; } + /* Setting device state as 'suspended' initially, + * to make sure we know device state prior to + * pm_runtime_enable + */ + pm_runtime_set_suspended(dev); + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + pm_runtime_forbid(dev); + if (IS_ENABLED(CONFIG_USB_DWC3_HOST)) mode = DWC3_MODE_HOST; else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET))