]> git.baikalelectronics.ru Git - kernel.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)
commit3bba3c9aa73eb3b037d5bdc3877c02228675b998
tree10bdada0183fa33d78be95ab81b4d7cba5839710
parent4ced78e693ae966554bb91b651c87dc9f9eceee1
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