Selaa lähdekoodia

[realtek] Enable DAC only when built as a 64-bit binary

Some RTL8169 cards (observed with an RTL8169SC) crash and burn if DAC
is enabled, even if only 32-bit addresses are used.  Observed
behaviour includes system lockups and repeated transmission of garbage
data onto the wire.

This seems to be a known problem.  The Linux r8169 driver disables DAC
by default and provides a "use_dac" module parameter.

There appears to be no known test for determining whether or not DAC
will work.  As a workaround, enable DAC only if we are built as as
64-bit binary.  This at least eliminates the problem in the common
case of a 32-bit build, which will never use 64-bit addresses anyway.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 vuotta sitten
vanhempi
commit
0dacd54174
1 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  1. 7
    2
      src/drivers/net/realtek.c

+ 7
- 2
src/drivers/net/realtek.c Näytä tiedosto

@@ -878,10 +878,15 @@ static void realtek_detect ( struct realtek_nic *rtl ) {
878 878
 	/* The C+ Command register is present only on 8169 and 8139C+.
879 879
 	 * Try to enable C+ mode and PCI Dual Address Cycle (for
880 880
 	 * 64-bit systems), if supported.
881
+	 *
882
+	 * Note that enabling DAC seems to cause bizarre behaviour
883
+	 * (lockups, garbage data on the wire) on some systems, even
884
+	 * if only 32-bit addresses are used.
881 885
 	 */
882 886
 	cpcr = readw ( rtl->regs + RTL_CPCR );
883
-	cpcr |= ( RTL_CPCR_DAC | RTL_CPCR_MULRW | RTL_CPCR_CPRX |
884
-		  RTL_CPCR_CPTX );
887
+	cpcr |= ( RTL_CPCR_MULRW | RTL_CPCR_CPRX | RTL_CPCR_CPTX );
888
+	if ( sizeof ( physaddr_t ) > sizeof ( uint32_t ) )
889
+		cpcr |= RTL_CPCR_DAC;
885 890
 	writew ( cpcr, rtl->regs + RTL_CPCR );
886 891
 	check_cpcr = readw ( rtl->regs + RTL_CPCR );
887 892
 

Loading…
Peruuta
Tallenna