net: bcmgenet: Reset RBUF on first open
authorPhil Elwell <phil@raspberrypi.com>
Fri, 25 Sep 2020 14:07:23 +0000 (15:07 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 27 Jan 2021 19:13:20 +0000 (19:13 +0000)
commit359dd1b79767d4d8bab4e4561dd6c2ada051a17b
treec63c62eb3613f9b9c8f20f855f1e915c62023ec8
parent8560ca0b2ad99b851a44ab39157cdb366d926c45
net: bcmgenet: Reset RBUF on first open

If the RBUF logic is not reset when the kernel starts then there
may be some data left over from any network boot loader. If the
64-byte packet headers are enabled then this can be fatal.

Extend bcmgenet_dma_disable to do perform the reset, but not when
called from bcmgenet_resume in order to preserve a wake packet.

N.B. This different handling of resume is just based on a hunch -
why else wouldn't one reset the RBUF as well as the TBUF? If this
isn't the case then it's easy to change the patch to make the RBUF
reset unconditional.

See: https://github.com/raspberrypi/linux/issues/3850

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/net/ethernet/broadcom/genet/bcmgenet.c