Skip to content
Commit d0c04926 authored by Andre Przywara's avatar Andre Przywara Committed by Tom Rini
Browse files

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.

Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
Reviewed-by: default avatarMichael Trimarchi <michael@amarulasolutions.com>
Tested-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
parent d32211ee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment