freebsd-drivers Digest, Vol 310, Issue 2

prateek sethi prateekrootkey at gmail.com
Fri Nov 20 04:21:25 UTC 2015


Memory barrier

On Fri, Oct 9, 2015 at 5:30 PM, <freebsd-drivers-request at freebsd.org> wrote:

> Send freebsd-drivers mailing list submissions to
>         freebsd-drivers at freebsd.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.freebsd.org/mailman/listinfo/freebsd-drivers
> or, via email, send a message with subject or body 'help' to
>         freebsd-drivers-request at freebsd.org
>
> You can reach the person managing the list at
>         freebsd-drivers-owner at freebsd.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of freebsd-drivers digest..."
>
>
> Today's Topics:
>
>    1. Re: Memory barrier (John-Mark Gurney)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 8 Oct 2015 15:39:35 -0700
> From: John-Mark Gurney <jmg at funkthat.com>
> To: Leonardo Fogel <leonardofogel at yahoo.com.br>
> Cc: freebsd-drivers at freebsd.org
> Subject: Re: Memory barrier
> Message-ID: <20151008223935.GH67524 at funkthat.com>
> Content-Type: text/plain; charset=us-ascii
>
> Leonardo Fogel wrote this message on Sun, Sep 06, 2015 at 06:53 -0700:
> > Please, what are the correct barriers for the following cases?
> >
> > Case 1:
> >    bus_write_1(region_0, ...);
> >    /* barrier here */
> >    DELAY(some_time);
> >
> > Case 2:
> >    bus_write_1(region_0, ...);
> >    /* barrier here */
> >    bus_write_1(region_2, ...);
> >
> > In the first one, I want the write to reach the device before the thread
> busy-waits. As I understand it, bus_space_barrier(9) is not adequate,
> because it does not prevent the processor from executing instructions (or
> load/store to RAM) before the write completes.
> >
> > In the second one, I want the write to a device (e.g. power management)
> to complete before the write to another starts/completes. Again,
> bus_space_barrier() seems not to be adequate because it can not cover two
> regions.
> >
> > Thank you for your time.
>
> If this is a PCI device, you need to do a read from the device before
> it is guaranteed that all the bridges have flushed the writes to the
> device...  A barrier only guarantees from the processor's perspective
> that the write "has completed", but not that it will reach the device..
>
> If this is a different bus, then the rules are probably different...
>
> --
>   John-Mark Gurney                              Voice: +1 415 225 5579
>
>      "All that I will do, has been done, All that I have, has not."
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> freebsd-drivers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-drivers
> To unsubscribe, send any mail to "freebsd-drivers-unsubscribe at freebsd.org"
>
> ------------------------------
>
> End of freebsd-drivers Digest, Vol 310, Issue 2
> ***********************************************
>


More information about the freebsd-drivers mailing list