lkml.org 
[lkml]   [2013]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be)
    From
    2013/2/12 Benjamin Herrenschmidt <benh@kernel.crashing.org>:
    > On Mon, 2013-02-11 at 16:57 +0100, Michal Simek wrote:
    >> But it reminds me that maybe the easiest solution is not to use endian
    >> accessors just use two simple macros which should work on all systems.
    >>
    >> #define <name>_readreg(offset) ({__raw_readl(offset); rmb(); })
    >> #define <name>_writereg(offset, val) ({wmb(); __raw_writel(val, offset); })
    >>
    >> which is probably the faster solution which add minimum additional code
    >> to driver and can also remove endian detection code.
    >
    > Except that rmb & wmb might not be the right barriers for IOs ...

    Arm is using __iormb in readX macros
    #define __iormb() rmb()
    but it is arm specific only that's why I have added there rmb().

    Thanks,
    Michal




    --
    Michal Simek, Ing. (M.Eng)
    w: www.monstr.eu p: +42-0-721842854
    Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
    Maintainer of Linux kernel - Xilinx Zynq ARM architecture
    Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


    \
     
     \ /
      Last update: 2013-02-12 12:01    [W:2.084 / U:0.400 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site