From patchwork Mon May 20 11:32:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10950925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABCA1933 for ; Mon, 20 May 2019 11:32:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A53F287E5 for ; Mon, 20 May 2019 11:32:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E83C287EF; Mon, 20 May 2019 11:32:50 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 114AE287E5 for ; Mon, 20 May 2019 11:32:49 +0000 (UTC) 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:References: In-Reply-To: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:List-Owner; bh=pv/IpnqJF9hcsNb4HP9sYz2f227+nRbryIgbfFcFRFk=; b=Zr36pfMIAU/hZHdZ1lPxmTsgFj Lt315jbGh+lIrh7HYVLagxwPq4Rr174oUluhwhYwFcHV7VesQreA1G5ynmZ5dvEYckxJqHQ5852O5 L1x0r2/zae1m1zqbob0kGqxibYR242fIBu6L9nJEKuEMgOB9exgITHYRVxPK8jkpRfWWV0kPaiLHd ciNuyjMnYu6TtKSClzQmZ5hNHy7OaSMZDHAqFthTZB9D8P769nxlH5AuklNts4sSr/S6A1oTSLGHT iVNK1uNn4K1/f5SWt0cxaV6/rfL1TiOwfIMll/E9PwH5/nagQNNoqIW+n8arrBSUXElGf1eO5nnI4 nlqlaZxw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXA-0001Ym-Sb; Mon, 20 May 2019 11:32:49 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgX0-0001PD-L2 for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 11:32:42 +0000 Received: by mail-pl1-x642.google.com with SMTP id p1so1218856plo.2 for ; Mon, 20 May 2019 04:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Pu70ShnJxUdtWer7PLRUZo2fIfEap/6ISYxXnxlKkFM=; b=tSv5fPUTNSCsf6Ukd/lSAyUahMBsuc98eyjNM/qYxJeGXkwXVbkgNJc+pFwwZNwv2I Scn3L30ZnZrh9pzJAS7Meka65ldkpHDUxxklBTFrXzLQCxefgHwNPeqldbEfdzqoduEM pTuac3U1VGESKok+UbgmEytjjjr2gT+RbqAUNzQOVoM4Sxre2l02WmG5IoLOn/sX6LQX vg81cGBQVbG4FEE6CgSXlvQm1VweLAbyQf/2saQPC28lXohZr907F2vyCvk8jX08yTCl 8uaY04tYzl4kT8BSqqHpTtAVSWnAndVIQlXLRfe2ou8slxwxC8J8LlE7FFcia65HeMW9 bRhQ== 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:in-reply-to:references; bh=Pu70ShnJxUdtWer7PLRUZo2fIfEap/6ISYxXnxlKkFM=; b=A93O/SgqeQ9CJavcBNILiO2UnhvqFyhtbYxUmnu2OPoflw837b2o0eZ7mDjFC7zWVt m7CYEM4cy8U1mJY+VUDgfCkmzj19Px7xv22Kt1XX3gNvAt5lGcDXBaeBFTscYGrrB44M vwoRDqXpHIvY5kgsSsF2EpYfy0l9lut2sWT621G9OqWWhT4sz6Cg5KWnrTPlzNGVqNyx huH9JI7mH3OcAa7ErPOxWjQgWH3b5Sam4v/EjhDNgY7vGojkJ4Qnh3clIOLSjZOQOXxy cggf1OrOUfw6XtQAS+qDn8PQB49uWINHWX4e3OUvBS43waPDbmKWs3GkjNRY2RBl7MJs QY9A== X-Gm-Message-State: APjAAAXJGy/kkf2P/3UMm9T4zEaiLqweK+/k/xCrQXKUWfiXelqtU3XU YiSY6DeGZJcs0hepJW3lbNtbtA== X-Google-Smtp-Source: APXvYqwHu74YjBkzbQE6BKlSW/l5+RvOSNMRXBkWCZa08ZuVF8USsRLbC/WnBBD/UHKRmsu6Y6DNcQ== X-Received: by 2002:a17:902:9a9:: with SMTP id 38mr31813396pln.10.1558351957443; Mon, 20 May 2019 04:32:37 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.32.31 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:32:36 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Subject: [PATCH v2 1/8] dmaengine: Add matching device node validation in __dma_request_channel() Date: Mon, 20 May 2019 19:32:14 +0800 Message-Id: <5eb3a0099f7ade7e81226c69bfab5443e83c03cc.1558351667.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_043239_399020_21360BB2 X-CRM114-Status: GOOD ( 16.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, vincent.guittot@linaro.org, dmaengine@vger.kernel.org, baolin.wang@linaro.org, festevam@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, wsa+renesas@sang-engineering.com, thierry.reding@gmail.com, linux-imx@nxp.com, kernel@pengutronix.de, linux-tegra@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When user try to request one DMA channel by __dma_request_channel(), it won't validate if it is the correct DMA device to request, that will lead each DMA engine driver to validate the correct device node in their filter function if it is necessary. Thus we can add the matching device node validation in the DMA engine core, to remove all of device node validation in the drivers. Tested-by: Peter Ujfalusi Signed-off-by: Baolin Wang --- drivers/dma/dmaengine.c | 10 ++++++++-- drivers/dma/of-dma.c | 4 ++-- include/linux/dmaengine.h | 12 ++++++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 3a11b10..610080c 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -641,11 +641,13 @@ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device) * @mask: capabilities that the channel must satisfy * @fn: optional callback to disposition available channels * @fn_param: opaque parameter to pass to dma_filter_fn + * @np: device node to look for DMA channels * * Returns pointer to appropriate DMA channel on success or NULL. */ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, - dma_filter_fn fn, void *fn_param) + dma_filter_fn fn, void *fn_param, + struct device_node *np) { struct dma_device *device, *_d; struct dma_chan *chan = NULL; @@ -653,6 +655,10 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, /* Find a channel */ mutex_lock(&dma_list_mutex); list_for_each_entry_safe(device, _d, &dma_device_list, global_node) { + /* Finds a DMA controller with matching device node */ + if (np && device->dev->of_node && np != device->dev->of_node) + continue; + chan = find_candidate(device, mask, fn, fn_param); if (!IS_ERR(chan)) break; @@ -769,7 +775,7 @@ struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask) if (!mask) return ERR_PTR(-ENODEV); - chan = __dma_request_channel(mask, NULL, NULL); + chan = __dma_request_channel(mask, NULL, NULL, NULL); if (!chan) { mutex_lock(&dma_list_mutex); if (list_empty(&dma_device_list)) diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c index 91fd395..6b43d04 100644 --- a/drivers/dma/of-dma.c +++ b/drivers/dma/of-dma.c @@ -316,8 +316,8 @@ struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, if (count != 1) return NULL; - return dma_request_channel(info->dma_cap, info->filter_fn, - &dma_spec->args[0]); + return __dma_request_channel(&info->dma_cap, info->filter_fn, + &dma_spec->args[0], dma_spec->np); } EXPORT_SYMBOL_GPL(of_dma_simple_xlate); diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index d49ec5c..504085b 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1314,7 +1314,8 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); void dma_issue_pending_all(void); struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, - dma_filter_fn fn, void *fn_param); + dma_filter_fn fn, void *fn_param, + struct device_node *np); struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); struct dma_chan *dma_request_chan(struct device *dev, const char *name); @@ -1339,7 +1340,9 @@ static inline void dma_issue_pending_all(void) { } static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, - dma_filter_fn fn, void *fn_param) + dma_filter_fn fn, + void *fn_param, + struct device_node *np) { return NULL; } @@ -1411,7 +1414,8 @@ static inline int dmaengine_desc_free(struct dma_async_tx_descriptor *desc) void dma_run_dependencies(struct dma_async_tx_descriptor *tx); struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); struct dma_chan *dma_get_any_slave_channel(struct dma_device *device); -#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) +#define dma_request_channel(mask, x, y) \ + __dma_request_channel(&(mask), x, y, NULL) #define dma_request_slave_channel_compat(mask, x, y, dev, name) \ __dma_request_slave_channel_compat(&(mask), x, y, dev, name) @@ -1429,6 +1433,6 @@ static inline int dmaengine_desc_free(struct dma_async_tx_descriptor *desc) if (!fn || !fn_param) return NULL; - return __dma_request_channel(mask, fn, fn_param); + return __dma_request_channel(mask, fn, fn_param, NULL); } #endif /* DMAENGINE_H */ From patchwork Mon May 20 11:32:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10950933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 011FB933 for ; Mon, 20 May 2019 11:33:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0F15287F3 for ; Mon, 20 May 2019 11:33:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D48CF287FA; Mon, 20 May 2019 11:33:04 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88CC5287E5 for ; Mon, 20 May 2019 11:33:04 +0000 (UTC) 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:References: In-Reply-To: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:List-Owner; bh=rjB/6z6SlKL8dDCUtGcH82cMFmCvtNsVxoLAXJpIdl0=; b=N+aYAbzCVLVSkfoN4ysKmKkoHt kPYTwlhh/43Xdg1u2eKHSJvYH7+wshGNsC6cz5LbUG0o+JCUtO03zvaQ0f2KwQMnCwlAEIiHqAus9 JPw4ZDTN+t54Q3L/c+BGQR/qPx71JBIGeWNwN9FZY/sYvxpytFngrdJcQdBGZ3XOwIkhlq4ZZPGqX MuSU9cXG/YkebfBIh80SSDTSdLZBigD1Y9LKR4sOdy71VkP84rtZX8yKzF8oOkMUt/voVYrJZedIe pViS0xYt+FeP+ez++iAJ9s48O5Qe4pK9nzlSeGIZj7IzbhPMiV++HpeER99jrD1/lGuqOag0cFH+9 9lx8d1vw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXL-0001o9-VK; Mon, 20 May 2019 11:32:59 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgX4-0001Vk-PB for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 11:32:44 +0000 Received: by mail-pl1-x642.google.com with SMTP id w7so6613293plz.1 for ; Mon, 20 May 2019 04:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=SH6bOeq9QaZcFruKHetHjcR5Vxn/cn2SAhXtcAspD6Q=; b=sflEPPU61og2VFcVypItpwuhuRDg9RrZEU06pKHkq2dyUELMdFIRetA3Amp70Gtasf LhfWjt1c9cmf+TG5FSEfkVz+lZS0jhnu+radx8ygtiMy6DUBV6VY/q7zmVwRrpmQQgY2 B9Dc9sKeRreukolUt81y2EoSpDcHlDSNm3QhtmO5fmJhtkfyi6KzETanmpcUjlCFpOcf Q26N+Ofg3YiM4/uR0pX24XqD7mW/EcgeKAO2TfSrLASTOTfUwr2snO69Ns6Zc+0XQf1M LBwZV3ZxwK9YX1i7P0cXIqNlvHWZPbknS8ZDFw4g+tubEeoIjZHWwcDoF3THlN+Gxy0Y vhJw== 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:in-reply-to:references; bh=SH6bOeq9QaZcFruKHetHjcR5Vxn/cn2SAhXtcAspD6Q=; b=VEsz8t8uSQak9XX8O9CeIxwYB3aJfLLLlF2Dqf6duSBx2+XdGnLRgFb8AHaIbLCiph 2Y5uwZmXOabUaBu/AGn+jREQCmWVerpYs7KYRbyN/+oDGZ+p1LYJEvJbc7ghRe79MWBh iWpK73rB+/AYk7CYXEPMvl/De2vL/ZSxsCmHLdSKRyTOHyjwoVakvJIJuYIfqkbpQWwx gG2jWDd7p9v4ZwY4TrNRToi7ge0RiEgpmfMfm57cx5bn6fmDfMg6hyYMWJOwIp6CjSNd zMgFaZExLtAgcHHFjEN/wyCnSJBjUz7hjrm5j18knHzYE44w2RIC71Q3uzCIvcEUEH5d FScw== X-Gm-Message-State: APjAAAXLczKEBvCsmX6yMRU8W22UA29EmePkasIzdH58tY/hjvYy2Puc qhw9P3WOVrLytLLQEKhDuwBbew== X-Google-Smtp-Source: APXvYqw5fPKlpPwCDX8Prno12aw6CFqlLCWkN1e77syboLkhzA1LnbIZ14RetfpmMHPjpaxnXWlwXw== X-Received: by 2002:a17:902:a81:: with SMTP id 1mr29319466plp.287.1558351962410; Mon, 20 May 2019 04:32:42 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.32.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:32:42 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Subject: [PATCH v2 2/8] soc: tegra: fuse: Use dma_request_channel instead of __dma_request_channel() Date: Mon, 20 May 2019 19:32:15 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_043242_853484_7214D440 X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, vincent.guittot@linaro.org, dmaengine@vger.kernel.org, baolin.wang@linaro.org, festevam@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, wsa+renesas@sang-engineering.com, thierry.reding@gmail.com, linux-imx@nxp.com, kernel@pengutronix.de, linux-tegra@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The __dma_request_channel() prototype has been changed to help to do device node validation, thus we can use dma_request_channel() instead of __dma_request_channel() to keep kernel bisectable. Signed-off-by: Baolin Wang --- drivers/soc/tegra/fuse/fuse-tegra20.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/tegra/fuse/fuse-tegra20.c b/drivers/soc/tegra/fuse/fuse-tegra20.c index 49ff017..f40a06f 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra20.c +++ b/drivers/soc/tegra/fuse/fuse-tegra20.c @@ -110,7 +110,7 @@ static int tegra20_fuse_probe(struct tegra_fuse *fuse) dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - fuse->apbdma.chan = __dma_request_channel(&mask, dma_filter, NULL); + fuse->apbdma.chan = dma_request_channel(mask, dma_filter, NULL); if (!fuse->apbdma.chan) return -EPROBE_DEFER; From patchwork Mon May 20 11:32:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10950937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 195F1933 for ; Mon, 20 May 2019 11:33:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06DE4287E5 for ; Mon, 20 May 2019 11:33:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECFD4287EF; Mon, 20 May 2019 11:33:14 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 80ECB287E5 for ; Mon, 20 May 2019 11:33:14 +0000 (UTC) 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:References: In-Reply-To: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:List-Owner; bh=RUxuF/6IxQ5TyYnIX2enJ9jf0UxIhlKnkqKnqLhBpg0=; b=SrGVlic6iiC2H9/kw4ci5D8INM fnDIXhJki/ut8BVncBMtO4FSgemqVjGlc37GxLlJY7DIVKFRcX8nHqQx9G6wPFmVlXzp/BnDAxP8o z2QQjesHZg2GakQXU9k8rv50B1HUmRWahSlDQd9w2WQbVn7oMvT3eTjLnVwaNPop2/EG2gN7lXWQw GK3JOZkdTU11SQPE4F5N9t6WFPkMG8MHkYLM8wCMCkQMPjwEq97zQxDp93ubWoXBD5WTD8H9GLaX2 37shLvBDIZGHid3idR1LQetL7rP9haSR0F0xx4nQVDe6plINZtXQeBFwBLAiibveCyQHtyKCMHAgD u2wx4r3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXT-00020W-Hx; Mon, 20 May 2019 11:33:07 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgX9-0001a6-DL for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 11:32:49 +0000 Received: by mail-pl1-x643.google.com with SMTP id r18so6585710pls.13 for ; Mon, 20 May 2019 04:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Rhx5bIGIXYyTwXNSrFhH6sXCwPoowbOq8I8g6rhgfcM=; b=u/TmKJQVbWXU1jY6nvSgyqY9QzIEzS6idFSTXXT7qz9wsgNBI/s4V17hUgh4Rv7R2Y cwuuJfl56c+TBCEGqsc5RRIu34NSt4lHOx8UibOcyvnhXey8lHP7056ZxtHY0B4NseoG 6152HD/5j7w4ftbZ4++CLib5eBofL1XNbn5oS8Osd8NYxVsBI8Ft9hZDT1zAZ/NwACnM BkDXCqfsjhvdPmSFeCmpfO3FxtOu2mbVJWnOjskv6Npuj/95BixXJKam34owM1QCU0dF hZkQDeWU7Y0zRyI7nbkB4upO4egh0ZnC/sBYA0i4TH21JKW6sXLUUZFUxv9bWc9DnUq2 NdBA== 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:in-reply-to:references; bh=Rhx5bIGIXYyTwXNSrFhH6sXCwPoowbOq8I8g6rhgfcM=; b=a1TtZLBycMi7bgsp8N+/lDpU5UuIbxSLvwedGl1d+MepnTcWHK3hxkOzuC3Jq2N8Wt pAHVNN1RMCYCOchmDxGv6ZjkDi8XI6WXMn4Qe844o3yuzPstUbSeBtu+A/M7/nOKVxGa U34OJClC43X/uv5bhZVoijk7X1M9rYceCCGjxD6lWXHxIunZCHG73nGsErMPnVWWWIsZ hMi6PdzFDjDXuF91aPLElE4wrQHhK1EnvW8Nt2+efCHmuPf/Thz5zOHDhI6lFfObRwaG UiUzq2PjBOER5qnRkPUMNaipoLuOkjMs5JTiaFfSvjPSrJ7ON+BzyCAsQNWk6SGN5OwU PNMQ== X-Gm-Message-State: APjAAAVC1soQmIXfPuznGqAiCJYpoci0CNHBXrxnXMKfdNZ6aP9Ko0/Z tgntqYqndBy/5M4/9tAnnlkjzA== X-Google-Smtp-Source: APXvYqwgHwuoUVL1ByBfPSEobTX9ErDzyRhrOOJ1I3tJoZIQ3cgXSjtVqIPbUPY7AzkB1zM9IH6mIA== X-Received: by 2002:a17:902:8ec4:: with SMTP id x4mr65112742plo.249.1558351966882; Mon, 20 May 2019 04:32:46 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.32.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:32:46 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Subject: [PATCH v2 3/8] dmaengine: imx-sdma: Let the core do the device node validation Date: Mon, 20 May 2019 19:32:16 +0800 Message-Id: <77c1171088844b62a50977817103c2cf01fd75ae.1558351667.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_043247_545412_05A342B9 X-CRM114-Status: GOOD ( 13.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, vincent.guittot@linaro.org, dmaengine@vger.kernel.org, baolin.wang@linaro.org, festevam@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, wsa+renesas@sang-engineering.com, thierry.reding@gmail.com, linux-imx@nxp.com, kernel@pengutronix.de, linux-tegra@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let the DMA engine core do the device node validation instead of drivers. Signed-off-by: Baolin Wang --- drivers/dma/imx-sdma.c | 9 ++------- include/linux/platform_data/dma-imx.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 99d9f43..ca296f0 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1934,16 +1934,11 @@ static int sdma_init(struct sdma_engine *sdma) static bool sdma_filter_fn(struct dma_chan *chan, void *fn_param) { struct sdma_channel *sdmac = to_sdma_chan(chan); - struct sdma_engine *sdma = sdmac->sdma; struct imx_dma_data *data = fn_param; if (!imx_dma_is_general_purpose(chan)) return false; - /* return false if it's not the right device */ - if (sdma->dev->of_node != data->of_node) - return false; - sdmac->data = *data; chan->private = &sdmac->data; @@ -1971,9 +1966,9 @@ static struct dma_chan *sdma_xlate(struct of_phandle_args *dma_spec, * be set to sdmac->event_id1. */ data.dma_request2 = 0; - data.of_node = ofdma->of_node; - return dma_request_channel(mask, sdma_filter_fn, &data); + return __dma_request_channel(&mask, sdma_filter_fn, &data, + ofdma->of_node); } static int sdma_probe(struct platform_device *pdev) diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h index 9daea8d..7d964e7 100644 --- a/include/linux/platform_data/dma-imx.h +++ b/include/linux/platform_data/dma-imx.h @@ -55,7 +55,6 @@ struct imx_dma_data { int dma_request2; /* secondary DMA request line */ enum sdma_peripheral_type peripheral_type; int priority; - struct device_node *of_node; }; static inline int imx_dma_is_ipu(struct dma_chan *chan) From patchwork Mon May 20 11:32:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10950941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E95841390 for ; Mon, 20 May 2019 11:33:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4306287E5 for ; Mon, 20 May 2019 11:33:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6E28287EF; Mon, 20 May 2019 11:33:26 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6AD4A287E5 for ; Mon, 20 May 2019 11:33:26 +0000 (UTC) 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:References: In-Reply-To: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:List-Owner; bh=eelW2Ert+ym9W57rPGyLEc4lghLbfBHI8ASHLK8peNM=; b=t4ZUNLSdbpA5QiqvMn4n+t2KMR Wc0COh7Dzu4ld9QdYX3f02Tx8LvBwVilpzv7d2VBQEcdTlDz8y1vSz1QY3kP/wj/h0NwZCOVW6WA6 YJGE/yG9LkQ+IX7JY1qlAAzgskX3+4u4ilKLfgXfu+xkDia7J/X3lriD7p5TkJEH6pkSdDBIS43UB RK/PFReRnCanq3Ui/w0fHOkE1ElLbTmKexxJ/zUpsGH3Yu053zf+nGgUdXmOqmAX05zlFHcBwDX9P u3PTrH9EJPBXAXhfwlYIn41UkwtJyyPrH4ynzo6+WInpWed+XsNpiF4MNIQ8GHD5dss3DiSBq5FnU 1Ci29oGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXf-0002Fp-QT; Mon, 20 May 2019 11:33:19 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXE-0001fK-7m for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 11:32:56 +0000 Received: by mail-pg1-x541.google.com with SMTP id t187so6652099pgb.13 for ; Mon, 20 May 2019 04:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Cnx84NxIhSp4uZgqi6VSWZYaVNVqt10XSPlG8JL56aM=; b=Mc4UZBCTGeP16M5dC8d43FPiSMsrdIIRD0s1wJ3KIvGHw+JOobzUKZHB0Q73iG3BTg V1l22QS5KJy5tXZPxHsQ9Mo7fVFBsMD7FRweoPvewbBbo62lTppD8pPJHBkor7ekGe3j PPFqi5Wdl4B9MzR3QJGHoKzN9KO9A5aa2u6lsjS6tZ9ohu5PS1AQTwdCEgh1IVHPURc5 Py3c2rYZyRrff+CtksSQP1kLT7g3w0aSUXqFbK2960r8YJHBAG0F6FtkWv/SXPaG5Gq8 XKa7McsxohMfNawU7tUAhFpQfWCIpWFs89ePwMm5HMMISDMi9KE0isl13qia+OwjzVYJ H+fg== 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:in-reply-to:references; bh=Cnx84NxIhSp4uZgqi6VSWZYaVNVqt10XSPlG8JL56aM=; b=qWhNtrWJTK3aefko0LluuK0wTPS/a6xXoyhPMswYsVkM9+XSBWwHBLY2YO8Vx7zfPt fRN0LUF/tkVBr5QmBfaQ61ZXI7+8JmNpum63Xb2bz/hsdov3YqiZYGpVdrHWypTmJNLM j+U+Mb/OBvT6cQa+XS/seN9cqj6fhYOQ3tiOOO5bmNT298EXJ46gHkmzL6tkybQUhDW5 zx+kIxcMX2euHxOEhZrwBI51CUaI1vk3HbJZZsm2vKuUZ3jw5I6zo+fH3biNJGSats7e Z8UmeJVs4/BbLcd5o4iZIIHIvlY4Oxg6sgdOn37Aqud/u2vMX44PS6jdJezL6gfUL4z9 xa9g== X-Gm-Message-State: APjAAAVTpx+mRt2I+GLT2q778tPe8HJCon5LxzwHyePpnYuzXqCXlgXh WlSIyP1czsMmsebGFzm+kohxig== X-Google-Smtp-Source: APXvYqwEGtRYs32a6qVJ0IDeIICdhKvEjXa4z1alPx313+QuihcD0g4n814DyWumr6jWnBbSFvUJJg== X-Received: by 2002:a65:42cd:: with SMTP id l13mr21734824pgp.72.1558351971654; Mon, 20 May 2019 04:32:51 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.32.47 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:32:51 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Subject: [PATCH v2 4/8] dmaengine: dma-jz4780: Let the core do the device node validation Date: Mon, 20 May 2019 19:32:17 +0800 Message-Id: <231f063f65d0f4ca9a69edfb267fb82500954415.1558351667.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_043252_686529_6ABCF5C1 X-CRM114-Status: GOOD ( 11.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, vincent.guittot@linaro.org, dmaengine@vger.kernel.org, baolin.wang@linaro.org, festevam@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, wsa+renesas@sang-engineering.com, thierry.reding@gmail.com, linux-imx@nxp.com, kernel@pengutronix.de, linux-tegra@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let the DMA engine core do the device node validation instead of drivers. Signed-off-by: Baolin Wang --- drivers/dma/dma-jz4780.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 9ce0a38..7e1d381 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -160,7 +160,6 @@ struct jz4780_dma_dev { }; struct jz4780_dma_filter_data { - struct device_node *of_node; uint32_t transfer_type; int channel; }; @@ -765,8 +764,6 @@ static bool jz4780_dma_filter_fn(struct dma_chan *chan, void *param) struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); struct jz4780_dma_filter_data *data = param; - if (jzdma->dma_device.dev->of_node != data->of_node) - return false; if (data->channel > -1) { if (data->channel != jzchan->id) @@ -790,7 +787,6 @@ static struct dma_chan *jz4780_of_dma_xlate(struct of_phandle_args *dma_spec, if (dma_spec->args_count != 2) return NULL; - data.of_node = ofdma->of_node; data.transfer_type = dma_spec->args[0]; data.channel = dma_spec->args[1]; @@ -815,7 +811,8 @@ static struct dma_chan *jz4780_of_dma_xlate(struct of_phandle_args *dma_spec, return dma_get_slave_channel( &jzdma->chan[data.channel].vchan.chan); } else { - return dma_request_channel(mask, jz4780_dma_filter_fn, &data); + return __dma_request_channel(&mask, jz4780_dma_filter_fn, &data, + ofdma->of_node); } } From patchwork Mon May 20 11:32:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10950943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CAAA933 for ; Mon, 20 May 2019 11:33:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A740287E5 for ; Mon, 20 May 2019 11:33:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E6D2287EF; Mon, 20 May 2019 11:33:49 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 247CF287E5 for ; Mon, 20 May 2019 11:33:49 +0000 (UTC) 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:References: In-Reply-To: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:List-Owner; bh=F2yerNPAtm9XyPrdFzhOjhMiQsy28DfEoNNJiINWh84=; b=RZz4DHm3Mg+Tpk3q4nHlJmAspM r323fMP65Mvln1rbY2XNfXxd0jqoVHpPuHzW57dRJb2m/w8ilzCFzbL7UbNGOMZrcH5PmrSJhNt6s J6wVXZv9f4p6SuPgB1WxsIhylC99rbJBid8Bi+V0e1jrwytz5/G908U/0icYhIjVtkqXAAqz+2VqB V2U+wSZQypJAcekGdOvIgnFY1TD83KTs/jhowyXE6aEBnjO8rK2/5vMU8i2LfGop8ECQeSxbM1l3o F0/acnzIs9Vz/vbhVuwHfx05MEr0AizMtyCLmMXHY5bGzmlKL+jT4a8wrTuQ4u/00K6fBmbWyGeaW MPE8dzUA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgY2-0002c5-ON; Mon, 20 May 2019 11:33:42 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXJ-0001lQ-5S for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 11:32:58 +0000 Received: by mail-pf1-x442.google.com with SMTP id y11so7074020pfm.13 for ; Mon, 20 May 2019 04:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=SIcVyU2wUJ5jnbmBXFPsqnRHsqNC2CkR/vX822PSMOY=; b=QKc8XOBsWShq6QEmKaBcAza24sj5L89yQgva5BBJBD15azjrDgyggyl2Y6xH7l9m0+ qnbIVd8x46sGrGKbAFeOh9JcMuN8/8jHVUwKDDhLh5QIfnAQQVJcZo5GHolCqHVWUW1O HOOJE3BxF5szua4H8FJtxAzbduLES4VIQYRkDnjzWncNLnDgwlxQgwChnpNXpKFovDT6 4ZR45hFmVZ3QeHbNTfQ+mYMUwLMzZPT9tDEZSw9OLO4EKIVIp293+huklSqG+P9pT0sK JqjJIHo8V9bygr+sN87cZAnBBnSAcX+nCot+RqBM0luM5W3PidNFeReMZjG/yi3x4T1B DwzA== 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:in-reply-to:references; bh=SIcVyU2wUJ5jnbmBXFPsqnRHsqNC2CkR/vX822PSMOY=; b=t36TLCIJMUqEkOlsWy/Si7Ua8542mK8R/m6lx4sFULFcDKT6JP6HezLnDptrZVfJh/ dSWFvs1D1QEXio+tQWmHBNsOi8I5srfZ1aZqiw5V3erGJGxmju4kJikPTAPZilr9gYM/ Zd7/Ve8lcA4TkwoHqG+iUWlI5iCV9SWt1okmnudCXgQa7bexJljceNtvb3N2x6I/s0fX WtAWoDmf08m3QbGb+9dJT8y858yGCr1uTWs89vUDPOikTn6z11d8xvCOIaxf9M9g85sO wrpuc62Rzlk/mdPQkipiXQUxt+6XW3p/lkDlqgjV/kcrmfMH4Q1TfDW6wM8qydqhpDwe zTAQ== X-Gm-Message-State: APjAAAXnSWcvWljREzKQpAZu9Vdbgc+VXbXxGlBl8ufhURU1QzksH9Oj DA44zMRF2Ep5Nm3Gzca/hwOY0A== X-Google-Smtp-Source: APXvYqxLeHaPHSHfiQmInEnHejopO5Ea8Zrwi3xZ14RXUo26VmHyfg5o1zIlWo3HHOh+5pmpHodGlw== X-Received: by 2002:a63:184:: with SMTP id 126mr48415643pgb.420.1558351976125; Mon, 20 May 2019 04:32:56 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.32.51 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:32:55 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Subject: [PATCH v2 5/8] dmaengine: mmp_tdma: Let the core do the device node validation Date: Mon, 20 May 2019 19:32:18 +0800 Message-Id: <5600ce71701aac33035d78bf038d97ca331bf18b.1558351667.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_043257_258654_98D0AB03 X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, vincent.guittot@linaro.org, dmaengine@vger.kernel.org, baolin.wang@linaro.org, festevam@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, wsa+renesas@sang-engineering.com, thierry.reding@gmail.com, linux-imx@nxp.com, kernel@pengutronix.de, linux-tegra@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let the DMA engine core do the device node validation instead of drivers. Signed-off-by: Baolin Wang --- drivers/dma/mmp_tdma.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index 0c56faa0..e76858b 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c @@ -586,18 +586,12 @@ static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev, } struct mmp_tdma_filter_param { - struct device_node *of_node; unsigned int chan_id; }; static bool mmp_tdma_filter_fn(struct dma_chan *chan, void *fn_param) { struct mmp_tdma_filter_param *param = fn_param; - struct mmp_tdma_chan *tdmac = to_mmp_tdma_chan(chan); - struct dma_device *pdma_device = tdmac->chan.device; - - if (pdma_device->dev->of_node != param->of_node) - return false; if (chan->chan_id != param->chan_id) return false; @@ -615,13 +609,13 @@ static struct dma_chan *mmp_tdma_xlate(struct of_phandle_args *dma_spec, if (dma_spec->args_count != 1) return NULL; - param.of_node = ofdma->of_node; param.chan_id = dma_spec->args[0]; if (param.chan_id >= TDMA_CHANNEL_NUM) return NULL; - return dma_request_channel(mask, mmp_tdma_filter_fn, ¶m); + return __dma_request_channel(&mask, mmp_tdma_filter_fn, ¶m, + ofdma->of_node); } static const struct of_device_id mmp_tdma_dt_ids[] = { From patchwork Mon May 20 11:32:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10950945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32F011390 for ; Mon, 20 May 2019 11:33:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FFE5287E5 for ; Mon, 20 May 2019 11:33:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12814287EF; Mon, 20 May 2019 11:33:59 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD768287E5 for ; Mon, 20 May 2019 11:33:58 +0000 (UTC) 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:References: In-Reply-To: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:List-Owner; bh=OE6Gis3qHJTzNuLPHS/nGQcDMF2UFYxWxk24r9+bIRQ=; b=f4vaUhuWT3gGYk/kD7rvnNCB8P hREopZrMJ66ylVVCluYuiMFbaAptP4YjBjBbcxYSYEIeeY80FrGJHphn+RKLCmjYN6mJLGPd7C/GB 5JVKEixOKB11Xjj/OSI7+DvqhdqKZqsefYiPDDmey80bh8488LN1fnQw9YV05MdnCWzey0ay6GT57 Kij/cnWOILt46Cnnat/YFQOhB6LrItJuAykR0d2wnDFukkphiTlRU9lSicPYLe2wTEqhavoLxmSx3 pJGhSdIdNxZuC4RYM+Nk/FI7w0r1vszlp800No+ctg7Ccrh+pSE/Fnwu3mCZkAjEJGVdFYm+sAe2O 0mdicl/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgYC-0002nB-27; Mon, 20 May 2019 11:33:52 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXN-0001rG-Bp for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 11:33:14 +0000 Received: by mail-pf1-x441.google.com with SMTP id g9so7074076pfo.11 for ; Mon, 20 May 2019 04:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=MjWLMAdBW11KI57uPKHpmOc8QO2EQsc2Bw5TFtq2aeM=; b=QlKJ6r1aObcZ4e/504tulmS44XDtvOqWXOeJ7wgE1B+qEzdF8A6Ye8ybl6JSbXdowf Fbx4Y0P9D/5zijVUhbgS/2hpOtRgBIilgav6Fn3qZV4A3hbgw25/Rzxea6lEyHRrDxBu 0w+Jp7JdKp0vaJ1ZAHGJtNsZ195h2NaCgScaAnpZoqGbhRlItoawUBO+LTSL5fjnQC3r I03Bp6Fj4PFLvnYB8H8DaqWfJ4K4bfuNVzatgSU40EKQZzG31HCHatdZY3FPBK056x7r 4AMw+Z9y8lJiDFYI3oQodoGTmTvmu9ekhcWYEM4ei6PXFx2sADK/ZiIWk3YLrnnIpeu5 wUHA== 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:in-reply-to:references; bh=MjWLMAdBW11KI57uPKHpmOc8QO2EQsc2Bw5TFtq2aeM=; b=qhbWSN0v7n4yy2aYEDxjGHcJLMxS4hLFVhojHIx1772dNFLZDgz7uOvIF2aMmSnTQX 0snC9Y6hwiRNE8VmXtIBz5HqsGhF4oiWfcNLbkzIhuWxobf7zm0NYkOc8sj+rMp6kgl+ cagXdM4tqdYNfLRc9Tvu5kHokaMW+IAwBoMphV0f9aSBFg5MsXI139zUGUk1sZsZGrIE 7P5eUSSe2BtSQ3wwdEqcSZVLJJBgmgyItsmyKVFGMETNBe6aBG6IxZ9NK//y86RxTpHe xzC8N1xgbmxV6jV5MjwtGEFFQDTxEKPKTsZwa/E704UiLBNxo/WXblADUamzKTkoIbrx LTdQ== X-Gm-Message-State: APjAAAVjnPCk2OFFHXCzGJqbPDgPkFQ+HSebv7T+IhTEmEfoE8JyuJvJ CES8D1MEqkrStzxaqxAptqJ4Vw== X-Google-Smtp-Source: APXvYqzvbnYheVzjLAwm4HomvMFLaeeJKqzxnDKXoHl0dMjK1k4k08i8lD/BQRS3A+Rm2kIGCkj5/Q== X-Received: by 2002:a65:5302:: with SMTP id m2mr62317316pgq.369.1558351980703; Mon, 20 May 2019 04:33:00 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.32.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:33:00 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Subject: [PATCH v2 6/8] dmaengine: mxs-dma: Let the core do the device node validation Date: Mon, 20 May 2019 19:32:19 +0800 Message-Id: <15bd5303ecf61f3a3aacd0b078d13f042dea73c6.1558351667.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_043302_021129_9502DBA0 X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, vincent.guittot@linaro.org, dmaengine@vger.kernel.org, baolin.wang@linaro.org, festevam@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, wsa+renesas@sang-engineering.com, thierry.reding@gmail.com, linux-imx@nxp.com, kernel@pengutronix.de, linux-tegra@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let the DMA engine core do the device node validation instead of drivers. Signed-off-by: Baolin Wang --- drivers/dma/mxs-dma.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 22cc7f6..8ce5e79 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -716,7 +716,6 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma) } struct mxs_dma_filter_param { - struct device_node *of_node; unsigned int chan_id; }; @@ -727,9 +726,6 @@ static bool mxs_dma_filter_fn(struct dma_chan *chan, void *fn_param) struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma; int chan_irq; - if (mxs_dma->dma_device.dev->of_node != param->of_node) - return false; - if (chan->chan_id != param->chan_id) return false; @@ -752,13 +748,13 @@ static struct dma_chan *mxs_dma_xlate(struct of_phandle_args *dma_spec, if (dma_spec->args_count != 1) return NULL; - param.of_node = ofdma->of_node; param.chan_id = dma_spec->args[0]; if (param.chan_id >= mxs_dma->nr_channels) return NULL; - return dma_request_channel(mask, mxs_dma_filter_fn, ¶m); + return __dma_request_channel(&mask, mxs_dma_filter_fn, ¶m, + ofdma->of_node); } static int __init mxs_dma_probe(struct platform_device *pdev) From patchwork Mon May 20 11:32:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10950947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3575933 for ; Mon, 20 May 2019 11:34:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2410287E5 for ; Mon, 20 May 2019 11:34:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6697287EF; Mon, 20 May 2019 11:34:04 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 59668287E5 for ; Mon, 20 May 2019 11:34:04 +0000 (UTC) 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:References: In-Reply-To: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:List-Owner; bh=dUlOtd+OFVe8mcfYPGPNIbKLoKw1Fq7f1Ef40gj1cEc=; b=eW/84BtL08rtD/2oomHSxHLLcD F8zRAY2y5Axg3+7h60wjQAyiIGQy4adkYiuOJ28VehcxbZ6vGv6T9ZwLEGrFtLAeJRH5sMNmd6M/7 42ksvHHUROp2fT9jOx5rV5oJU0eqjlkBjXUc1Xd7I/IxjMo0X8tnMuvSI41wrTC7oEZtTu8kNPxpw xBajYcrAcyqI049/3p4xLKZ49IpjumvT5J4aYnSrBWocLkdm/fgxVpegNDe8GtEp4H+jrcEmMSnjy VPkaqdurSY8MVS9kRTRw8ZcjMqCiCFmPVvk3e9OMEwJxd+kPea2jzK+iUGwNTmgAUx0FyxUWVzyol wT86CwFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgYM-00031t-Si; Mon, 20 May 2019 11:34:02 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXS-0001xy-4r for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 11:33:19 +0000 Received: by mail-pf1-x444.google.com with SMTP id u17so7089372pfn.7 for ; Mon, 20 May 2019 04:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=S4gzzO6EwH6f41hdnpuqebXlIsK5G8TT4DFszJQHgV0=; b=kGzjAWx09b8i614qTj93eApuhAYdKFfSCQb0+hZtpocLm2MSIaH0rF9+HiZf0A+vcj DFTljdFN5pWcPxuYfUOJ68tQFKj30ZgtibGH2S3BXHbVCKNLZZhwrhp/XsRkXdFInukP Xjk9fWaCFqZJ8jZcXhR3aezzU8FJfnpD/f2ytgb8QX23t5dF/R+yuoTqXH0C0ZF9DjXK kK/Z6PNz6xn9BbWuEogWU+jIyoiUOisWLQVu90JBLpFdeKSeAFeaYkcaW1tllFwwnKdZ nJfsJF6cAcVhHJ/woNRx2z15cQYdmwdMhtceda3QpfeXnUfr/bh84yM2S2fBpXB8Pd1R Y6ZQ== 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:in-reply-to:references; bh=S4gzzO6EwH6f41hdnpuqebXlIsK5G8TT4DFszJQHgV0=; b=nuZ1C5vzlOO2NSusmjlA82/YQgToGl2eqaqHHtLfO5uJC59z9U+OWTdr7o8s2B2TUI tDkNRnRFY/HhQ3j0LPCJqrV+7cpHCf6ZbqURsRTKTek0CnTJIjKBw78X+/ZZh0vDMxWN Fo69DaL3fpd+HnuWjhP7/6FAVIQnBmlqI9CPruy7Qfdjhv4ifNTm2zXOZ3z8HqdP5s3f emnmbyIL7+HaL+H7FWrM0aRHIXuj5rJ6OCkcE3jkV3SHzD7B9mWUrW2uMR8sWPNJ1DEb kit0tCDGbZkTQLzyWQPA9hpsmhsEfJIRcapsvn91AicpfV4bDfWC2hElwxBprJ1G8MC4 9aZA== X-Gm-Message-State: APjAAAXUT39WUrtB4iQHvRzEOlTca0jadpgWyoVmj/A7MSOpOy5PrzV/ hJftOCga3y+cygEbhrJfCrmARw== X-Google-Smtp-Source: APXvYqz1+ao7UVqG40GQmasG5WxCT+39UIx+E5Jw485BRv+ugxfxElvHdFQ11VJd43Wx3nTx7nGipA== X-Received: by 2002:a63:6cc5:: with SMTP id h188mr13909311pgc.105.1558351985496; Mon, 20 May 2019 04:33:05 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.33.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:33:05 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Subject: [PATCH v2 7/8] dmaengine: sh: rcar-dmac: Let the core do the device node validation Date: Mon, 20 May 2019 19:32:20 +0800 Message-Id: <6e544656cea22f93bdb2626620b381b00d1b38bf.1558351667.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_043306_682297_7A69D25E X-CRM114-Status: GOOD ( 11.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, vincent.guittot@linaro.org, dmaengine@vger.kernel.org, baolin.wang@linaro.org, festevam@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, wsa+renesas@sang-engineering.com, thierry.reding@gmail.com, linux-imx@nxp.com, kernel@pengutronix.de, linux-tegra@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let the DMA engine core do the device node validation instead of drivers. Signed-off-by: Baolin Wang --- drivers/dma/sh/rcar-dmac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 33ab1b6..67df54a 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1654,8 +1654,7 @@ static bool rcar_dmac_chan_filter(struct dma_chan *chan, void *arg) * Forcing it to call dma_request_channel() and iterate through all * channels from all controllers is just pointless. */ - if (chan->device->device_config != rcar_dmac_device_config || - dma_spec->np != chan->device->dev->of_node) + if (chan->device->device_config != rcar_dmac_device_config) return false; return !test_and_set_bit(dma_spec->args[0], dmac->modules); @@ -1675,7 +1674,8 @@ static struct dma_chan *rcar_dmac_of_xlate(struct of_phandle_args *dma_spec, dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - chan = dma_request_channel(mask, rcar_dmac_chan_filter, dma_spec); + chan = __dma_request_channel(&mask, rcar_dmac_chan_filter, dma_spec, + ofdma->of_node); if (!chan) return NULL; From patchwork Mon May 20 11:32:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10950949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3352933 for ; Mon, 20 May 2019 11:34:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE522287E5 for ; Mon, 20 May 2019 11:34:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D492287EF; Mon, 20 May 2019 11:34:17 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 48D3C287E5 for ; Mon, 20 May 2019 11:34:17 +0000 (UTC) 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:References: In-Reply-To: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:List-Owner; bh=VZsrjIM/pH2jV8ZB1Db4LD3sNZvmcBR6i5tvahr+aCE=; b=Pb1E/n6Lfasi/TSg1RRr0iOTBI 9/ZPkqgUFyT+TRI5ey9vp37SL4ZQM5IYkpjyOCB7Sz09EUSm3yZ3VbbOHGGGy3mbiNCloOQzkltkb z4kof2JyCzDPAE9WGL7eWiYSWiL4KZCzCZKdoVVu5jBVimdeIttSOYqaCpnD24/lEO4BhtOm/4CfR Qd+cRQsYWdF/l6zL75gE8op189sHQCdAVK1Qowm/1i63w0QiHuId+4srf94wAZpYhaA3nM+qnSU5/ CJpsgTii8nvZ5NWS0vmeatRa/5DcmoZi9dI1FlfgPJSVcpUk/0HpUr7HFeTZ2wVFAjCPHo3/QUsHA +E088qQA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgYV-0003FE-Oa; Mon, 20 May 2019 11:34:11 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSgXX-00026P-8I for linux-arm-kernel@lists.infradead.org; Mon, 20 May 2019 11:33:31 +0000 Received: by mail-pl1-x642.google.com with SMTP id p15so6602990pll.4 for ; Mon, 20 May 2019 04:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=kSx/2bQ8k2nUJmyS2liy45fCcO2iYHSDnrOKKw/RGV4=; b=cPRtb7tQHJTTiLOHkiEpYP+wKGEqufi5OlZI8LAVDn750p0hkPo7BlZXT75VNfp9dR bKCNesFU3UCDsME+gGsOPK0VHvOUsTWH5NPfg+xK8mJwmFd5vbJmaO0EKQMFmNQ+n19H U8mqxoNBif5syGeoUe2lEXsWbDC1YB0BzSBgumFCN8STOyMNeJCtTeNLvgnvh10BAtQu 5J6eaQFuVUuyZhLT2t+Y0NRhAjRTWOVvbNG74UrINXey6BdbxtdfZyTEs6vh0o0X64Ku AulkUGud8AZoQWHpwMC3klVwa3PQ8CDJYu9MkPTAavxbcDPzAhTfuFpg/fcSO03u0aXx CAKg== 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:in-reply-to:references; bh=kSx/2bQ8k2nUJmyS2liy45fCcO2iYHSDnrOKKw/RGV4=; b=aj0nXr0hoJ/v/SjgUdNRdHtrhjiPNSxxcwqUdGui55Axl4nYpfxGqfgcOCg3etunlA nJJ18NgvxtkJ+RfL/DhV1k0yel5fx+1xxnT+vA6B3YNTjX6/64KxSDBOykNUJHOUsB5s i8xvjy7Ing/RaUyHeWkHuzRGZvA91ASPArAOzXuW/AZDdYgotbVLffv7tzajQwX8bxDd sOXwPQAliT7GxM7mUN5h5LnuplwGMN53P7yTidcd3sFZgqEiWquz7FqJFtphuaDYW8ZF F1/lQXFfNEAgXMq1TCuZNIVUkRaPFsm6359j+RbIXEaLk8ttXmFgXh5MUsn57Oh3ez7q V5LQ== X-Gm-Message-State: APjAAAUCON9CaMWb+x+rl5e6EHh9IFJa76HjDLxCdC2zFPG8nQEmEZHW nQPgM0KL4uCvnrQmjGL7CgEgrw== X-Google-Smtp-Source: APXvYqxhkwURFkAYdOsYEFVXpnFbD8H/TQI0K1REXB9rdjkjQNCy7pJURAn59WPfwElP41gCPmfnxw== X-Received: by 2002:a17:902:18b:: with SMTP id b11mr50155937plb.264.1558351990778; Mon, 20 May 2019 04:33:10 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id z124sm21310020pfz.116.2019.05.20.04.33.05 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 04:33:10 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Subject: [PATCH v2 8/8] dmaengine: sh: usb-dmac: Let the core do the device node validation Date: Mon, 20 May 2019 19:32:21 +0800 Message-Id: <0b4418a1891261a6a4f8e8356b68e38f4ed6a1d5.1558351667.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_043312_111566_CF4346B5 X-CRM114-Status: GOOD ( 10.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jroedel@suse.de, vincent.guittot@linaro.org, dmaengine@vger.kernel.org, baolin.wang@linaro.org, festevam@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, jonathanh@nvidia.com, wsa+renesas@sang-engineering.com, thierry.reding@gmail.com, linux-imx@nxp.com, kernel@pengutronix.de, linux-tegra@vger.kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let the DMA engine core do the device node validation instead of drivers. Signed-off-by: Baolin Wang --- drivers/dma/sh/usb-dmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c index 59403f6..0afabf3 100644 --- a/drivers/dma/sh/usb-dmac.c +++ b/drivers/dma/sh/usb-dmac.c @@ -636,9 +636,6 @@ static bool usb_dmac_chan_filter(struct dma_chan *chan, void *arg) struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); struct of_phandle_args *dma_spec = arg; - if (dma_spec->np != chan->device->dev->of_node) - return false; - /* USB-DMAC should be used with fixed usb controller's FIFO */ if (uchan->index != dma_spec->args[0]) return false; @@ -659,7 +656,8 @@ static struct dma_chan *usb_dmac_of_xlate(struct of_phandle_args *dma_spec, dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - chan = dma_request_channel(mask, usb_dmac_chan_filter, dma_spec); + chan = __dma_request_channel(&mask, usb_dmac_chan_filter, dma_spec, + ofdma->of_node); if (!chan) return NULL;