[PATCH] Fix the issue of fsldma driver's VIRT_TO_BUS dependence in Kconfig.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove virt_to_bus(), just using the saved phy address to match.

Signed-off-by: Zhang Wei <[email protected]>
---
 drivers/dma/fsldma.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 71e1c32..899b0c0 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -495,15 +495,20 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
  */
 static void fsl_dma_update_completed_cookie(struct fsl_dma_chan *fsl_chan)
 {
-	struct fsl_desc_sw *cur_desc;
+	struct fsl_desc_sw *cur_desc, *desc;
 	dma_addr_t ld_phy;
 
 	ld_phy = get_cdar(fsl_chan) & FSL_DMA_NLDA_MASK;
 
 	if (ld_phy) {
-		cur_desc = (struct fsl_desc_sw *)bus_to_virt(ld_phy);
-
-		if (cur_desc->async_tx.cookie) {
+		cur_desc = NULL;
+		list_for_each_entry(desc, &fsl_chan->ld_queue, node)
+			if (desc->async_tx.phys == ld_phy) {
+				cur_desc = desc;
+				break;
+			}
+
+		if (cur_desc && cur_desc->async_tx.cookie) {
 			if (dma_is_idle(fsl_chan))
 				fsl_chan->completed_cookie =
 					cur_desc->async_tx.cookie;
-- 
1.5.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux