mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
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:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user