[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1508241030430.1628-100000@iolanthe.rowland.org>
Date: Mon, 24 Aug 2015 10:35:48 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Ramneek Mehresh <ramneek.mehresh@...escale.com>
cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"balbi@...com" <balbi@...com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
Li Leo <LeoLi@...escale.com>
Subject: RE: [PATCH 3/8][v3]usb:fsl:otg: Add support to add/remove usb host
driver
On Mon, 24 Aug 2015, Ramneek Mehresh wrote:
> > On Thu, 20 Aug 2015, Ramneek Mehresh wrote:
> >
> > > > > --- a/drivers/usb/host/ehci-fsl.h
> > > > > +++ b/drivers/usb/host/ehci-fsl.h
> > > > > @@ -63,4 +63,22 @@
> > > > > #define UTMI_PHY_EN (1<<9)
> > > > > #define ULPI_PHY_CLK_SEL (1<<10)
> > > > > #define PHY_CLK_VALID (1<<17)
> > > > > +
> > > > > +struct ehci_fsl {
> > > > > +#ifdef CONFIG_PM
> > > > > + /* Saved USB PHY settings, need to restore after deep sleep. */
> > > > > + u32 usb_ctrl;
> > > > > +#endif
> > > >
> > > > Do you need this #ifdef?
> > > >
> > > Yes, this is required for deep-sleep support...we need to save/restore
> > controller
> > > registers during deep-sleep when usb controller power is shut-off. Don't
> > need this
> > > during normal usb operation...saving/restoring usb controller registers in
> > non deep-sleep
> > > scenario will add unnecessary delays
> >
> > What I meant was, can you keep the "u32 usb_ctrl;" line but get rid of
> > the "#ifdef CONFIG_PM" and "#endif" lines?
> >
> > Alan Stern
> I do understand that.
It doesn't sound like you do.
> However, USB suspend/resume functionality work in context of
> PM. Only in this context, we need to save/restore usb controller register
> for deep-sleep functionality. If you see usage of this in ehci-fsl.c file, it's used in
> ehci_fsl_drv_suspend() under CONFIG_PM to save USB CNTL register.
Yes, I know.
> If I remove CONFIG_PM from struct ehci_fsl{}, I'll need to change the entire driver
> also to make suspend and resume functionalities compile by default.
Why? Suppose you remove the "#ifdef CONFIG_PM" and "#endif" lines but
leave everything else the same. Won't the driver still work?
If CONFIG_PM is enabled then everything will be exactly the same as it
is now. If CONFIG_PM isn't enabled then you will have an extra
usb_ctrl field in the ehci_fsl structure. It will never get used for
anything but the driver should still work. Right?
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists