All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Julius Werner <jwerner@chromium.org>
Cc: Felipe Balbi <balbi@ti.com>,
	Douglas Anderson <dianders@chromium.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	John Youn <johnyoun@synopsys.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Chris Zhong <zyw@rock-chips.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Andrew Bresticker <abrestic@chromium.org>,
	Alexandru Stan <amstan@chromium.org>, lyz <lyz@rock-chips.com>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled
Date: Wed, 8 Jul 2015 15:58:14 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1507081555570.2243-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <CAODwPW9-5abTDGwLyNRZ0hvn4+6T8ix55TqFhSy_xZx1VVuVNA@mail.gmail.com>

On Wed, 8 Jul 2015, Julius Werner wrote:

> > But I don't see how you will make it work when the root hub itself is
> > not enabled for wakeup and a non-hub device plugged into one of the
> > root hub's ports is enabled.
> >
> > It seems like you would need a usb_hcd_wakeup_not_needed(hcd, port)
> > subroutine.
> 
> We'd just put that in the Tegra platform driver, I guess. Iterate over
> all ports, call usb_wakeup_enabled_descendants() on the connected
> device (if any) and disable that port's PHY if it returns 0 or wasn't
> connected. Since usb_wakeup_enabled_descendants() also counts
> do_remote_wakeup from the device itself and is safe to call even on
> non-hubs, that should work for all cases.

All right, that seems reasonable.  But remember not to do this if 
wakeup is enabled on the root hub -- in that case all the PHYs must 
remain powered because unplugging and plugging are both wakeup events.

Alan Stern


WARNING: multiple messages have this Message-ID (diff)
From: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
To: Julius Werner <jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
	Douglas Anderson
	<dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	John Youn <johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	"linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	Andrew Bresticker
	<abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Alexandru Stan <amstan-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	lyz <lyz-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled
Date: Wed, 8 Jul 2015 15:58:14 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1507081555570.2243-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <CAODwPW9-5abTDGwLyNRZ0hvn4+6T8ix55TqFhSy_xZx1VVuVNA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, 8 Jul 2015, Julius Werner wrote:

> > But I don't see how you will make it work when the root hub itself is
> > not enabled for wakeup and a non-hub device plugged into one of the
> > root hub's ports is enabled.
> >
> > It seems like you would need a usb_hcd_wakeup_not_needed(hcd, port)
> > subroutine.
> 
> We'd just put that in the Tegra platform driver, I guess. Iterate over
> all ports, call usb_wakeup_enabled_descendants() on the connected
> device (if any) and disable that port's PHY if it returns 0 or wasn't
> connected. Since usb_wakeup_enabled_descendants() also counts
> do_remote_wakeup from the device itself and is safe to call even on
> non-hubs, that should work for all cases.

All right, that seems reasonable.  But remember not to do this if 
wakeup is enabled on the root hub -- in that case all the PHYs must 
remain powered because unplugging and plugging are both wakeup events.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-07-08 19:58 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 18:27 [REPOST PATCH 0/3] dwc2 patches to allow wakeup on Rockchip rk3288 Douglas Anderson
2015-07-06 18:27 ` Douglas Anderson
2015-07-06 18:27 ` [REPOST PATCH 1/3] USB: Export usb_wakeup_enabled_descendants() Douglas Anderson
2015-07-06 18:27   ` Douglas Anderson
2015-07-06 18:27 ` [REPOST PATCH 2/3] Documentation: dt-bindings: Add snps,need-phy-for-wake for dwc2 USB Douglas Anderson
2015-07-06 18:27   ` Douglas Anderson
2015-07-06 18:27 ` [REPOST PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled Douglas Anderson
2015-07-06 18:27   ` Douglas Anderson
2015-07-06 18:34   ` Felipe Balbi
2015-07-06 18:34     ` Felipe Balbi
2015-07-06 19:32     ` Doug Anderson
2015-07-06 19:32       ` Doug Anderson
2015-07-06 19:35       ` Felipe Balbi
2015-07-06 19:35         ` Felipe Balbi
2015-07-06 18:58   ` Alan Stern
2015-07-06 18:58     ` Alan Stern
2015-07-06 19:02     ` Felipe Balbi
2015-07-06 19:02       ` Felipe Balbi
2015-07-06 19:39       ` Doug Anderson
2015-07-06 19:39         ` Doug Anderson
2015-07-07 14:28       ` Alan Stern
2015-07-07 14:28         ` Alan Stern
2015-07-08  0:06         ` Julius Werner
2015-07-08  0:06           ` Julius Werner
2015-07-08 15:01           ` Alan Stern
2015-07-08 19:41             ` Julius Werner
2015-07-08 19:41               ` Julius Werner
2015-07-08 19:58               ` Alan Stern [this message]
2015-07-08 19:58                 ` Alan Stern
2015-10-21 16:23 ` [REPOST PATCH 0/3] dwc2 patches to allow wakeup on Rockchip rk3288 Doug Anderson
2015-10-21 16:23   ` Doug Anderson
2015-10-27  2:05   ` John Youn
2015-10-27  2:05     ` John Youn
2015-10-31  0:01     ` Doug Anderson
2015-10-31  0:01       ` Doug Anderson

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=Pine.LNX.4.44L0.1507081555570.2243-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=abrestic@chromium.org \
    --cc=amstan@chromium.org \
    --cc=balbi@ti.com \
    --cc=dianders@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=johnyoun@synopsys.com \
    --cc=jwerner@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lyz@rock-chips.com \
    --cc=zyw@rock-chips.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 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.