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: 756406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wDvyx0kN0z9s89 for ; Fri, 28 Apr 2017 23:38:17 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NjDvk5bs"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=X8+6c7XQnZA1419ZuSQc48dmIznB0E7C3x2CaxztMbI=; b=NjD vk5bs6fr9v9KtMMRvysuVE30KwO+4Dz0iYJZxz7nv5bpZYv9H1RYJ5Us9Zc87Ld1cjvbE401QauQS IK6zFcZK4DeZ6JmongxIfudk5XDwBGy8QLDdbuJu5orkp6fHnhLnZtgig5G7jmkxh4Bj9L5oImpcO hdBivJiEebyEXRcpHKnmL3NlmpnHS7Pacnmaq5NB4QleNJ7T6q3zSYAoVtZXjQXJ6OSE5PNRcAA5E Ngn/eLJV0MDRjKgS1lBmExpnS1xzuVGnfij8V7jb8ta/ejwVMuFCtaTEqdLqXrJpvH5zfaPF4NQBs /8PWfCYKPygSb26xGM6Fv24iOdUT6GA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d466B-00052m-PG; Fri, 28 Apr 2017 13:38:15 +0000 Received: from smtprelay.synopsys.com ([198.182.47.9]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d4669-000513-2I for linux-snps-arc@lists.infradead.org; Fri, 28 Apr 2017 13:38:14 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170428_063813_123613_1DA3AFE1 X-CRM114-Status: UNSURE ( 7.52 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andy Shevchenko , Vinod Koul , Alexey Brodkin , linux-kernel@vger.kernel.org, Dan Williams , linux-snps-arc@lists.infradead.org, Eugeniy Paltsev MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 {