Home
last modified time | relevance | path

Searched hist:"8 ceda4e546425baf0b56fd29ffd3b58f17b4040e" (Results 1 – 1 of 1) sorted by relevance

/rk3399_rockchip-uboot/drivers/nvme/
H A Dnvme.c8ceda4e546425baf0b56fd29ffd3b58f17b4040e Wed Jun 10 19:18:23 UTC 2020 Jagan Teki <jagan@amarulasolutions.com> UPSTREAM: nvme: Invalidate dcache before submitting admin cmd

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 <andre.przywara@arm.com>
Change-Id: Ib38e7ef860cb86a210eefe187720d98d354af7fe
Reported-by: Suniel Mahesh <sunil@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Suniel Mahesh <sunil@amarulasolutions.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 1a027a90aaa65ea429a55035f0316eadd0d83180)