[PATCH] nvme: add cache flush in get/set_features

Neil Armstrong narmstrong at baylibre.com
Fri Feb 26 15:13:18 CET 2021


On Amlogic G12A platforms, the NVME probe timeouts at get/set_feature(),
adding a cache flush solves the timeout.

Signed-off-by: Neil Armstrong <narmstrong at baylibre.com>
---
 drivers/nvme/nvme.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index 5d6331ad34..44c00a0309 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -487,11 +487,11 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
 	c.features.nsid = cpu_to_le32(nsid);
 	c.features.prp1 = cpu_to_le64(dma_addr);
 	c.features.fid = cpu_to_le32(fid);
-
 	/*
-	 * TODO: add cache invalidate operation when the size of
+	 * TODO: add better cache invalidate operation when the size of
 	 * the DMA buffer is known
 	 */
+	invalidate_dcache_all();
 
 	return nvme_submit_admin_cmd(dev, &c, result);
 }
@@ -508,9 +508,10 @@ int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
 	c.features.dword11 = cpu_to_le32(dword11);
 
 	/*
-	 * TODO: add cache flush operation when the size of
+	 * TODO: add better cache flush operation when the size of
 	 * the DMA buffer is known
 	 */
+	invalidate_dcache_all();
 
 	return nvme_submit_admin_cmd(dev, &c, result);
 }
-- 
2.25.1



More information about the U-Boot mailing list