Skip to content

Commit 17e96d8

Browse files
ldesrochesstorulf
authored andcommitted
mmc: android-goldfish: fix bad logic of sg_copy_{from,to}_buffer conversion
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 <[email protected]> Suggested-by: Douglas Gilbert <[email protected]> Fixes: 53d7e09 ("mmc: android-goldfish: use sg_copy_{from,to}_buffer") Signed-off-by: Ulf Hansson <[email protected]>
1 parent 19f5e9e commit 17e96d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mmc/host/android-goldfish.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
217217
* We don't really have DMA, so we need
218218
* to copy from our platform driver buffer
219219
*/
220-
sg_copy_to_buffer(data->sg, 1, host->virt_base,
220+
sg_copy_from_buffer(data->sg, 1, host->virt_base,
221221
data->sg->length);
222222
}
223223
host->data->bytes_xfered += data->sg->length;
@@ -393,7 +393,7 @@ static void goldfish_mmc_prepare_data(struct goldfish_mmc_host *host,
393393
* We don't really have DMA, so we need to copy to our
394394
* platform driver buffer
395395
*/
396-
sg_copy_from_buffer(data->sg, 1, host->virt_base,
396+
sg_copy_to_buffer(data->sg, 1, host->virt_base,
397397
data->sg->length);
398398
}
399399
}

0 commit comments

Comments
 (0)