]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/dma/at_hdmac.c
amd64_edac: Cleanup NBCTL code
[mirror_ubuntu-zesty-kernel.git] / drivers / dma / at_hdmac.c
index 73a470b4809bfc2fbe1a67eaa0618837f7b9c697..3d7d705f026fa8f93a33565d17db57f8c264a9aa 100644 (file)
@@ -583,7 +583,6 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
                desc->lli.ctrlb = ctrlb;
 
                desc->txd.cookie = 0;
-               async_tx_ack(&desc->txd);
 
                if (!first) {
                        first = desc;
@@ -604,7 +603,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
        /* 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;
 
@@ -722,7 +721,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
                        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) {
@@ -749,8 +748,8 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
        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 @@ static void atc_issue_pending(struct dma_chan *chan)
 
        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 @@ 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)
 {