ath6kl: Restrict memcpy to bounce buffer only for write request
authorRaja Mani <rmani@qca.qualcomm.com>
Fri, 2 Mar 2012 12:32:08 +0000 (18:02 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 5 Mar 2012 17:06:34 +0000 (19:06 +0200)
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 <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/sdio.c

index 346f5dd3a9541b33124fe04ccd695ca852b7dcb3..e2f42a13395249d96a8406a6599ff5921804cf74 100644 (file)
@@ -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;