summaryrefslogtreecommitdiff
path: root/drivers/nvme/nvme_show.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-08-22 18:15:14 +0300
committerTom Rini <trini@konsulko.com>2017-08-28 14:17:13 +0300
commit704e040a51d2456a6c56e79363279b230d37cef7 (patch)
treef07e9f4b860fb395195354820cdc6bdc4af60b57 /drivers/nvme/nvme_show.c
parent625a483cea6442da5d435830357c10ecc459f9c6 (diff)
downloadu-boot-704e040a51d2456a6c56e79363279b230d37cef7.tar.xz
nvme: Apply cache operations on the DMA buffers
So far cache operations are only applied on the submission queue and completion queue, but they are missing in other places like identify and block read/write routines. In order to correctly operate on the caches, the DMA buffer passed to identify routine must be allocated properly on the stack with the existing macro ALLOC_CACHE_ALIGN_BUFFER(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/nvme/nvme_show.c')
-rw-r--r--drivers/nvme/nvme_show.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/nvme/nvme_show.c b/drivers/nvme/nvme_show.c
index 5577e5de45..52351388e2 100644
--- a/drivers/nvme/nvme_show.c
+++ b/drivers/nvme/nvme_show.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <dm.h>
#include <errno.h>
+#include <memalign.h>
#include <nvme.h>
#include "nvme.h"
@@ -106,8 +107,10 @@ int nvme_print_info(struct udevice *udev)
{
struct nvme_ns *ns = dev_get_priv(udev);
struct nvme_dev *dev = ns->dev;
- struct nvme_id_ns buf_ns, *id = &buf_ns;
- struct nvme_id_ctrl buf_ctrl, *ctrl = &buf_ctrl;
+ ALLOC_CACHE_ALIGN_BUFFER(char, buf_ns, sizeof(struct nvme_id_ns));
+ struct nvme_id_ns *id = (struct nvme_id_ns *)buf_ns;
+ ALLOC_CACHE_ALIGN_BUFFER(char, buf_ctrl, sizeof(struct nvme_id_ctrl));
+ struct nvme_id_ctrl *ctrl = (struct nvme_id_ctrl *)buf_ctrl;
if (nvme_identify(dev, 0, 1, (dma_addr_t)ctrl))
return -EIO;