Skip to content

Commit

Permalink
[realtek] Allow reaction time between writing RTL_CAPR and reading RT…
Browse files Browse the repository at this point in the history
…L_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>
  • Loading branch information
mcb30 committed Apr 30, 2013
1 parent e411b37 commit 592755e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/drivers/net/realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,9 @@ static void realtek_legacy_poll_rx ( struct net_device *netdev ) {
rtl->rx_offset = ( ( rtl->rx_offset + 3 ) & ~3 );
rtl->rx_offset = ( rtl->rx_offset % RTL_RXBUF_LEN );
writew ( ( rtl->rx_offset - 16 ), rtl->regs + RTL_CAPR );

/* Give chip time to react before rechecking RTL_CR */
readw ( rtl->regs + RTL_CAPR );
}
}

Expand Down

0 comments on commit 592755e

Please sign in to comment.