Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21006122ybl; Sun, 5 Jan 2020 17:20:01 -0800 (PST) X-Google-Smtp-Source: APXvYqw2ar1eFPOiFekDpj3O7iF/LrpVjCHXoHShiTX2P/yUKgxGzZmzeFGnBP1j/N6RXeMG2xzp X-Received: by 2002:a05:6830:1e67:: with SMTP id m7mr110200574otr.262.1578273601858; Sun, 05 Jan 2020 17:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578273601; cv=none; d=google.com; s=arc-20160816; b=DecBUhafrBbQxZjy+zICeLi7S+gWBhAbrX/hN9kbwN2zX9TlDjGKyopLsV0mIMab1O SO1kCbgHr3mEfmxthKxMtsc82NyuoU5ngBEGER7TuPyxb6fRSdYpRqYoxxxhlFn8jLsa pyikrRguMo1o1BCHwBDCSZ0RQkBqW2FV7IzVyQjQmIrKkYRlHiuRIB3Dq1XKVxK0ylNo ShQFl7Wx0Z36bPFda4ZKkpjb6suUiSsEkNYkRSx2KkMDrqc2lMWzv7CCHW6k5L/6Q8t7 DPfqS8YdZvK6ln7Xkc6etb2RvU8HpeDQ72+qwexOG3TylYfkeG/2f2IusFTK1KvFnXxD hpYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iSzNtTGK3mbZvFsWdibdEoWrg4nzIZ5PMxmWTFl+mGA=; b=NTk0wSAsnrZqblOr8XQ9E1TS3A2uweYUL6s6IUgKL18MwkP0SYQYuE0BRFDvyWbjeV lZP1lKeNKrc7SFahGojY6qjWLeOjAc6x20dsKwsTa4ja874KWID03cwmctdoWp96WoER oZrZVnoDlvny/YTXI9FgUndT2NKKF3n3SihyKUDSGuGPBLVMVohmWf3Wf78YrvHpa6g9 XFA3sIS4fPwv1aSIBUJlDidv1AIdM9Pvn6exjE4Q/kUyYIiqQCm3V73NDxz64Uyla405 PZlbc2nucq50Ea0+/i++OZ4felR91WPKHXf4duZrX9jeDU9vt3drdUdQ+unhqDYeNXsF g2mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KaKzgkEl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si32274173otn.48.2020.01.05.17.19.50; Sun, 05 Jan 2020 17:20:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KaKzgkEl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727334AbgAFBR0 (ORCPT + 99 others); Sun, 5 Jan 2020 20:17:26 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:39691 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbgAFBRZ (ORCPT ); Sun, 5 Jan 2020 20:17:25 -0500 Received: by mail-lj1-f193.google.com with SMTP id l2so49273106lja.6; Sun, 05 Jan 2020 17:17:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iSzNtTGK3mbZvFsWdibdEoWrg4nzIZ5PMxmWTFl+mGA=; b=KaKzgkEls3Ub0KNMTwRBoR6uaqurUZoOaqFBhHrePHMddJXQgaCgyJnsj89WRoCPVX EoWPL8gGVOUNIHWstRHJOCH8slaN49O2t1BHTHcA64Inn/p3lDEPCVEfVPpHkXKVRRnm +GhT+CkSRgaWacjajq6/4E925STgFpfPppgxZhfaDBvVcubiS04IFmUavfUu3pE+IptK hGPOCtFD++31X+D4N9pOYhw7pc3Nw0h6YFflsLL6Z60LUWeZ3GkpSCaNZJv6uQUWyj7E utIOAjjogLKdG3Uu0ySh0KNr7t04ZHCmcIm8DE83uyfVKz+Z78EkDaCRvPvqno7FsOlZ ahCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iSzNtTGK3mbZvFsWdibdEoWrg4nzIZ5PMxmWTFl+mGA=; b=s2WTQkvIi6V6SpfYXwuCjS+MinsvzmLlkxcpGWUml78jFyouH43a8SrQukQNzMWUsN YBPly5S6sZtE6Iq1RLMfjuV5IDAk5TUi1uArgn8IB0Zyzbc8viVbb8AfNytx3LKk/yw1 Efh/H78C05m7oYtbx02ejHfw9OPed2X8KfynFST52Sxzf3fv0aqj/ZBHkIv9gFY9zYHa hyc0QiSWh16HK84UalQZ6wyBxGUCFtTBS7d66PyUEmrareqndA0Fm3yReGa2zoglCObF RTfaIevQN6PGEN3DEvw9As+alfs9yAbYBqo4U8nzBYfHh54Qqwc43+LMMcG/1ut5kkpF Relw== X-Gm-Message-State: APjAAAXMr6Y5KEfPO02K13PKArM6LWweunTEIredeyOqrHBDpdoirVKS 96wyYZzEexESLxAxSxy8RhE= X-Received: by 2002:a05:651c:8f:: with SMTP id 15mr58672337ljq.109.1578273443275; Sun, 05 Jan 2020 17:17:23 -0800 (PST) Received: from localhost.localdomain (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.gmail.com with ESMTPSA id y14sm28353271ljk.46.2020.01.05.17.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2020 17:17:22 -0800 (PST) From: Dmitry Osipenko To: Laxman Dewangan , Vinod Koul , Dan Williams , Thierry Reding , Jonathan Hunter , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Cc: dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 02/13] dmaengine: tegra-apb: Implement synchronization callback Date: Mon, 6 Jan 2020 04:16:57 +0300 Message-Id: <20200106011708.7463-3-digetx@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200106011708.7463-1-digetx@gmail.com> References: <20200106011708.7463-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ISR tasklet could be kept scheduled after DMA transfer termination, let's add synchronization callback which blocks until tasklet is finished. Signed-off-by: Dmitry Osipenko --- drivers/dma/tegra20-apb-dma.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 319f31d27014..664e9c5df3ba 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -798,6 +798,13 @@ static int tegra_dma_terminate_all(struct dma_chan *dc) return 0; } +static void tegra_dma_synchronize(struct dma_chan *dc) +{ + struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); + + tasklet_kill(&tdc->tasklet); +} + static unsigned int tegra_dma_sg_bytes_xferred(struct tegra_dma_channel *tdc, struct tegra_dma_sg_req *sg_req) { @@ -1506,6 +1513,7 @@ static int tegra_dma_probe(struct platform_device *pdev) tdma->dma_dev.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; tdma->dma_dev.device_config = tegra_dma_slave_config; tdma->dma_dev.device_terminate_all = tegra_dma_terminate_all; + tdma->dma_dev.device_synchronize = tegra_dma_synchronize; tdma->dma_dev.device_tx_status = tegra_dma_tx_status; tdma->dma_dev.device_issue_pending = tegra_dma_issue_pending; -- 2.24.0