svn commit: r219356 - stable/8/sys/dev/sis
Pyun YongHyeon
yongari at FreeBSD.org
Mon Mar 7 00:42:23 UTC 2011
Author: yongari
Date: Mon Mar 7 00:42:22 2011
New Revision: 219356
URL: http://svn.freebsd.org/changeset/base/219356
Log:
MFC r219102:
Make sure changing ownership of RX descriptor to be done as last
operation. Previously ownership was transferred to hardware before
setting address of new RX buffer such that it was possible for
hardware to use wrong RX buffer address.
While here keep compiler from re-ordering instructions by declaring
descriptor members volatile. Memory barriers would do the same job
but volatile is supposed to be cheaper than using memory barriers,
especially on MP systems.
Submitted by: marius
Modified:
stable/8/sys/dev/sis/if_sis.c
stable/8/sys/dev/sis/if_sisreg.h
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/sys/dev/sis/if_sis.c
==============================================================================
--- stable/8/sys/dev/sis/if_sis.c Sun Mar 6 23:15:24 2011 (r219355)
+++ stable/8/sys/dev/sis/if_sis.c Mon Mar 7 00:42:22 2011 (r219356)
@@ -1568,8 +1568,8 @@ sis_newbuf(struct sis_softc *sc, struct
sc->sis_rx_sparemap = map;
bus_dmamap_sync(sc->sis_rx_tag, rxd->rx_dmamap, BUS_DMASYNC_PREREAD);
rxd->rx_m = m;
- rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN);
rxd->rx_desc->sis_ptr = htole32(SIS_ADDR_LO(segs[0].ds_addr));
+ rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN);
return (0);
}
Modified: stable/8/sys/dev/sis/if_sisreg.h
==============================================================================
--- stable/8/sys/dev/sis/if_sisreg.h Sun Mar 6 23:15:24 2011 (r219355)
+++ stable/8/sys/dev/sis/if_sisreg.h Mon Mar 7 00:42:22 2011 (r219356)
@@ -337,8 +337,8 @@
struct sis_desc {
/* SiS hardware descriptor section */
uint32_t sis_next;
- uint32_t sis_cmdsts;
- uint32_t sis_ptr;
+ volatile uint32_t sis_cmdsts;
+ volatile uint32_t sis_ptr;
};
#define SIS_CMDSTS_BUFLEN 0x00000FFF
More information about the svn-src-stable
mailing list