[PATCH 2/2] WIP: Fix unreliable networking

Cyril Bur cyril.bur at au1.ibm.com
Tue Dec 8 11:02:12 AEDT 2015


This is not the final version of this patch as the fix only serves to raise
the "how did this ever work" question which I have yet to answer.

The reason this DOES work is that the hardware must be told to move data
from its RX FIFO to system memory where the driver can then consume it.
There are two mechanisms for this, a 'do this automatically' register which
can be set on device init or simply a 'copy data now' polling style which
is what this patch does.

Both options were investigated and as the entire network stack of u-boot is
polling and we're only polling when we expect to receive a message it make
sense to continue this down to the hardware level as well, doing the
automatic copy actually causes more noise and unnecessary work.

Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 drivers/net/aspeednic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/aspeednic.c b/drivers/net/aspeednic.c
index 0bfc8c1..dca4ecc 100644
--- a/drivers/net/aspeednic.c
+++ b/drivers/net/aspeednic.c
@@ -1301,6 +1301,7 @@ static int aspeednic_recv(struct eth_device* dev)
 
   for ( ; ; )
   {
+    OUTL(dev, POLL_DEMAND, RXPD_REG);
     status = (s32)le32_to_cpu(rx_ring[rx_new].status);
 
     if ((status & RXPKT_STATUS) == 0) {
-- 
2.6.3



More information about the openbmc mailing list