• Maciej W. Rozycki's avatar
    MIPS: Define MMIO ordering barriers · 4ae0452b
    Maciej W. Rozycki authored
    Define MMIO ordering barriers as separate operations so as to allow
    making places where such a barrier is required distinct from places
    where a memory or a DMA barrier is needed.
    
    Architecturally MIPS does not specify ordering requirements for uncached
    bus accesses such as MMIO operations normally use and therefore explicit
    barriers have to be inserted between MMIO accesses where unspecified
    ordering of operations would cause unpredictable results.
    
    MIPS MMIO ordering barriers are implemented using the same underlying
    mechanism that memory or a DMA barrier ordering barriers use, that is
    either a suitable SYNC instruction or a platform-specific `wbflush'
    call.  However platforms may implement different ordering rules for
    different kinds of bus activity, so having a separate API makes it
    possible to remove unnecessary barriers and avoid a performance hit they
    may cause due to unrelated bus activity by making their implementation
    expand to nil while keeping the necessary ones.
    
    Also having distinct barriers for each kind of use makes it easier for
    the reader to understand what code has been intended to do.
    Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
    Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
    Patchwork: https://patchwork.linux-mips.org/patch/20862/
    Cc: Ralf Baechle <ralf@linux-mips.org>
    4ae0452b
io.h 19.2 KB