Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci - Correct NVM word size check in wm_nvm_version(...
details: https://anonhg.NetBSD.org/src/rev/81d374327414
branches: trunk
changeset: 356436:81d374327414
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Tue Sep 26 08:25:56 2017 +0000
description:
- Correct NVM word size check in wm_nvm_version() to prevent
"EERD polling failed" error on attach. if_wm.c rev. 1.534 was not perfect.
Reported by ozaki-r@.
- Print NVM offset and word count when EERD polling failed.
XXX pullup-8.
diffstat:
sys/dev/pci/if_wm.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (37 lines):
diff -r ce46fac97b2c -r 81d374327414 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Tue Sep 26 07:42:05 2017 +0000
+++ b/sys/dev/pci/if_wm.c Tue Sep 26 08:25:56 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.538 2017/09/26 07:42:06 knakahara Exp $ */
+/* $NetBSD: if_wm.c,v 1.539 2017/09/26 08:25:56 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.538 2017/09/26 07:42:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.539 2017/09/26 08:25:56 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -11768,7 +11768,8 @@
CSR_WRITE(sc, WMREG_EERD, eerd);
rv = wm_poll_eerd_eewr_done(sc, WMREG_EERD);
if (rv != 0) {
- aprint_error_dev(sc->sc_dev, "EERD polling failed\n");
+ aprint_error_dev(sc->sc_dev, "EERD polling failed: "
+ "offset=%d. wordcnt=%d\n", offset, wordcnt);
break;
}
data[i] = (CSR_READ(sc, WMREG_EERD) >> EERD_DATA_SHIFT);
@@ -12549,7 +12550,7 @@
}
/* Assume the Option ROM area is at avove NVM_SIZE */
- if ((sc->sc_nvm_wordsize >= NVM_SIZE) && check_optionrom
+ if ((sc->sc_nvm_wordsize > NVM_SIZE) && check_optionrom
&& (wm_nvm_read(sc, NVM_OFF_COMB_VER_PTR, 1, &off) == 0)) {
/* Option ROM Version */
if ((off != 0x0000) && (off != 0xffff)) {
Home |
Main Index |
Thread Index |
Old Index