The temporary buffer may be passed to DMA capable device,
make sure it is cache aligned.

Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
---
 drivers/scsi/scsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 6caeb3fcdd0..5e1cb230833 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -14,6 +14,7 @@
 #include <env.h>
 #include <libata.h>
 #include <log.h>
+#include <memalign.h>
 #include <part.h>
 #include <pci.h>
 #include <scsi.h>
@@ -42,7 +43,7 @@ const struct pci_device_id scsi_device_list[] = { 
SCSI_DEV_LIST };
 #endif
 static struct scsi_cmd tempccb;        /* temporary scsi command buffer */
 
-static unsigned char tempbuff[512]; /* temporary data buffer */
+DEFINE_CACHE_ALIGN_BUFFER(u8, tempbuff, 512);  /* temporary data buffer */
 
 #if !defined(CONFIG_DM_SCSI)
 static int scsi_max_devs; /* number of highest available scsi device */
-- 
2.40.1

Reply via email to