Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4218879rwr; Mon, 8 May 2023 04:56:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62crDpVL7vIuWrUgJpIoR6XiDzAi/D7QqpiC21hzbZvPSZFR7/VsFGEK+0uBWr60cIXjUf X-Received: by 2002:a05:6a20:840a:b0:f1:8f7:eeb6 with SMTP id c10-20020a056a20840a00b000f108f7eeb6mr13301230pzd.59.1683546979230; Mon, 08 May 2023 04:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683546979; cv=none; d=google.com; s=arc-20160816; b=YMTNi6U+16ww0wEUXBxop2r+lRc6vQAM54yHAYgIiK8T3ZEV4ZWdNfuRkRNiCGZN6P sohEqUy6f/R2aqw9En4pGJBo1qj1QhaDanc7ElxDRV+2YG1mKX/PVJuxTHWqTLTBhaMw iFl3QXNFMhTSSLUpxCb+8ZAKXMpLd3spkEidItBQRn4RWHhSHeml30Vcy9rsCdqucfwb 3yoaZ8+I1UZ5/5lTyWI9lsjfRO/bK7ELj73xomrt1QCYjqkMKm3q6XjNK9KjtqrBmJWF aOwXUjesFqk3u+e0RHIicr22nqBXS71kgE5Je3HAekzLE0Z1kBqX4IXM/EvHfUDPsvWd JjWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=F42iifSQ10kSEA0s53mXvCsjc7ERS34SKCkL65Gonu0=; b=ZjXOdobenlorVVJVRR1ehbIRZ2hEpGrepR2pHvRqU9SAhzw2Rr0FW6SPKpgMmFkD/8 RAU6rYQ5uOps4Recyc4x3pIIfqBfTJlU154IMUvTbvMMKVPBMt0T4TL9FHpYUAmZZj0s Ou4CzmME9qjWPII0MSk7y0YJ6pp3bO0+ulsMcVYc0gEfw9WASIn9fp2wgw7h7j5H+R3G RolUA9LZXkAbrGgnnf+4hJ1NUAf9NXGh8sxg2wNG9GH0tS5d7QPcdcFTEuSJPR2739Mt DRs8uKPzNcheVVBYBi+U0OuqfhAeKT8EYopg4W2uP3Xpb+Pn7qci4y4vu/mQ1TdqKmh0 Hlgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bu17-20020a632951000000b0052c885da611si8437534pgb.152.2023.05.08.04.56.07; Mon, 08 May 2023 04:56:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235470AbjEHLR1 (ORCPT + 99 others); Mon, 8 May 2023 07:17:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233955AbjEHLRZ (ORCPT ); Mon, 8 May 2023 07:17:25 -0400 Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D72D32356; Mon, 8 May 2023 04:17:21 -0700 (PDT) Received: from francesco-nb.int.toradex.com (31-10-206-125.static.upc.ch [31.10.206.125]) by mail11.truemail.it (Postfix) with ESMTPA id 4C53F202F9; Mon, 8 May 2023 13:17:18 +0200 (CEST) Date: Mon, 8 May 2023 13:17:11 +0200 From: Francesco Dolcini To: Jun Li Cc: Francesco Dolcini , Luca Ceresoli , "devicetree@vger.kernel.org" , "festevam@gmail.com" , "gregkh@linuxfoundation.org" , "kernel@pengutronix.de" , "linux-arm-kernel@lists.infradead.org" , dl-linux-imx , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "robh+dt@kernel.org" , "s.hauer@pengutronix.de" , "shawnguo@kernel.org" , Krzysztof Kozlowski , Francesco Dolcini , Xu Yang Subject: Re: [PATCH v2 2/3] usb: chipidea: imx: support disabling runtime-pm Message-ID: References: <23672d66d229d3be4cc854ddf1462c3507f1c2fc.camel@toradex.com> <20230504162312.1506763-1-luca.ceresoli@bootlin.com> <20230505120618.2f4cf22c@booty> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 06, 2023 at 09:02:39AM +0000, Jun Li wrote: > > -----Original Message----- > > From: Francesco Dolcini > > Sent: Friday, May 5, 2023 7:00 PM > > To: Luca Ceresoli ; Jun Li > > Cc: Francesco Dolcini ; devicetree@vger.kernel.org; > > festevam@gmail.com; gregkh@linuxfoundation.org; kernel@pengutronix.de; > > linux-arm-kernel@lists.infradead.org; dl-linux-imx ; > > linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org; > > peter.chen@nxp.com; robh+dt@kernel.org; s.hauer@pengutronix.de; > > shawnguo@kernel.org; Krzysztof Kozlowski ; > > Francesco Dolcini > > Subject: Re: [PATCH v2 2/3] usb: chipidea: imx: support disabling runtime-pm > > > > On Fri, May 05, 2023 at 12:06:18PM +0200, Luca Ceresoli wrote: > > > On Fri, 5 May 2023 09:49:16 +0000 > > > Jun Li wrote: > > > > Is your board design similar like Francesco's as below? > > > > > > Possibly, but I'm afraid I can't say: I am using the Toradex Colibri > > > i.MX6ULL SoM, whose schematics are not public. > > > > I can confirm that it's the same. > > Thanks Francesco for the confirmation, had a check with design team, > there is no status bit which can be used to judge the VDD_USB_CAP is > powered or not, so we have to add a board level dts property to tell > this usb phy driver to bypass MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS. > > Before send a formal patch, I want to confirm this should work for your > HW design, like below simple hack: Thanks Li Jun, I tested it with v6.3.1 kernel and it's all good. I would be happy to test the patch as soon as you send it. With that said I had another issue that I assume is unrelated. In addition to the USB Host port, we have an additional OTG one. This interface has the same circuit WRT to the VBUS, however in this case it's possible to read the VBUS using extcon, e.g. a standard GPIO input. With that setup, while doing a role switch, I had a couple of time this error: [ 187.310421] ci_hdrc ci_hdrc.0: USB bus 2 deregistered [ 192.351452] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in OTGSC that was recovered only doing an additional transition. More complete logs here: [ 184.997619] usb 2-1: USB disconnect, device number 9 [ 185.019620] ci_hdrc ci_hdrc.0: remove, state 1 [ 185.024271] usb usb2: USB disconnect, device number 1 [ 185.334975] ci_hdrc ci_hdrc.0: USB bus 2 deregistered [ 185.353857] ci_hdrc ci_hdrc.0: EHCI Host Controller [ 185.389670] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 2 [ 185.470170] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00 [ 185.476097] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01 [ 185.484527] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 185.491811] usb usb2: Product: EHCI Host Controller [ 185.496704] usb usb2: Manufacturer: Linux 6.1.22-6.2.0+git.3b29299e5f60 ehci_hcd [ 185.504148] usb usb2: SerialNumber: ci_hdrc.0 [ 185.531121] hub 2-0:1.0: USB hub found [ 185.542636] hub 2-0:1.0: 1 port detected [ 185.556586] mxs_phy 20c9000.usbphy: vbus is not valid [ 187.271684] ci_hdrc ci_hdrc.0: remove, state 4 [ 187.276281] usb usb2: USB disconnect, device number 1 [ 187.310421] ci_hdrc ci_hdrc.0: USB bus 2 deregistered [ 192.351452] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in OTGSC > diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c > index e1a2b2ea098b..ec5ee790455e 100644 > --- a/drivers/usb/phy/phy-mxs-usb.c > +++ b/drivers/usb/phy/phy-mxs-usb.c > @@ -178,7 +178,6 @@ static const struct mxs_phy_data imx6sx_phy_data = { > }; > > static const struct mxs_phy_data imx6ul_phy_data = { > - .flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS, > }; > > static const struct mxs_phy_data imx7ulp_phy_data = { Francesco