From: Dan Williams Date: Mon, 17 May 2010 23:30:58 +0000 (-0700) Subject: Merge branch 'ioat' into dmaengine X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0b28330e39bbe0ffee4c56b09fc415fcec595ea3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge branch 'ioat' into dmaengine --- 0b28330e39bbe0ffee4c56b09fc415fcec595ea3 diff --cc drivers/dma/ioat/dma_v3.c index d1adbf35268c,e2a23952172d..1cdd22e1051b --- a/drivers/dma/ioat/dma_v3.c +++ b/drivers/dma/ioat/dma_v3.c @@@ -443,12 -408,12 +408,12 @@@ ioat3_tx_status(struct dma_chan *c, dma { struct ioat2_dma_chan *ioat = to_ioat2_chan(c); - if (ioat_is_complete(c, cookie, done, used) == DMA_SUCCESS) + if (ioat_tx_status(c, cookie, txstate) == DMA_SUCCESS) return DMA_SUCCESS; - ioat3_cleanup_poll(ioat); + ioat3_cleanup(ioat); - return ioat_is_complete(c, cookie, done, used); + return ioat_tx_status(c, cookie, txstate); } static struct dma_async_tx_descriptor * diff --cc include/linux/dmaengine.h index 17456571ff7a,cb234979fc6b..5204f018931b --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@@ -248,23 -234,67 +249,82 @@@ struct dma_async_tx_descriptor struct dma_async_tx_descriptor *next; struct dma_async_tx_descriptor *parent; spinlock_t lock; + #endif }; + #ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH + static inline void txd_lock(struct dma_async_tx_descriptor *txd) + { + } + static inline void txd_unlock(struct dma_async_tx_descriptor *txd) + { + } + static inline void txd_chain(struct dma_async_tx_descriptor *txd, struct dma_async_tx_descriptor *next) + { + BUG(); + } + static inline void txd_clear_parent(struct dma_async_tx_descriptor *txd) + { + } + static inline void txd_clear_next(struct dma_async_tx_descriptor *txd) + { + } + static inline struct dma_async_tx_descriptor *txd_next(struct dma_async_tx_descriptor *txd) + { + return NULL; + } + static inline struct dma_async_tx_descriptor *txd_parent(struct dma_async_tx_descriptor *txd) + { + return NULL; + } + + #else + static inline void txd_lock(struct dma_async_tx_descriptor *txd) + { + spin_lock_bh(&txd->lock); + } + static inline void txd_unlock(struct dma_async_tx_descriptor *txd) + { + spin_unlock_bh(&txd->lock); + } + static inline void txd_chain(struct dma_async_tx_descriptor *txd, struct dma_async_tx_descriptor *next) + { + txd->next = next; + next->parent = txd; + } + static inline void txd_clear_parent(struct dma_async_tx_descriptor *txd) + { + txd->parent = NULL; + } + static inline void txd_clear_next(struct dma_async_tx_descriptor *txd) + { + txd->next = NULL; + } + static inline struct dma_async_tx_descriptor *txd_parent(struct dma_async_tx_descriptor *txd) + { + return txd->parent; + } + static inline struct dma_async_tx_descriptor *txd_next(struct dma_async_tx_descriptor *txd) + { + return txd->next; + } + #endif + +/** + * struct dma_tx_state - filled in to report the status of + * a transfer. + * @last: last completed DMA cookie + * @used: last issued DMA cookie (i.e. the one in progress) + * @residue: the remaining number of bytes left to transmit + * on the selected transfer for states DMA_IN_PROGRESS and + * DMA_PAUSED if this is implemented in the driver, else 0 + */ +struct dma_tx_state { + dma_cookie_t last; + dma_cookie_t used; + u32 residue; +}; + /** * struct dma_device - info on the entity supplying DMA services * @chancnt: how many DMA channels are supported