]> Git Repo - linux.git/commitdiff
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
authorLinus Torvalds <[email protected]>
Mon, 17 Jan 2011 18:54:41 +0000 (10:54 -0800)
committerLinus Torvalds <[email protected]>
Mon, 17 Jan 2011 18:54:41 +0000 (10:54 -0800)
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx: (63 commits)
  ARM: PL08x: cleanup comments
  Update CONFIG_MD_RAID6_PQ to CONFIG_RAID6_PQ in drivers/dma/iop-adma.c
  ARM: PL08x: fix a warning
  Fix dmaengine_submit() return type
  dmaengine: at_hdmac: fix race while monitoring channel status
  dmaengine: at_hdmac: flags located in first descriptor
  dmaengine: at_hdmac: use subsys_initcall instead of module_init
  dmaengine: at_hdmac: no need set ACK in new descriptor
  dmaengine: at_hdmac: trivial add precision to unmapping comment
  dmaengine: at_hdmac: use dma_address to program DMA hardware
  pch_dma: support new device ML7213 IOH
  ARM: PL08x: prevent dma_set_runtime_config() reconfiguring memcpy channels
  ARM: PL08x: allow dma_set_runtime_config() to return errors
  ARM: PL08x: fix locking between prepare function and submit function
  ARM: PL08x: introduce 'phychan_hold' to hold on to physical channels
  ARM: PL08x: put txd's on the pending list in pl08x_tx_submit()
  ARM: PL08x: rename 'desc_list' as 'pend_list'
  ARM: PL08x: implement unmapping of memcpy buffers
  ARM: PL08x: store prep_* flags in async_tx structure
  ARM: PL08x: shrink srcbus/dstbus in txd structure
  ...

1  2 
drivers/dma/Kconfig
drivers/dma/at_hdmac.c
drivers/dma/fsldma.c
drivers/dma/intel_mid_dma.c
include/linux/dmaengine.h

diff --combined drivers/dma/Kconfig
index ef138731c0ead5008e43bca8bd0aaf51177fa55f,1b61d3aa2962d0757920e463f4457206d5c547d7..1c28816152fa3169254681cbe76f758f99192e59
@@@ -109,7 -109,7 +109,7 @@@ config FSL_DM
  
  config MPC512X_DMA
        tristate "Freescale MPC512x built-in DMA engine support"
 -      depends on PPC_MPC512x
 +      depends on PPC_MPC512x || PPC_MPC831x
        select DMA_ENGINE
        ---help---
          Enable support for the Freescale MPC512x built-in DMA engine.
@@@ -200,11 -200,16 +200,16 @@@ config PL330_DM
          platform_data for a dma-pl330 device.
  
  config PCH_DMA
-       tristate "Topcliff (Intel EG20T) PCH DMA support"
+       tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7213 IOH DMA support"
        depends on PCI && X86
        select DMA_ENGINE
        help
-         Enable support for the Topcliff (Intel EG20T) PCH DMA engine.
+         Enable support for Intel EG20T PCH DMA engine.
+         This driver also can be used for OKI SEMICONDUCTOR ML7213 IOH(Input/
+         Output Hub) which is for IVI(In-Vehicle Infotainment) use.
+         ML7213 is companion chip for Intel Atom E6xx series.
+         ML7213 is completely compatible for Intel EG20T PCH.
  
  config IMX_SDMA
        tristate "i.MX SDMA support"
diff --combined drivers/dma/at_hdmac.c
index ea0ee81cff53e266643140eb752ef3ba26289c6a,40f2bf4ae474eeaa74c55c7000612b8cfddfe46a..3d7d705f026fa8f93a33565d17db57f8c264a9aa
@@@ -253,7 -253,7 +253,7 @@@ atc_chain_complete(struct at_dma_chan *
        /* move myself to free_list */
        list_move(&desc->desc_node, &atchan->free_list);
  
-       /* unmap dma addresses */
+       /* unmap dma addresses (not on slave channels) */
        if (!atchan->chan_common.private) {
                struct device *parent = chan2parent(&atchan->chan_common);
                if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
@@@ -583,7 -583,6 +583,6 @@@ atc_prep_dma_memcpy(struct dma_chan *ch
                desc->lli.ctrlb = ctrlb;
  
                desc->txd.cookie = 0;
-               async_tx_ack(&desc->txd);
  
                if (!first) {
                        first = desc;
        /* set end-of-link to the last link descriptor of list*/
        set_desc_eol(desc);
  
-       desc->txd.flags = flags; /* client is in control of this ack */
+       first->txd.flags = flags; /* client is in control of this ack */
  
        return &first->txd;
  
@@@ -670,7 -669,7 +669,7 @@@ atc_prep_slave_sg(struct dma_chan *chan
                        if (!desc)
                                goto err_desc_get;
  
-                       mem = sg_phys(sg);
+                       mem = sg_dma_address(sg);
                        len = sg_dma_len(sg);
                        mem_width = 2;
                        if (unlikely(mem & 3 || len & 3))
                        if (!desc)
                                goto err_desc_get;
  
-                       mem = sg_phys(sg);
+                       mem = sg_dma_address(sg);
                        len = sg_dma_len(sg);
                        mem_width = 2;
                        if (unlikely(mem & 3 || len & 3))
                        desc->lli.daddr = mem;
                        desc->lli.ctrla = ctrla
                                        | ATC_DST_WIDTH(mem_width)
 -                                      | len >> mem_width;
 +                                      | len >> reg_width;
                        desc->lli.ctrlb = ctrlb;
  
                        if (!first) {
        first->txd.cookie = -EBUSY;
        first->len = total_len;
  
-       /* last link descriptor of list is responsible of flags */
-       prev->txd.flags = flags; /* client is in control of this ack */
+       /* first link descriptor of list is responsible of flags */
+       first->txd.flags = flags; /* client is in control of this ack */
  
        return &first->txd;
  
@@@ -854,11 -853,11 +853,11 @@@ static void atc_issue_pending(struct dm
  
        dev_vdbg(chan2dev(chan), "issue_pending\n");
  
+       spin_lock_bh(&atchan->lock);
        if (!atc_chan_is_enabled(atchan)) {
-               spin_lock_bh(&atchan->lock);
                atc_advance_work(atchan);
-               spin_unlock_bh(&atchan->lock);
        }
+       spin_unlock_bh(&atchan->lock);
  }
  
  /**
@@@ -1210,7 -1209,7 +1209,7 @@@ static int __init at_dma_init(void
  {
        return platform_driver_probe(&at_dma_driver, at_dma_probe);
  }
module_init(at_dma_init);
subsys_initcall(at_dma_init);
  
  static void __exit at_dma_exit(void)
  {
diff --combined drivers/dma/fsldma.c
index e5e172d21692d60a81fce6a9ed06e5807c57b370,531230b87976fa40a4c9793e3cf0d08f82733c2c..4de947a450fce30a1bf747c1d5f4ce454f3df2a4
@@@ -1,7 -1,7 +1,7 @@@
  /*
   * Freescale MPC85xx, MPC83xx DMA Engine support
   *
-  * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+  * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. All rights reserved.
   *
   * Author:
   *   Zhang Wei <[email protected]>, Jul 2007
@@@ -50,11 -50,9 +50,11 @@@ static void dma_init(struct fsldma_cha
                 * EIE - Error interrupt enable
                 * EOSIE - End of segments interrupt enable (basic mode)
                 * EOLNIE - End of links interrupt enable
 +               * BWC - Bandwidth sharing among channels
                 */
 -              DMA_OUT(chan, &chan->regs->mr, FSL_DMA_MR_EIE
 -                              | FSL_DMA_MR_EOLNIE | FSL_DMA_MR_EOSIE, 32);
 +              DMA_OUT(chan, &chan->regs->mr, FSL_DMA_MR_BWC
 +                              | FSL_DMA_MR_EIE | FSL_DMA_MR_EOLNIE
 +                              | FSL_DMA_MR_EOSIE, 32);
                break;
        case FSL_DMA_IP_83XX:
                /* Set the channel to below modes:
@@@ -1324,6 -1322,8 +1324,8 @@@ static int __devinit fsldma_of_probe(st
        fdev->common.device_control = fsl_dma_device_control;
        fdev->common.dev = &op->dev;
  
+       dma_set_mask(&(op->dev), DMA_BIT_MASK(36));
        dev_set_drvdata(&op->dev, fdev);
  
        /*
index 78266382797e6d172e0cfcf7642485f5536c9625,5397d8535e0a70394920231f5228a9f607be13a4..798f46a4590d4eed64d1ee5a66ed01bac56c665c
@@@ -664,11 -664,20 +664,20 @@@ static struct dma_async_tx_descriptor *
        /*calculate CTL_LO*/
        ctl_lo.ctl_lo = 0;
        ctl_lo.ctlx.int_en = 1;
-       ctl_lo.ctlx.dst_tr_width = mids->dma_slave.dst_addr_width;
-       ctl_lo.ctlx.src_tr_width = mids->dma_slave.src_addr_width;
        ctl_lo.ctlx.dst_msize = mids->dma_slave.src_maxburst;
        ctl_lo.ctlx.src_msize = mids->dma_slave.dst_maxburst;
  
+       /*
+        * Here we need some translation from "enum dma_slave_buswidth"
+        * to the format for our dma controller
+        *              standard        intel_mid_dmac's format
+        *               1 Byte                 0b000
+        *               2 Bytes                0b001
+        *               4 Bytes                0b010
+        */
+       ctl_lo.ctlx.dst_tr_width = mids->dma_slave.dst_addr_width / 2;
+       ctl_lo.ctlx.src_tr_width = mids->dma_slave.src_addr_width / 2;
        if (mids->cfg_mode == LNW_DMA_MEM_TO_MEM) {
                ctl_lo.ctlx.tt_fc = 0;
                ctl_lo.ctlx.sinc = 0;
@@@ -746,8 -755,18 +755,18 @@@ static struct dma_async_tx_descriptor *
        BUG_ON(!mids);
  
        if (!midc->dma->pimr_mask) {
-               pr_debug("MDMA: SG list is not supported by this controller\n");
-               return  NULL;
+               /* We can still handle sg list with only one item */
+               if (sg_len == 1) {
+                       txd = intel_mid_dma_prep_memcpy(chan,
+                                               mids->dma_slave.dst_addr,
+                                               mids->dma_slave.src_addr,
+                                               sgl->length,
+                                               flags);
+                       return txd;
+               } else {
+                       pr_warn("MDMA: SG list is not supported by this controller\n");
+                       return  NULL;
+               }
        }
  
        pr_debug("MDMA: SG Length = %d, direction = %d, Flags = %#lx\n",
                pr_err("MDMA: Prep memcpy failed\n");
                return NULL;
        }
        desc = to_intel_mid_dma_desc(txd);
        desc->dirn = direction;
        ctl_lo.ctl_lo = desc->ctl_lo;
@@@ -1021,11 -1041,6 +1041,6 @@@ static irqreturn_t intel_mid_dma_interr
  
        /*DMA Interrupt*/
        pr_debug("MDMA:Got an interrupt on irq %d\n", irq);
-       if (!mid) {
-               pr_err("ERR_MDMA:null pointer mid\n");
-               return -EINVAL;
-       }
        pr_debug("MDMA: Status %x, Mask %x\n", tfr_status, mid->intr_mask);
        tfr_status &= mid->intr_mask;
        if (tfr_status) {
@@@ -1060,8 -1075,8 +1075,8 @@@ static irqreturn_t intel_mid_dma_interr
   * mid_setup_dma -    Setup the DMA controller
   * @pdev: Controller PCI device structure
   *
 - * Initilize the DMA controller, channels, registers with DMA engine,
 - * ISR. Initilize DMA controller channels.
 + * Initialize the DMA controller, channels, registers with DMA engine,
 + * ISR. Initialize DMA controller channels.
   */
  static int mid_setup_dma(struct pci_dev *pdev)
  {
@@@ -1217,7 -1232,7 +1232,7 @@@ static void middma_shutdown(struct pci_
   * @pdev: Controller PCI device structure
   * @id: pci device id structure
   *
 - * Initilize the PCI device, map BARs, query driver data.
 + * Initialize the PCI device, map BARs, query driver data.
   * Call setup_dma to complete contoller and chan initilzation
   */
  static int __devinit intel_mid_dma_probe(struct pci_dev *pdev,
index 8cd00ad98d3773a4afa44e5e7ad6eaac184e6d71,830935b7c49cf8ab616a804e1b54459b09616502..9bebd7f16ef1468f36438047f2ef58f8beb363dd
@@@ -532,7 -532,7 +532,7 @@@ static inline int dmaengine_resume(stru
        return dmaengine_device_control(chan, DMA_RESUME, 0);
  }
  
- static inline int dmaengine_submit(struct dma_async_tx_descriptor *desc)
+ static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc)
  {
        return desc->tx_submit(desc);
  }
@@@ -824,8 -824,6 +824,8 @@@ enum dma_status dma_sync_wait(struct dm
  #ifdef CONFIG_DMA_ENGINE
  enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
  void dma_issue_pending_all(void);
 +struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param);
 +void dma_release_channel(struct dma_chan *chan);
  #else
  static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
  {
  }
  static inline void dma_issue_pending_all(void)
  {
 -      do { } while (0);
 +}
 +static inline struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask,
 +                                            dma_filter_fn fn, void *fn_param)
 +{
 +      return NULL;
 +}
 +static inline void dma_release_channel(struct dma_chan *chan)
 +{
  }
  #endif
  
@@@ -851,6 -842,8 +851,6 @@@ void dma_async_device_unregister(struc
  void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
  struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
  #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
 -struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param);
 -void dma_release_channel(struct dma_chan *chan);
  
  /* --- Helper iov-locking functions --- */
  
This page took 0.077447 seconds and 4 git commands to generate.