1. 17 11月, 2016 2 次提交
    • T
      usb: musb: Fix PM for hub disconnect · 2bff3916
      Tony Lindgren 提交于
      With a USB hub disconnected, devctl can be 0x19 for about a second
      on am335x and will stay forever on at least omap3. And we get no
      further interrupts when devctl session bit clears. This keeps
      PM runtime active.
      
      Let's fix the issue by polling devctl until the session bit clears
      or times out. We can do this by making musb->irq_work into
      delayed_work.
      
      And with the polling implemented, we can now also have the quirk
      for invalid VBUS it to avoid disconnecting too early while VBUS
      is ramping up.
      
      Fixes: 467d5c98 ("usb: musb: Implement session bit based runtime
      PM for musb-core")
      Fixes: 65b3f50e ("usb: musb: Add PM runtime support for MUSB DSPS
      Tested-by: NLadislav Michl <ladis@linux-mips.org>
      Tested-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2bff3916
    • T
      usb: musb: Fix sleeping function called from invalid context for hdrc glue · ea2f35c0
      Tony Lindgren 提交于
      Commit 65b3f50e ("usb: musb: Add PM runtime support for MUSB DSPS
      glue layer") wrongly added a call for pm_runtime_get_sync to otg_timer
      that runs in softirq context. That causes a "BUG: sleeping function called
      from invalid context" every time when polling the cable status:
      
      [<c015ebb4>] (__might_sleep) from [<c0413d60>] (__pm_runtime_resume+0x9c/0xa0)
      [<c0413d60>] (__pm_runtime_resume) from [<c04d0bc4>] (otg_timer+0x3c/0x254)
      [<c04d0bc4>] (otg_timer) from [<c0191180>] (call_timer_fn+0xfc/0x41c)
      [<c0191180>] (call_timer_fn) from [<c01915c0>] (expire_timers+0x120/0x210)
      [<c01915c0>] (expire_timers) from [<c0191acc>] (run_timer_softirq+0xa4/0xdc)
      [<c0191acc>] (run_timer_softirq) from [<c010168c>] (__do_softirq+0x12c/0x594)
      
      I did not notice that as I did not have CONFIG_DEBUG_ATOMIC_SLEEP enabled.
      And looks like also musb_gadget_queue() suffers from the same problem.
      
      Let's fix the issue by using a list of delayed work then call it on
      resume. Note that we want to do this only when musb core and it's
      parent devices are awake, and we need to make sure the DSPS glue
      timer is stopped as noted by Johan Hovold <johan@kernel.org>.
      Note that we already are re-enabling the timer with mod_timer() in
      dsps_musb_enable().
      
      Later on we may be able to remove other delayed work in the musb driver
      and just do it from pending_resume_work. But this should be done only
      for delayed work that does not have other timing requirements beyond
      just being run on resume.
      
      Fixes: 65b3f50e ("usb: musb: Add PM runtime support for MUSB DSPS
      glue layer")
      Reported-by: NJohan Hovold <johan@kernel.org>
      Reviewed-by: NJohan Hovold <johan@kernel.org>
      Tested-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ea2f35c0
  2. 24 10月, 2016 1 次提交
  3. 23 9月, 2016 1 次提交
  4. 17 7月, 2016 2 次提交
  5. 02 6月, 2016 3 次提交
  6. 27 4月, 2016 1 次提交
  7. 17 12月, 2015 1 次提交
  8. 07 8月, 2015 1 次提交
  9. 06 8月, 2015 2 次提交
  10. 05 8月, 2015 1 次提交
  11. 31 7月, 2015 1 次提交
  12. 08 5月, 2015 2 次提交
  13. 09 3月, 2015 1 次提交
  14. 30 1月, 2015 1 次提交
  15. 11 11月, 2014 1 次提交
  16. 04 11月, 2014 4 次提交
  17. 25 9月, 2014 1 次提交
  18. 20 12月, 2013 1 次提交
    • A
      usb: musb: fix setting JZ4740 gadget periphal mode on reset · 23db9fd2
      Apelete Seketeli 提交于
      JZ4740 USB Device Controller is not OTG compatible and does not have
      DEVCTL register in silicon.
      
      During ethernet-over-usb transactions, on reset, musb driver tries to
      read from DEVCTL and consequently sets device as host (A-Device)
      instead of peripheral (B-Device), which makes it a composite device to
      the USB gadget driver.
      This induces a kernel panic during power down where the USB gadget
      driver does a null pointer dereference when trying to access the
      composite device configuration.
      
      On reset, do not rely on DEVCTL value for setting gadget peripheral
      mode. Use is_otg flag instead to set it to B-Device.
      Signed-off-by: NApelete Seketeli <apelete@seketeli.net>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      23db9fd2
  19. 18 12月, 2013 1 次提交
    • R
      usb: gadget: add "maxpacket_limit" field to struct usb_ep · e117e742
      Robert Baldyga 提交于
      This patch adds "maxpacket_limit" to struct usb_ep. This field contains
      maximum value of maxpacket supported by driver, and is set in driver probe.
      This value should be used by autoconfig() function, because value of field
      "maxpacket" is set to value from endpoint descriptor when endpoint becomes
      enabled. So when autoconfig() function will be called again for this endpoint,
      "maxpacket" value will contain wMaxPacketSize from descriptior instead of
      maximum packet size for this endpoint.
      
      For this reason this patch adds new field "maxpacket_limit" which contains
      value of maximum packet size (which defines maximum endpoint capabilities).
      This value is used in ep_matches() function used by autoconfig().
      
      Value of "maxpacket_limit" should be set in UDC driver probe function, using
      usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function
      set choosen value to both "maxpacket_limit" and "maxpacket" fields.
      
      This patch modifies UDC drivers by adding support for maxpacket_limit.
      Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      e117e742
  20. 26 11月, 2013 1 次提交
    • A
      usb: fix musb gadget to enable OTG mode conditionally · fd3923a9
      Apelete Seketeli 提交于
      The musb driver is usable in host, gadget or dual role mode depending
      on the kernel configuration.
      
      However, the musb gadget part of the driver is enabling OTG mode
      whether the driver is built for dual role or gadget only mode. This
      induces a bug for gadget only USB device controllers where the kernel
      tries to use Host Negotiation Protocol with such controllers, which
      causes a panic.
      
      This behaviour is now fixed by enabling OTG mode only when musb driver
      is built for dual role mode.
      Signed-off-by: NApelete Seketeli <apelete@seketeli.net>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      fd3923a9
  21. 15 10月, 2013 1 次提交
  22. 12 10月, 2013 1 次提交
  23. 11 10月, 2013 1 次提交
    • S
      usb: musb: start musb on the udc side, too · 001dd84a
      Sebastian Andrzej Siewior 提交于
      I have am335x-evm with one port running in OTG mode. Since commit
      fe4cb091 ("usb: musb: gadget: remove hcd initialization") the loaded
      gadget does non pop up on the host. All I see is
      |usb 4-5: new high-speed USB device number 52 using ehci-pci
      |usb 4-5: device descriptor read/64, error -110
      
      Since a later commit 2cc65fea ("usb: musb: add musb_host_setup() and
      musb_host_cleanup()) the gadget shows up on the host again but only
      in OTG mode (because we have the host init code running). It does not
      work in device only mode.
      If running in OTG mode and the gadget is removed and added back (rmmod
      followed by modprobe of a gadget) then the same error is pops up on the
      host side.
      
      This patch ensures that the gadget side also executes musb_start() which
      puts the chip in "connect accept" mode. With this change the device
      works in OTG & device mode and the gadget can be added & removed
      multiple times.
      A device (if musb is in OTG mode acting as a host) is only recognized if
      it is attached during module load (musb_hdrc module). After the device
      unplugged and plugged again the host does not recognize it. We get a
      buch of errors if musb running in OTG mode, attached to a host and no
      gadget is loaded. Bah.
      This is one step forward. Host & device only mode should work. I will
      look at OTG later. I looked at this before commit fe4cb091 and OTG wasn't
      working there perfectly so I am not sure that it is a regression :)
      
      Cc: <stable@vger.kernel.org> # v3.11
      Cc: Daniel Mack <zonque@gmail.com>
      Cc: Peter Korsgaard <jacmet@sunsite.dk>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      001dd84a
  24. 26 9月, 2013 1 次提交
  25. 18 9月, 2013 1 次提交
    • B
      usb: musb: fix otg default state · 1374a430
      Bin Liu 提交于
      Right after the musb_hdrc driver is loaded, the otg default state
      is a_idle, and Mode=Host, which are set by musb_host_setup().
      
      This causes the following kernel message during musb gadget
      enumeration.
      
      	CAUTION: musb: Babble Interrupt Occurred
      
      This patch sets the otg default state to b_idle, and its Mode to
      Peripheral.
      
      It has been validated on TI AM335x GP EVM USB0 port with g_zero.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      1374a430
  26. 28 8月, 2013 3 次提交
  27. 14 8月, 2013 1 次提交
  28. 29 7月, 2013 1 次提交
  29. 29 5月, 2013 1 次提交