You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/09/26 14:18:05 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7174: stm32h7:SDMMC fix unaligned access for buffers not on 32 bit boundaries

pkarashchenko commented on code in PR #7174:
URL: https://github.com/apache/incubator-nuttx/pull/7174#discussion_r980093372


##########
arch/arm/src/stm32h7/stm32_sdmmc.c:
##########
@@ -381,10 +382,14 @@ struct stm32_dev_s
 #if !defined(CONFIG_STM32H7_SDMMC_IDMA)
   struct work_s      cbfifo;          /* Monitor for Lame FIFO */
 #endif
-  uint8_t            rxfifo[FIFO_SIZE_IN_BYTES] /* To offload with IDMA */
+  uint8_t            rxfifo[FIFO_SIZE_IN_BYTES] /* To offload with IDMA and support un-alinged buffers */
                      aligned_data(ARMV7M_DCACHE_LINESIZE);
-#if defined(CONFIG_ARMV7M_DCACHE) && defined(CONFIG_STM32H7_SDMMC_IDMA)
-  bool               unaligned_rx; /* read buffer is not cache-line aligned */
+  bool               unaligned_rx; /* read buffer is not cache-line or 32 bit aligned */
+
+  /* Input dma buffer for unaligned transfers */
+#if defined(CONFIG_STM32H7_SDMMC_IDMA)
+  uint8_t sdmmc_rxbuffer[SDMMC_MAX_BLOCK_SIZE]
+  __attribute__((aligned(ARMV7M_DCACHE_LINESIZE)));

Review Comment:
   ```suggestion
     aligned_data(ARMV7M_DCACHE_LINESIZE);
   ```
   Just to use the same as at line 386



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org