netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IOAT: ioatdma needs to to play nice in a multi-dma-client world
@ 2007-08-23  0:12 Shannon Nelson
  2007-08-25  6:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Shannon Nelson @ 2007-08-23  0:12 UTC (permalink / raw)
  To: netdev, davem, akpm, linux-kernel; +Cc: shannon.nelson, dan.j.williams, jgarzik

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: Shannon Nelson <shannon.nelson@intel.com>
---

 drivers/dma/ioatdma.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c
index 2d1f178..41b18c5 100644
--- a/drivers/dma/ioatdma.c
+++ b/drivers/dma/ioatdma.c
@@ -191,17 +191,12 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
 	int i;
 	LIST_HEAD(tmp_list);
 
-	/*
-	 * In-use bit automatically set by reading chanctrl
-	 * If 0, we got it, if 1, someone else did
-	 */
-	chanctrl = readw(ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
-	if (chanctrl & IOAT_CHANCTRL_CHANNEL_IN_USE)
-		return -EBUSY;
+	/* have we already been set up? */
+	if (!list_empty(&ioat_chan->free_desc))
+		return INITIAL_IOAT_DESC_COUNT;
 
         /* Setup register to interrupt and write completion status on error */
-	chanctrl = IOAT_CHANCTRL_CHANNEL_IN_USE |
-		IOAT_CHANCTRL_ERR_INT_EN |
+	chanctrl = IOAT_CHANCTRL_ERR_INT_EN |
 		IOAT_CHANCTRL_ANY_ERR_ABORT_EN |
 		IOAT_CHANCTRL_ERR_COMPLETION_EN;
         writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
@@ -282,11 +277,6 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
 			in_use_descs - 1);
 
 	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 *

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] IOAT: ioatdma needs to to play nice in a multi-dma-client world
  2007-08-23  0:12 [PATCH] IOAT: ioatdma needs to to play nice in a multi-dma-client world Shannon Nelson
@ 2007-08-25  6:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-08-25  6:03 UTC (permalink / raw)
  To: shannon.nelson; +Cc: netdev, akpm, linux-kernel, dan.j.williams, jgarzik

From: Shannon Nelson <shannon.nelson@intel.com>
Date: Wed, 22 Aug 2007 17:12:18 -0700

> 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: Shannon Nelson <shannon.nelson@intel.com>

Applied, thanks Shannon.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-25  6:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-23  0:12 [PATCH] IOAT: ioatdma needs to to play nice in a multi-dma-client world Shannon Nelson
2007-08-25  6:03 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).