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: 164590 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp167507ili; Mon, 20 May 2019 04:32:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzXu6aQ6/lUHNwqZFJMFMeNhC5Cc0sGtdkV0lEqKS0euOlty/RwE0kB1o62aL2D7FqPT/s X-Received: by 2002:a65:5588:: with SMTP id j8mr75000150pgs.306.1558351959977; Mon, 20 May 2019 04:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351959; cv=none; d=google.com; s=arc-20160816; b=drEFlHk2zK0Ag1mDxubDej77hrkRT2xeKo8GKuufGi5GG/Y5B1+EcgrQ4vsGJpVDiV zJhBTBmQWzVlY8QBNXakkoZsOZ7dORSixVIDKyDYI19LlbxTX45IycHPfOhEwbvl1Taj X0XnqAxABf6wyjq45V+baoUzVWGrskLxslrdGEC1N1HE56uViebOgt1kIuWfPZGNG1U6 l/YwIuNxiXFtJzzoMr3Co/0Mucy2W2w8DzsUiD2lz+Ts/b4Y2Vy8fihHlErJYMx57jgl 0Q8ls4tti3wp0MhSLpsqOS/3cjcGDjny68qKkB+79X2mV4ml7pA9OtKX7GIGeXHn0jZp MgUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Pu70ShnJxUdtWer7PLRUZo2fIfEap/6ISYxXnxlKkFM=; b=X+bjt2S/g0W1d9XoUi/TsVQrAocBF2/4wgb0Ao15xq/iGUC4P/rmuOnaHCzBTqnV41 rUXg6+8r4ekYLNlVRC6x9xQTiQyzabtKIKdfZe8lCPOdomjOOGPuenHWgnPiNxkEXCZ8 ZsWqnFBbdI1XWXUSqcz9+GcLSWsnBRe40ghSKfj0A0nO78cK0hhj0IiA2DvUCEZ+weM+ /uHmg3t06u9ZzNILXE/f+i5z4GJvshstzE7pjkzIlyUQSREX0Uk9mFXHBfma1qUHSqlK vr4TdEONQXrnomDT6+iIj7t6ABnvR2lkAnnwC3jLtCPMYKguc4JgujS5RkFuGmsSRrlI XV6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tSv5fPUT; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si17324176pgd.155.2019.05.20.04.32.39; Mon, 20 May 2019 04:32:39 -0700 (PDT) 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=@linaro.org header.s=google header.b=tSv5fPUT; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732904AbfETLcj (ORCPT + 30 others); Mon, 20 May 2019 07:32:39 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45161 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730274AbfETLci (ORCPT ); Mon, 20 May 2019 07:32:38 -0400 Received: by mail-pl1-f193.google.com with SMTP id a5so6569568pls.12 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=oCh0aZLXpyE3In0zZFV+0c+XFUd8COcRYwC5FkO6CscvGxE1Ki44yeeKNkZcL3q3F0 DSfDXtnwlWTfF5OozFkipNXg2NOD0hjST695BGrRYqDWU3TV60Vouz798bSm3R+LdC7Q 3/l8NydPTKJLQ5URc3Ul+7xb7eKyQRTAiylHaBe/yt3aEUZhrhk/7+ERbHp4kvoogtZ6 WRUch4P7ph+AMbHRW52bSODqUMgeScJYzUgW/vMS8ghp3t108XpmxbHy2ymUg5wgYM2G vFqYYfDDD+ZZcNpEdSI43Qpqz4enepo/88PtqP4CQkwYMy6gkyb3eoxHkzYZZrV/Ohnc /ElQ== X-Gm-Message-State: APjAAAW0AU65AtsvbIESilhNOLL1ez4trXT9hJkLNcy0YpPmKpdhFdMa 641q7Jf65hscnq+a/7ZSd2U/zQ== 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 Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.7.9.5 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: 164591 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp167576ili; Mon, 20 May 2019 04:32:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpizlWUT2JuDRpcDvtDbyfphab4cHH9aLzBwDg4msUjsZrapB7mEWaEWbg9SrTm4KTwLN7 X-Received: by 2002:aa7:8ec6:: with SMTP id b6mr79687029pfr.234.1558351963676; Mon, 20 May 2019 04:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351963; cv=none; d=google.com; s=arc-20160816; b=L6CBRWTIcMUS6yVCj50LKZts2NHInR26gpjMMuQ+zT3DjozNA6YXo1mbFkoNWf8Chv PK5/xzB0y8KXFEdXTy/SdQZZ8UnGPUeYN69qggxpY4j2ovJvyM7YyLckQyicDaYRCtz2 VlBjtV4cRnsPFuuuATICQkg+XivebiQhrNGdaTxwYXsFUTeS9cHfeF6ZBoNw9R/amz3V kXqfnSCNPMPW1U/rRSeVNU81OJ8Un0V794n9VE3YPaUiU0uP8wGl9jwa8U05CULiTToQ pMrIei20Es24GamMXXg2S9PqqYWRDXsIiwqOUCO2mgncDpAtgf5qoHCGLlaA3uCtNAq0 RVeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=SH6bOeq9QaZcFruKHetHjcR5Vxn/cn2SAhXtcAspD6Q=; b=TFl9+7AGai8FvsDd21f8pQflcsp1lQQvKDmtuaWke6ZrtjH6Y/lG6q5d+x1Feeaypx aQt6K7oB3cyfHjVf6C4vFgSm1zFjZ2U6Ezu4RgI7NIGW1j20B/sSxxzj5HRR30jCUPDM FkIpC9jI2Szp1YezNU9NNojDbE+cDBPBGoSbVJKqPPPxjpxMxbAue3Jn2Kk8y/J7b8bO fJTftdMLPLjxjXkCQxLjENUWjysYad0OaM4Um0bPRzdFoGCh2l7scIQLOV++y+d9ukXl 487C3hf2OGCfDTsvA/oJWcwn65twVAy7HnoWHGRjEUvTZGDHzQZLYl+zo9/Iq2N3P8Fe sF9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sflEPPU6; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si17324176pgd.155.2019.05.20.04.32.43; Mon, 20 May 2019 04:32:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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=@linaro.org header.s=google header.b=sflEPPU6; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732907AbfETLcn (ORCPT + 3 others); Mon, 20 May 2019 07:32:43 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34021 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732905AbfETLcn (ORCPT ); Mon, 20 May 2019 07:32:43 -0400 Received: by mail-pl1-f196.google.com with SMTP id w7so6613292plz.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=bnwd7WvW6VOfYMVsHzTOnsGL+zTcE8+fD0paGl98zSGLyqVCyxFCR6PPaexYXZp+Km 5CCjhntdTtBVEVH/9s06bBVwg38uDF79qTKnACYUiby2gwxIJfFdAt27ZQQpHt8v7AAn cW/ggCJRz3yIvcMufh3RbHRr8GmHNlJht0PrCeY0RvJ+gDyU3QaZ8a9Vc44AgB7CClFn mv1QTj8b28CJKBzr64ntsOs172ZtbJeBnnNRGDDT+QyGeU954r3sVMehmwNlMYnXEUdR 4nn1gNvKYcE3V/Zo6rX1rWAn+qQd3ci/HT+nxg+Q9cmGkJet0LQIE7EaPrngg9jXPtBO qwSA== X-Gm-Message-State: APjAAAVKCsOfprLZQ0rI31quJjjLF1F7rHL3NN8LOmoK0qu95oEb6UBZ 6Tf+Rx0h2Jx4t27stGlovs0Tyw== 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 Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org 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(-) -- 1.7.9.5 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: 164592 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp167670ili; Mon, 20 May 2019 04:32:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUeP+BKItUohhngpWG8X0nrjZn/oraab3svMFFdtizB4Yfc06PZMc1eG9Phfb6gwfHp+rA X-Received: by 2002:a65:52c8:: with SMTP id z8mr6054397pgp.10.1558351968178; Mon, 20 May 2019 04:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351968; cv=none; d=google.com; s=arc-20160816; b=t9f1i7A29AZEk1Zid2WLcW7Kf0uJCtkslEHgDxo+vVJutRK7jQod+EjM/XdZSIOiE+ r/viZksr+o0WnGiNtq6SCyejaonWR+FG9W4w7nGfNHlQCn5qHk3yWnt4ZQRYHltmoNr9 remu//Xt+MXDb+CVL1TmktgFEJp1ix/hA3qqGd4ZOoEhX8ZsDP0Ns6LVhswcI/1goDP+ wdxyg9gfXaA111uTdD2kwbT+R7L2JSOt7jlact2R+zveeduWvvYD8NyEZz8q+8JUhF9A /qzDJwIVh6Mx+xvD4ppEgLdM2KV+9B+ZjXyTFU+qvoCexZnRdP1fo1Jv7Pk2+cATarRX Iy1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Rhx5bIGIXYyTwXNSrFhH6sXCwPoowbOq8I8g6rhgfcM=; b=gfTvl0x1Oa+94i22Srk5+VDGjmP8q5FTv4QAcJyniuQZZoD4HUNWu81A0bee5dnSeO urmZdpZGfYU390Z5NOlDLhAgiMin29sx4WYeJjnI1FvDuhKU3aN1wHVaQu3O73pe00+E +tQ6LjJKRVE2p+PKjINhWzBDzUoK5oYSZi30rFR+a+VrhFyQy3Y+RuDtK06+QvL4gcT2 JXN5ZCjskYaZmnVmZpX5jEUMZFXuRimQoO8hzFodYY5K1tc/4gGnLhqnBRU86I4E6tlw lBXMP/8fwnJBuu5nwtuksA9KWbnRSxkf7OVmqMjX/OpfgegpHC+eAyPBc8JGwLmseaWG Pzag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="u/TmKJQV"; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e192si17128583pgc.222.2019.05.20.04.32.47; Mon, 20 May 2019 04:32:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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=@linaro.org header.s=google header.b="u/TmKJQV"; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732921AbfETLcr (ORCPT + 3 others); Mon, 20 May 2019 07:32:47 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42533 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732918AbfETLcr (ORCPT ); Mon, 20 May 2019 07:32:47 -0400 Received: by mail-pl1-f195.google.com with SMTP id x15so6592177pln.9 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=lIGi8g1UDjVWAxg5SlNkSlhnseko5zxIr6KDLoM0V8nIRxfsCGH8ETWbNpJveSn5y6 AhcXb5EV7c0AWpqIGlkISdr9QTAytuFFPnOsPUx2IS+6ftaGbvb904tr1OimmPkJF4ve dmwNXiSSap2b7AOcjsWU4etv1SKQkMI1UDjOVI3OeFRFgP0OFDrtskhgg1WVpNbtqdIK XJZDyrv9Jd9GS3sm3rpzWC/XXMbF6Wp22ZSreM9GYBsmyj7jbkJcmG+SJn0Pgp/HoTzu gGzwbj6r4j5iPTL4qGmz/7KsO3iGuYwkaWh2n8fZWoBXn48i1qqnncwGQsLaApNn5lnw SklA== X-Gm-Message-State: APjAAAV3XwiMQFd4wRIofsPvj9RPZyaktd2eRMMLpChQyyFQpxQO96fO 5Szvq+87qG9x7pDXqsJarLarOw== 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 Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org 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(-) -- 1.7.9.5 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: 164593 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp167749ili; Mon, 20 May 2019 04:32:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmMJh/TXAXneLF4zAkq80eq6A91DuIJ0Uvr2gB62SQlG4EYr3bVrG7ac/A+NrnLKwGPaSq X-Received: by 2002:a63:ee10:: with SMTP id e16mr69322629pgi.207.1558351972813; Mon, 20 May 2019 04:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351972; cv=none; d=google.com; s=arc-20160816; b=EOrQHSqeZ6mzOZsK2yvh+H4UE0KNjr6iZPj9S/jKLkTPk/X2AOdBxjo9o5A0fSAXJX TprthWU6Nv/TsgMW3Pidfi6qTLIqtnwYnOaBRU1SVoFGR3tPZAWBhIsArurYru8nr7Wr u4g3V3LkoB9NawTiKWqHpSR8fmXiayGHcIzquS3u3cB4/EcShoSBiIDko0asD+Roou9z SDxVrmnWyzaiuOj0cjdAYIW5oVlpg36Ue0h84xTkUYjY/ZXRU2m8COKNs+nRXjP+gwZA ZkDFK4JJkziGRh+QfTuZj8FaoZmVY73ep8MeOvURNutSB3ocdZ6dCvmYI53QYnJhHNgO DtVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Cnx84NxIhSp4uZgqi6VSWZYaVNVqt10XSPlG8JL56aM=; b=E9i2IE+duLHdZEhunv826gFoMmAGfaeoiL9j0PgtDRWsAKJEjszbkLsCeKM3o3aUG4 jYqGN5jeBhp3ICyQaj//coLlNDJOCKkMyOZeh14468qGGrkOqWd/dst3lrDWnnqJ1K0g nrmYt/m2Y6Pq/fHOy81sXaibmXutcG7/jYSAnlNymQl7rtPxD69+6/ym4yfveJFfecnK 1IkwMd/HjuKxbAR/etiW2giwx2lotK9GKyeV/+3zbk5zT7yE5KrYWJfQFo/mpiamntxa i3Dap7k8f5L9G0NedY6uJTbtejRLaYXc9vEZ6JaddBiImke7CjN4T87JErmndr7pVgi8 KuIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mc4UZBCT; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e40si20049367plb.180.2019.05.20.04.32.52; Mon, 20 May 2019 04:32:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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=@linaro.org header.s=google header.b=Mc4UZBCT; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732919AbfETLcw (ORCPT + 3 others); Mon, 20 May 2019 07:32:52 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33308 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732932AbfETLcw (ORCPT ); Mon, 20 May 2019 07:32:52 -0400 Received: by mail-pg1-f194.google.com with SMTP id h17so6686695pgv.0 for ; Mon, 20 May 2019 04:32:51 -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=UTrXUk8DQXGaPM2LYl0m4obl0OSwUBZc63BlJuqy+rv12NoQchUC8Kfggyf5BxPIUl veMv30IpCTaam/YR3RiHs3C6JMmrV51MmOYYuSNPms+Grl/jHINu6vt7nTl7TH2o0kTO OxN51aQQr7Ayn6Y9swYiecDYfUFqJI2rLDlf7GSgDM5Iou3FVt3pzB6aoS0D5I+JWrVt Sr107N431Zp9CG7OTj/lPPTDCcXGJSPny/wOJAIenBSxeWWDdGRMU5Sqdm2RXROq3ID5 ehiXD7g+Uiq/qSQMPpYZ9W/AGAMcZfDEiSTohDvB4k7pNtXSKXZNKd/3SIhAjR/tLG7m E8HA== X-Gm-Message-State: APjAAAUb8P+smEodsOFpmYmno93otjCcvi4120KZxwK8VNXh2umqnXd5 kzsSlfreNHaUA13vb5YsqcbE6g== 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 Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org 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(-) -- 1.7.9.5 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: 164594 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp167846ili; Mon, 20 May 2019 04:32:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkLIaddgir/GtfBQzxnQvjP7DtcLuBuw/ARsGb/xfHyLdRjntzRbygDdc5mjwvkMzyDE76 X-Received: by 2002:a63:a84c:: with SMTP id i12mr76480215pgp.115.1558351977383; Mon, 20 May 2019 04:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351977; cv=none; d=google.com; s=arc-20160816; b=qNafJtQkzPR00VvBdWgMSIwoLA3KNAwr0V3rswxGnBzlo2eR9YasMjiBwvm6JLmFmP IUiQNYZLQReWwsLrqyITcE/Fd77I8sBskCCz1gA3f/2nMENjVcztpPWKrs0fvfarTpRf Qx43lkaULx6aZwqS7YfVuuKnUKYyB2yUq92wbbRfKZWGLxA3amKoLeZTB5ZFaMSUWsp4 je1emcMbPTIituiDs8n++gVVpef1NMo/kbnVjk36I6F+nAkPFgAdbcMKokeF1bqgXRDg oqXtahMgT2pPgzuqAEjwVzoO43boCbcmTMVfLqoeBIvVccdVA+dnY/kO/LtQWBwwHDe0 TPiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=SIcVyU2wUJ5jnbmBXFPsqnRHsqNC2CkR/vX822PSMOY=; b=uY4aki7iebiv/nLvXO8jD2tiqPh3jMZDbWMobAlp+qnwH7i3iSfYrP6RJjwxTjT2kL QOVdw0C/JjoTQQxgLASomEJhkPbHHbREebeh7vAuH2o1pL3//OKzSJtuoaaf6xLyAAAD iq/k3LC6QIeyenI2ka9OdyEoMslek09pomEcHslNxNt3skvkJp0eJ6MM0FACtxQhImww RoF8yIAzC7lMW8O6/naD/PK6yb1up6IBqVGzMOXcTmLUGgCzaz+3jTZJJ+AKAcLcZsPq FoiKSYL1+tDjwKYoX50G0X66c3zySzqmUNqeZ1RR2BRH9Aw/yaTckjfWzRe7ETA/VAt5 9PKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QKc8XOBs; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si17531156pgh.321.2019.05.20.04.32.57; Mon, 20 May 2019 04:32:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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=@linaro.org header.s=google header.b=QKc8XOBs; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732947AbfETLc4 (ORCPT + 3 others); Mon, 20 May 2019 07:32:56 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41974 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732945AbfETLc4 (ORCPT ); Mon, 20 May 2019 07:32:56 -0400 Received: by mail-pf1-f195.google.com with SMTP id q17so7079427pfq.8 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=G8a0IOjiMgK1wHp/QUkcDxOdajSKV4vPsi3nJXzl07fdRjPoLb8wQXA/v2piaj+OPd R+JqzUN/TGjTammEJ/s20iXsRWLVDdPc6lW5Ga4HkhnhxlLAY+nVilYBhs114McPatjs R7A3PtHy9FpATpH8H1lyWuHcNTFVK2xTuZ/uAIBnMMsFCOfzYsukw7Ec5CwDMXIUEGz+ 8YYpl+txVq8lTQPOmwh7vk9Y0AoWXgTYMzpiQM4df9tk2oRb69wSOEMOYWGBk8Ea/1r5 Z20BziFZoJH+VImHC5QxyULmmqf3foZA3VMTzkMH6Md8hE27Wpw+pjSVYg3tgdofRtvF /jVQ== X-Gm-Message-State: APjAAAXOzzGfbBMWgqs/xQxXyYbaqwMHgM6djvEHcxw440UPganlURFG j5lVpYOK6aLr0TBAYuZp8Bq7RA== 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 Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org 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(-) -- 1.7.9.5 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: 164595 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp167929ili; Mon, 20 May 2019 04:33:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuRdXYfvT9Uux1/xuLuwhR4+7Jzbce1b4t+sLbzBHhztntt7Q3v9nmGVmgWP8YA/W4mLaA X-Received: by 2002:a62:1b85:: with SMTP id b127mr51697854pfb.165.1558351982145; Mon, 20 May 2019 04:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351982; cv=none; d=google.com; s=arc-20160816; b=LWKZDv7yKacbBfY1v8f/Iws+cBdi2zG5HS6+Y6B4RrUzpxlHp7a1cYmZdgj6CnNnaB MoTNvz4xBdOfIf5Zb+LxGXfgozvjYqI3Xp2fVSjU6+OyF/P/5P2OoOiM5OpTlcFV7FkV tNwbNM93vgoHz8ZLS9JYPaA+8Rjm9yqj5xLBCx+txVH4sDkiciEWe8GEv9gUOtBpyVtN lo7sydV78JV4zi6ebLmPSSL6HL1zdDM0mRKwinDbsN+8K1LKcLZ5wh5PUZUQLKYyYfc7 Hf/cuhDztfbK9mp7fKCHezFrCQ6Sg30aWqhDlzA7S/f0aVOygz/ReCj0M6T+b4C2vo7E Pe1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=MjWLMAdBW11KI57uPKHpmOc8QO2EQsc2Bw5TFtq2aeM=; b=cDc1x4hBA5PHJGuoID4Z90TkdLtUPqKj1gyIz+QRlB3PPwSpzmpW/IMgwaAcg7SlAj ZnXrzKrko8QdD8VfEgPsTr7glNtSAnio56GHmcSDBgn9q494FWcAVUwcsGBPOmGfJLx+ RslXEYdnPGuciUfY+ve2KaFmwuzVPyMYDtkN+/IQkYHSTZiMYCdEHNdseCTmU58+lmqI TEaq+JMelAF+hYREOXfyd2VME/iNjx8mRhDJMVuWHRDY71VeGzjTPY0xo/o2mF69/qIP LsJPxRnCO7WQwDEbxmFSGbFHhbTktbgLjC5xNMlGyqXekJVfb5V7xfpOOLqbq5EWCOia 8zcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QlKJ6r1a; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19si6272018pfr.70.2019.05.20.04.33.01; Mon, 20 May 2019 04:33:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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=@linaro.org header.s=google header.b=QlKJ6r1a; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732959AbfETLdB (ORCPT + 3 others); Mon, 20 May 2019 07:33:01 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43318 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732946AbfETLdB (ORCPT ); Mon, 20 May 2019 07:33:01 -0400 Received: by mail-pg1-f196.google.com with SMTP id f25so123295pgv.10 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=XxcKb9NC64vyuWS6gFDBSMSs/BY4quYPqtfEHSYDIcV2Sp+luCSQjb+JcFMEB/P8j5 5upMxCMBg9lYGwfVo42MuEoWRzfsSc4hRPrO24O7taT922i6ag+9EhNU0hgw7XMXFSiD HD3bhE6cs8qcK4IEZDDKJH75+do8V9OaFmIPmiTFUzJqKSpFTahVyZ8hn+Goiw0Ua0Sz mJaAsOjIR6y1RqOS/LXeAtds+SEyzhLyg/FE04lRnxS+7q/wkaJE9zcYy4pjreT2bK2c KbI9TBuGnsxvSN4Tfpl7SV62lncWNamuG7Lq8NAYsTty/nr46QKaFAAMvYYg50Ltgnos Yc6w== X-Gm-Message-State: APjAAAWqXbbP21nJG0nCRc2Ip0Jrf7AwQ8A5UFxix0Y3Jj935nf4qr7J VgCsdpND1NnEvitHaZUp2oyPMA== 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 Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org 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(-) -- 1.7.9.5 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: 164596 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp168000ili; Mon, 20 May 2019 04:33:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7RCZU/WlBL5+tBK9Hpp2oYOnbm4QFK0t30/F8/XKksyj/h8xZq8GPtVfI4Gr20dMZATev X-Received: by 2002:a17:902:7591:: with SMTP id j17mr15204695pll.200.1558351986925; Mon, 20 May 2019 04:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351986; cv=none; d=google.com; s=arc-20160816; b=lExhaz/HcgPZTTHV37lnQk5R2jckCQojrZfXlpUTYIQftABQ20YwCq6lt24PEcK4RJ Kg3La7TfUtZMi6JzjS0Fi1pXrdLcKk9fWl66pwTHIfDMegDodnjaM8R/Ab7EqaknlAtt fTSnoBO8FjhgqfHjATljVrwR+hd4xjbVm3xMoBnUprQgtz1A2ZkpruP3y+Q2qkpAmsdk USye9E9Pdx8UuP7TR9C+O0U4vYhn5zm1omZNftS6DBlIUwdHC46IzHvGpzacYJsSv1co 5hejpgpLHB+Ytzlb8ZGeZCpuwBPY96E+8izQCGrpA+ZrL01PMV0jBW26PVOWQEHSgqJk OLwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=S4gzzO6EwH6f41hdnpuqebXlIsK5G8TT4DFszJQHgV0=; b=mPPZryt6OQ1+Z67cy75P/d3+fvun6sQeNK7E6A07cZGAKq2cKzrJAiKaDmeJjlM9MN /XVZLQ9kQzH7UE80q6dMU9zFqaRUbubDkuYiu5UCgECz5bWMePbstRp3e8jIWMontMt5 Bdf3jZ4g6N05IpTcCwReAP3OhZCSU+4XkMgNYOzHhBXWqBebv7SVLF9JrdG/iLqPbnxZ XvMNWcxhalKDOdyU///883Vfc2zB8XKIQlsMbaJRJMSXATHWr4LLX2Z5tDrUZAElXGZs Lv8uJ65TRi0HszNHepPM/KRx/D1Q62Vj119j0d6XZD+rzuV9sdvMYNSLA7Aa0R7AAgGr gemg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kGzjAWx0; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay1si17878224plb.96.2019.05.20.04.33.06; Mon, 20 May 2019 04:33:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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=@linaro.org header.s=google header.b=kGzjAWx0; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732974AbfETLdG (ORCPT + 3 others); Mon, 20 May 2019 07:33:06 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43683 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732971AbfETLdG (ORCPT ); Mon, 20 May 2019 07:33:06 -0400 Received: by mail-pf1-f196.google.com with SMTP id c6so7076910pfa.10 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=ZkZ2DIhP6XCdf3YCxehKrIGeiD0MJ/qfsMu4l3ZFqecjFf6vFopRz2j/Dn0SdhK/ap jY7NQbJi3lksC2CuMx0uml1rbwEUVfADgs5iAgI/JnInuvo2akzLhz2n5wXZ++Ln1OHA ARzXuf6jvhkfxyqZMqEyNZbWoZ3wH4B3ZHXGtuFMwbluWpBBO7FtgkCH80WrdxqrBcdl JVIxit9FC6tc3dDUHZLps0sX2R9sb3f14/fbJANUMWkPgsRnlo0/Khh1Pmij/KbR2CmR SGn8ODTdehQMX3mUGt5u3/DRt1q7oXuwVVmdOmtV+79SyDN/9pBNBj4a8TylVNniFP4j TFrw== X-Gm-Message-State: APjAAAXnyH1fwRmQ98rwTx2bntj2IQpGtvEuHmy/8c1GMe6I62Gb50OI jkVcNb+fell2r1Eh024Mrnn+zg== 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 Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org 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(-) -- 1.7.9.5 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: 164597 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp168128ili; Mon, 20 May 2019 04:33:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxj8C8CUxxKTi930UHrArk7lijrANaUDDhncyheFCE9u//Np9DjqSYnPFGqJzDcCIJfyX4j X-Received: by 2002:a17:902:12f:: with SMTP id 44mr29078728plb.137.1558351993698; Mon, 20 May 2019 04:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351993; cv=none; d=google.com; s=arc-20160816; b=aa/G2V1IoUK2oFFG6t/ukh6tX5t/h9+JTJXL8M/ExclgEH0Ks4nqDUNGMCiJ3zXHgf 02YdVyzlP5QIJXgcgc5enpYcy0mxPbzTty5ttG2Wlmc4/UXgC9o9mYsVPDKKcK62VbSJ 5s5hGhkieNMiWJkjFa1Q8ThiuTUcolq15zwD8GXR+RdeUYYtbmWCN4yp2muuQYgc5wKX eB3PUA2Q4afwfQQUfXGN0jS3bxWTfAOZ9mRiU3TRaBAx8JctJtKfNFwDo7FWu8YXdieX my58/vauB5u4Wjm72aZLtE3fxp+kBPKLOA/PwAfrb7nYad/JQZKDBiPBmAJ47ptKD1wk pH1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=kSx/2bQ8k2nUJmyS2liy45fCcO2iYHSDnrOKKw/RGV4=; b=ksO6JKKe5hLb5BFoYVUaLGErQSIFSmEt3OAwTrnWxvmYUEjdZLAB+2r4d4moUhRs0T m5VZr/8I0EDnekPVI3FaunSViDZfA8MgSDExrWLpRr3//BmxEpArBvRHdN9PMVNU/eJ2 Pu0y2F6vMuloSyWyUragjS96EdK84d/WOAYBaSerz4yZOoJEMdQYxY7YhKgUBfijpj+I H3i1ULyk2ArwjSmr+VDccspeDg1P3qqJwRIT3L/mH1/OF9gzbykWbBs/8S7PfnKDP4ps /osqzKyxSlp96IQqqKuhVLgymEm98mQdo7Y75yiRUkWBwSpNygAnRht8v7SDm5L2+gYo X/qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cPRtb7tQ; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si3854732pga.550.2019.05.20.04.33.13; Mon, 20 May 2019 04:33:13 -0700 (PDT) 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=@linaro.org header.s=google header.b=cPRtb7tQ; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733008AbfETLdM (ORCPT + 30 others); Mon, 20 May 2019 07:33:12 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46744 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732996AbfETLdL (ORCPT ); Mon, 20 May 2019 07:33:11 -0400 Received: by mail-pl1-f195.google.com with SMTP id r18so6586142pls.13 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=KqwuHo6Wj5/hwxgcdG9sk0hE6lPMrz/WWxxPfXqTxmetbt9MrKmmHSR3s3ganm9T0a uRu4sGU80msZNGB9kNvdI7oDzVcRhLLUKRFYB+qjn0KmEu0YBJvKj4P+AwyvJ/2Kv8WL 7ZfpvfHnX7NjHhZqb4jwZMxuZKkLy3iBbK4SwlisM1fSiNSDC7JIzkue8u3yN/r9fMkh i9Y2JjgovoLBnIP2e+2GCXVUb2ygwxlP+Y6DSoUS+g6I0iGrv7LR1+aZxJ+noukC0CED AuHkV+0MFb+3y9afYm4wOTsqkLEoL5fzWC4R/gHffus/54vDML1ioixd8FpUg1Ldo4+k CUgg== X-Gm-Message-State: APjAAAWJrF/nz4um7QNDDJPRqMZ7ZpKeg+GdLUKlZVVFZ+7dA5Gqvrza uCdCVOKLE0efET1qi7j6dklwqA== 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 Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wsa+renesas@sang-engineering.com, jroedel@suse.de, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.7.9.5 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;