From patchwork Mon Feb 26 16:34:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 10242749 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69669602A0 for ; Mon, 26 Feb 2018 16:34:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 545D12A186 for ; Mon, 26 Feb 2018 16:34:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 453DA2A188; Mon, 26 Feb 2018 16:34:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C51142A186 for ; Mon, 26 Feb 2018 16:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AcJFaI5BZQvyCgP1wFs1p9R55De7+D03MLrQReAYSHA=; b=kg0NaxPlV97yxi K2BBTp74h6MoSLyFU3kVPrXzLlzJvuYRmWCNjlvMdhRg2Hwd8681Vs14Kp/naBh0xCMHOP3n1Z6IL xy3BBSUN5ix+lrZKK6Q1tvxqCTjk3FcPvzBaJUdZ7lrbb/S9DVP7qyGp857IbOtEOHieXmpbdRoQq 35DNexMfoP7+AhrSbrfqmkbvbwUoQML2blvAbvg2z4L8a1xcCBOadI+klmTxwIWpY3iRfMi6dC12e jSXFStR44TTi5j8une1cYZxSq/kjCWc1IqBRwkiAiAm496OHdtqdFe6bCWXZFFB/M6krAGGAUf2WK jpQrWjAyWL00y3mbJR9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eqLjb-0005XW-SU; Mon, 26 Feb 2018 16:34:39 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqLjX-0005WX-LQ for linux-rockchip@lists.infradead.org; Mon, 26 Feb 2018 16:34:37 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id D5B81265E95 Subject: Re: USB3 regression in RK3399 To: Vicente Bergas References: <14336855.DpIqxNeK64@phil> From: Enric Balletbo i Serra Message-ID: <9e64e878-07c8-912c-c597-7da7b3f96dd6@collabora.com> Date: Mon, 26 Feb 2018 17:34:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180226_083435_985716_EA51A6E7 X-CRM114-Status: GOOD ( 22.42 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: William wu , Heiko Stuebner , linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Vicente, On 25/02/18 11:03, Vicente Bergas wrote: > (cut) >>>>>> testing on the Sapphire board, which uses the RK3399 SoC, a regression >>>>>> has been found in v4.16-rc2 wrt v4.15.4 regarding the USB3 type-A port: >>>>>> In v4.15.4 it works in USB2-only mode. >>>>>> In v4.16-rc2 it does not work. > (cut) >>>>> Hmm, I'd guess the main issue would be a missing typec-phy driver >>>>> in your kernel (see drivers/phy/rockchip/phy-rockchip-typec.c > (cut) >>> I suspect that what Heiko says is right and typec-phy fails probing. Could you > (cut) > > Hello, > this is the patch to blame for the regression: > > From c301b327aea898af558b2387252a2f5fc0117dee Mon Sep 17 00:00:00 2001 > From: Enric Balletbo i Serra > Date: Fri, 15 Dec 2017 12:00:03 +0100 > Subject: [PATCH] arm64: dts: rockchip: add usb3-phy otg-port support for rk3399 > > Add the usb3 phyter for the USB3.0 OTG controller. > > Signed-off-by: Enric Balletbo i Serra > Signed-off-by: Heiko Stuebner > --- > arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi > b/arch/arm64/boot/dts/rockchip/rk3399.dtsi > index b4511503878b..7aa2144e0d47 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi > @@ -411,8 +411,8 @@ > reg = <0x0 0xfe800000 0x0 0x100000>; > interrupts = ; > dr_mode = "otg"; > - phys = <&u2phy0_otg>; > - phy-names = "usb2-phy"; > + phys = <&u2phy0_otg>, <&tcphy0_usb3>; > + phy-names = "usb2-phy", "usb3-phy"; > phy_type = "utmi_wide"; > snps,dis_enblslpm_quirk; > snps,dis-u2-freeclk-exists-quirk; > @@ -444,8 +444,8 @@ > reg = <0x0 0xfe900000 0x0 0x100000>; > interrupts = ; > dr_mode = "otg"; > - phys = <&u2phy1_otg>; > - phy-names = "usb2-phy"; > + phys = <&u2phy1_otg>, <&tcphy1_usb3>; > + phy-names = "usb2-phy", "usb3-phy"; > phy_type = "utmi_wide"; > snps,dis_enblslpm_quirk; > snps,dis-u2-freeclk-exists-quirk; > Can you try if the following patch solves the issue for you? pm_runtime_enable(dev); Best regards, Enric diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi index f7157c1d768b..617d362eb8af 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi @@ -569,6 +569,14 @@ status = "okay"; }; +&tcphy0 { + status = "okay"; +}; + +&tcphy1 { + status = "okay"; +}; + &u2phy0 { status = "okay"; diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c index 1c79785a5439..6af1ec262fcb 100644 --- a/drivers/phy/rockchip/phy-rockchip-typec.c +++ b/drivers/phy/rockchip/phy-rockchip-typec.c @@ -821,6 +821,9 @@ static int tcphy_get_mode(struct rockchip_typec_phy *tcphy) u8 mode; int ret; + if (!edev) + return MODE_DFP_USB; + ufp = extcon_get_state(edev, EXTCON_USB); dp = extcon_get_state(edev, EXTCON_DISP_DP); @@ -1159,9 +1162,9 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) tcphy->extcon = extcon_get_edev_by_phandle(dev, 0); if (IS_ERR(tcphy->extcon)) { - if (PTR_ERR(tcphy->extcon) != -EPROBE_DEFER) - dev_err(dev, "Invalid or missing extcon\n"); - return PTR_ERR(tcphy->extcon); + if (PTR_ERR(tcphy->extcon) == -EPROBE_DEFER) + return PTR_ERR(tcphy->extcon); + tcphy->extcon = NULL; }