From patchwork Fri Apr 28 13:37:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 9704741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CBD7F602B7 for ; Fri, 28 Apr 2017 13:37:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BADA028418 for ; Fri, 28 Apr 2017 13:37:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABC0C28449; Fri, 28 Apr 2017 13:37:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E67C028418 for ; Fri, 28 Apr 2017 13:37:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032096AbdD1Nhx (ORCPT ); Fri, 28 Apr 2017 09:37:53 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:48153 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031028AbdD1Nhw (ORCPT ); Fri, 28 Apr 2017 09:37:52 -0400 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id E993D24E2045; Fri, 28 Apr 2017 06:37:51 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id CE92A42D; Fri, 28 Apr 2017 06:37:51 -0700 (PDT) Received: from localhost.internal.synopsys.com (unknown [10.121.8.113]) by mailhost.synopsys.com (Postfix) with ESMTP id AE6AF40E; Fri, 28 Apr 2017 06:37:49 -0700 (PDT) From: Eugeniy Paltsev To: dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, Dan Williams , Vinod Koul , Andy Shevchenko , Alexey Brodkin , Eugeniy Paltsev Subject: [PATCH] Allow to use DMA_CTRL_REUSE flag for all channel types Date: Fri, 28 Apr 2017 16:37:46 +0300 Message-Id: <20170428133746.1855-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.9.3 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the current implementation dma_get_slave_caps is used to check state of descriptor_reuse option. But dma_get_slave_caps includes check if the channel supports slave transactions. So DMA_CTRL_REUSE flag can be set (even for MEM-TO-MEM tranfers) only if channel supports slave transactions. Now we can use DMA_CTRL_REUSE flag for all channel types. Also it allows to test reusing mechanism with simply mem-to-mem dma test. Signed-off-by: Eugeniy Paltsev --- include/linux/dmaengine.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 5336808..92cf8b0 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1376,11 +1376,7 @@ static inline int dma_get_slave_caps(struct dma_chan *chan, static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx) { - struct dma_slave_caps caps; - - dma_get_slave_caps(tx->chan, &caps); - - if (caps.descriptor_reuse) { + if (tx->chan->device->descriptor_reuse) { tx->flags |= DMA_CTRL_REUSE; return 0; } else {