Re: [PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-10 Thread Daniel Mack
On 08.04.2013 12:38, B, Ravi wrote:
 Felipe
 
 Hi,
 
 On Mon, Apr 08, 2013 at 12:25:38PM +0200, B, Ravi wrote:
 Daniel
 
 On 08.04.2013 09:57, B, Ravi wrote:
 Hi all,
 
 here are some patches to separate the HCD and gadget part
 of the
 musb
 driver so they can be deselected in Kconfig. They also make
 the
 driver
 keep track of the configured port mode that is set from DT,
 so the actual runtime configuration can be selected
 dynamically.
 
 One thing that is still broken is that once pm_suspend()
 was called
 on
 a musb device on a USB disconnect, the port won't wake up
 again
 when a
 device is plugged back in.
 
 This could be due to SESSION bit removal when root port is
 disconnected
 in otg_timer function.
 
 Not sure if we are thinking about the same details, but after
 debuging this a further, turns out that
 musb_platform_try_idle() eventually switches off the entire
 controller, which then leads to DRVBUS going
 low
 on the board. That, in turn, prevents the interrupt from being
 triggered
 on reconnect, because the host port is not powered anymore.
 
 I don't know yet how to cope with that, but for now, I simply
 disabled the call from musb_stage0_irq() to
 musb_platform_try_idle() locally.
 
 The otg_timer() gets invoked, which removes the session when no
 device connected to root controller, this is required in otg or
 dual role mode (Not for host-only mode). Because otg state is
 un-defined till user's connected a-side of b-side of cable.
 
 Embedded hosts might also want this to save some power while no
 devices are connected. I guess most of those devices would rely on
 SRP or on a polling method to enable VBUS.
 
 Yes, in case of true otg, SRP wakesup the device to enable VBUS.
 
 By 'polling' I mean that e.g. every 2
 seconds turn vbus on, if no device are enumerated in 200ms, then
 sleep for another 2 seconds.
 
 Yes, we had this workaround mechanism enabled on some earlier davinci
 platform by setting the session periodically to check any device
 connected for host or otg/dual-role controller to save VBUS power
 when no device connected.

However, this workaround doesn't seem to work anymore.

Anyway, I think we can address this issue separately from the patch set
I submitted.


Thanks,
Daniel
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-10 Thread Felipe Balbi
On Wed, Apr 10, 2013 at 09:10:19AM +0200, Daniel Mack wrote:
 On 08.04.2013 12:38, B, Ravi wrote:
  Felipe
  
  Hi,
  
  On Mon, Apr 08, 2013 at 12:25:38PM +0200, B, Ravi wrote:
  Daniel
  
  On 08.04.2013 09:57, B, Ravi wrote:
  Hi all,
  
  here are some patches to separate the HCD and gadget part
  of the
  musb
  driver so they can be deselected in Kconfig. They also make
  the
  driver
  keep track of the configured port mode that is set from DT,
  so the actual runtime configuration can be selected
  dynamically.
  
  One thing that is still broken is that once pm_suspend()
  was called
  on
  a musb device on a USB disconnect, the port won't wake up
  again
  when a
  device is plugged back in.
  
  This could be due to SESSION bit removal when root port is
  disconnected
  in otg_timer function.
  
  Not sure if we are thinking about the same details, but after
  debuging this a further, turns out that
  musb_platform_try_idle() eventually switches off the entire
  controller, which then leads to DRVBUS going
  low
  on the board. That, in turn, prevents the interrupt from being
  triggered
  on reconnect, because the host port is not powered anymore.
  
  I don't know yet how to cope with that, but for now, I simply
  disabled the call from musb_stage0_irq() to
  musb_platform_try_idle() locally.
  
  The otg_timer() gets invoked, which removes the session when no
  device connected to root controller, this is required in otg or
  dual role mode (Not for host-only mode). Because otg state is
  un-defined till user's connected a-side of b-side of cable.
  
  Embedded hosts might also want this to save some power while no
  devices are connected. I guess most of those devices would rely on
  SRP or on a polling method to enable VBUS.
  
  Yes, in case of true otg, SRP wakesup the device to enable VBUS.
  
  By 'polling' I mean that e.g. every 2
  seconds turn vbus on, if no device are enumerated in 200ms, then
  sleep for another 2 seconds.
  
  Yes, we had this workaround mechanism enabled on some earlier davinci
  platform by setting the session periodically to check any device
  connected for host or otg/dual-role controller to save VBUS power
  when no device connected.
 
 However, this workaround doesn't seem to work anymore.
 
 Anyway, I think we can address this issue separately from the patch set
 I submitted.

correct

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-10 Thread Daniel Mack
On 10.04.2013 10:09, Felipe Balbi wrote:
 On Wed, Apr 10, 2013 at 09:10:19AM +0200, Daniel Mack wrote:
 On 08.04.2013 12:38, B, Ravi wrote:
 Felipe

 Hi,

 On Mon, Apr 08, 2013 at 12:25:38PM +0200, B, Ravi wrote:
 Daniel

 On 08.04.2013 09:57, B, Ravi wrote:
 Hi all,

 here are some patches to separate the HCD and gadget part
 of the
 musb
 driver so they can be deselected in Kconfig. They also make
 the
 driver
 keep track of the configured port mode that is set from DT,
 so the actual runtime configuration can be selected
 dynamically.

 One thing that is still broken is that once pm_suspend()
 was called
 on
 a musb device on a USB disconnect, the port won't wake up
 again
 when a
 device is plugged back in.

 This could be due to SESSION bit removal when root port is
 disconnected
 in otg_timer function.

 Not sure if we are thinking about the same details, but after
 debuging this a further, turns out that
 musb_platform_try_idle() eventually switches off the entire
 controller, which then leads to DRVBUS going
 low
 on the board. That, in turn, prevents the interrupt from being
 triggered
 on reconnect, because the host port is not powered anymore.

 I don't know yet how to cope with that, but for now, I simply
 disabled the call from musb_stage0_irq() to
 musb_platform_try_idle() locally.

 The otg_timer() gets invoked, which removes the session when no
 device connected to root controller, this is required in otg or
 dual role mode (Not for host-only mode). Because otg state is
 un-defined till user's connected a-side of b-side of cable.

 Embedded hosts might also want this to save some power while no
 devices are connected. I guess most of those devices would rely on
 SRP or on a polling method to enable VBUS.

 Yes, in case of true otg, SRP wakesup the device to enable VBUS.

 By 'polling' I mean that e.g. every 2
 seconds turn vbus on, if no device are enumerated in 200ms, then
 sleep for another 2 seconds.

 Yes, we had this workaround mechanism enabled on some earlier davinci
 platform by setting the session periodically to check any device
 connected for host or otg/dual-role controller to save VBUS power
 when no device connected.

 However, this workaround doesn't seem to work anymore.

 Anyway, I think we can address this issue separately from the patch set
 I submitted.
 
 correct
 

Ok, I'll amend my patches to include Peter's reports and resend? Or
should I wait for more comments from you?


Thanks,
Daniel

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


RE: [PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-08 Thread B, Ravi
Daniel

 Hi all,
 
 here are some patches to separate the HCD and gadget part of the musb
 driver so they can be deselected in Kconfig. They also make the driver
 keep track of the configured port mode that is set from DT, so the
 actual runtime configuration can be selected dynamically.
 
 One thing that is still broken is that once pm_suspend() was called on
 a musb device on a USB disconnect, the port won't wake up again when a
 device is plugged back in. 

This could be due to SESSION bit removal when root port is disconnected in 
otg_timer function.

I doubt this is related to my patches, but I
 might be wrong. If that effect rings a bell to anyone, please let me
 know.
 
--
Ravi B

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


Re: [PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-08 Thread Daniel Mack
Hi Ravi,

On 08.04.2013 09:57, B, Ravi wrote:
 Hi all,

 here are some patches to separate the HCD and gadget part of the musb
 driver so they can be deselected in Kconfig. They also make the driver
 keep track of the configured port mode that is set from DT, so the
 actual runtime configuration can be selected dynamically.

 One thing that is still broken is that once pm_suspend() was called on
 a musb device on a USB disconnect, the port won't wake up again when a
 device is plugged back in. 
 
 This could be due to SESSION bit removal when root port is disconnected in 
 otg_timer function.

Not sure if we are thinking about the same details, but after debuging
this a further, turns out that musb_platform_try_idle() eventually
switches off the entire controller, which then leads to DRVBUS going low
on the board. That, in turn, prevents the interrupt from being triggered
on reconnect, because the host port is not powered anymore.

I don't know yet how to cope with that, but for now, I simply disabled
the call from musb_stage0_irq() to musb_platform_try_idle() locally.


Thanks,
Daniel
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-08 Thread B, Ravi
Daniel

 On 08.04.2013 09:57, B, Ravi wrote:
  Hi all,
 
  here are some patches to separate the HCD and gadget part of the musb
  driver so they can be deselected in Kconfig. They also make the driver
  keep track of the configured port mode that is set from DT, so the
  actual runtime configuration can be selected dynamically.
 
  One thing that is still broken is that once pm_suspend() was called on
  a musb device on a USB disconnect, the port won't wake up again when a
  device is plugged back in.
 
  This could be due to SESSION bit removal when root port is disconnected
 in otg_timer function.
 
 Not sure if we are thinking about the same details, but after debuging
 this a further, turns out that musb_platform_try_idle() eventually
 switches off the entire controller, which then leads to DRVBUS going low
 on the board. That, in turn, prevents the interrupt from being triggered
 on reconnect, because the host port is not powered anymore.
 
 I don't know yet how to cope with that, but for now, I simply disabled
 the call from musb_stage0_irq() to musb_platform_try_idle() locally.

The otg_timer() gets invoked, which removes the session when no device 
connected to root controller, this is required in otg or dual role mode (Not 
for host-only mode). Because otg state is un-defined till user's connected 
a-side of b-side of cable. 

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


Re: [PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-08 Thread Felipe Balbi
Hi,

On Mon, Apr 08, 2013 at 12:25:38PM +0200, B, Ravi wrote:
 Daniel
 
  On 08.04.2013 09:57, B, Ravi wrote:
   Hi all,
  
   here are some patches to separate the HCD and gadget part of the musb
   driver so they can be deselected in Kconfig. They also make the driver
   keep track of the configured port mode that is set from DT, so the
   actual runtime configuration can be selected dynamically.
  
   One thing that is still broken is that once pm_suspend() was called on
   a musb device on a USB disconnect, the port won't wake up again when a
   device is plugged back in.
  
   This could be due to SESSION bit removal when root port is disconnected
  in otg_timer function.
  
  Not sure if we are thinking about the same details, but after debuging
  this a further, turns out that musb_platform_try_idle() eventually
  switches off the entire controller, which then leads to DRVBUS going low
  on the board. That, in turn, prevents the interrupt from being triggered
  on reconnect, because the host port is not powered anymore.
  
  I don't know yet how to cope with that, but for now, I simply disabled
  the call from musb_stage0_irq() to musb_platform_try_idle() locally.
 
 The otg_timer() gets invoked, which removes the session when no device
 connected to root controller, this is required in otg or dual role
 mode (Not for host-only mode). Because otg state is un-defined till
 user's connected a-side of b-side of cable. 

Embedded hosts might also want this to save some power while no devices
are connected. I guess most of those devices would rely on SRP or on a
polling method to enable VBUS. By 'polling' I mean that e.g. every 2
seconds turn vbus on, if no device are enumerated in 200ms, then sleep
for another 2 seconds.

Or something similar. I know of some products (cellphones) which will
only switch Vbus on when you open e.g. file manager.

-- 
balbi


signature.asc
Description: Digital signature


RE: [PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-08 Thread B, Ravi
Felipe

 Hi,
 
 On Mon, Apr 08, 2013 at 12:25:38PM +0200, B, Ravi wrote:
  Daniel
 
   On 08.04.2013 09:57, B, Ravi wrote:
Hi all,
   
here are some patches to separate the HCD and gadget part of the
 musb
driver so they can be deselected in Kconfig. They also make the
 driver
keep track of the configured port mode that is set from DT, so the
actual runtime configuration can be selected dynamically.
   
One thing that is still broken is that once pm_suspend() was called
 on
a musb device on a USB disconnect, the port won't wake up again
 when a
device is plugged back in.
   
This could be due to SESSION bit removal when root port is
 disconnected
   in otg_timer function.
  
   Not sure if we are thinking about the same details, but after debuging
   this a further, turns out that musb_platform_try_idle() eventually
   switches off the entire controller, which then leads to DRVBUS going
 low
   on the board. That, in turn, prevents the interrupt from being
 triggered
   on reconnect, because the host port is not powered anymore.
  
   I don't know yet how to cope with that, but for now, I simply disabled
   the call from musb_stage0_irq() to musb_platform_try_idle() locally.
 
  The otg_timer() gets invoked, which removes the session when no device
  connected to root controller, this is required in otg or dual role
  mode (Not for host-only mode). Because otg state is un-defined till
  user's connected a-side of b-side of cable.
 
 Embedded hosts might also want this to save some power while no devices
 are connected. I guess most of those devices would rely on SRP or on a
 polling method to enable VBUS. 

Yes, in case of true otg, SRP wakesup the device to enable VBUS.

By 'polling' I mean that e.g. every 2
 seconds turn vbus on, if no device are enumerated in 200ms, then sleep
 for another 2 seconds.

Yes, we had this workaround mechanism enabled on some earlier davinci platform 
by setting the session periodically to check any device connected for host or 
otg/dual-role controller to save VBUS power when no device connected.

 
 Or something similar. I know of some products (cellphones) which will
 only switch Vbus on when you open e.g. file manager.
 

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


[PATCH v2 00/11] usb: musb: add back support for host mode

2013-04-05 Thread Daniel Mack
Hi all,

here are some patches to separate the HCD and gadget part of the musb
driver so they can be deselected in Kconfig. They also make the driver
keep track of the configured port mode that is set from DT, so the
actual runtime configuration can be selected dynamically.

One thing that is still broken is that once pm_suspend() was called on
a musb device on a USB disconnect, the port won't wake up again when a
device is plugged back in. I doubt this is related to my patches, but I
might be wrong. If that effect rings a bell to anyone, please let me
know.

Thanks,
Daniel


Changes from v1:
* fixed some typos in commit logs
* factor out musb_host_resume_root_hub and
  musb_host_poke_root_hub()
* split some changes into separate patches
* some minor cosmetics fixed

Daniel Mack (11):
  usb: gadget: drop unused USB_GADGET_MUSB_HDRC
  usb: musb: move function declarations to musb_{host,gadget}.h
  usb: musb: factor some host-specific functions
  usb: musb: gadget: remove hcd initialization
  usb: musb: move musb_start to musb_virthub.c
  usb: musb: factor out hcd initalization
  usb: musb: add Kconfig options for HOST, GAGDET or DUAL_ROLE modes
  usb: musb: add musb_host_setup() and musb_host_cleanup()
  usb: musb: re-introduce musb-port_mode
  usb: musb: use musb-port_mode
  usb: musb: eliminate musb_to_hcd

 drivers/usb/gadget/Kconfig  |   8 ---
 drivers/usb/musb/Kconfig|  29 +
 drivers/usb/musb/Makefile   |  10 +++-
 drivers/usb/musb/musb_core.c| 127 +++-
 drivers/usb/musb/musb_core.h|  26 +++-
 drivers/usb/musb/musb_gadget.c  |  10 
 drivers/usb/musb/musb_gadget.h  |  38 ++--
 drivers/usb/musb/musb_host.c|  90 +---
 drivers/usb/musb/musb_host.h|  57 ++
 drivers/usb/musb/musb_virthub.c |  51 +++-
 10 files changed, 300 insertions(+), 146 deletions(-)

-- 
1.8.1.4

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