diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-07-19 08:22:34 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-07-19 08:22:34 +0000 |
| commit | 8a751ff65664d15b219515ad6d57e90261f14096 (patch) | |
| tree | b31f896679f136cbc7b4effec49371c2f2658d2c /sys/dev | |
| parent | 5a22958c3e3bd23469261f9f60f99f27e057ac46 (diff) | |
wm(4): Use CSR_WRITE_FLUSH, not bus_space_barrier.
The bus space is mapped non-prefetchable and non-cacheable, so there
is no need for bus_space_barrier and it might not even have any
effect -- bus_space_read/write are totally ordered for non-
prefetchable, non-cacheable mappings anyway. Presumably the intent
here was to wait for acknowledgment of the write from the device --
which bus_space_barrier does not guarantee, and which I expect
requires a read transaction as CSR_WRITE_FLUSH performs.
ok msaitoh@, knakahara@
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/if_wm.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/pci/if_wm.c b/sys/dev/pci/if_wm.c index 70418b856e4..f9830443086 100644 --- a/sys/dev/pci/if_wm.c +++ b/sys/dev/pci/if_wm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.744 2022/07/19 08:21:02 riastradh Exp $ */ +/* $NetBSD: if_wm.c,v 1.745 2022/07/19 08:22:34 riastradh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -82,7 +82,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.744 2022/07/19 08:21:02 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.745 2022/07/19 08:22:34 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -4923,8 +4923,7 @@ wm_flush_desc_rings(struct wm_softc *sc) txq->txq_next = WM_NEXTTX(txq, txq->txq_next); CSR_WRITE(sc, WMREG_TDT(0), txq->txq_next); - bus_space_barrier(sc->sc_st, sc->sc_sh, 0, 0, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + CSR_WRITE_FLUSH(sc); delay(250); preg = pci_conf_read(sc->sc_pc, sc->sc_pcitag, WM_PCI_DESCRING_STATUS); |
