Re: [PATCH] spi: imx: correct handling of MXC_CSPIRXDATA value endianness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26.05.23 16:09, Ahmad Fatoum wrote:
>> -	writel(val, spi_imx->base + MXC_CSPITXDATA);
>> +	__raw_writel((__force u32)cpu_to_be32(val),
>> +		     spi_imx->base + MXC_CSPITXDATA);
>>  }

On more thing: __raw_writel doesn't involve a write barrier (at least
on ARM). That means above code introduces a bug as the CPU may now reorder
writes that were sequential before. Both iowrite32be() and readl()
have a __iowmb(); on ARM before doing the write itself.

>>  
>>  /* MX51 eCSPI */
>>
>>
>>
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux