Skip to content

Commit

Permalink
x86: poll waiting for I/OAT DMA channel status
Browse files Browse the repository at this point in the history
For certain system configurations a 5 usec udelay before checking I/OAT DMA
channel status is sometimes not sufficient, resulting in a false failure
status and unnecessary freeing of channel resources.  Conversely, for many
configurations 5 usec is longer than necessary.

Loop for up to 20 usec waiting for successful status before failing.

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dimitri Sivanich authored and Dan Williams committed May 27, 2011
1 parent 5dbd05d commit 19d78a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/dma/ioat/dma_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ int ioat2_alloc_chan_resources(struct dma_chan *c)
struct ioat_ring_ent **ring;
u64 status;
int order;
int i = 0;

/* have we already been set up? */
if (ioat->ring)
Expand Down Expand Up @@ -547,8 +548,11 @@ int ioat2_alloc_chan_resources(struct dma_chan *c)
ioat2_start_null_desc(ioat);

/* check that we got off the ground */
udelay(5);
status = ioat_chansts(chan);
do {
udelay(1);
status = ioat_chansts(chan);
} while (i++ < 20 && !is_ioat_active(status) && !is_ioat_idle(status));

if (is_ioat_active(status) || is_ioat_idle(status)) {
set_bit(IOAT_RUN, &chan->state);
return 1 << ioat->alloc_order;
Expand Down

0 comments on commit 19d78a6

Please sign in to comment.