From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 19 Mar 2021 16:41:50 -0400 Subject: [RFC PATCH] nvme: Always invalidate whole cqes[] array In-Reply-To: <20210208133154.12645-1-andre.przywara@arm.com> References: <20210208133154.12645-1-andre.przywara@arm.com> Message-ID: <20210319204150.GS1310@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Feb 08, 2021 at 01:31:54PM +0000, Andre Przywara wrote: > At the moment nvme_read_completion_status() tries to invidate 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: Andre Przywara > Reviewed-by: Bin Meng > Reviewed-by: Michael Trimarchi > Tested-by: Neil Armstrong Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: