]> asedeno.scripts.mit.edu Git - linux.git/commit
bgmac: fix DMA rx corruption
authorFelix Fietkau <nbd@openwrt.org>
Tue, 14 Apr 2015 10:08:01 +0000 (12:08 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Apr 2015 18:57:11 +0000 (14:57 -0400)
commit4668ae1fbcab89af5ffbb161d4c70b25ce4c50f4
tree10bdada0183fa33d78be95ab81b4d7cba5839710
parent74b6f29163490d88ff53f7c54d0e4514bbf1630b
bgmac: fix DMA rx corruption

The driver needs to inform the hardware about the first invalid (not yet
filled) rx slot, by writing its DMA descriptor pointer offset to the
BGMAC_DMA_RX_INDEX register.

This register was set to a value exceeding the rx ring size, effectively
allowing the hardware constant access to the full ring, regardless of
which slots are initialized.

To fix this issue, always mark the last filled rx slot as invalid.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bgmac.c