]> git.baikalelectronics.ru Git - kernel.git/commit
ftgmac100: Use a scratch buffer for failed RX allocations
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 6 Apr 2017 01:02:45 +0000 (11:02 +1000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Apr 2017 22:39:45 +0000 (15:39 -0700)
commit062bc2258990ad1fa49c3eb645664e3b31bd4fbb
tree14e9d4bc90f89704122ac9400acb3587cf48e2c3
parent07459c85d851af6b2877e9b29aff9f3ab41f401a
ftgmac100: Use a scratch buffer for failed RX allocations

We can occasionally fail to allocate new RX buffers at
runtime or when starting the driver. At the moment the
latter just fails to open which is fine but the former
leaves stale DMA pointers in the ring.

Instead, use a scratch page and have all RX ring descriptors
point to it by default unless a proper buffer can be allocated.

It will help later on when re-initializing the whole ring
at runtime on link changes since there is no clean failure
path there unlike open().

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/faraday/ftgmac100.c