Pārlūkot izejas kodu

[realtek] Allow reaction time between writing RTL_CAPR and reading RTL_CR

Some older RTL8139 chips seem to not immediately update the
RTL_CR.BUFE bit in response to a write to RTL_CAPR.  This results in
iPXE seeing a spurious zero-length received packet, and thereafter
being out of sync with the hardware's RX ring offset.

Fix by inserting an extra PCI read cycle after writing to RTL_CAPR, to
give the chip time to react before we next read RTL_CR.

Reported-by: Gelip <mrgelip@gmail.com>
Tested-by: Gelip <mrgelip@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 gadus atpakaļ
vecāks
revīzija
592755eccf
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3
    0
      src/drivers/net/realtek.c

+ 3
- 0
src/drivers/net/realtek.c Parādīt failu

@@ -861,6 +861,9 @@ static void realtek_legacy_poll_rx ( struct net_device *netdev ) {
861 861
 		rtl->rx_offset = ( ( rtl->rx_offset + 3 ) & ~3 );
862 862
 		rtl->rx_offset = ( rtl->rx_offset % RTL_RXBUF_LEN );
863 863
 		writew ( ( rtl->rx_offset - 16 ), rtl->regs + RTL_CAPR );
864
+
865
+		/* Give chip time to react before rechecking RTL_CR */
866
+		readw ( rtl->regs + RTL_CAPR );
864 867
 	}
865 868
 }
866 869
 

Notiek ielāde…
Atcelt
Saglabāt