imx9: usdhc fix dmapreflight rejecting small unaligned buffers

imx9_dmapreflight() rejected unaligned buffers unconditionally, but
dmarecvsetup() has a bounce path via priv->rxbuffer for small
transfers. Add a buflen > sizeof(priv->rxbuffer) check so that
small reads (e.g. ext_csd 512-byte stack buffer) can use the
bounce buffer instead of failing with -EFAULT.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
buxiasen
2026-03-06 15:51:37 +08:00
committed by Xiang Xiao
parent 0b75df277d
commit 9e048af2c3
+1
View File
@@ -3131,6 +3131,7 @@ static int imx9_dmapreflight(struct sdio_dev_s *dev,
*/
if (buffer != priv->rxbuffer &&
buflen > sizeof(priv->rxbuffer) &&
(((uintptr_t)buffer & (USDHC_DATABUF_ALIGN - 1)) != 0 ||
((uintptr_t)(buffer + buflen) & (USDHC_DATABUF_ALIGN - 1)) != 0))
{