linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: musb: Call musb_platform_exit from musb_stop
@ 2018-07-19 10:10 Jagan Teki
  2018-07-19 15:37 ` Bin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Jagan Teki @ 2018-07-19 10:10 UTC (permalink / raw)
  To: Bin Liu, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Jagan Teki

musb stop is musb core call during unregister or shutting down
gadget or host musb. For graceful exit add musb_platform_exit
on musb_stop so-that it can exit the musb platform driver as well.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 drivers/usb/musb/musb_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index b7d56272f9d1..0b93b6384eda 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1110,6 +1110,7 @@ void musb_stop(struct musb *musb)
 	 *  - ...
 	 */
 	musb_platform_try_idle(musb, 0);
+	musb_platform_exit(musb);
 }
 
 /*-------------------------------------------------------------------------*/
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: musb: Call musb_platform_exit from musb_stop
  2018-07-19 10:10 [PATCH] usb: musb: Call musb_platform_exit from musb_stop Jagan Teki
@ 2018-07-19 15:37 ` Bin Liu
  2018-07-19 17:46   ` Jagan Teki
  0 siblings, 1 reply; 4+ messages in thread
From: Bin Liu @ 2018-07-19 15:37 UTC (permalink / raw)
  To: Jagan Teki; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

Hi,

On Thu, Jul 19, 2018 at 03:40:38PM +0530, Jagan Teki wrote:
> musb stop is musb core call during unregister or shutting down
> gadget or host musb. For graceful exit add musb_platform_exit
> on musb_stop so-that it can exit the musb platform driver as well.

Thanks for the patch. but musb_stop() is called in the .udc_stop() and
host .stop() hooks, which can stop (and restart) at any time by the udc
or host core, not really during unregister. musb_platform_init() is not
called in .udc_start() and .start() hooks, so we shouldn't add
musb_platform_exit() in musb_stop().

Regards,
-Bin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: musb: Call musb_platform_exit from musb_stop
  2018-07-19 15:37 ` Bin Liu
@ 2018-07-19 17:46   ` Jagan Teki
  2018-07-19 18:34     ` Bin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Jagan Teki @ 2018-07-19 17:46 UTC (permalink / raw)
  To: Bin Liu, Jagan Teki, Greg Kroah-Hartman, linux-usb, linux-kernel

On Thu, Jul 19, 2018 at 9:07 PM, Bin Liu <b-liu@ti.com> wrote:
> Hi,
>
> On Thu, Jul 19, 2018 at 03:40:38PM +0530, Jagan Teki wrote:
>> musb stop is musb core call during unregister or shutting down
>> gadget or host musb. For graceful exit add musb_platform_exit
>> on musb_stop so-that it can exit the musb platform driver as well.
>
> Thanks for the patch. but musb_stop() is called in the .udc_stop() and
> host .stop() hooks, which can stop (and restart) at any time by the udc
> or host core, not really during unregister. musb_platform_init() is not
> called in .udc_start() and .start() hooks, so we shouldn't add
> musb_platform_exit() in musb_stop().

Thanks for the explanation.

Look like musb_platform_exit calling during musb_remove call of
platform driver. can you explain how the shutdown sequence happen
because of if udc_stop call musb_stop to shutdown how come
platform_exit will shutdown it's PHY and CLK bits. or is it in
reverse?

Jagan.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: musb: Call musb_platform_exit from musb_stop
  2018-07-19 17:46   ` Jagan Teki
@ 2018-07-19 18:34     ` Bin Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Bin Liu @ 2018-07-19 18:34 UTC (permalink / raw)
  To: Jagan Teki; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

On Thu, Jul 19, 2018 at 11:16:18PM +0530, Jagan Teki wrote:
> On Thu, Jul 19, 2018 at 9:07 PM, Bin Liu <b-liu@ti.com> wrote:
> > Hi,
> >
> > On Thu, Jul 19, 2018 at 03:40:38PM +0530, Jagan Teki wrote:
> >> musb stop is musb core call during unregister or shutting down
> >> gadget or host musb. For graceful exit add musb_platform_exit
> >> on musb_stop so-that it can exit the musb platform driver as well.
> >
> > Thanks for the patch. but musb_stop() is called in the .udc_stop() and
> > host .stop() hooks, which can stop (and restart) at any time by the udc
> > or host core, not really during unregister. musb_platform_init() is not
> > called in .udc_start() and .start() hooks, so we shouldn't add
> > musb_platform_exit() in musb_stop().
> 
> Thanks for the explanation.
> 
> Look like musb_platform_exit calling during musb_remove call of
> platform driver. can you explain how the shutdown sequence happen
> because of if udc_stop call musb_stop to shutdown how come

musb_stop() only disables for example irq and session. I didn't read
how udc_stop() is used though.

> platform_exit will shutdown it's PHY and CLK bits. or is it in

platform_exit() is called in musb_remove().

Not sure if this answers your question though.

Regards,
-Bin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-19 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19 10:10 [PATCH] usb: musb: Call musb_platform_exit from musb_stop Jagan Teki
2018-07-19 15:37 ` Bin Liu
2018-07-19 17:46   ` Jagan Teki
2018-07-19 18:34     ` Bin Liu

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).