summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-08-23 11:57:48 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-08-23 11:57:48 +0000
commitb1e1180427f0d6fee6292e2757e36feb758b0598 (patch)
tree24db459eb02ae691ffbb9b706f2d0d9038f19fcc /sys
parent577a449a61f7af2267afadc30038aecb11e91bfb (diff)
the first read or write in the crb space after you switch the windows
tends to be junk, except in the pci regs for some reason. read the crb window register back after setting it to force the junk to go away. this fixes some really weird issues i had.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_nxe.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c
index a051c75427a..ce2daa8427b 100644
--- a/sys/dev/pci/if_nxe.c
+++ b/sys/dev/pci/if_nxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nxe.c,v 1.42 2007/08/23 11:44:49 dlg Exp $ */
+/* $OpenBSD: if_nxe.c,v 1.43 2007/08/23 11:57:47 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -1932,12 +1932,16 @@ int
nxe_crb_set(struct nxe_softc *sc, int window)
{
int oldwindow = sc->sc_window;
+ u_int32_t r;
if (sc->sc_window != window) {
sc->sc_window = window;
- nxe_write(sc, NXE_WIN_CRB(sc->sc_function),
- window ? NXE_WIN_CRB_1 : NXE_WIN_CRB_0);
+ r = window ? NXE_WIN_CRB_1 : NXE_WIN_CRB_0;
+ nxe_write(sc, NXE_WIN_CRB(sc->sc_function), r);
+
+ if (nxe_read(sc, NXE_WIN_CRB(sc->sc_function)) != r)
+ printf("%s: crb window hasnt moved\n");
}
return (oldwindow);