mci: sdhci: initialize dma state on non-data commands
PATCH 1/1 mci: sdhci: initialize dma state on non-data commands
Commands without data will leave the dma parameter uninitialized in sdhci_setup_data_dma(). Drivers then decide whether to set SDHCI_DMA_EN based on this uninitialized data. This seems to be mostly harmless as the host controllers seem to ignore this bit on non-data commands, but it's still a bit confusing. Make sure to always return a valid state.
--- drivers/mci/sdhci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mci/sdhci.c +4 -1
@@ -478,8 +478,11 @@ void sdhci_setup_data_dma(struct sdhci *sdhci, struct mci_data *data,struct device *dev =sdhci_dev (sdhci);int nbytes; -if (!data) +if (!data) { +if (dma) + *dma =SDHCI_NO_DMA ;return ; + }sdhci_setup_data_pio (sdhci, data);
Signature · 1 line
2.47.1
Sascha Hauer
AppliedQuoted 8 lines · Lucas Stach
Commands without data will leave the dma parameter uninitialized in
sdhci_setup_data_dma(). Drivers then decide whether to setSDHCI_DMA_ENbased on this uninitialized data. This seems to be mostly harmless as the host controllers seem to ignore this bit on non-data commands, but it's still a bit confusing. Make sure to always return a valid state.[...]
Applied, thanks!
[1/1] mci: sdhci: initialize dma state on non-data commands
https://git.pengutronix.de/cgit/barebox/commit/?id=ce07b7ed0266 (link may not be stable)
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>