Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/dev/pci Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/49b4ebb25b76
branches:  netbsd-6
changeset: 774401:49b4ebb25b76
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Aug 09 08:00:55 2012 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #471):
        sys/dev/pci/if_wm.c: revision 1.230
        sys/dev/pci/if_wm.c: revision 1.231
  Add workaround for QEMU and the variants that fail on EEPROM access.
  This problem was discovered a few years ago, but some variants and
cloud services still have the bug. This problem is not NetBSD's bug
but qemus's bug. For NetBSD users, existence of buggy virtual machines
s sad thing, so we add a workaroud.
Fix the check of the device type in last commit.
Reported by Thomas Klausner.

diffstat:

 sys/dev/pci/if_wm.c |  20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 2c23712ace3a -r 49b4ebb25b76 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Thu Aug 09 07:53:30 2012 +0000
+++ b/sys/dev/pci/if_wm.c       Thu Aug 09 08:00:55 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.227.2.1 2012/06/28 16:06:36 riz Exp $      */
+/*     $NetBSD: if_wm.c,v 1.227.2.2 2012/08/09 08:00:55 martin Exp $   */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.227.2.1 2012/06/28 16:06:36 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.227.2.2 2012/08/09 08:00:55 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -4628,6 +4628,22 @@
                reg = CSR_READ(sc, WMREG_EECD) & ~(EECD_SK | EECD_DI);
                CSR_WRITE(sc, WMREG_EECD, reg);
 
+               /*
+                * XXX: workaround for a bug in qemu-0.12.x and prior
+                * and Xen.
+                *
+                * We use this workaround only for 82540 because qemu's
+                * e1000 act as 82540.
+                */
+               if (sc->sc_type == WM_T_82540) {
+                       reg |= EECD_SK;
+                       CSR_WRITE(sc, WMREG_EECD, reg);
+                       reg &= ~EECD_SK;
+                       CSR_WRITE(sc, WMREG_EECD, reg);
+                       delay(2);
+               }
+               /* XXX: end of workaround */
+               
                /* Set CHIP SELECT. */
                reg |= EECD_CS;
                CSR_WRITE(sc, WMREG_EECD, reg);



Home | Main Index | Thread Index | Old Index