Skip to content

Commit

Permalink
mmc: android-goldfish: fix bad logic of sg_copy_{from,to}_buffer conv…
Browse files Browse the repository at this point in the history
…ersion

The conversion to sg_copy_{from,to}_buffer has been done in the wrong
way. sg_copy_to_buffer is a copy from an SG list to a linear buffer so
it can't replace memcpy(dest, host->virt_base, data->sg->length) where
dest is the virtual address of the SG. Same for sg_copy_from_buffer
but in the opposite way.

Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Suggested-by: Douglas Gilbert <dgilbert@interlog.com>
Fixes: 53d7e09 ("mmc: android-goldfish: use sg_copy_{from,to}_buffer")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Ludovic Desroches authored and Ulf Hansson committed Aug 21, 2018
1 parent 19f5e9e commit 17e96d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mmc/host/android-goldfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
* We don't really have DMA, so we need
* to copy from our platform driver buffer
*/
sg_copy_to_buffer(data->sg, 1, host->virt_base,
sg_copy_from_buffer(data->sg, 1, host->virt_base,
data->sg->length);
}
host->data->bytes_xfered += data->sg->length;
Expand Down Expand Up @@ -393,7 +393,7 @@ static void goldfish_mmc_prepare_data(struct goldfish_mmc_host *host,
* We don't really have DMA, so we need to copy to our
* platform driver buffer
*/
sg_copy_from_buffer(data->sg, 1, host->virt_base,
sg_copy_to_buffer(data->sg, 1, host->virt_base,
data->sg->length);
}
}
Expand Down

0 comments on commit 17e96d8

Please sign in to comment.