From patchwork Tue Dec 13 13:40:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M'boumba Cedric Madianga X-Patchwork-Id: 9472289 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 860D16021C for ; Tue, 13 Dec 2016 13:42:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A1E528210 for ; Tue, 13 Dec 2016 13:42:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D2182833C; Tue, 13 Dec 2016 13:42:15 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 1B5C728210 for ; Tue, 13 Dec 2016 13:42:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932990AbcLMNmM (ORCPT ); Tue, 13 Dec 2016 08:42:12 -0500 Received: from mail-wj0-f193.google.com ([209.85.210.193]:36613 "EHLO mail-wj0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933143AbcLMNlT (ORCPT ); Tue, 13 Dec 2016 08:41:19 -0500 Received: by mail-wj0-f193.google.com with SMTP id j10so16640782wjb.3; Tue, 13 Dec 2016 05:41:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aRSbDoygBcT8t+sx+BJrz/S1g+xTmQ1rcVbP8Dydo1E=; b=fhDZg48U8+puctLNyFvpCHFuoJE3oQKD6N08tmMz/HAZadI7pDSIuRtpYU36qmSYOv 3NFzaXiwvEboTMO/khS1ugWjNph35hgPXsIl//yTIheHXJtgdVdPgU8Z0CP9qqmsohL3 ZSBVcYls8CH4xTm5EI/F7uirnPw0IeVBjuGIZVVQVSa1HAyHNZP9BpRvy/mz2qNkkIPm sXJI5CYQq4wCzNRRMS9F3AbjYJj2xK/FiJgOwDEjNEel5C3vUUASY9HHSr1ofHG8gwsM gazqLdQM+OFEAbVWQJPy8PSm67eEZvdgP7kTFgQVbBiAcYupDdYqJUILKnkCu8sSX6cQ Gj+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aRSbDoygBcT8t+sx+BJrz/S1g+xTmQ1rcVbP8Dydo1E=; b=Oj1eX3idj0GQ36MpMVqAI4wOF3rZdcCQMxORyVfap/JWpVnv1DwSqZNVWoVHSpBSmf X43pB2EykVPCSt8c8TdHJC3COg6OZepynRFfrh8f1Cm9YKQFlNP6eMqzGNdCJ0DGCDnc eyleD7E0Od2RmLENww91RcUPGHnd9PxjpeW+aasDx2SmRpLBbrhQe55v9Z3Zal7C2zUc 4EA5G0946nEbuDhKecqSbCvDANufdDDUR97Umt5j4KgXlYu9yQrbyWgJXXguBdHNGG3D gY0OLXzX5m48jHP2s/PKvEvBDJB2dWWOVA6+1E0r8kgW8qIQpynYXeIhJgVlVkJzdBWn pOGg== X-Gm-Message-State: AKaTC02NWBYqLHjNv/J0nLNFrG42aJpKadOvsWP0+tYPTyiXE5fhrgLfwMIt2Ue0SzyPXw== X-Received: by 10.194.0.43 with SMTP id 11mr85168067wjb.218.1481636477589; Tue, 13 Dec 2016 05:41:17 -0800 (PST) Received: from lmenx29w.st.com. ([80.215.199.148]) by smtp.gmail.com with ESMTPSA id vr9sm62269846wjc.35.2016.12.13.05.41.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Dec 2016 05:41:16 -0800 (PST) From: M'boumba Cedric Madianga To: vinod.koul@intel.com, robh+dt@kernel.org, mark.rutland@arm.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, dan.j.williams@intel.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: M'boumba Cedric Madianga Subject: [PATCH 8/9] dmaengine: stm32-dma: Add synchronization support Date: Tue, 13 Dec 2016 14:40:50 +0100 Message-Id: <1481636451-27863-9-git-send-email-cedric.madianga@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481636451-27863-1-git-send-email-cedric.madianga@gmail.com> References: <1481636451-27863-1-git-send-email-cedric.madianga@gmail.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Implement the new device_synchronize() callback to allow proper synchronization when stopping a channel. Signed-off-by: M'boumba Cedric Madianga --- drivers/dma/stm32-dma.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 35639f6..b7be43a 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -403,6 +403,13 @@ static int stm32_dma_terminate_all(struct dma_chan *c) return 0; } +static void stm32_dma_synchronize(struct dma_chan *c) +{ + struct stm32_dma_chan *chan = to_stm32_dma_chan(c); + + vchan_synchronize(&chan->vchan); +} + static void stm32_dma_dump_reg(struct stm32_dma_chan *chan) { struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); @@ -1068,6 +1075,7 @@ static int stm32_dma_probe(struct platform_device *pdev) dd->device_prep_dma_cyclic = stm32_dma_prep_dma_cyclic; dd->device_config = stm32_dma_slave_config; dd->device_terminate_all = stm32_dma_terminate_all; + dd->device_synchronize = stm32_dma_synchronize; dd->src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);