Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 2015 09:51:21 +0530
From:      prateek sethi <prateekrootkey@gmail.com>
To:        freebsd-drivers@freebsd.org
Subject:   Re: freebsd-drivers Digest, Vol 310, Issue 2
Message-ID:  <CABD8d0qJ%2Bi%2BVaoOi5Zcjo_7ctjvRbutuSRknWvUpkY4nrnQQvQ@mail.gmail.com>
In-Reply-To: <mailman.36.1444392000.41924.freebsd-drivers@freebsd.org>

index | next in thread | previous in thread | raw e-mail

Memory barrier

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

> Send freebsd-drivers mailing list submissions to
>         freebsd-drivers@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@freebsd.org
>
> You can reach the person managing the list at
>         freebsd-drivers-owner@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@funkthat.com>
> To: Leonardo Fogel <leonardofogel@yahoo.com.br>
> Cc: freebsd-drivers@freebsd.org
> Subject: Re: Memory barrier
> Message-ID: <20151008223935.GH67524@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@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-drivers
> To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org"
>
> ------------------------------
>
> End of freebsd-drivers Digest, Vol 310, Issue 2
> ***********************************************
>


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABD8d0qJ%2Bi%2BVaoOi5Zcjo_7ctjvRbutuSRknWvUpkY4nrnQQvQ>