Skip to content

[HELP] Is the stm32_dmapreflight check necessary (stm32h7) #16412

@snikeguo

Description

@snikeguo

Description

Is the stm32_dmapreflight check necessary? I can still successfully mount the filesystem and read/write when CONFIG_ARCH_HAVE_SDIO_PREFLIGHT is set to 'n'. However, setting it to 'y' results in a "dcache unaligned" error.

#if defined(CONFIG_ARMV7M_DCACHE) && !defined(CONFIG_ARMV7M_DCACHE_WRITETHROUGH)
  /* buffer alignment is required for DMA transfers with dcache in buffered
   * mode (not write-through) because a) arch_invalidate_dcache could lose
   * buffered writes and b) arch_flush_dcache could corrupt adjacent memory
   * if the maddr and the mend+1, the next next address are not on
   * ARMV7M_DCACHE_LINESIZE boundaries.
   */

  if (buffer != priv->rxfifo &&
      (((uintptr_t)buffer & (ARMV7M_DCACHE_LINESIZE - 1)) != 0 ||
      ((uintptr_t)(buffer + buflen) & (ARMV7M_DCACHE_LINESIZE - 1)) != 0))
    {
      mcerr("dcache unaligned "
            "buffer:%p end:%p\n",
            buffer, buffer + buflen - 1);
      return -EFAULT;
    }
#endif

  return 0;

Image

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions