Ticket #1049: madwifi-mb2.diff

File madwifi-mb2.diff, 1.0 kB (added by anders.lundstrom, 5 years ago)

Memory Barriers for IO Access 2

  • ath_hal/ah_os.h

    old new  
    145145 */ 
    146146 
    147147#if (AH_BYTE_ORDER == AH_BIG_ENDIAN) 
    148 #define _OS_REG_WRITE(_ah, _reg, _val) do {                            
    149         (0x4000 <= (_reg) && (_reg) < 0x5000) ?                        
    150          writel((_val), (_ah)->ah_sh + (_reg)) :       
    151          __raw_writel((_val), (_ah)->ah_sh + (_reg)); 
     148#define _OS_REG_WRITE(_ah, _reg, _val) do {                     
     149        (0x4000 <= (_reg) && (_reg) < 0x5000) ?                 
     150         writel((_val), (_ah)->ah_sh + (_reg)) :               
     151         ({__raw_writel((_val), (_ah)->ah_sh + (_reg)); mb();});
    152152} while (0) 
    153153#define _OS_REG_READ(_ah, _reg)                                 \ 
    154154        ((0x4000 <= (_reg) && (_reg) < 0x5000) ?                \ 
    155          readl((_ah)->ah_sh + (_reg)) : \ 
    156          __raw_readl((_ah)->ah_sh + (_reg))) 
     155         readl((_ah)->ah_sh + (_reg)) :                         \ 
     156         ({unsigned long __v = __raw_readl((_ah)->ah_sh +       \ 
     157          (_reg)); mb(); __v; })) 
    157158#else /* AH_LITTLE_ENDIAN */ 
    158159#define _OS_REG_WRITE(_ah, _reg, _val) do {                     \ 
    159160        writel(_val, (_ah)->ah_sh + (_reg));                    \