Skip to contentSkip to conversation

disk: part: align buffer so it can be used with DMA enabled drivers

PATCH In review Stefan Agner 3 participants 3 messages Aug 23, 2017 – Aug 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 disk: part: align buffer so it can be used with DMA enabled drivers

From: Stefan Agner <[email protected]>

When using ISO partitions with a DMA enabled block device driver reading the ISO partition leads to unaligned DMA operations:
CACHE: Misaligned operation at range [bffb7da8, bffb85a8]

Align the buffer to make sure we pass a buffer which works for DMA operations.

---

 disk/part_iso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
disk/part_iso.c +1 -1
index bb8ed658f2..8aef251f4e 100644
@@ -24,7 +24,7 @@
 #undef CHECK_FOR_POWERPC_PLATTFORM
 #define CD_SECTSIZE 2048
 
-static unsigned char tmpbuf[CD_SECTSIZE];
+static unsigned char tmpbuf[CD_SECTSIZE] __aligned(ARCH_DMA_MINALIGN);
 
 unsigned long iso_dread(struct blk_desc *block_dev, lbaint_t start,
                         lbaint_t blkcnt, void *buffer)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 disk: part: align buffer so it can be used with DMA enabled drivers

Quoted 6 lines · Stefan Agner

From: Stefan Agner <[email protected]>

When using ISO partitions with a DMA enabled block device driver reading the ISO partition leads to unaligned DMA operations:
CACHE: Misaligned operation at range [bffb7da8, bffb85a8]

Quoted 9 lines

Align the buffer to make sure we pass a buffer which works for DMA operations.

---

 disk/part_iso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw
In reply to Stefan Agner
Quoted 11 lines · Stefan Agner

From: Stefan Agner <[email protected]>

When using ISO partitions with a DMA enabled block device driver reading the ISO partition leads to unaligned DMA operations:
CACHE: Misaligned operation at range [bffb7da8, bffb85a8]

Align the buffer to make sure we pass a buffer which works for DMA operations.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170826/36d515db/attachment.sig>