All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Peter Chen <peter.chen@freescale.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Michael Grzeschik <m.grzeschik@pengutronix.de>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] usb: chipidea: host: Disable port power only if previously enabled
Date: Fri, 27 Dec 2019 01:45:03 +0000	[thread overview]
Message-ID: <20191227014459.GA5283@b29397-desktop> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1912261428310.6148-100000@netrider.rowland.org>

On 19-12-26 14:46:15, Alan Stern wrote:
> On Thu, 26 Dec 2019, Guenter Roeck wrote:
> 
> > On shutdown, ehci_power_off() is called unconditionally to power off
> > each port, even if it was never called to power on the port.
> > For chipidea, this results in a call to ehci_ci_portpower() with a request
> > to power off ports even if the port was never powered on.
> > This results in the following warning from the regulator code.
> 
> That's weird -- we should always power-on every port during hub 
> initialization.
> 
> It looks like there's a bug in hub.c:hub_activate(): The line under
> HUB_INIT which calls hub_power_on() should call
> usb_hub_set_port_power() instead.  In fact, the comment near the start
> of hub_power_on() is wrong.  It says "Enable power on each port", but
> in fact it only enables power for ports that had been powered-on
> previously (i.e., the port's bit in hub->power_bits was set).  
> Apparently this got messed up in commit ad493e5e5805 ("usb: add usb
> port auto power off mechanism").
> 
> Now, the chipidea driver may still need to be updated, because 
> ehci_turn_off_all_ports() will still be called during shutdown and it 
> will try to power-down all ports, even those which are already powered 
> down (for example, because the port is suspended).
> 

Hi Alan,

When the port is suspended, why it was turned off? If it was turned
off, how could respond wakeup event?

-- 

Thanks,
Peter Chen

  reply	other threads:[~2019-12-27  1:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 15:57 [PATCH] usb: chipidea: host: Disable port power only if previously enabled Guenter Roeck
2019-12-26 19:46 ` Alan Stern
2019-12-27  1:45   ` Peter Chen [this message]
2019-12-27 14:47     ` Alan Stern
2019-12-27 16:55   ` Guenter Roeck
2019-12-28 19:33     ` Alan Stern
2019-12-29 16:28       ` Guenter Roeck
2019-12-29 16:40         ` Alan Stern
2019-12-30  0:57           ` Guenter Roeck
2020-01-01 22:09           ` Guenter Roeck
2020-01-02  2:30             ` Alan Stern
2019-12-27  1:45 ` Peter Chen

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=20191227014459.GA5283@b29397-desktop \
    --to=peter.chen@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=m.grzeschik@pengutronix.de \
    --cc=peter.chen@freescale.com \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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.