From patchwork Thu Aug 8 09:41:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 170790 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp8322085ile; Thu, 8 Aug 2019 02:41:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgrK6VBnDkdQofmVUYIQ818XZmFfhndIgZiFB2TEbTfg29jKLxC/twqunF0hzM/rYGuTPk X-Received: by 2002:a17:902:4b:: with SMTP id 69mr12766980pla.89.1565257310559; Thu, 08 Aug 2019 02:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565257310; cv=none; d=google.com; s=arc-20160816; b=rH4e1cAQtD+2h+TSlHrTHv7h1LHZitxPGsOdBiy3I5naH5AcnrIozGtgKYHUg42pnP ga16aBkwB3wfUDdR3u2YuRuPWn1ajGJHZZ5m9ZZhgp6Ar8TI7AnIQzkT1ZEdkyYI8SJI vch7kosP3W01+diY39udVicyE/PQ52Bsa9GF+XNehfbiD1P40EC0d0SMnR6C97HgOIei LoYgPAXvLtLsTFZKloBLdbupKxgv0EoPc8tIjANn3j9AGoNOqptIPe6rLmg0YYfZXlli F+tHUPyVheRtBQ1uXy0s9eE5xWV52Y/CyjPuiYTUprlQR4IPYEeGAyosKC2H3LKsCiFS 05aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=8i0ZsJoTCw9igACp/Y80+zUSsANQc6ilNqp2fm8mj+w=; b=CnhzStBsy48STAmHe8MPQ8gTBV3enMLk8+W6ByOvAaz6cyCfQIE6FlopovKs/tNORZ LgDHkkC36SusD9/Bt3/Pcuan0eZkPuIhN1VlaGFjIk8GADy9uWurvTogWTr4iiiE8QtC ep22IKDwC9330UHR7/n7BeXJdCRzsPzTqG6jA246BlRGLog5UCCGYmd7xAQVUvZHv106 PDo4lcJA0IlJGMD97fbWsiiMXiVuuoPRr0IIhztYR+lKIvhxzjflASEMHCpKG5Hz7CRZ UT/z9MxgvUV4nWH7WkHX18OEXI0bTQRETtpM/N17kjcX5l95CFVIXsNGcmVlbGf0AKQA C0DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=REMvWkfu; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y34si4720749plb.423.2019.08.08.02.41.50; Thu, 08 Aug 2019 02:41:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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=@samsung.com header.s=mail20170921 header.b=REMvWkfu; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732384AbfHHJlt (ORCPT + 3 others); Thu, 8 Aug 2019 05:41:49 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54176 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732243AbfHHJlt (ORCPT ); Thu, 8 Aug 2019 05:41:49 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190808094147euoutp0261ddd369656c72658e6df71ed0f1b1a1~46Tp35LYO1137811378euoutp02e for ; Thu, 8 Aug 2019 09:41:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190808094147euoutp0261ddd369656c72658e6df71ed0f1b1a1~46Tp35LYO1137811378euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1565257307; bh=8i0ZsJoTCw9igACp/Y80+zUSsANQc6ilNqp2fm8mj+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=REMvWkfujrNbrugXb355ht/X0j80unvJhgP6bTdCcwjUmWVdJMDI/ra/5klSgx+s5 ZPgvUs1PE5EDezz+9TisUXJa3TOnaAcpvUVKYKq91gYbuI2iiULlkhv/QboGH+Hq32 ZBF3h/OzA36L5+dPrwFVC5mWaClLkybEtLgwZYk4= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190808094147eucas1p1e45c1f2bdb73d61d6a0f318248689611~46TpNAm2k1424414244eucas1p1X; Thu, 8 Aug 2019 09:41:47 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 88.84.04374.A5EEB4D5; Thu, 8 Aug 2019 10:41:46 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190808094146eucas1p2a5a88ce5e7a87d47c4bcececab4df9a5~46TodoXf20339303393eucas1p20; Thu, 8 Aug 2019 09:41:46 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190808094146eusmtrp1548af4d6fddd50dd790cc64abf22148b~46ToO-MCt0652806528eusmtrp1b; Thu, 8 Aug 2019 09:41:46 +0000 (GMT) X-AuditID: cbfec7f5-4f7ff70000001116-b9-5d4bee5aad1b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 58.E5.04166.95EEB4D5; Thu, 8 Aug 2019 10:41:45 +0100 (BST) Received: from AMDC2765.DIGITAL.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190808094145eusmtip14ac841d81885e0e191b4896c39a79d32~46TnqfF-T2468724687eusmtip1Q; Thu, 8 Aug 2019 09:41:45 +0000 (GMT) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Martin Blumenstingl , Marek Szyprowski , Mathias Nyman , Felipe Balbi , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Jochen Sprickerhof , Anand Moon Subject: [PATCH v2 1/2 RESEND] usb: core: phy: add support for PHY calibration Date: Thu, 8 Aug 2019 11:41:27 +0200 Message-Id: <20190808094128.27213-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190808094128.27213-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSfyxUcQD39d699+7m2utovlOx3fqxtPwotbeRnWX1zNqsVn8wceWFOOwe J1lNlHFJwmR+5fwI1+GcX0VJmAuLuP6ohmUobChkmR/L89B/n5/fz3fffQlEUiawIUIjohll hDxcionQpu6V/hO+c97+TqZqF6out1ZAdSdP4FRSaS1Gla+PAmpgQI9TppYCjModaDOnSl48 RKiaum84Vd01glPdJT0olWTIFsgs6Nd5Izg9mZGF06Vvps1pgzYVo98V6nA6vUELaH3DBkov Gmx9CF+RWxATHqpilI7ugaIQ03wCFlVqfTtJp0ESwLilGggJSLrArymzqBqICAlZCaCuXY/z ZAnA38ud22QRwOHVAnSnUjSkQ3ijAsDlmSJkt5LXUgW4FEY6Q/WsGuOwFSmDZeXDGBdCyFYE vl2Z2zIsSR+Yv7yOcxglD8PSRzNbupg8C6fSCwE/Zwdf6tsRDgtJdziVUAy4gyCpxWHNeI05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5ccXleakFh9iNAU6aiKzlGhyPjBG80riDU0NzS0sDc2NzY3NLJTEeTsEDsYI CaQnlqRmp6YWpBbB9DFxcEo1ME59GjphlexLYd6G1lUcXnp7bvU4b9HW9DD7/UzzAdfiJRO4 GfdMadjT0y8qe+pidkk/f8G14x91C7oUQ/ddPnJ9bZABa+CUgmhPZYHEA4Xm+1xsFvw70b+7 L753UqWswdKaaW5rt0dOWeV6cYKFTjfHHeXpqcXT0kU9/pZddP6y/Xio1vWnS5RYijMSDbWY i4oTATajDFCZAgAA X-CMS-MailID: 20190808094146eucas1p2a5a88ce5e7a87d47c4bcececab4df9a5 X-Msg-Generator: CA X-RootMTR: 20190808094146eucas1p2a5a88ce5e7a87d47c4bcececab4df9a5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190808094146eucas1p2a5a88ce5e7a87d47c4bcececab4df9a5 References: <20190808094128.27213-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Some PHYs (for example Exynos5 USB3.0 DRD PHY) require calibration to be done after every USB HCD reset. Generic PHY framework has been already extended with phy_calibrate() function in commit 36914111e682 ("drivers: phy: add calibrate method"). This patch adds support for it to generic PHY handling code in USB HCD core. Signed-off-by: Marek Szyprowski Tested-by: Anand Moon Tested-by: Jochen Sprickerhof --- drivers/usb/core/hcd.c | 7 +++++++ drivers/usb/core/phy.c | 21 +++++++++++++++++++++ drivers/usb/core/phy.h | 1 + 3 files changed, 29 insertions(+) -- 2.17.1 diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 88533938ce19..b89936c1df23 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -2291,6 +2291,9 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg) hcd->state = HC_STATE_RESUMING; status = hcd->driver->bus_resume(hcd); clear_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags); + if (status == 0) + status = usb_phy_roothub_calibrate(hcd->phy_roothub); + if (status == 0) { struct usb_device *udev; int port1; @@ -2864,6 +2867,10 @@ int usb_add_hcd(struct usb_hcd *hcd, } hcd->rh_pollable = 1; + retval = usb_phy_roothub_calibrate(hcd->phy_roothub); + if (retval) + goto err_hcd_driver_setup; + /* NOTE: root hub and controller capabilities may not be the same */ if (device_can_wakeup(hcd->self.controller) && device_can_wakeup(&hcd->self.root_hub->dev)) diff --git a/drivers/usb/core/phy.c b/drivers/usb/core/phy.c index 7580493b867a..fb1588e7c282 100644 --- a/drivers/usb/core/phy.c +++ b/drivers/usb/core/phy.c @@ -151,6 +151,27 @@ int usb_phy_roothub_set_mode(struct usb_phy_roothub *phy_roothub, } EXPORT_SYMBOL_GPL(usb_phy_roothub_set_mode); +int usb_phy_roothub_calibrate(struct usb_phy_roothub *phy_roothub) +{ + struct usb_phy_roothub *roothub_entry; + struct list_head *head; + int err; + + if (!phy_roothub) + return 0; + + head = &phy_roothub->list; + + list_for_each_entry(roothub_entry, head, list) { + err = phy_calibrate(roothub_entry->phy); + if (err) + return err; + } + + return 0; +} +EXPORT_SYMBOL_GPL(usb_phy_roothub_calibrate); + int usb_phy_roothub_power_on(struct usb_phy_roothub *phy_roothub) { struct usb_phy_roothub *roothub_entry; diff --git a/drivers/usb/core/phy.h b/drivers/usb/core/phy.h index dad564e2d2d4..20a267cd986b 100644 --- a/drivers/usb/core/phy.h +++ b/drivers/usb/core/phy.h @@ -18,6 +18,7 @@ int usb_phy_roothub_exit(struct usb_phy_roothub *phy_roothub); int usb_phy_roothub_set_mode(struct usb_phy_roothub *phy_roothub, enum phy_mode mode); +int usb_phy_roothub_calibrate(struct usb_phy_roothub *phy_roothub); int usb_phy_roothub_power_on(struct usb_phy_roothub *phy_roothub); void usb_phy_roothub_power_off(struct usb_phy_roothub *phy_roothub); From patchwork Thu Aug 8 09:41:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 170792 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp8322207ile; Thu, 8 Aug 2019 02:41:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZmLstJbhnuWphD57icPYP1c9GVc0X1KD6RQNlEWVnDMpf2yjfgYO6Ba0s/DDho35hVm35 X-Received: by 2002:a17:90a:2562:: with SMTP id j89mr3095837pje.123.1565257317239; Thu, 08 Aug 2019 02:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565257317; cv=none; d=google.com; s=arc-20160816; b=Y7VFMzzr89md72oCKG7287heMGNIouN/wRfo/P9RmfyKlqiThKJg7VTSv/s1DDvqN/ 1epkxheeUVB6wvwiZ7snakK2Bw6W1YpfWNF9ctX2YuD4ONJWpqlMw3n94d5hVbLd39uy e9AmXFjKJwxjyyC/SZQgrHJ8XfzYWL1wyFH8rg7hsgQ5krhBlE/IBb2rW2eXaRATkpVB mCOfmNNt+PWySaaXsKAZVb/NSfBZ+o5v+sGaxnXLYeHm6FTs7G7SdoCNUqROnRxB3YDa G/vWfVyE1/UHtEwMPg1y6k5WZKkzlOm0NHYvcxdHCgKo62bZEtH4hRljiX3y/W6EMXye N1BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=cz4Qd6MlizXRretLU95QGiGoiGOemuoYoRdu6ABD9jw=; b=ax/pGdxTeCsU5hsN0fdmxXz38/nuqOhre3pCanlFjlRM4KyLmqdEGCexeYDALXTeVF WLtGaLQw9UD3fAJ5HgK6s3Pm7LeQ47+qErEeFNtnFfyrFOS71WnyvJlnqqlD/r8WBEE/ MLRNgbtulkyQ8cgIZxi3Hz/WJMdCuMY9B6zLbUaKuUHvGKHdhoz0EQnpOdbq1TKUzJTh UJDbtYz41aWb9RVpY8nhGH8UhjTkR+tmglgo3MhNHUH06QTB923EudhuN2YO9EpQDIz1 RCfrY7FXacl084opLWUXjt6sG9/SjDUwGpqX3Q5HSFC3xfsxB6GulBuchPh+y/yv4FIA 8p1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KItGPt71; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23si1591256pjw.56.2019.08.08.02.41.57; Thu, 08 Aug 2019 02:41:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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=@samsung.com header.s=mail20170921 header.b=KItGPt71; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732249AbfHHJlv (ORCPT + 3 others); Thu, 8 Aug 2019 05:41:51 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46590 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732294AbfHHJlv (ORCPT ); Thu, 8 Aug 2019 05:41:51 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190808094148euoutp0103d8bfdff61674253b4b481898b4508c~46TqZu_-51632916329euoutp01D for ; Thu, 8 Aug 2019 09:41:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190808094148euoutp0103d8bfdff61674253b4b481898b4508c~46TqZu_-51632916329euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1565257308; bh=cz4Qd6MlizXRretLU95QGiGoiGOemuoYoRdu6ABD9jw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KItGPt71NBC6ltnkE3fto32lsThXSodw2duHmJfqj4nmQLbqka0XOfTgub6BdaDSh ICB95UjuEFer5hK+GABthehT4okCzEk8oCJOHofK2hkXfIt3Q9RLwhMpNyk1TU81w+ NIoimCfdfuDS/5Zyi7pa299yxI8/GExG5t896V+g= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190808094147eucas1p2389c9f807a695836c3c25b6629fe1524~46TpqTPUh3273032730eucas1p2f; Thu, 8 Aug 2019 09:41:47 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 89.84.04374.B5EEB4D5; Thu, 8 Aug 2019 10:41:47 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190808094146eucas1p27c673846a5a9be0c55f1f87c89af4adf~46To-nEeV3273032730eucas1p2c; Thu, 8 Aug 2019 09:41:46 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190808094146eusmtrp2ec2650f8d2256fd43dbab1e64b694e10~46ToweoCy2859328593eusmtrp2I; Thu, 8 Aug 2019 09:41:46 +0000 (GMT) X-AuditID: cbfec7f5-4f7ff70000001116-bb-5d4bee5bb977 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BC.E6.04117.A5EEB4D5; Thu, 8 Aug 2019 10:41:46 +0100 (BST) Received: from AMDC2765.DIGITAL.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190808094146eusmtip133b223338a0b9f9cfd92077cf8157957~46ToLCmDV2428224282eusmtip1Z; Thu, 8 Aug 2019 09:41:45 +0000 (GMT) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Martin Blumenstingl , Marek Szyprowski , Mathias Nyman , Felipe Balbi , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Jochen Sprickerhof , Anand Moon Subject: [PATCH v2 2/2 RESEND] usb: dwc3: remove generic PHY calibrate() calls Date: Thu, 8 Aug 2019 11:41:28 +0200 Message-Id: <20190808094128.27213-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190808094128.27213-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCKsWRmVeSWpSXmKPExsWy7djP87rR77xjDQ5OFrPYOGM9q8Wxtifs Fs2L17NZLP17j9Hi/PkN7BaXd81hs5hxfh+TxaJlrcwW6zbeYrdYe+Quu8WxRSdZLJo3TWF1 4PHYOesuu8fTCZPZPRbvecnksWlVJ5vH/rlr2D36tqxi9Niw5R+Lx+dNcgEcUVw2Kak5mWWp Rfp2CVwZk/7OZC5o466YdbaXtYFxGWcXIyeHhICJxJsZ81m7GLk4hARWMEq8PnqTGSQhJPCF UeLXmlKIxGdGiX131rLAdCz9u4oFomg5o8S6T6oQRUANqw9+YQdJsAkYSnS97WIDsUUEHCSW LL3DBlLELLCbWWLvz3dgCWGBAIn1MxrB1rEIqEo8eL4SbCqvgK3En0eb2SC2yUus3nAArIZT wE7iRcMCRpBBEgKr2CV2dG1kgihykXi8aD47hC0s8er4FihbRuL/zvlMEA3NjBIPz61lh3B6 GCUuN81ghKiyljh8/CIwCDiA7tOUWL9LHyLsKDHtzTp2kLCEAJ/EjbeCI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aG5sbmxmYWSuK8HQIHY4QE 0hNLUrNTUwtSi2D6mDg4pRoY97CmXNUWPvVn3tkodhaXsqD/2szGAtxvtzQfq66Y7z4nhOOz xNXVxVtnFjzUjbW7PFsn4ugH4xixAuPa+R88LFPSju+J6qgufuMTumdRf/DkbfKdux+82zGd 6cT7hBlT5tm97W18XqfIvzdz1oqVuZ5RTy/tTw79+Sn0tXvbreUl0jb7F5U9UWIpzkg01GIu Kk4EABIURCCZAgAA X-CMS-MailID: 20190808094146eucas1p27c673846a5a9be0c55f1f87c89af4adf X-Msg-Generator: CA X-RootMTR: 20190808094146eucas1p27c673846a5a9be0c55f1f87c89af4adf X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190808094146eucas1p27c673846a5a9be0c55f1f87c89af4adf References: <20190808094128.27213-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Calls to USB2 generic PHY calibrate() method has been moved to HCD core, which now successfully handles generic PHYs and their calibration after every HCD reset. This fixes all the timing issues related to PHY calibration done directly from DWC3 driver: incorrect operation after system suspend/resume or USB3.0 detection failure when XHCI-plat driver compiled as separate module. Signed-off-by: Marek Szyprowski Tested-by: Anand Moon Tested-by: Jochen Sprickerhof --- drivers/usb/dwc3/core.c | 2 -- 1 file changed, 2 deletions(-) -- 2.17.1 Acked-by: Felipe Balbi diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c9bb93a2c81e..7dd6d419254d 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -168,7 +168,6 @@ static void __dwc3_set_mode(struct work_struct *work) otg_set_vbus(dwc->usb2_phy->otg, true); phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_HOST); phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_HOST); - phy_calibrate(dwc->usb2_generic_phy); } break; case DWC3_GCTL_PRTCAP_DEVICE: @@ -1166,7 +1165,6 @@ static int dwc3_core_init_mode(struct dwc3 *dwc) dev_err(dev, "failed to initialize host\n"); return ret; } - phy_calibrate(dwc->usb2_generic_phy); break; case USB_DR_MODE_OTG: INIT_WORK(&dwc->drd_work, __dwc3_set_mode);