1. 25 1月, 2017 1 次提交
    • T
      usb: musb: Fix host mode error -71 regression · 407788b5
      Tony Lindgren 提交于
      Commit 467d5c98 ("usb: musb: Implement session bit based runtime PM for
      musb-core") started implementing musb generic runtime PM support by
      introducing devctl register session bit based state control.
      
      This caused a regression where if a USB mass storage device is connected
      to a USB hub, we can get:
      
      usb 1-1: reset high-speed USB device number 2 using musb-hdrc
      usb 1-1: device descriptor read/64, error -71
      usb 1-1.1: new high-speed USB device number 4 using musb-hdrc
      
      This is because before the USB storage device is connected, musb is
      in OTG_STATE_A_SUSPEND. And we currently only set need_finish_resume
      in musb_stage0_irq() and the related code calling finish_resume_work
      in musb_resume() and musb_runtime_resume() never gets called.
      
      To fix the issue, we can call schedule_delayed_work() directly in
      musb_stage0_irq() to have finish_resume_work run.
      
      And we should no longer never get interrupts when when suspended.
      We have changed musb to no longer need pm_runtime_irqsafe().
      The need_finish_resume flag was added in commit 9298b4aa ("usb:
      musb: fix device hotplug behind hub") and no longer applies as far
      as I can tell. So let's just remove the earlier code that no longer
      is needed.
      
      Fixes: 467d5c98 ("usb: musb: Implement session bit based runtime PM for musb-core")
      Reported-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      407788b5
  2. 06 1月, 2017 1 次提交
    • B
      usb: musb: core: add clear_ep_rxintr() to musb_platform_ops · 6def85a3
      Bin Liu 提交于
      During dma teardown for dequque urb, if musb load is high, musb might
      generate bogus rx ep interrupt even when the rx fifo is flushed. In such
      case any of the follow log messages could happen.
      
      	musb_host_rx 1853: BOGUS RX2 ready, csr 0000, count 0
      
      	musb_host_rx 1936: RX3 dma busy, csr 2020
      
      As mentioned in the current inline comment, clearing ep interrupt in the
      teardown path avoids the bogus interrupt.
      
      Clearing ep interrupt is platform dependent, so this patch adds a
      platform callback to allow glue driver to clear the ep interrupt.
      
      This bug seems to be existing since the initial driver for musb support,
      but I only validated the fix back to v4.1, so only cc stable for v4.1+.
      
      cc: stable@vger.kernel.org # 4.1+
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6def85a3
  3. 22 11月, 2016 1 次提交
  4. 17 11月, 2016 3 次提交
  5. 23 9月, 2016 1 次提交
    • T
      usb: musb: Fix session based PM for first invalid VBUS · 2b9a8c40
      Tony Lindgren 提交于
      With the session bit based PM runtime working on musb, we've
      implemented few quirks to attempt to detect the current state of
      the hardware. One of the quirks is for invalid VBUS as peripheral,
      but it is not working in all cases.
      
      If we start musb on dm3730 as a peripheral with no cable connected,
      we will get the devctl 91 state once and will never idle as there
      are not further interrupts from musb. So we need to ignore the first
      devctl 91 state as there will be more interrupts if we're connected.
      
      The invalid VBUS state also can happen always when connected to
      certain USB hubs. Looks like musb on dm3730 can claim invalid VBUS
      with some hubs while 3717-evm and BeagleBone don't. This causes
      session as peripheral to fail for dm3730 with some hubs.
      
      This too is fixed by ignoring only the first invalid VBUS. When
      connected, we can just look at the session bit as that will clear
      automatically when the session ends.
      
      Fixes: 467d5c98 ("usb: musb: Implement session bit based runtime PM for musb-core")
      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>
      2b9a8c40
  6. 13 9月, 2016 1 次提交
  7. 02 6月, 2016 2 次提交
  8. 04 3月, 2016 1 次提交
  9. 17 12月, 2015 1 次提交
    • T
      usb: musb: core: Fix handling of the phy notifications · 8055555f
      Tony Lindgren 提交于
      We currently can't unload omap2430 MUSB platform glue driver module and
      this cause issues for fixing the MUSB code further. The reason we can't
      remove omap2430 is because it uses the PHY functions and also exports the
      omap_musb_mailbox function that some PHY drivers are using.
      
      Let's fix the issue by exporting a more generic musb_mailbox function
      from the MUSB core and allow platform glue layers to register phy_callback
      function as needed.
      
      And now we can now also get rid of the include/linux/musb-omap.h.
      
      Cc: Bin Liu <b-liu@ti.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: NeilBrown <neil@brown.name>
      Reviewed-by: NKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      8055555f
  10. 16 10月, 2015 1 次提交
  11. 26 5月, 2015 3 次提交
  12. 08 5月, 2015 1 次提交
  13. 11 3月, 2015 2 次提交
  14. 25 11月, 2014 3 次提交
  15. 06 11月, 2014 1 次提交
    • S
      usb: musb: try a race-free wakeup · baadd52f
      Sebastian Andrzej Siewior 提交于
      Attaching a keyboard, using it as a wakeup via
      |for f in $(find /sys/devices/ocp.3/47400000.usb -name wakeup)
      |do
      |	echo enabled > $f
      |done
      
      going into standby
      |  echo standby >  /sys/power/state
      
      and now a wake up by a pressing a key.
      What happens is that the system wakes up but the USB device is dead. The
      USB stack tries to send a few control URBs but nothing comes back.
      Eventually it gaves up and the device remains dead:
      |[  632.559678] PM: Wakeup source USB1_PHY
      |[  632.581074] PM: noirq resume of devices complete after 21.261 msecs
      |[  632.607521] PM: early resume of devices complete after 10.360 msecs
      |[  632.616854] net eth2: initializing cpsw version 1.12 (0)
      |[  632.704126] net eth2: phy found : id is : 0x4dd074
      |[  636.704048] libphy: 4a101000.mdio:00 - Link is Up - 1000/Full
      |[  638.444620] usb 1-1: reset low-speed USB device number 2 using musb-hdrc
      |[  653.713435] usb 1-1: device descriptor read/64, error -110
      |[  669.093435] usb 1-1: device descriptor read/64, error -110
      |[  669.473424] usb 1-1: reset low-speed USB device number 2 using musb-hdrc
      |[  684.743436] usb 1-1: device descriptor read/64, error -110
      |[  690.065097] PM: resume of devices complete after 57450.744 msecs
      |[  690.076601] PM: Finishing wakeup.
      |[  690.076627] Restarting tasks ...
      
      It seems that since we got woken up via MUSB_INTR_RESUME the
      musb_host_finish_resume() callback is executed before the
      resume-callbacks of the PHY and glue layer are invoked. If I delay it
      until the glue layer resumed then I don't see this problem.
      
      I also move musb_host_resume_root_hub() into that callback since I don't
      see any reason in doing anything resume-link if there are still pieces
      not restored.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      baadd52f
  16. 16 7月, 2014 2 次提交
  17. 17 5月, 2014 1 次提交
  18. 22 4月, 2014 2 次提交
  19. 20 12月, 2013 1 次提交
    • D
      usb: musb: finish suspend/reset work independently from musb_hub_control() · 8ed1fb79
      Daniel Mack 提交于
      Currently, resume and reset is completed when the USB core calls back
      the root hub, asking for the port's state. This results in
      unpredictable timing of state assertion, which in turn renders some
      USB devices unusable after resume.
      
      Fix this by moving the logic to end the reset and suspend state out of
      musb_hub_control() into separate functions called from delayed workers.
      GetPortStatus only reports the current state now, without taking any
      real action.
      
      The rh_timeout variable is kept in order to define a minimum time gap
      between reset and resume only.
      
      FWIW, in my case, a Verbatim "STORE N GO" mass storage device won't
      resume cleanly without this patch.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      8ed1fb79
  20. 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
  21. 28 9月, 2013 1 次提交
  22. 29 7月, 2013 1 次提交
  23. 29 5月, 2013 5 次提交
  24. 01 11月, 2012 1 次提交
    • S
      usb: musb: remove hand-crafted id handling · 2f771164
      Sebastian Andrzej Siewior 提交于
      This replaced the handcrafted id handling by the PLATFORM_DEVID_AUTO
      value which should do the same thing.
      
      This patch probably also fixes ux500 because I did not find the "musbid"
      variable to remove. And we close a tiny-unlikely race window becuase the
      old code gave the id back before device was destroyed in the remove
      case.
      
      [ balbi@ti.com : fixed up two failed hunks when applying patch ]
      
      Cc: B, Ravi <ravibabu@ti.com>
      Cc: Santhapuri, Damodar <damodar.santhapuri@ti.com>
      Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
      Cc: Bob Liu <lliubbo@gmail.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      2f771164
  25. 31 10月, 2012 2 次提交