From patchwork Tue Oct 13 19:54:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 7388411 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4DB489F302 for ; Tue, 13 Oct 2015 20:01:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DCBC205B6 for ; Tue, 13 Oct 2015 20:01:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 820D320595 for ; Tue, 13 Oct 2015 20:00:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752862AbbJMUAQ (ORCPT ); Tue, 13 Oct 2015 16:00:16 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:18444 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752621AbbJMUAO (ORCPT ); Tue, 13 Oct 2015 16:00:14 -0400 Received: from belgarion.home ([90.16.80.96]) by mwinf5d36 with ME id Uk091r00124gpwi03k0CQs; Tue, 13 Oct 2015 22:00:13 +0200 X-ME-Helo: belgarion.home X-ME-Date: Tue, 13 Oct 2015 22:00:13 +0200 X-ME-IP: 90.16.80.96 From: Robert Jarzmik To: Vinod Koul , Daniel Mack , Haojian Zhuang , Robert Jarzmik Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/3] dmaengine: enable DMA_CTRL_REUSE Date: Tue, 13 Oct 2015 21:54:29 +0200 Message-Id: <1444766070-26915-2-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444766070-26915-1-git-send-email-robert.jarzmik@free.fr> References: <1444766070-26915-1-git-send-email-robert.jarzmik@free.fr> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 In the current state, the capability of transfer reuse can neither be set by a slave dmaengine driver, nor used by a client driver, because the capability is not available to dma_get_slave_caps(). Fix this by adding a way to declare the capability. Fixes: 272420214d26 ("dmaengine: Add DMA_CTRL_REUSE") Signed-off-by: Robert Jarzmik --- drivers/dma/dmaengine.c | 1 + include/linux/dmaengine.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 09479d4be4db..0d64dc8627a8 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -493,6 +493,7 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps) caps->dst_addr_widths = device->dst_addr_widths; caps->directions = device->directions; caps->residue_granularity = device->residue_granularity; + caps->descriptor_reuse = device->descriptor_reuse; /* * Some devices implement only pause (e.g. to get residuum) but no diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 7ea9184eaa13..2fd8344f219b 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -658,6 +658,7 @@ enum dmaengine_alignment { * struct with auxiliary transfer status information, otherwise the call * will just return a simple status code * @device_issue_pending: push pending transactions to hardware + * @descriptor_reuse: a submitted transfer can be resubmitted after completion */ struct dma_device { @@ -680,6 +681,7 @@ struct dma_device { u32 src_addr_widths; u32 dst_addr_widths; u32 directions; + bool descriptor_reuse; enum dma_residue_granularity residue_granularity; int (*device_alloc_chan_resources)(struct dma_chan *chan);