From patchwork Thu Feb 18 19:04:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Pimentel X-Patchwork-Id: 12094003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56D7CC433E6 for ; Thu, 18 Feb 2021 19:10:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EC6864DE9 for ; Thu, 18 Feb 2021 19:10:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbhBRTKB (ORCPT ); Thu, 18 Feb 2021 14:10:01 -0500 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:33188 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233724AbhBRTFk (ORCPT ); Thu, 18 Feb 2021 14:05:40 -0500 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 91B9240341; Thu, 18 Feb 2021 19:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1613675070; bh=w9iK+I/EoC4W0BDyuaOzXjQJW+o0ZoU+YLQQVJ9KZaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=XtZDWhEV1y09wEP0fcIAH4cs40qrrFRqi77N+oeVABU+wzRw6j33eNWjCLWtQ0Q9n U1VrOSZbCbfa+CqzfZ+q1MK/Gu/JXB7FmPtqNcUOO3WzXzUFCFv1CrJ2BlL1a7RXA1 FKCvmSoddQrZV+EgdBVNyoubG/HjG2/nEsdmSOQlRFX+3G/gK9KJx14xmnh2w9qTM0 gMDiw7YbjOwnd0JvwYFWkZRTSrhOT2E7AARTPA6gdFS+b/tiY05tyWdHyQ7pMbAnGq kvsjclqpSq06yHGOKer54ktA6/EVz+987SKbvaTZgNvs/+lMgbzfg36u884DyLrFaz Sv7G+c+NZYUQw== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 6DB42A005D; Thu, 18 Feb 2021 19:04:28 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Gustavo Pimentel To: dmaengine@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Vinod Koul , Dan Williams , Bjorn Helgaas , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Lukas Wunner , Gustavo Pimentel Cc: Gustavo Pimentel Subject: [PATCH v7 14/15] dmaengine: dw-edma: Revert fix scatter-gather address calculation Date: Thu, 18 Feb 2021 20:04:08 +0100 Message-Id: <1778422e389fe40032e216b59b1b992c61ec9887.1613674948.git.gustavo.pimentel@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Reverting the applied patch because it caused a regression on ARC700 platform (32 bits). Fixes: 05655541c950 ("dmaengine: dw-edma: Fix scatter-gather address calculation") Signed-off-by: Gustavo Pimentel --- drivers/dma/dw-edma/dw-edma-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c index 0793df1..5328992 100644 --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -429,7 +429,8 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) if (xfer->type == EDMA_XFER_CYCLIC) { burst->dar = xfer->xfer.cyclic.paddr; } else if (xfer->type == EDMA_XFER_SCATTER_GATHER) { - burst->dar = dst_addr; + src_addr += sg_dma_len(sg); + burst->dar = sg_dma_address(sg); /* Unlike the typical assumption by other * drivers/IPs the peripheral memory isn't * a FIFO memory, in this case, it's a @@ -443,7 +444,8 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) if (xfer->type == EDMA_XFER_CYCLIC) { burst->sar = xfer->xfer.cyclic.paddr; } else if (xfer->type == EDMA_XFER_SCATTER_GATHER) { - burst->sar = src_addr; + dst_addr += sg_dma_len(sg); + burst->sar = sg_dma_address(sg); /* Unlike the typical assumption by other * drivers/IPs the peripheral memory isn't * a FIFO memory, in this case, it's a @@ -455,8 +457,6 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) } if (xfer->type == EDMA_XFER_SCATTER_GATHER) { - src_addr += sg_dma_len(sg); - dst_addr += sg_dma_len(sg); sg = sg_next(sg); } else if (xfer->type == EDMA_XFER_INTERLEAVED && xfer->xfer.il->frame_size > 0) {