From patchwork Wed Jan 10 13:11:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 124096 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5259361qgn; Wed, 10 Jan 2018 05:12:10 -0800 (PST) X-Google-Smtp-Source: ACJfBotGskluQyf9G02bgITNYuahqgxhjQK9B/OaJHmvxgejh1SpmCnaBluplOqoY3Xh1lGcDM85 X-Received: by 10.124.18.13 with SMTP id t13mr14018133ply.249.1515589930092; Wed, 10 Jan 2018 05:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515589930; cv=none; d=google.com; s=arc-20160816; b=jedGMFGEiUvklRqREGgC69OFlfKbiH4sm00SghRvCbUqjSv+z4bS6mzhCH2iH+Uv0t aF4g4VO6OTpCSHaJSQMr7sVgPO//A8WhOkkvy2SvCiuU/6pjrL/QheAnY+lOwghmL0j3 /09rNqj2ezsQ40i9B61Kxwq6lbpDJGzXXyzk3Zp9VjDQMwF+rJebIXWLmSXGl1jZJsUs PPItZ4qtae2JBdunHwRZfZoHuQ9bJg5fq94dyBY3Yi4e2a4wzJmrAN40GrMlrz27pXbW vgNLvMRR6ZQt9xSlXn75w6WamwHvzi/kkDDvXJSPTvHaBJxXoz25L5BbxInAgq3eW+sB TIhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=kW1U4XQWNF3yqdjQBjPEsFfskJumWseq+83f4HEueXU=; b=TETDm9CSrodzshza/capR7b5zhMlH7e3fldtbC4rZt3dkxzpvFQaB5/sGrfPRQ5zEm GMYLPQYvTb18IzprhDSOkXL7lN55U6XVF156O8vk3y4BB+alwShyDdf2021R8vVKUKjw DAaOU32nH4VyudYwC0Zmyya33PRV3ElSy6n9mmkjlnZrq9tzlecsGItU6gt1p+0kbJu4 hivIK9boc8llXQ7LThtY72fsVE6wgRDTs6awSn47FLObgBaEgT8s0iccjELw4rnqwBpE g7OKTXyVLMbd9Xl34oGIpFhT2RIi1gIvYXv13g7eyX1Y4aunRcm4lrWZBVLROpS8kEuo LxdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VzLie5zQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si5312125pgp.516.2018.01.10.05.12.09; Wed, 10 Jan 2018 05:12:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VzLie5zQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964984AbeAJNMI (ORCPT + 28 others); Wed, 10 Jan 2018 08:12:08 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:47276 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932630AbeAJNMF (ORCPT ); Wed, 10 Jan 2018 08:12:05 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w0ADC3VP006672; Wed, 10 Jan 2018 07:12:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1515589923; bh=l+jlneC8eQNh+3Np8bHwXc9v09hco3PkX+gaoWVzhfc=; h=From:To:CC:Subject:Date; b=VzLie5zQLuYou5zvHVyz26hoTeHXl4fjaimJBhtkfc8g7jDgYc7ULntbh30frooJg ZZwo+KGh0UWLUa4+0W7L5eVQAte8UCOZgcXpYB5o9X/NJNbKYGfwnUtrtKn/vfsS8w 7+HvSJ9NYqqmB0W/cS8ei1BRM8EUmt/KuOGwzTno= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0ADC3xD001222; Wed, 10 Jan 2018 07:12:03 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 10 Jan 2018 07:12:03 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 10 Jan 2018 07:12:03 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0ADC3ia006547; Wed, 10 Jan 2018 07:12:03 -0600 Received: from lta0400828d.ti.com (vboxa0400828d.emea.dhcp.ti.com [172.22.235.207]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0ADC0Tu012252; Wed, 10 Jan 2018 07:12:01 -0600 From: Roger Quadros To: CC: , , , , Roger Quadros , "linux-stable # = v4 . 13" Subject: [PATCH] usb: dwc3: core: Don't try to get PHYs during suspend/resume Date: Wed, 10 Jan 2018 15:11:54 +0200 Message-ID: <1515589914-23460-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The USB PHYs should be requested only once during the life cycle of this driver. As dwc3_core_init() is called during system suspend/resume it will result in multiple calls to dwc3_core_get_phy() which is wrong. To prevent that let's move dwc3_core_get_phy() call outside dwc3_core_init(). Fixes: 541768b08a4 ("usb: dwc3: core: Call dwc3_core_get_phy() before initializing phys") Cc: linux-stable # >= v4.13 Signed-off-by: Roger Quadros --- drivers/usb/dwc3/core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- cheers, -roger Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 0783250..1274251 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -722,8 +722,6 @@ static void dwc3_core_setup_global_control(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_GCTL, reg); } -static int dwc3_core_get_phy(struct dwc3 *dwc); - /** * dwc3_core_init - Low-level initialization of DWC3 Core * @dwc: Pointer to our controller context structure @@ -754,10 +752,6 @@ static int dwc3_core_init(struct dwc3 *dwc) dwc->maximum_speed = USB_SPEED_HIGH; } - ret = dwc3_core_get_phy(dwc); - if (ret) - goto err0; - ret = dwc3_core_soft_reset(dwc); if (ret) goto err0; @@ -1177,6 +1171,10 @@ static int dwc3_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dwc); dwc3_cache_hwparams(dwc); + ret = dwc3_core_get_phy(dwc); + if (ret) + goto err0; + spin_lock_init(&dwc->lock); pm_runtime_set_active(dev);