From patchwork Tue Nov 4 06:17:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 40089 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB7AD21894 for ; Tue, 4 Nov 2014 06:17:19 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id l18sf3561578wgh.0 for ; Mon, 03 Nov 2014 22:17:19 -0800 (PST) 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 :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=xaAeos8+eyxzz6LvgI7I0u3hUTfGZBPJIVEod4xysog=; b=hsn8BgiP9UWWdfVCyT7ma+8Zw3yeh/+H58oUN/+vtpbxJxQ0ze+r7s9Wvf0kgpG02J tFC9RHvx4aNY6n7b1df6LWLuplhLg/y5LjC1gWjoQgZ2XLfo2Rj4CUD03s2LlW8YZGWM c/Zlbn+A7Zrp/PJ1fwYOKynp3CrfVUyvIl7wkA8eoeRPdICi/E5pYYlJd8/3gWCENzz+ IypE0Dw7LfanEJ+wSmaFmFIcepHYCf1KojFo6T75gXehPdfMBzjz/nqOQwTaaoJO/4y1 MItadePdlbjX4Ti5NbuE3Tu9dyucEpDocQZIyp/xY3D9Ue8cfGAmY5fRp62Ins4sINp1 fEHg== X-Gm-Message-State: ALoCoQncBAL6SdwuNOGxy/FvozYeNI7aPizI4c8jSXhoaEPnQJPt1Yv6Iab6FJIcX273sAiwZ+13 X-Received: by 10.180.90.234 with SMTP id bz10mr1296985wib.0.1415081839044; Mon, 03 Nov 2014 22:17:19 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.100 with SMTP id z4ls827751laz.60.gmail; Mon, 03 Nov 2014 22:17:18 -0800 (PST) X-Received: by 10.112.77.129 with SMTP id s1mr57804922lbw.36.1415081838851; Mon, 03 Nov 2014 22:17:18 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id uc5si35910074lbb.31.2014.11.03.22.17.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 22:17:18 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id s18so309719lam.0 for ; Mon, 03 Nov 2014 22:17:18 -0800 (PST) X-Received: by 10.112.218.101 with SMTP id pf5mr20415025lbc.46.1415081838763; Mon, 03 Nov 2014 22:17:18 -0800 (PST) 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.184.201 with SMTP id ew9csp71060lbc; Mon, 3 Nov 2014 22:17:17 -0800 (PST) X-Received: by 10.70.126.102 with SMTP id mx6mr20040406pdb.28.1415081837076; Mon, 03 Nov 2014 22:17:17 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si15656703pdd.59.2014.11.03.22.17.16 for ; Mon, 03 Nov 2014 22:17:17 -0800 (PST) Received-SPF: none (google.com: linux-kernel-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 S1751430AbaKDGRP (ORCPT + 25 others); Tue, 4 Nov 2014 01:17:15 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:50130 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914AbaKDGRK (ORCPT ); Tue, 4 Nov 2014 01:17:10 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id sA46H9Sq024165; Tue, 4 Nov 2014 00:17:09 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA46H9Gq020829; Tue, 4 Nov 2014 00:17:09 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Nov 2014 00:17:09 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA46H7Ld030864; Tue, 4 Nov 2014 00:17:08 -0600 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly Date: Tue, 4 Nov 2014 11:47:06 +0530 Message-ID: <1415081826-9297-1-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kishon@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.41 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: Oussama Ghorbel The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commit eb82a3d846fa (phy: omap-usb2: Balance pm_runtime_enable() on probe failure and remove). This because the call to pm_runtime_enable() function is moved after the call to devm_phy_create() function, which has side effect since later in the subsequent calls of devm_phy_create() there is a check with pm_runtime_enabled() to configure few things. Signed-off-by: Oussama Ghorbel Tested-by: Rabin Vincent Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/phy-omap-usb2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 8c84298..f091576 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c @@ -258,14 +258,16 @@ static int omap_usb2_probe(struct platform_device *pdev) otg->phy = &phy->phy; platform_set_drvdata(pdev, phy); + pm_runtime_enable(phy->dev); generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL); - if (IS_ERR(generic_phy)) + if (IS_ERR(generic_phy)) { + pm_runtime_disable(phy->dev); return PTR_ERR(generic_phy); + } phy_set_drvdata(generic_phy, phy); - pm_runtime_enable(phy->dev); phy_provider = devm_of_phy_provider_register(phy->dev, of_phy_simple_xlate); if (IS_ERR(phy_provider)) {