Message ID | 20210810081644.19353-3-tony@atomide.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/3] mmc: sdhci: Fix issue with uninitialized dma_slave_config | expand |
On Tue, 10 Aug 2021 at 10:16, Tony Lindgren <tony@atomide.com> wrote: > > Depending on the DMA driver being used, the struct dma_slave_config may > need to be initialized to zero for the unused data. > > For example, we have three DMA drivers using src_port_window_size and > dst_port_window_size. If these are left uninitialized, it can cause DMA > failures. > > For moxart, this is probably not currently an issue but is still good to > fix though. > > Fixes: 1b66e94e6b99 ("mmc: moxart: Add MOXA ART SD/MMC driver") > Cc: Jonas Jensen <jonas.jensen@gmail.com> > Cc: Vinod Koul <vkoul@kernel.org> > Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com> > Signed-off-by: Tony Lindgren <tony@atomide.com> Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/host/moxart-mmc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c > --- a/drivers/mmc/host/moxart-mmc.c > +++ b/drivers/mmc/host/moxart-mmc.c > @@ -628,6 +628,7 @@ static int moxart_probe(struct platform_device *pdev) > host->dma_chan_tx, host->dma_chan_rx); > host->have_dma = true; > > + memset(&cfg, 0, sizeof(cfg)); > cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; > cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; > > -- > 2.32.0
diff --git a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c --- a/drivers/mmc/host/moxart-mmc.c +++ b/drivers/mmc/host/moxart-mmc.c @@ -628,6 +628,7 @@ static int moxart_probe(struct platform_device *pdev) host->dma_chan_tx, host->dma_chan_rx); host->have_dma = true; + memset(&cfg, 0, sizeof(cfg)); cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures. For moxart, this is probably not currently an issue but is still good to fix though. Fixes: 1b66e94e6b99 ("mmc: moxart: Add MOXA ART SD/MMC driver") Cc: Jonas Jensen <jonas.jensen@gmail.com> Cc: Vinod Koul <vkoul@kernel.org> Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/mmc/host/moxart-mmc.c | 1 + 1 file changed, 1 insertion(+)