Skip to content

Commit

Permalink
net: ethernet: davinci_cpdma: decrease the desc count when cleaning u…
Browse files Browse the repository at this point in the history
…p the remaining packets

chan->count is used by rx channel. If the desc count is not updated by
the clean up loop in cpdma_chan_stop, the value written to the rxfree
register in cpdma_chan_start will be incorrect.

Signed-off-by: Tao Hou <hotforest@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
htbegin authored and David S. Miller committed Oct 3, 2012
1 parent da15864 commit ffb5ba9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/ti/davinci_cpdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ int cpdma_chan_stop(struct cpdma_chan *chan)

next_dma = desc_read(desc, hw_next);
chan->head = desc_from_phys(pool, next_dma);
chan->count--;
chan->stats.teardown_dequeue++;

/* issue callback without locks held */
Expand Down

0 comments on commit ffb5ba9

Please sign in to comment.