Skip to content

mmcsd_sdio: SDIO_RECVSETUP/SENDSETUP return values ignored on the non-DMA data paths #20399

Closed

Description

@rikaken2004

In drivers/mmcsd/mmcsd_sdio.c the return value of SDIO_RECVSETUP is discarded on the non-DMA read paths, so when the lower half fails to set up the receive the driver still issues CMD17/CMD18 and the failure only surfaces later as an unrelated-looking transfer timeout:

  • mmcsd_readsingle() — line 1665
  • mmcsd_readmultiple() — line 1821

The DMA paths in the same functions check SDIO_DMARECVSETUP and bail out (:1654-1661, :1810-1818), which makes the unchecked non-DMA paths look like an oversight. The write side has the same asymmetry: SDIO_SENDSETUP goes unchecked in mmcsd_writesingle() (:2016) and mmcsd_writemultiple() (:2268), while the DMA send paths check theirs. There are a few more unchecked sites as well (:573, :2839, :3431, :3568, :3696).

The fix is to check the return value, SDIO_CANCEL and propagate the error, mirroring the DMA paths. Happy to open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions