Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17e96d85 authored by Ludovic Desroches's avatar Ludovic Desroches Committed by Ulf Hansson
Browse files

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: default avatarLudovic Desroches <ludovic.desroches@microchip.com>
Suggested-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Fixes: 53d7e098 ("mmc: android-goldfish: use sg_copy_{from,to}_buffer")
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 19f5e9e0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
			 * We don't really have DMA, so we need
			 * We don't really have DMA, so we need
			 * to copy from our platform driver buffer
			 * 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);
					data->sg->length);
		}
		}
		host->data->bytes_xfered += data->sg->length;
		host->data->bytes_xfered += data->sg->length;
@@ -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
		 * We don't really have DMA, so we need to copy to our
		 * platform driver buffer
		 * 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);
				data->sg->length);
	}
	}
}
}