Module Name:    src
Committed By:   msaitoh
Date:           Mon Feb 16 00:25:52 UTC 2015

Modified Files:
        src/sys/dev/pci: if_wm.c

Log Message:
 Fix a bug that the first access to NVM is failed on 8254[17] which use
SPI EEPROM. Observed on Dell PowerEdge [12]850. Thanks Tom Ivar Helbekkmo
for debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.312 src/sys/dev/pci/if_wm.c:1.313
--- src/sys/dev/pci/if_wm.c:1.312	Sun Feb 15 21:32:33 2015
+++ src/sys/dev/pci/if_wm.c	Mon Feb 16 00:25:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.312 2015/02/15 21:32:33 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.313 2015/02/16 00:25:52 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.312 2015/02/15 21:32:33 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.313 2015/02/16 00:25:52 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1757,6 +1757,7 @@ wm_attach(device_t parent, device_t self
 	case WM_T_82541_2:
 	case WM_T_82547:
 	case WM_T_82547_2:
+		sc->sc_flags |= WM_F_LOCK_EECD;
 		reg = CSR_READ(sc, WMREG_EECD);
 		if (reg & EECD_EE_TYPE) {
 			/* SPI */
@@ -1772,7 +1773,6 @@ wm_attach(device_t parent, device_t self
 				sc->sc_nvm_addrbits = 6;
 			}
 		}
-		sc->sc_flags |= WM_F_LOCK_EECD;
 		break;
 	case WM_T_82571:
 	case WM_T_82572:

Reply via email to