From: hzpeterchen@gmail.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v14 4/7] usb: core: add power sequence handling for USB devices
Date: Tue, 6 Jun 2017 09:32:17 +0800 [thread overview]
Message-ID: <20170606013217.GA26189@b29397-desktop> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1706051013300.1795-100000@iolanthe.rowland.org>
On Mon, Jun 05, 2017 at 10:16:34AM -0400, Alan Stern wrote:
> On Mon, 5 Jun 2017, Peter Chen wrote:
>
> > On Thu, May 18, 2017 at 08:49:00AM +0800, Peter Chen wrote:
> > > Some hard-wired USB devices need to do power sequence to let the
> > > device work normally, the typical power sequence like: enable USB
> > > PHY clock, toggle reset pin, etc. But current Linux USB driver
> > > lacks of such code to do it, it may cause some hard-wired USB devices
> > > works abnormal or can't be recognized by controller at all.
> > >
> > > In this patch, it calls power sequence library APIs to finish
> > > the power sequence events. It will do power on sequence at hub's
> > > probe for all devices under this hub (includes root hub).
> > > At hub_disconnect, it will do power off sequence which is at powered
> > > on list.
> > >
> >
> > Greg, Alan, would you please help on reviewing it? It seems Rafael
> > is waiting for USB MAINTAINERS's comments or ack. It resolves some
> > USB HUB issues for several persons.
> >
> > Peter
> >
> > > Signed-off-by: Peter Chen <peter.chen@nxp.com>
> > > Tested-by Joshua Clayton <stillcompiling@gmail.com>
> > > Tested-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
> > > Reviewed-by: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
>
> > > ---
> > > drivers/usb/Kconfig | 1 +
> > > drivers/usb/core/hub.c | 49 +++++++++++++++++++++++++++++++++++++++++++++----
> > > drivers/usb/core/hub.h | 1 +
> > > 3 files changed, 47 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> > > index 939a63b..b6f626e 100644
> > > --- a/drivers/usb/Kconfig
> > > +++ b/drivers/usb/Kconfig
> > > @@ -39,6 +39,7 @@ config USB
> > > tristate "Support for Host-side USB"
> > > depends on USB_ARCH_HAS_HCD
> > > select USB_COMMON
> > > + select POWER_SEQUENCE
> > > select NLS # for UTF-8 strings
> > > ---help---
> > > Universal Serial Bus (USB) is a specification for a serial bus
> > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > > index 9dca59e..7a67296 100644
> > > --- a/drivers/usb/core/hub.c
> > > +++ b/drivers/usb/core/hub.c
> > > @@ -28,6 +28,7 @@
> > > #include <linux/mutex.h>
> > > #include <linux/random.h>
> > > #include <linux/pm_qos.h>
> > > +#include <linux/power/pwrseq.h>
> > >
> > > #include <linux/uaccess.h>
> > > #include <asm/byteorder.h>
> > > @@ -1619,6 +1620,7 @@ static void hub_disconnect(struct usb_interface *intf)
> > > hub->error = 0;
> > > hub_quiesce(hub, HUB_DISCONNECT);
> > >
> > > + of_pwrseq_off_list(&hub->pwrseq_on_list);
>
> Things like this look a little peculiar -- you are passing an "on_list"
> to a function named "...off_list".
>
> How about naming the new field hub->pwrseq_list instead?
>
Thanks, Alan. I will change it at next revision.
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2017-06-06 1:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-18 0:48 [PATCH v14 0/7] power: add power sequence library Peter Chen
2017-05-18 0:48 ` [PATCH v14 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic " Peter Chen
2017-05-18 0:48 ` [PATCH v14 2/7] power: add " Peter Chen
2017-06-05 6:51 ` Peter Chen
2017-05-18 0:48 ` [PATCH v14 3/7] binding-doc: usb: usb-device: add optional properties for power sequence Peter Chen
2017-05-18 0:49 ` [PATCH v14 4/7] usb: core: add power sequence handling for USB devices Peter Chen
2017-06-05 6:55 ` Peter Chen
2017-06-05 14:16 ` Alan Stern
2017-06-06 1:32 ` Peter Chen [this message]
2017-05-18 0:49 ` [PATCH v14 5/7] ARM: dts: imx6qdl: Enable usb node children with <reg> Peter Chen
2017-05-18 0:49 ` [PATCH v14 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property Peter Chen
2017-05-18 0:49 ` [PATCH v14 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line 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=20170606013217.GA26189@b29397-desktop \
--to=hzpeterchen@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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 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).