Searched hist:"1 a11099d699a6bd86d2ed955a439c9df9c5e8c11" (Results 1 – 1 of 1) sorted by relevance
| /rk3399_rockchip-uboot/drivers/nvme/ |
| H A D | nvme.c | 1a11099d699a6bd86d2ed955a439c9df9c5e8c11 Mon Feb 08 13:31:54 UTC 2021 Andre Przywara <andre.przywara@arm.com> UPSTREAM: nvme: Always invalidate whole cqes[] array
At the moment nvme_read_completion_status() tries to invalidate a single member of the cqes[] array, which is shady as just a single entry is not cache line aligned. The structure is dictated by hardware, and with 16 bytes is smaller than any cache line we usually deal with. Also multiple entries need to be consecutive in memory, so we can't pad them to cover a whole cache line.
As a consequence we can only always invalidate all of them - U-Boot just uses two of them anyway. This is fine, as they are only ever read by the CPU (apart from the initial zeroing), so they can't become dirty.
Make this obvious by always invalidating the whole array, regardless of the entry number we are about to read. Also blow up the allocation size to cover whole cache lines, to avoid other heap allocations to sneak in.
Change-Id: Ic904dec7a3b0717fc68084e63dd431f8d4125dbd Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Tested-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit d0c04926cd054cf7360ec15913ac17a465f32603)
|