1. 27 3月, 2017 3 次提交
  2. 07 3月, 2017 7 次提交
  3. 09 2月, 2017 1 次提交
  4. 25 1月, 2017 3 次提交
    • T
      dmaengine: cppi41: Clean up pointless warnings · 6610d0ed
      Tony Lindgren 提交于
      With patches "dmaengine: cppi41: Fix runtime PM timeouts with USB mass
      storage", and "dmaengine: cppi41: Fix oops in cppi41_runtime_resume",
      the pm_runtime_get/put() in cppi41_irq() is no longer needed. We now
      guarantee that cppi41 is enabled when dma is in use.
      
      We can still get pointless error -115 when musb is configured as a
      usb peripheral. That's because we should now check for the state of
      is_suspended instead.
      
      Let's just remove the now useless code and replace it with a WARN().
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      6610d0ed
    • T
      dmaengine: cppi41: Fix oops in cppi41_runtime_resume · 362f4562
      Tony Lindgren 提交于
      Commit fdea2d09 ("dmaengine: cppi41: Add basic PM runtime support")
      together with recent MUSB changes allowed USB and DMA on BeagleBone to idle
      when no cable is connected. But looks like few corner case issues still
      remain.
      
      Looks like just by re-plugging USB cable about ten or so times on BeagleBone
      when configured in USB peripheral mode we can get warnings and eventually
      trigger an oops in cppi41 DMA:
      
      WARNING: CPU: 0 PID: 14 at drivers/dma/cppi41.c:1154 cppi41_runtime_suspend+
      x28/0x38 [cppi41]
      ...
      
      WARNING: CPU: 0 PID: 14 at drivers/dma/cppi41.c:452
      push_desc_queue+0x94/0x9c [cppi41]
      ...
      
      Unable to handle kernel NULL pointer dereference at virtual
      address 00000104
      pgd = c0004000
      [00000104] *pgd=00000000
      Internal error: Oops: 805 [#1] SMP ARM
      ...
      [<bf0d92cc>] (cppi41_runtime_resume [cppi41]) from [<c0589838>]
      (__rpm_callback+0xc0/0x214)
      [<c0589838>] (__rpm_callback) from [<c05899ac>] (rpm_callback+0x20/0x80)
      [<c05899ac>] (rpm_callback) from [<c0589460>] (rpm_resume+0x504/0x78c)
      [<c0589460>] (rpm_resume) from [<c058a1a0>] (pm_runtime_work+0x60/0xa8)
      [<c058a1a0>] (pm_runtime_work) from [<c0156120>] (process_one_work+0x2b4/0x808)
      
      This is because of a race with runtime PM and cppi41_dma_issue_pending()
      as reported by Alexandre Bailon <abailon@baylibre.com> in earlier
      set of patches. Based on mailing list discussions we however came to the
      conclusion that a different fix from Alexandre's fix is needed in order
      to guarantee that DMA is really active when we try to use it.
      
      To fix the issue, we need to add a driver specific flag as we otherwise
      can have -EINPROGRESS state set by runtime PM and can't rely on
      pm_runtime_active() to tell us when we can use the DMA.
      
      And we need to make sure the DMA transfers get triggered in the queued
      order. So let's always queue the transfers, then flush the queue
      from both cppi41_dma_issue_pending() and cppi41_runtime_resume()
      as suggested by Grygorii Strashko <grygorii.strashko@ti.com> in an
      earlier example patch.
      
      For reference, this is also documented in Documentation/power/runtime_pm.txt
      in the example at the end of the file as pointed out by Grygorii Strashko
      <grygorii.strashko@ti.com>.
      
      Based on earlier patches from Alexandre Bailon <abailon@baylibre.com>
      and Grygorii Strashko <grygorii.strashko@ti.com> modified based on
      testing and what was discussed on the mailing lists.
      
      Fixes: fdea2d09 ("dmaengine: cppi41: Add basic PM runtime support")
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Bin Liu <b-liu@ti.com>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Patrick Titiano <ptitiano@baylibre.com>
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reported-by: NAlexandre Bailon <abailon@baylibre.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      362f4562
    • T
      dmaengine: cppi41: Fix runtime PM timeouts with USB mass storage · ae4a3e02
      Tony Lindgren 提交于
      Commit fdea2d09 ("dmaengine: cppi41: Add basic PM runtime support")
      added runtime PM support for cppi41, but had corner case issues. Some of
      the issues were fixed with commit 098de42a ("dmaengine: cppi41: Fix
      unpaired pm runtime when only a USB hub is connected"). That fix however
      caused a new regression where we can get error -115 messages with USB on
      BeagleBone when connecting a USB mass storage device to a hub.
      
      This is because when connecting a USB mass storage device to a hub, the
      initial DMA transfers can take over 200ms to complete and cppi41
      autosuspend delay times out.
      
      To fix the issue, we want to implement refcounting for chan_busy array
      that contains the active dma transfers. Increasing the autosuspend delay
      won't help as that the delay could be potentially seconds, and it's best
      to let the USB subsystem to deal with the timeouts on errors.
      
      The earlier attempt for runtime PM was buggy as the pm_runtime_get/put()
      calls could get unpaired easily as they did not follow the state of
      the chan_busy array as described in commit 098de42a ("dmaengine:
      cppi41: Fix unpaired pm runtime when only a USB hub is connected".
      
      Let's fix the issue by adding pm_runtime_get() to where a new transfer
      is added to the chan_busy array, and calls to pm_runtime_put() where
      chan_busy array entry is cleared. This prevents any autosuspend timeouts
      from happening while dma transfers are active.
      
      Fixes: 098de42a ("dmaengine: cppi41: Fix unpaired pm runtime when
      only a USB hub is connected")
      Fixes: fdea2d09 ("dmaengine: cppi41: Add basic PM runtime support")
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Bin Liu <b-liu@ti.com>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Patrick Titiano <ptitiano@baylibre.com>
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      ae4a3e02
  5. 17 11月, 2016 1 次提交
    • T
      dmaengine: cppi41: More PM runtime fixes · d5afc1b6
      Tony Lindgren 提交于
      Fix use of u32 instead of int for checking for negative errors values
      as pointed out by Dan Carpenter <dan.carpenter@oracle.com>.
      
      And while testing the PM runtime error path by randomly returning
      failed values in runtime resume, I noticed two more places that need
      fixing:
      
      - If pm_runtime_get_sync() fails in probe, we still need to do
        pm_runtime_put_sync() to keep the use count happy. We could call
        pm_runtime_put_noidle() on the error path, but we're just going
        to call pm_runtime_disable() after that so pm_runtime_put_sync()
        will do what we want
      
      - We should print an error if pm_runtime_get_sync() fails in
        cppi41_dma_alloc_chan_resources() so we know where it happens
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Fixes: 740b4be3 ("dmaengine: cpp41: Fix handling of error path")
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      d5afc1b6
  6. 14 11月, 2016 3 次提交
  7. 14 9月, 2016 1 次提交
  8. 07 9月, 2016 1 次提交
  9. 31 8月, 2016 2 次提交
  10. 08 8月, 2016 1 次提交
  11. 23 7月, 2016 1 次提交
  12. 11 4月, 2015 1 次提交
  13. 22 12月, 2014 1 次提交
  14. 09 12月, 2014 2 次提交
    • S
      dma: cppi41: add a delay while setting the TD bit · 754416e1
      Sebastian Andrzej Siewior 提交于
      The manual says that we need to (repeatedly) set the TearDown-bit for
      the endpoint in order to get the active transfer descriptor released.
      Doing this "real" quick over and over again seems to work but it also
      seems that the hardware might not have enough time to breathe. So I
      though, hey lets add a udelay() between between the individual sets
      of the bit.
      This change with the g_zero testcase resulted in a warning about missing
      transfer descriptor (we got the tear-down one). It seems that if the
      hardware has some time it manages to release the transfer-descriptor on
      the completion queue after the teaddown descriptor.
      With this change, I observe that the transfer descriptor is released
      after 20-30 retry loops.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      754416e1
    • S
      dma: cppi41: wait longer for the HW to return the descriptor · 6f9d7056
      Sebastian Andrzej Siewior 提交于
      For a "complete" teardown we have to wait until the teardown descriptor
      is returned by the hardware. The g_zero testcase "testusb -a -t 9" triggers
      the following warning quite reliable:
      
      |------------[ cut here ]------------
      |WARNING: CPU: 0 PID: 0 at drivers/dma/cppi41.c:609 cppi41_dma_control+0x198/0x304()
      |[<c003f84c>] (warn_slowpath_null) from [<c02be8d8>]
      |[<c02be8d8>] (cppi41_dma_control) from [<bf08d25c>]
      |[<bf08d25c>] (cppi41_dma_channel_abort [musb_hdrc])
      |[<bf08bc38>] (nuke.constprop.10 [musb_hdrc])
      |[<bf08bd08>] (musb_gadget_disable [musb_hdrc])
      |[<bf252524>] (disable_endpoints [usb_f_ss_lb])
      |[<bf2525d8>] (disable_source_sink [usb_f_ss_lb])
      |[<bf25260c>] (sourcesink_set_alt [usb_f_ss_lb])
      |[<bf23ad24>] (composite_setup [libcomposite])
      |[<bf08a2f4>] (musb_g_ep0_irq [musb_hdrc])
      |[<bf085ec4>] (musb_interrupt [musb_hdrc])
      |[<bf0aeaf4>] (dsps_interrupt [musb_dsps])
      |[<c0080ea8>] (handle_irq_event_percpu)
      |[<c008112c>] (handle_irq_event)
      |[<c008348c>] (handle_level_irq)
      |[<c00807a8>] (generic_handle_irq)
      |[<c000ee80>] (handle_IRQ)
      |[<c00085f0>] (omap3_intc_handle_irq)
      
      and complains about a TD descriptor which is not returned. I've been
      looking at several things and haven't noticed anything unusual that
      might lead to this.
      The manual says "to try again" until the descriptor comes out. I limited
      the amount of retries to 100 retries in order to avoid an infinite number
      of retries and so a busy-loop. Back then testing revealed that the
      number of retries were around 20-30 so 100 seemed a good upper limit.
      This g_zero test reaches without a problem 98 retries and it jumps
      sometimes to 101 on am335x-evm and so the WARN_ON() triggers. Same test
      run on beaglebone black and the retries start at 122 and my max value so
      far was at 128.
      So lets rise the limit to 500.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      6f9d7056
  15. 06 11月, 2014 1 次提交
  16. 20 10月, 2014 1 次提交
  17. 15 10月, 2014 1 次提交
  18. 01 7月, 2014 1 次提交
    • D
      dma: cppi41: handle 0-length packets · 13bbfb5c
      Daniel Mack 提交于
      When a 0-length packet is received on the bus, desc->pd0 yields 1,
      which confuses the driver's users. This information is clearly wrong
      and not in accordance to the datasheet, but it's been observed on an
      AM335x board, very reproducible.
      
      Fix this by looking at bit 19 in PD2 of the completed packet. This bit
      will tell us if a zero-length packet was received on a queue. If it's
      set, ignore the value in PD0 and report a total length of 0 instead.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      13bbfb5c
  19. 11 3月, 2014 1 次提交
  20. 20 1月, 2014 1 次提交
  21. 12 11月, 2013 4 次提交
  22. 25 10月, 2013 1 次提交
  23. 07 10月, 2013 1 次提交