From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 25 Jun 2020 10:39:19 -0400 Subject: [PATCH V2] nvme: Invalidate dcache before submitting admin cmd In-Reply-To: <20200610191823.21143-1-michael@amarulasolutions.com> References: <20200610191823.21143-1-michael@amarulasolutions.com> Message-ID: <20200625143919.GL8432@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 Wed, Jun 10, 2020 at 09:18:23PM +0200, Michael Trimarchi wrote: > From: Jagan Teki > > This patch try to avoids eviction of dirty lines during DMA > transfer. The code right now execute the following step: > > - allocate the buffer > - start a dma operation using the non-coherent dma buffer > - invalidate cache lines associated with the buffer > - read the buffer > > This can lead to reading back not valid information, because the cache > controller could evict dirty cache lines belonging to the buffer *after* > the DMA operation has started to fill the DRAM. > In order to avoid this, a new invalidation is required *before* starting > the DMA operation. The patch just adds an invalidation before submitting > the DMA command. > > Example below shows the nvme disk scan result without the following > patch > > => nvme scan > nvme_get_info_from_identify: nn = 544502629, vwc = 100, > sn = dev_0T, mn = `?\?, fr = t_part, mdts = 105 > > So, invalidating the cache before submitting the admin command, > fix the cpu read. > > Cc: Andr? Przywara > Reported-by: Suniel Mahesh > Signed-off-by: Michael Trimarchi > Signed-off-by: Jagan Teki > Tested-by: Suniel Mahesh > Reviewed-by: Bin Meng Applied (back on June 23rd) 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: