Commit c302214c authored by Christian Lütke-Stetzkamp's avatar Christian Lütke-Stetzkamp Committed by Greg Kroah-Hartman

staging: mt7621-mmc: Fix dma_map_sg may map to fewer entries

The dma_map_sg function may merge several sglist entries into one, the
return value has to be saved to consider that. The data->sg_count
field is the position, where it should be saved, like it is done in
other mmc host drivers. Also the count of mapped entries is needed for
the dma setup.
Signed-off-by: default avatarChristian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: default avatarNeilBrown <neil@brown.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 05e41c96
...@@ -1423,8 +1423,10 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq) ...@@ -1423,8 +1423,10 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
goto done; goto done;
dir = read ? DMA_FROM_DEVICE : DMA_TO_DEVICE; dir = read ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
(void)dma_map_sg(mmc_dev(mmc), data->sg, data->sg_len, dir); data->sg_count = dma_map_sg(mmc_dev(mmc), data->sg,
msdc_dma_setup(host, &host->dma, data->sg, data->sg_len); data->sg_len, dir);
msdc_dma_setup(host, &host->dma, data->sg,
data->sg_count);
/* then wait command done */ /* then wait command done */
if (msdc_command_resp(host, cmd, 1, CMD_TIMEOUT) != 0) if (msdc_command_resp(host, cmd, 1, CMD_TIMEOUT) != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment