1. 23 4月, 2014 6 次提交
  2. 14 4月, 2014 1 次提交
    • S
      dma: edma: fix incorrect SG list handling · 5fc68a6c
      Sekhar Nori 提交于
      The code to handle any length SG lists calls edma_resume()
      even before edma_start() is called. This is incorrect
      because edma_resume() enables edma events on the channel
      after which CPU (in edma_start) cannot clear posted
      events by writing to ECR (per the EDMA user's guide).
      
      Because of this EDMA transfers fail to start if due
      to some reason there is a pending EDMA event registered
      even before EDMA transfers are started. This can happen if
      an EDMA event is a byproduct of device initialization.
      
      Fix this by calling edma_resume() only if it is not the
      first batch of MAX_NR_SG elements.
      
      Without this patch, MMC/SD fails to function on DA850 EVM
      with DMA. The behaviour is triggered by specific IP and
      this can explain why the issue was not reported before
      (example with MMC/SD on AM335x).
      
      Tested on DA850 EVM and AM335x EVM-SK using MMC/SD card.
      
      Cc: stable@vger.kernel.org # v3.12.x+
      Cc: Joel Fernandes <joelf@ti.com>
      Acked-by: NJoel Fernandes <joelf@ti.com>
      Tested-by: NJon Ringle <jringle@gridpoint.com>
      Tested-by: NAlexander Holler <holler@ahsoftware.de>
      Reported-by: NJon Ringle <jringle@gridpoint.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      5fc68a6c
  3. 06 3月, 2014 1 次提交
  4. 19 12月, 2013 1 次提交
  5. 13 11月, 2013 1 次提交
  6. 12 11月, 2013 1 次提交
    • J
      dma: edma: Add support for Cyclic DMA · 50a9c707
      Joel Fernandes 提交于
      Using the PaRAM configuration function that we split for reuse by the
      different DMA types, we implement Cyclic DMA support.
      For the cyclic case, we pass different configuration parameters to this
      function, and handle all the Cyclic-specific functionality separately.
      
      Callbacks to the DMA users are handled using vchan_cyclic_callback in
      the virt-dma layer. Linking is handled the same way as the slave SG case
      except for the last slot where we link it back to the first one in a
      cyclic fashion.
      
      For continuity, we check for cases where no.of periods is great than the
      MAX number of slots the driver can allocate for a particular descriptor
      and error out on such cases.
      Signed-off-by: NJoel Fernandes <joelf@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      50a9c707
  7. 31 10月, 2013 1 次提交
  8. 30 10月, 2013 1 次提交
  9. 25 10月, 2013 3 次提交
  10. 21 10月, 2013 2 次提交
  11. 11 10月, 2013 1 次提交
  12. 17 9月, 2013 1 次提交
  13. 04 9月, 2013 5 次提交
    • J
      dma: edma: Remove limits on number of slots · 5622ff1a
      Joel Fernandes 提交于
      With this series, this check is no longer required and
      we shouldn't need to reject drivers DMA'ing more than the
      MAX number of slots.
      Signed-off-by: NJoel Fernandes <joelf@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      5622ff1a
    • J
      dma: edma: Leave linked to Null slot instead of DUMMY slot · b267b3bc
      Joel Fernandes 提交于
      Dummy slot has been used as a way for missed-events not to be
      reported as missing. This has been particularly troublesome for cases
      where we might want to temporarily pause all incoming events.
      
      For EDMA DMAC, there is no way to do any such pausing of events as
      the occurence of the "next" event is not software controlled.
      Using "edma_pause" in IRQ handlers doesn't help as by then the event
      in concern from the slave is already missed.
      
      Linking a dummy slot, is seen to absorb these events which we didn't
      want to miss. So we don't link to dummy, but instead leave it linked
      to NULL set, allow an error condition and detect the channel that
      missed it.
      
      Consider the case where we have a scatter-list like:
      SG1->SG2->SG3->SG4->SG5->SG6->Null
      
      For ex, for a MAX_NR_SG of 2, earlier we were splitting this as:
      SG1->SG2->Null
      SG3->SG4->Null
      SG5->SG6->Null
      
      Now we split it as
      SG1->SG2->Null
      SG3->SG4->Null
      SG5->SG6->Dummy
      
      This approach results in lesser unwanted interrupts that occur
      for the last list split. The Dummy slot has the property of not
      raising an error condition if events are missed unlike the Null
      slot. We are OK with this as we're done with processing the
      whole list once we reach Dummy.
      Signed-off-by: NJoel Fernandes <joelf@ti.com>
      [modifed duplicate s-o-b & patch title]
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      b267b3bc
    • J
      dma: edma: Find missed events and issue them · c5f47990
      Joel Fernandes 提交于
      In an effort to move to using Scatter gather lists of any size with
      EDMA as discussed at [1] instead of placing limitations on the driver,
      we work through the limitations of the EDMAC hardware to find missed
      events and issue them.
      
      The sequence of events that require this are:
      
      For the scenario where MAX slots for an EDMA channel is 3:
      
      SG1 -> SG2 -> SG3 -> SG4 -> SG5 -> SG6 -> Null
      
      The above SG list will have to be DMA'd in 2 sets:
      
      (1) SG1 -> SG2 -> SG3 -> Null
      (2) SG4 -> SG5 -> SG6 -> Null
      
      After (1) is succesfully transferred, the events from the MMC controller
      donot stop coming and are missed by the time we have setup the transfer
      for (2). So here, we catch the events missed as an error condition and
      issue them manually.
      
      In the second part of the patch, we make handle the NULL slot cases:
      For crypto IP, we continue to receive events even continuously in
      NULL slot, the setup of the next set of SG elements happens after
      the error handler executes. This is results in some recursion problems.
      Due to this, we continously receive error interrupts when we manually
      trigger an event from the error handler.
      
      We fix this, by first detecting if the Channel is currently transferring
      from a NULL slot or not, that's where the edma_read_slot in the error
      callback from interrupt handler comes in. With this we can determine if
      the set up of the next SG list has completed, and we manually trigger
      only in this case. If the setup has _not_ completed, we are still in NULL
      so we just set a missed flag and allow the manual triggerring to happen
      in edma_execute which will be eventually called. This fixes the above
      mentioned race conditions seen with the crypto drivers.
      
      [1] http://marc.info/?l=linux-omap&m=137416733628831&w=2Signed-off-by: NJoel Fernandes <joelf@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      c5f47990
    • J
      dma: edma: Write out and handle MAX_NR_SG at a given time · 53407062
      Joel Fernandes 提交于
      Process SG-elements in batches of MAX_NR_SG if they are greater
      than MAX_NR_SG. Due to this, at any given time only those many
      slots will be used in the given channel no matter how long the
      scatter list is. We keep track of how much has been written
      inorder to process the next batch of elements in the scatter-list
      and detect completion.
      
      For such intermediate transfer completions (one batch of MAX_NR_SG),
      make use of pause and resume functions instead of start and stop
      when such intermediate transfer is in progress or completed as we
      donot want to clear any pending events.
      Signed-off-by: NJoel Fernandes <joelf@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      53407062
    • J
      dma: edma: Setup parameters to DMA MAX_NR_SG at a time · 6fbe24da
      Joel Fernandes 提交于
      Changes are made here for configuring existing parameters to support
      DMA'ing them out in batches as needed.
      
      Also allocate as many as slots as needed by the SG list, but not more
      than MAX_NR_SG. Then these slots will be reused accordingly.
      For ex, if MAX_NR_SG=10, and number of SG entries is 40, still only
      10 slots will be allocated to DMA the entire SG list of size 40.
      
      Also enable TC interrupts for slots that are a last in a current
      iteration, or that fall on a MAX_NR_SG boundary.
      Signed-off-by: NJoel Fernandes <joelf@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      6fbe24da
  14. 05 8月, 2013 1 次提交
  15. 18 6月, 2013 1 次提交
  16. 14 2月, 2013 1 次提交
  17. 20 1月, 2013 1 次提交
    • M
      dma: edma: fix slave config dependency on direction · 661f7cb5
      Matt Porter 提交于
      The edma_slave_config() implementation depends on the
      direction field such that it will not properly configure
      a slave channel when called without direction set.
      
      This fixes the implementation so that the slave config
      is copied as is and prep_slave_sg() handles the
      direction dependent handling. spi-omap2-mcspi and
      omap_hsmmc both expose this bug as they configure the
      slave channel config from a common path with an unconfigured
      direction field.
      Signed-off-by: NMatt Porter <mporter@ti.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      661f7cb5
  18. 04 1月, 2013 1 次提交
    • G
      Drivers: dma: remove __dev* attributes. · 4bf27b8b
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitconst,
      and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Viresh Kumar <viresh.linux@gmail.com>
      Cc: Dan Williams <djbw@fb.com>
      Cc: Vinod Koul <vinod.koul@intel.com>
      Cc: Barry Song <baohua.song@csr.com>
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Alexander Duyck <alexander.h.duyck@intel.com>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Jassi Brar <jassisinghbrar@gmail.com>
      Cc: Dave Jiang <dave.jiang@intel.com>
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4bf27b8b
  19. 29 11月, 2012 2 次提交
  20. 01 9月, 2012 1 次提交