提交 e4223976 编写于 作者: S Shannon Nelson 提交者: David S. Miller

[IOAT]: ioatdma needs to to play nice in a multi-dma-client world

Now that the DMA engine has a multi-client interface, fix the ioatdma
driver to play along.  At the same time, remove a couple of unnecessary
reads and writes.
Signed-off-by: NShannon Nelson <shannon.nelson@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 97a1ad43
...@@ -191,17 +191,12 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan) ...@@ -191,17 +191,12 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
int i; int i;
LIST_HEAD(tmp_list); LIST_HEAD(tmp_list);
/* /* have we already been set up? */
* In-use bit automatically set by reading chanctrl if (!list_empty(&ioat_chan->free_desc))
* If 0, we got it, if 1, someone else did return INITIAL_IOAT_DESC_COUNT;
*/
chanctrl = readw(ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
if (chanctrl & IOAT_CHANCTRL_CHANNEL_IN_USE)
return -EBUSY;
/* Setup register to interrupt and write completion status on error */ /* Setup register to interrupt and write completion status on error */
chanctrl = IOAT_CHANCTRL_CHANNEL_IN_USE | chanctrl = IOAT_CHANCTRL_ERR_INT_EN |
IOAT_CHANCTRL_ERR_INT_EN |
IOAT_CHANCTRL_ANY_ERR_ABORT_EN | IOAT_CHANCTRL_ANY_ERR_ABORT_EN |
IOAT_CHANCTRL_ERR_COMPLETION_EN; IOAT_CHANCTRL_ERR_COMPLETION_EN;
writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET); writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
...@@ -282,11 +277,6 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan) ...@@ -282,11 +277,6 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
in_use_descs - 1); in_use_descs - 1);
ioat_chan->last_completion = ioat_chan->completion_addr = 0; ioat_chan->last_completion = ioat_chan->completion_addr = 0;
/* Tell hw the chan is free */
chanctrl = readw(ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
chanctrl &= ~IOAT_CHANCTRL_CHANNEL_IN_USE;
writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
} }
static struct dma_async_tx_descriptor * static struct dma_async_tx_descriptor *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册