devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: Francesco Dolcini <francesco@dolcini.it>, Jun Li <jun.li@nxp.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Francesco Dolcini <francesco.dolcini@toradex.com>
Subject: Re: [EXT] Re: [PATCH v2 2/3] usb: chipidea: imx: support disabling runtime-pm
Date: Wed, 19 Jul 2023 18:48:31 +0200	[thread overview]
Message-ID: <20230719184831.75ae8658@booty> (raw)
In-Reply-To: <DB7PR04MB4505560E7DCBC2523FD7A0FE8C39A@DB7PR04MB4505.eurprd04.prod.outlook.com>

Hello Xu,

thanks for the follow up.

On Wed, 19 Jul 2023 11:23:26 +0000
Xu Yang <xu.yang_2@nxp.com> wrote:

> Hi Luca,
> 
> > -----Original Message-----
> > 
> > Hello Xu,
> > 
> > On Tue, 18 Jul 2023 08:31:48 +0000
> > Xu Yang <xu.yang_2@nxp.com> wrote:
> >   
> > > > -----Original Message-----
> > > >
> > > > Ciao Francesco,
> > > >
> > > > On Thu, 6 Jul 2023 12:23:43 +0200
> > > > Francesco Dolcini <francesco@dolcini.it> wrote:
> > > >  
> > > > > Hello Luca,
> > > > >
> > > > > On Tue, May 30, 2023 at 11:22:51AM +0000, Jun Li wrote:  
> > > > > > Yes, your understanding is correct, talked with Xu(in CC), he will take this
> > > > > > soon.  
> > > > >
> > > > > A series was posted
> > > > >
> > > > > I had no time to try or look at it yet.  
> > > >
> > > > Thanks for keeping me up to date on this topic, which is still totally
> > > > relevant to me.
> > > >
> > > > I looked at the series, but it does not seem to be addressing the
> > > > problem with USB host not detecting new devices when VBUS is not
> > > > directly connected, e.g. in the Colibri imx6ull SoM.
> > > >
> > > > Xu, do you confirm the series at the link is _not_ solving the problem
> > > > being discussed here?  
> > >
> > > Have you tried this patchset? The upstream driver couldn't get correct
> > > USB role from HW_USBPHY_CTRL register when the ID pin is float. This is
> > > what this patchset is trying to fix. With this patch, condition
> > > "(!vbus_is_on && !mxs_phy_is_otg_host(mxs_phy)" will always be false when
> > > controller acts as host role, then __mxs_phy_disconnect_line(phy, true)
> > > will never be called. So I think it doesn't matter whether VBUS is connected
> > > or not when act as host mode. If you still have issue after apply this patchset,
> > > please let me know.  
> > 
> > I tested this patchset on top of v6.5-rc2 and I confirm USB detection
> > is still broken on the Colibri iMX6ULL. With or without the patches
> > the behavior is the same: USB devices are detected only during boot,
> > and anything connected after boot are never detected.  
> 
> Thanks for your feedback. As you said this issue will disappear with below change, right?
> 
> 	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 = {

Exactly.

> So I guess something in __mxs_phy_disconnect_line(mxs_phy, true) is causing this behavior.
> Could you please help to find which line to comment to make this issue disappear?

I did some tests and detection works by doing _any_ of the following
two changes (or both of them).

Change 1:

--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -359,10 +359,6 @@ static void __mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool disconnect)
        void __iomem *base = mxs_phy->phy.io_priv;
        u32 reg;
 
-       if (disconnect)
-               writel_relaxed(BM_USBPHY_DEBUG_CLKGATE,
-                       base + HW_USBPHY_DEBUG_CLR);
-
        if (mxs_phy->port_id == 0) {
                reg = disconnect ? ANADIG_USB1_LOOPBACK_SET
                        : ANADIG_USB1_LOOPBACK_CLR;

Change 2:

--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -372,9 +372,6 @@ static void __mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool disconnect)
        } else if (mxs_phy->port_id == 1) {
                reg = disconnect ? ANADIG_USB2_LOOPBACK_SET
                        : ANADIG_USB2_LOOPBACK_CLR;
-               regmap_write(mxs_phy->regmap_anatop, reg,
-                       BM_ANADIG_USB2_LOOPBACK_UTMI_DIG_TST1 |
-                       BM_ANADIG_USB2_LOOPBACK_TSTI_TX_EN);
        }
 
        if (!disconnect)

I hope this clarifies something to you.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2023-07-19 16:48 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 15:18 [PATCH v2 1/3] dt-bindings: usb: ci-hdrc-usb2: add property disable-runtime-pm Philippe Schenker
2020-07-14 15:18 ` [PATCH v2 2/3] usb: chipidea: imx: support disabling runtime-pm Philippe Schenker
2020-07-15  0:51   ` Peter Chen
2020-07-15 10:23     ` Philippe Schenker
2020-07-20  3:44       ` Peter Chen
2020-07-20  7:51         ` Philippe Schenker
2020-07-20  8:06           ` Peter Chen
2020-07-20 10:10             ` Philippe Schenker
2023-05-04 16:23               ` Luca Ceresoli
2023-05-04 16:50                 ` Francesco Dolcini
2023-05-05  9:23                   ` Luca Ceresoli
2023-05-05 10:58                     ` Francesco Dolcini
2023-05-05  9:49                   ` Jun Li
2023-05-05 10:06                     ` Luca Ceresoli
2023-05-05 11:00                       ` Francesco Dolcini
2023-05-06  9:02                         ` Jun Li
2023-05-08 11:17                           ` Francesco Dolcini
2023-05-08 11:53                             ` Jun Li
2023-05-08 14:35                               ` Francesco Dolcini
2023-05-08 13:17                             ` Luca Ceresoli
2023-05-29 10:18                               ` Luca Ceresoli
2023-05-30 11:22                                 ` Jun Li
2023-07-06 10:23                                   ` Francesco Dolcini
2023-07-17 16:45                                     ` Luca Ceresoli
2023-07-18  8:14                                       ` Francesco Dolcini
2023-07-18  8:31                                       ` [EXT] " Xu Yang
2023-07-18 12:25                                         ` Luca Ceresoli
2023-07-19 11:23                                           ` Xu Yang
2023-07-19 16:48                                             ` Luca Ceresoli [this message]
2023-07-20 10:13                                               ` Xu Yang
2023-07-20 12:49                                                 ` Luca Ceresoli
2023-07-21  2:06                                                   ` Xu Yang
     [not found]                                                     ` <20230721232750.0aea6e0f@booty>
     [not found]                                                       ` <DB7PR04MB450517AD9F25F47320835A5B8C03A@DB7PR04MB4505.eurprd04.prod.outlook.com>
2023-09-29 13:37                                                         ` Luca Ceresoli
2023-10-10 10:52                                                           ` Xu Yang
2020-07-14 15:18 ` [PATCH v2 3/3] ARM: dts: colibri-imx6ull: disable runtime pm Philippe Schenker
2020-07-16 19:24 ` [PATCH v2 1/3] dt-bindings: usb: ci-hdrc-usb2: add property disable-runtime-pm Rob Herring
2020-07-17  2:31   ` Peter Chen
2020-07-17 14:14     ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230719184831.75ae8658@booty \
    --to=luca.ceresoli@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.li@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=xu.yang_2@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).