All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <hzpeterchen@gmail.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Peter Chen <peter.chen@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	USB list <linux-usb@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC 1/1] usb: chipidea: ci_hdrc_imx: disable runtime pm for HSIC interface
Date: Tue, 15 Mar 2022 09:23:23 +0800	[thread overview]
Message-ID: <CAL411-o8TPNv8vAfdPtzTaFkOGc7EmwNJv1Jxc-YUv1wc_vq0g@mail.gmail.com> (raw)
In-Reply-To: <20220302094239.3075014-1-alexander.stein@ew.tq-group.com>

On Wed, Mar 2, 2022 at 5:42 PM Alexander Stein
<alexander.stein@ew.tq-group.com> wrote:
>
> With the add of power-domain support in commit 02f8eb40ef7b ("ARM: dts:
> imx7s: Add power domain for imx7d HSIC") runtime suspend will disable
> the power-domain. This prevents IRQs to occur when a new device is attached
> on a downstream hub.
>
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> Our board TQMa7x + MBa7x (i.MX7 based) uses a HSIC link to mounted USB HUB on
> usbh device. Cold plugging an USB mass storage device is working fine. But
> once the last non-HUB device is disconnected the ci_hdrc device goes into
> runtime suspend.

Would you please show the difference between cold boot and runtime
suspend after disconnecting
the last USB device?

- Power domain on/off status for HUB device
- Runtime suspend status at /sys entry for HUB device
- "/sys/..power/wakeup" /sys entry  for HUB device

Peter

> This will eventually also disable the 'pgc_hsic_phy' power
> domain. Results is that no more updates from USB hub is handled, neither HUB
> on HSIC link or HUB on that's downstream link. USB tree looks like this:
>
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M
>     |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
>         |__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
>             |__ Port 1: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M
>         |__ Port 2: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M
>
> I noticed once the power domain is disabled, no IRQs appear if I attach a new
> mass storage, essentially preventing any runtime resume.
> I do not know if this is specific to i.MX7 only or if this is a general USB
> HSIC problem, so this diff might be too much.
>
> BTW: An udev rule with the same effect is:
> ACTION=="add", SUBSYSTEMS=="platform", DRIVER=="ci_hdrc",
> KERNELS=="30b30000.usb", TEST=="power/control", ATTR{power/control}="on"
>
> But I would like to get this fixed on driver level.
>
> Regards
> Alexander
>
>  drivers/usb/chipidea/ci_hdrc_imx.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index 097142ffb184..e5c22b70431c 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -344,6 +344,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
>         if ((of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC)
>                 && data->usbmisc_data) {
>                 pdata.flags |= CI_HDRC_IMX_IS_HSIC;
> +               /* Runtime suspend is not supported for HSIC interface */
> +               pdata.flags &= ~CI_HDRC_SUPPORTS_RUNTIME_PM;
>                 data->usbmisc_data->hsic = 1;
>                 data->pinctrl = devm_pinctrl_get(dev);
>                 if (PTR_ERR(data->pinctrl) == -ENODEV)
> --
> 2.25.1
>

WARNING: multiple messages have this Message-ID (diff)
From: Peter Chen <hzpeterchen@gmail.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Peter Chen <peter.chen@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	 Fabio Estevam <festevam@gmail.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	 NXP Linux Team <linux-imx@nxp.com>,
	USB list <linux-usb@vger.kernel.org>,
	 linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC 1/1] usb: chipidea: ci_hdrc_imx: disable runtime pm for HSIC interface
Date: Tue, 15 Mar 2022 09:23:23 +0800	[thread overview]
Message-ID: <CAL411-o8TPNv8vAfdPtzTaFkOGc7EmwNJv1Jxc-YUv1wc_vq0g@mail.gmail.com> (raw)
In-Reply-To: <20220302094239.3075014-1-alexander.stein@ew.tq-group.com>

On Wed, Mar 2, 2022 at 5:42 PM Alexander Stein
<alexander.stein@ew.tq-group.com> wrote:
>
> With the add of power-domain support in commit 02f8eb40ef7b ("ARM: dts:
> imx7s: Add power domain for imx7d HSIC") runtime suspend will disable
> the power-domain. This prevents IRQs to occur when a new device is attached
> on a downstream hub.
>
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> Our board TQMa7x + MBa7x (i.MX7 based) uses a HSIC link to mounted USB HUB on
> usbh device. Cold plugging an USB mass storage device is working fine. But
> once the last non-HUB device is disconnected the ci_hdrc device goes into
> runtime suspend.

Would you please show the difference between cold boot and runtime
suspend after disconnecting
the last USB device?

- Power domain on/off status for HUB device
- Runtime suspend status at /sys entry for HUB device
- "/sys/..power/wakeup" /sys entry  for HUB device

Peter

> This will eventually also disable the 'pgc_hsic_phy' power
> domain. Results is that no more updates from USB hub is handled, neither HUB
> on HSIC link or HUB on that's downstream link. USB tree looks like this:
>
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M
>     |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
>         |__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
>             |__ Port 1: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M
>         |__ Port 2: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M
>
> I noticed once the power domain is disabled, no IRQs appear if I attach a new
> mass storage, essentially preventing any runtime resume.
> I do not know if this is specific to i.MX7 only or if this is a general USB
> HSIC problem, so this diff might be too much.
>
> BTW: An udev rule with the same effect is:
> ACTION=="add", SUBSYSTEMS=="platform", DRIVER=="ci_hdrc",
> KERNELS=="30b30000.usb", TEST=="power/control", ATTR{power/control}="on"
>
> But I would like to get this fixed on driver level.
>
> Regards
> Alexander
>
>  drivers/usb/chipidea/ci_hdrc_imx.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index 097142ffb184..e5c22b70431c 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -344,6 +344,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
>         if ((of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC)
>                 && data->usbmisc_data) {
>                 pdata.flags |= CI_HDRC_IMX_IS_HSIC;
> +               /* Runtime suspend is not supported for HSIC interface */
> +               pdata.flags &= ~CI_HDRC_SUPPORTS_RUNTIME_PM;
>                 data->usbmisc_data->hsic = 1;
>                 data->pinctrl = devm_pinctrl_get(dev);
>                 if (PTR_ERR(data->pinctrl) == -ENODEV)
> --
> 2.25.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-03-15  1:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02  9:42 [RFC 1/1] usb: chipidea: ci_hdrc_imx: disable runtime pm for HSIC interface Alexander Stein
2022-03-02  9:42 ` Alexander Stein
2022-03-15  1:23 ` Peter Chen [this message]
2022-03-15  1:23   ` Peter Chen
2022-03-29  8:14   ` (EXT) " Alexander Stein
2022-03-29  8:14     ` Alexander Stein
2022-04-09  2:19     ` Peter Chen
2022-04-09  2:19       ` Peter Chen
2022-04-09  4:49       ` Jun Li
2022-04-09  4:49         ` Jun Li
2022-04-11 13:52         ` (EXT) " Alexander Stein
2022-04-11 13:52           ` Alexander Stein
2022-04-12 11:36           ` Jun Li
2022-04-12 11:36             ` Jun Li
2022-05-04  7:06             ` Alexander Stein
2022-05-04  7:06               ` Alexander Stein
2022-05-06  7:09               ` Jun Li
2022-05-06  7:09                 ` Jun Li
2022-05-06  7:38                 ` (EXT) " Alexander Stein
2022-05-06  7:38                   ` Alexander Stein
2022-05-09  8:16                   ` Jun Li
2022-05-09  8:16                     ` Jun Li
2022-05-09  9:27                     ` Frieder Schrempf
2022-05-09  9:27                       ` Frieder Schrempf
2022-05-09  9:53                       ` Jun Li
2022-05-09  9:53                         ` Jun Li
2022-05-09 10:53                     ` (EXT) " Alexander Stein
2022-05-09 10:53                       ` Alexander Stein

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=CAL411-o8TPNv8vAfdPtzTaFkOGc7EmwNJv1Jxc-YUv1wc_vq0g@mail.gmail.com \
    --to=hzpeterchen@gmail.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.