1. 11 3月, 2015 6 次提交
  2. 23 2月, 2015 2 次提交
  3. 25 11月, 2014 1 次提交
  4. 08 11月, 2014 1 次提交
  5. 04 11月, 2014 3 次提交
  6. 23 10月, 2014 2 次提交
    • S
      usb: musb: musb_dsps: fix NULL pointer in suspend · f042e9cb
      Sebastian Andrzej Siewior 提交于
      So testing managed to configure musb in DMA mode but not load the
      matching cppi41 driver for DMA. This results in
      
      |musb-hdrc musb-hdrc.0.auto: Failed to request rx1.
      |musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517
      |platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral
      
      which is "okay". Once the driver is loaded we re-try probing and
      everyone is happy. Until then if you try suspend say
          echo mem > /sys/power/state
      then you go boom
      
      |Unable to handle kernel NULL pointer dereference at virtual address 000003a4
      |pgd = cf50c000
      |[000003a4] *pgd=8f6a3831, *pte=00000000, *ppte=00000000
      |Internal error: Oops: 17 [#1] ARM
      |PC is at dsps_suspend+0x18/0x9c [musb_dsps]
      |LR is at dsps_suspend+0x18/0x9c [musb_dsps]
      |pc : [<bf08e268>] lr : [<bf08e268>] psr: a0000013
      |sp : cbd97e00 ip : c0af4394 fp : 00000000
      |r10: c0831d90 r9 : 00000002 r8 : cf6da410
      |r7 : c03ba4dc r6 : bf08f224 r5 : 00000000 r4 : cbc5fcd0
      |r3 : bf08e250 r2 : bf08f264 r1 : cf6da410 r0 : 00000000
      |[<bf08e268>] (dsps_suspend [musb_dsps]) from [<c03ba508>] (platform_pm_suspend+0x2c/0x54)
      |Code: e1a04000 e9900041 e2800010 eb4caa8e (e59053a4)
      
      because platform_get_drvdata(glue->musb) returns a NULL pointer as long as the
      device is not fully probed.
      Tested-by: NGeorge Cherian <george.cherian@ti.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      f042e9cb
    • S
      usb: musb: dsps: start OTG timer on resume again · 53185b3a
      Sebastian Andrzej Siewior 提交于
      Commit 468bcc2a ("usb: musb: dsps: kill OTG timer on suspend") stopped
      the timer in suspend path but forgot the re-enable it in the resume
      path. This patch fixes the behaviour.
      
      Cc: <stable@vger.kernel.org> # v3.14+
      Fixes 468bcc2a "usb: musb: dsps: kill OTG timer on suspend"
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      53185b3a
  7. 16 9月, 2014 1 次提交
  8. 16 7月, 2014 2 次提交
  9. 01 7月, 2014 3 次提交
  10. 22 4月, 2014 3 次提交
  11. 16 4月, 2014 1 次提交
    • D
      usb: musb: dsps: move debugfs_remove_recursive() · 0fca91b8
      Daniel Mack 提交于
      When the platform initialization fails due to missing resources, it will
      return -EPROBE_DEFER after dsps_musb_init() has been called.
      
      dsps_musb_init() calls dsps_musb_dbg_init() to allocate the debugfs
      nodes. At a later point in time, the probe will be retried, and
      dsps_musb_dbg_init() will be called again. debugfs_create_dir() will
      fail this time, as the node already exists, and so the entire device
      probe will fail with -ENOMEM.
      
      Fix this by moving debugfs_remove_recursive() from dsps_remove() to the
      plaform's exit function, so it will be cleanly torn down when the probe
      fails. It also feels more natural this way, as .exit is the counterpart
      to .init.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      0fca91b8
  12. 20 2月, 2014 1 次提交
  13. 19 2月, 2014 1 次提交
  14. 09 1月, 2014 1 次提交
  15. 27 11月, 2013 4 次提交
  16. 17 10月, 2013 4 次提交
    • S
      usb: musb: dsps: run the timer only on OTG systems · 24616eb6
      Sebastian Andrzej Siewior 提交于
      I introduced this check here because it looked wrong in HOST only
      configurions. The timer would remove that session bit and will never
      come back and so there would not be another session.
      Now that I played with OTG for a while I belive this workaround is
      only required for the OTG mode because we have to end the session and
      then we have to try to start manually.
      Therefore, this patch limits this timer to the OTG only port mode so we
      don't need to poll around in device only mode.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      24616eb6
    • S
      usb: musb: dsps: redo the otg timer · 0f901c98
      Sebastian Andrzej Siewior 提交于
      According to the comments, we rely on the OTG timer because the core
      does not expose some important OTG details. So far this is all I
      know. After playing with OTG I stumbled over a problem:
      musb is recognized as a B-device without a problem. Whenever a cable is
      plugged, the VBUS rises, musb recognizes this as a starting session,
      sets the MUSB_DEVCTL_SESSION bit by itself and a RESET interrupt occurs,
      the session starts. Good.
      After a disconnect, the timer is started and re-starts itself because
      it remains in B_IDLE with the BDEVICE set. I didn't figure the the
      reason or the need for it. Nothing changes here except for OTG state
      from B to A device if the BDEVICE bit disappears. This doesn't make much
      sense to me because nothing happens after this. _IF_ we receive an
      interrupt before the state change then we may act on wrong condition.
      Plugging a B-device (and letting MUSB act as host) doesn't work here.
      The reason seems to be that the MUSB tries to start a session, it fails
      and then it removes the bit. So we never start as a host.
      
      This patch sets the MUSB_DEVCTL_SESSION bit in the IDLE state so musb
      can try to establish a session as host. After the bit is set, musb tries
      to start a session and if it fails it clears the bit. Therefore it will
      try over and over again until a session either as host or as device is
      established.
      
      The readout of the MUSB_DEVCTL register after the removal the
      MUSB_DEVCTL_SESSION (in A_WAIT_BCON) has been removed because it did not
      contain the BDEVICE bit set (in the second read) leading to A_IDLE. After
      plugging a host musb assumed that it is also a host and complained about
      a missing reset. However a third read of the register has has the BDEVICE
      bit set so it seems that it is not stable.
      This mostly what da8xx.c is doing except that we set the timer also
      after A_WAIT_BCON so the session bit can be triggered.
      
      Whit this change I was able to keep am335x-evm in OTG mode and plug in
      either a HOST or a DEVICE and in a random order and the device was
      recognized.
      
      Cc: stable@vger.kernel.org # v3.11
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      0f901c98
    • S
      usb: musb: dsps: remove declartion for dsps_musb_try_idle() · 807d0d2b
      Sebastian Andrzej Siewior 提交于
      This patch moves dsps_musb_try_idle() before dsps_musb_enable() so the
      declaration (of dsps_musb_try_idle() can be removed.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      807d0d2b
    • S
      usb: musb: dsps: move try_idle to start hook · 8b9fcce2
      Sebastian Andrzej Siewior 提交于
      The timer is initialized right after musb is probed. There is actually
      no need to have this timer running because _nothing_ will happen until
      we have the gadget loaded. Also we need this timer only if we run in OTG
      mode _and_ we need it also after the gadget has been replaced with
      another one.
      
      I've been looking at am35x.c, da8xx.c, omap2430.c, tusb6010.c. da8xx
      seem to have the same problem as dsps and doing mostly the same thing.
      tusb6010 seem to do something different and do some actual "idle / power
      saving" work so I am not too comfortable to remove
      musb_platform_try_idle() from musb_gadget_setup().
      
      Therefore this patch does not start the timer if there is no gadget
      active (which is at musb_gadget_setup() at time). In order to have the
      timer active after the gadget is loaded it will be triggered from
      dsps_musb_enable().
      
      Cc: stable@vger.kernel.org # v3.11
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      8b9fcce2
  17. 12 10月, 2013 1 次提交
  18. 01 10月, 2013 2 次提交
    • S
      usb: musb_dsps: Remove redundant of_match_ptr · b432cb83
      Sachin Kamat 提交于
      The data structure of_match_ptr() protects is always compiled in.
      Hence of_match_ptr() is not needed.
      Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
      Cc: Ravi B <ravibabu@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      b432cb83
    • S
      usb: musb: dsps: do not bind to "musb-hdrc" · 4fc4b274
      Sebastian Andrzej Siewior 提交于
      This went unnoticed in durin the merge window:
      The dsps driver creates a child device for the musb core driver _and_
      attaches the of_node to it so devm_usb_get_phy_by_phandle() grabs the
      correct phy and attaches the devm resources to the proper device. We
      could also use the parent device but then devm would attach the
      resource to the wrong device and it would be destroyed once the parent
      device is gone - not the device that is used by the musb core driver.
      
      If the phy is now not available then dsps_musb_init() /
      devm_usb_get_phy_by_phandle() returns with EPROBE_DEFER. Since the
      of_node is attached it tries OF drivers as well and matches the driver
      against DSPS. That one creates a new child device for the musb core
      driver which gets probed immediately.
      
      The whole thing repeats itself until the stack overflows.
      
      I belive the same problem exists in ux500 glue code (since 313bdb11
      ("usb: musb: ux500: add device tree probing support") but the drivers are
      now probed in the right order so they don't see it.
      
      The problem is that the dsps driver gets bound to the musb-child device
      due to the same of_node / matching binding. I don't really agree with
      having yet another child node in DT to fix this. Ideally we would have
      musb core driver with DT bindings and according to the binding we would
      select the few extra hacks / gleue layer.
      
      Therefore I suggest the driver to reject the musb-core device.
      
      Cc: Lee Jones <lee.jones@linaro.org>
      Tested-by: NTom Rini <trini@ti.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      4fc4b274
  19. 28 8月, 2013 1 次提交
    • S
      usb: musb: am335x-evm: Do not remove the session bit HOST-only mode · 781f1798
      Sebastian Andrzej Siewior 提交于
      This is what I observe:
      On the first connect, the musb starts with DEVCTL.Session set. On
      disconnect, musb_core calls try_idle. That functions removes the Session
      bit signalizing that the session is over (something that only in OTG is
      required). A new device, that is plugged, is no longer recognized.
      I've setup a timer and checked the DEVCTL register and I haven't seen a
      change in VBus and I saw the B-Device bit set. After setting the IDDIG
      into A mode and forcing the device to behave like a A device, I didn't
      see a change.
      Neither VBUS goes to 0b11 nor does a session start request comes.
      In the TI-v3.2 kernel they skip to call musb_platform_try_idle() in the
      OTG_STATE_A_WAIT_BCON state while not in OTG mode.
      Since the second port hast a standard A plug the patch changes the port
      to run in host mode only and skips the timer which would remove
      DEVCTL.Session so we can reconnect to another device later.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      781f1798