From patchwork Wed Oct 14 13:12:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 7395531 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AA943BEEA4 for ; Wed, 14 Oct 2015 13:21:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3C3720653 for ; Wed, 14 Oct 2015 13:21:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D497320627 for ; Wed, 14 Oct 2015 13:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932112AbbJNNNT (ORCPT ); Wed, 14 Oct 2015 09:13:19 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:53680 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbbJNNNR (ORCPT ); Wed, 14 Oct 2015 09:13:17 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t9EDCchx028217; Wed, 14 Oct 2015 08:12:38 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9EDCcrm028365; Wed, 14 Oct 2015 08:12:38 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Wed, 14 Oct 2015 08:12:38 -0500 Received: from dlep32.itg.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9EDCRp6025212; Wed, 14 Oct 2015 08:12:33 -0500 From: Peter Ujfalusi To: , , CC: , , , , , , , , Subject: [PATCH 01/13] dmaengine: edma: Remove alignment constraint for memcpy Date: Wed, 14 Oct 2015 16:12:12 +0300 Message-ID: <1444828344-21378-2-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1444828344-21378-1-git-send-email-peter.ujfalusi@ti.com> References: <1444828344-21378-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Despite the claim by the original commit adding the memcpy support, eDMA does not have constraint on the alignment of src, dst or length in increment mode. Signed-off-by: Peter Ujfalusi --- drivers/dma/edma.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 7eefbf1e1c94..b36dfa5458cb 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c @@ -1324,6 +1324,7 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy( struct edma_desc *edesc; struct device *dev = chan->device->dev; struct edma_chan *echan = to_edma_chan(chan); + unsigned int width; if (unlikely(!echan || !len)) return NULL; @@ -1336,8 +1337,12 @@ static struct dma_async_tx_descriptor *edma_prep_dma_memcpy( edesc->pset_nr = 1; + width = 1 << __ffs((src | dest | len)); + if (width > DMA_SLAVE_BUSWIDTH_64_BYTES) + width = DMA_SLAVE_BUSWIDTH_64_BYTES; + ret = edma_config_pset(chan, &edesc->pset[0], src, dest, 1, - DMA_SLAVE_BUSWIDTH_4_BYTES, len, DMA_MEM_TO_MEM); + width, len, DMA_MEM_TO_MEM); if (ret < 0) return NULL; @@ -1903,12 +1908,6 @@ static void edma_dma_init(struct edma_cc *ecc, struct dma_device *dma, dma->dev = dev; - /* - * code using dma memcpy must make sure alignment of - * length is at dma->copy_align boundary. - */ - dma->copy_align = DMAENGINE_ALIGN_4_BYTES; - INIT_LIST_HEAD(&dma->channels); }