Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys/dev/sdmmc



Module Name:    src
Committed By:   yurix
Date:           Wed Aug 12 10:03:18 UTC 2026

Modified Files:
        src/sys/dev/sdmmc: sdmmc.c sdmmc_mem.c

Log Message:
sdmmc: dmamap_load bounce buffer on demand

When using a bounce buffer, cmd->c_dmamap->dm_segs[0]->ds_len did not agree with cmd->c_datalen because the bounce buffer is loaded once at initialization, so cmd->c_dmamap->dm_segs[0]->ds_len never 
gets updated before executing a sdmmc command.

This is problematic when the dmamap is passed on to an API like fdt_dma that treats the dmamap as the source of truth.

This problem probably hasn't surfaced yet because it needs three preconditions:
- using bounce buffers is already an edge case for when we can't allocate block size aligned dma memory
- the driver needs CAPS_DMA, but not CAPS_MULTI_SEG_DMA
- the driver needs to use cmd->c_dmamap->dm_segs[0]->ds_len and not cmd->c_datalen

The fix is to bus_dmamap_load the bounce buffer just when we need it. This allows us to load it with the correct size.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/sdmmc/sdmmc.c
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/sdmmc/sdmmc_mem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index