From: Raja Mani Date: Fri, 2 Mar 2012 12:32:08 +0000 (+0530) Subject: ath6kl: Restrict memcpy to bounce buffer only for write request X-Git-Tag: v3.4-rc1~177^2~48^2~55^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=daa16bc52ad8e9513506fca29a038a1460e63638;p=platform%2Fkernel%2Flinux-3.10.git ath6kl: Restrict memcpy to bounce buffer only for write request No need to copy received local buffer content to bounce buffer (DMA buffer) while performing sync READ operation from the chip. It's applicable for only WRITE operation. Signed-off-by: Raja Mani Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index 346f5dd..e2f42a1 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -405,7 +405,10 @@ static int ath6kl_sdio_read_write_sync(struct ath6kl *ar, u32 addr, u8 *buf, return -ENOMEM; mutex_lock(&ar_sdio->dma_buffer_mutex); tbuf = ar_sdio->dma_buffer; - memcpy(tbuf, buf, len); + + if (request & HIF_WRITE) + memcpy(tbuf, buf, len); + bounced = true; } else tbuf = buf;