From patchwork Tue May 7 06:09:38 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: 163473 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp937722ilm; Mon, 6 May 2019 23:10:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrbI5dh0ezkU88HJ8pgOyAFOP5KqmUyZ7AbIH/nXrAlqz/8xAa3bx+QKY97/ouAZ9emfiF X-Received: by 2002:aa7:99dd:: with SMTP id v29mr40147323pfi.252.1557209414951; Mon, 06 May 2019 23:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209414; cv=none; d=google.com; s=arc-20160816; b=mxkiVhkmJQdLGgFovNOUWNdu5ZwazFOwJlHSaDTAAbxVeIZUD5CkC2rcNGCE9U4rfT 3SGlPnBiUOUK1c8yWopgC8CBRbBOODOUg1+LMsx5s3OJwr/WgJ+DbbS2YJK7wi79aX94 XIDzKSzdVsZ77zZcJ1bmajf6TgxqGkV1HxmgwcMGvLYu2ukkxzuRgLXFsmQ0V6X7aE6Z 7ZNSlfQ/LF4VuneSbX9L1gHGzOgkWrkKqutbOOsh2bv9jtTmOcXVNoimzSAbz+eXileU o0tx4qid74j1RxgN6zGr9DvTaodlMKXG9OgCCGNzbEZoZzZzVp7jKtHkHytT+CXgVtos buNg== 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=ocbAuIAf3IKqxmrD8BDylPcrWXIwDT9EtJL2aoTkWT0=; b=jyCxUK+j17fJ7xQmb8FwqHySZOXv0l6ZwCpiR8dKZcaztHngtMUlI0XgoJGhMCTSuW Am26L0/ojzOLP7LpW6ykigPw8XzrkSfceM7j+TXvaZ8hh8JSPtYaQJAmYnaOYk6yZTnX Zvhe6NFRvibLkV/2LQFyNzkPqyf/1oslwtEUEGi6Ph6cOniKe9TvefzDhgoYzGa4erV6 WZB9b34V1W/R5jMeqV8hPwbUNfx1g8e1WZxOPq/Z/N7ArnJN9QdFMnfoid92fqxPmzof B6PgkcI12nVTM/JxrBRAWDN/ltM3yGvQlwRQT7X48XmbDrzUs6hUA3dAEVxps8578M6p OqgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eW6FDJOc; 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 g64si18426550pfd.281.2019.05.06.23.10.14; Mon, 06 May 2019 23:10:14 -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=eW6FDJOc; 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 S1726739AbfEGGKN (ORCPT + 30 others); Tue, 7 May 2019 02:10:13 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45767 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726576AbfEGGKM (ORCPT ); Tue, 7 May 2019 02:10:12 -0400 Received: by mail-pf1-f196.google.com with SMTP id e24so8060564pfi.12 for ; Mon, 06 May 2019 23:10:12 -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=ocbAuIAf3IKqxmrD8BDylPcrWXIwDT9EtJL2aoTkWT0=; b=eW6FDJOcTD20PObfZpdVGKkaItn9WQ1hYpVO8EGcNkYkpbdcbslbka9dSSdhBu5/us 6m45eQR1VUr0hYBR8zTdkwc7je4Tm5t4GqvYRJYBo0PChRyyqW9tCMQSWgFzI3dX7VsQ FwBRCKZZcjZOhGApZPk48kNN24KkN6bXZ0GZ3N3RiLw5WOSQPiDCaTTvmxvt61LC4bxB FhvTbk6UNAE7dYiUZA8Wh2/YcDjgNCunpItqcjs/Str0If/TlRH7iOdCUPPabQRLeWXo jHa4ds3cktME2Ke6Do2jhx/oYHMVsK/6G4qQBQriJAmke3d62HFFWHJnVc+/TLFbwfpr lovg== 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=ocbAuIAf3IKqxmrD8BDylPcrWXIwDT9EtJL2aoTkWT0=; b=UDxdRCeugXu+WIZiOF7uz3BlMaq6v48cUU4rW3vsHVFw1P+I9gjjm+RksmJFp7pSXC Aujs5Bbp44bxjXs9esn/6s7N4O+Kf6IaFkWCx+fN6IAvQpIurgA5eRVWRawQiGzWSoqB au2h0PpdqLWjLKpU72w6meO4Sx1NKdFPLx4nktm4RhQGWL3Axrw0xIxyEPiE5GKg0vPu rmDOI/ib1H2vIHR7AmF982odOQTprCFU8fkPmoIb5SjOc+KbAXRhrPm7RaseT355+xEQ bKPtIcBOytFpYEJ48aT521fgx187pI0j9GaVFMHIu68H2HDSJo6Jkkh3DDLK2/3ewDsB qEOw== X-Gm-Message-State: APjAAAUwf2TAhoH0KGjggJgZksykHpWtPOKsis7wuvDmXtmdfllRgjOO s2dc+RGH5p+Dl0E4q095H6jfTw== X-Received: by 2002:a63:1706:: with SMTP id x6mr4601020pgl.280.1557209411899; Mon, 06 May 2019 23:10:11 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e184sm30786325pfc.102.2019.05.06.23.10.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 23:10:11 -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, Zubair.Kakakhel@imgtec.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 1/8] dmaengine: Add matching device node validation in __dma_request_channel() Date: Tue, 7 May 2019 14:09:38 +0800 Message-Id: <17a22052fdb759ae6129e30f9bd8862f23a03ad9.1557206859.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. 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 Tested-by: Peter Ujfalusi 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 Tue May 7 06:09:39 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: 163474 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp937778ilm; Mon, 6 May 2019 23:10:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCujbSGKJ4cBsx43NfHVDSGakMzRS4JWtNXGhU50qBGEQz1cJijkxNFQ512a9Zob3AfXlY X-Received: by 2002:a65:64c9:: with SMTP id t9mr37193021pgv.221.1557209418635; Mon, 06 May 2019 23:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209418; cv=none; d=google.com; s=arc-20160816; b=Z6YRWiW6kGaQ1YwBZ/tLl+2yBYF6RCMDn1Oa2DL3gTykL5x+riPJBSqgkjr0zxu0xW GsY+eQTJ0Rui2HmHiZG3lZ04t+uMGl7nIdWIgEIv9k73RlQltiD071u3AzynyNCazZ7l ftPPiHjVkyAl2nSLFYT1nB0+TkD0jxdcHEuzS1AvdMcWwXL5eiEdjs9ucufK+ccO0cSK q1m62XlPrp4wzDoxnBkC+kBhPu0/sECd2RhcoLh9pGeZrJqYyigWElK4E/w+MkOWL975 pzVWUTdCSjBhP25CQen3w1DB1fY5H2XkgLUkh1+w/FzlYz0JOWXQCQQxrha/bAAeQpA9 tyYA== 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=fegqHJdxTxrNP4emVZDAfoflYxMDA5HIYSCVsGvvNyk=; b=04befh0Kn09ehBR0Hofm4zPm+pE554qijmIKx3oNWRhYvEzMIn1cBjI4suY/WVNTCu YtNGBSWuxNXThm/eNh6ZrLZQ9NKyVUl8VMj7SIrX7dkG0rYWQyKaUgvbmba4WrH78GaH BjqREORLi1dOnuNmu6HFyNnBGlgGLNwEimwAnoWyZ2qxqPg6Clnnmy/Yrk3fLfeYBrno v6WEvgpgf8BWLahqx4Yl8cIg6mQv44oqag042fI1NfCMQq80HBuPFWfYohKT/CiYxWiB gpTzLKPU64BB6y4Q2n2eN5Tp4x3jRnlfwiAgpORLwy4Zbnprn+7jPU3iKzLMwRn9XXrc dT0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gpuzGeOz; 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 g64si18426550pfd.281.2019.05.06.23.10.18; Mon, 06 May 2019 23:10:18 -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=gpuzGeOz; 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 S1726560AbfEGGKS (ORCPT + 3 others); Tue, 7 May 2019 02:10:18 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43688 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbfEGGKR (ORCPT ); Tue, 7 May 2019 02:10:17 -0400 Received: by mail-pg1-f195.google.com with SMTP id t22so7715823pgi.10 for ; Mon, 06 May 2019 23:10:17 -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=fegqHJdxTxrNP4emVZDAfoflYxMDA5HIYSCVsGvvNyk=; b=gpuzGeOzJL+S9gtU42ApMv5X8chVRN0hkaUIvi7zD8VoJwnOqdqmXq7dtEBURIpA7j G/9Ev+cBM6PV3Go/z0mD8a8YNo5qNaDn0y4C4vJmag/YvzNjrhKByuxYlaoJr0TbQ5eo 2nfWjzDy/wFJLus92xSxL6b1c35GEBUadXry11rD/4luRTR0OTnpL1BvwojJFoJbTZ3q qWa5bLbGM9gj9Fx9aaKvHXZ3P3VInHnxnX37d6LK/Ysm/eB1ph8aMLSOBxn6e7x3Zz1j uw+pixeKEBnvOiks2g0sUhhj+flFxFWtez0II53gaB23VlKlK7kIVnWRfR8jUkae/ejN WMYg== 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=fegqHJdxTxrNP4emVZDAfoflYxMDA5HIYSCVsGvvNyk=; b=Sm08tcqjTwYpVvHKWJe/4H5wisW1XR4h9LDzgOGchr4W/UDq+uX+ZROaOzFx3D73Ah xlFMtLohXwdUxktc/+py/vuDOHgaZQDdE/8SuioK9iYUxRSDuSjw3fyDVKNvqTWleMCK rhLp4iyk0Y5fS6NGs+ZE1UeYK5/fSOAKFmsPvYpOTVB6UkecGSXafk1xh6Rbm5zP8GI5 I6IYnN7wG9dFokbLgplz5vao+PBM+YXo48Rid74OB2XHIJakMrfIcpEE+w7WqAMsOlT8 Q3/nKL1gF7tbrqeDm4xR4+/gp9orSNdvrFRCSIv/63f2+pS4/72kTXmS7eWdHkCc4Yte bCPg== X-Gm-Message-State: APjAAAW0tjp/7zJ9zrrngo8tVu7NebRLEJPWkOwec1VZG2CMrJ+qmnCW 3NoDHcexQdpv+8eWzuK+uf7nzw== X-Received: by 2002:a65:5184:: with SMTP id h4mr37881601pgq.109.1557209417270; Mon, 06 May 2019 23:10:17 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e184sm30786325pfc.102.2019.05.06.23.10.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 23:10:16 -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, Zubair.Kakakhel@imgtec.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 2/8] soc: tegra: fuse: Change to the correct __dma_request_channel() prototype Date: Tue, 7 May 2019 14:09:39 +0800 Message-Id: <1ddb1abe8722154dd546d265d5c4536480a24a87.1557206859.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 Since we've introduced one device node parameter for __dma_request_channel(), thus change to the correct function prototype. 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..e2571b6 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, NULL); if (!fuse->apbdma.chan) return -EPROBE_DEFER; From patchwork Tue May 7 06:09:40 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: 163475 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp937876ilm; Mon, 6 May 2019 23:10:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXImOEAK2fThLF3yjLsaOsmivbG/tYHwyCC1G/oDPfi+qaORSUPUoxn6m+uWIN6wa3jUuv X-Received: by 2002:a63:231c:: with SMTP id j28mr37690996pgj.430.1557209423699; Mon, 06 May 2019 23:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209423; cv=none; d=google.com; s=arc-20160816; b=AcpTLbw2XlFLq1RCk8QwsUhy5B4V9e6d1Nrj7Aa0X8jRLyRAo0D13dvYQI91F7C7XK MPg7j9hepnGTndtjL1xSTd4wJnCLPNtQf7LJuXA1da39EzgmrM0SiIoPgbRj0nJboqTZ EQDHO8qJ8tjUhe+dR61H6XN/tn9lGUSgmSxMMQqwXhv8JRzoI6VqLQu8u8zfARn7ZN37 Xs9qybkQgaQGjBcg9LvhLMrUqJ/Spmir+5C+0prpFDSMnKRMeE2B5lpndUe4opdwibgl I3sibALO1znFfe44R+oKgkYE2EYmoffsT3hKac1vYgUTtgzgEsXRZLU6CoGgVDBCjHSY 3qJQ== 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=zZVeFg3ilWn9d8BrQHwI8nm6+PjT4Uc8w1q60Oaxq8U=; b=mJS3bpS6cnVFiVFQXVWj+XKnPACJkot3geC5HfUQswhcqChc90jJvtkfy9rFa/K+2P MA0wTpTGf6gvTKptc+LXkkTwUqL5y15RrXaprHNJds599E/lRxODQDwKtIQAIU1WOMaV l7i+DbWVEEVmK2e/k7siEQhvLjZKsxt4MS7BcMXI9esnTOC77UhpzWpY3W6P4hp2JoR8 20URGoYnaO/xI0x/vM9G6gL1tHVAgV3EUEK6rj/Umn6IgD1U5FC6q9xwsPY7oss2YmZS qvQ9cDIla50y5DjYDQ+VQKKPTtRyQFVdYz5HpcEmwrfSG0j15Q1mwdnBq5jUKUQ6gvr2 JHMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rPaqrwn1; 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 w126si18446357pfw.53.2019.05.06.23.10.23; Mon, 06 May 2019 23:10:23 -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=rPaqrwn1; 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 S1726556AbfEGGKX (ORCPT + 3 others); Tue, 7 May 2019 02:10:23 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46527 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfEGGKW (ORCPT ); Tue, 7 May 2019 02:10:22 -0400 Received: by mail-pg1-f194.google.com with SMTP id t187so3605587pgb.13 for ; Mon, 06 May 2019 23:10:22 -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=zZVeFg3ilWn9d8BrQHwI8nm6+PjT4Uc8w1q60Oaxq8U=; b=rPaqrwn1dFRkPgVFFCucjoHDO9tCwtxHdMU6tMSwe80W34i8kOmUplfqdBpDJW71dL HM7rhYYCe2OGnSSmfVroNtvEdyr6r7JIRywbildJSl0RVF6A1wLs6aWvKzSZ2PgnRXUr cCHXZ+OvTXZRbab/VqQs16S4bcCDRdFSdBLLkKHfQ2NssH3PQGzdeVU7HlXwxk6EchIq dOsBethnRBXf/G73slckz7OKvoPkhfOznt28Mc5bFa9lCakZNCytQ77xEb/RWjolQr8b 0SziRR+oL/8Spt70qUhBz+G15DXEaE9/MAvB/8OqYQXH9eRx9Nm1j2FxuRpLUtg1ymrJ HD0A== 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=zZVeFg3ilWn9d8BrQHwI8nm6+PjT4Uc8w1q60Oaxq8U=; b=VvESgPea6Az/5CUWObevSjWzANFYP/7T91pNpTRSwLtIAsN3Z7KCja3YAXWA6SmQFB lzJWDr4P9Cef9ARV32GeUq512Kt4SWqqNcE+CFyEBzP+QvC4w4mdX/Wdl7i3AwZlWUtz GJ4OVbS51Fv9IBNJMpelQAvp4405bvXinamKwIEeItjoZC8gy4TXQ5WLbmPtPOX3h5xd BltbBxZ+rICZGCJiaR+45ONWWaOYT1bkBB8hZ9tjoTfgkXmNIY8DvLdcJghd4axj6F8V osSvQOUlhmV9Fzw7+8qKz3XW0VL0i0DMIzIN55zxK/Ff4mSGT2eyGj833wvCrWejuXgg XIDQ== X-Gm-Message-State: APjAAAW7JNCi98n9AqjvfvTUfS2y5LV6gGk6G02+zFc+GrrBnWEWVJlK 8v1DBzV58T3OqfUpAo4EVLAmuQ== X-Received: by 2002:a65:62c4:: with SMTP id m4mr37228778pgv.308.1557209422442; Mon, 06 May 2019 23:10:22 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e184sm30786325pfc.102.2019.05.06.23.10.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 23:10:21 -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, Zubair.Kakakhel@imgtec.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 3/8] dmaengine: imx-sdma: Let the core do the device node validation Date: Tue, 7 May 2019 14:09:40 +0800 Message-Id: <60acb5443a9bc18789bd86d6722f4726bf372fbc.1557206859.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 5f3c137..1a11118 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1921,16 +1921,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; @@ -1958,9 +1953,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 Tue May 7 06:09:41 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: 163476 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp937953ilm; Mon, 6 May 2019 23:10:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLqVxh1QJUWAt7njEX4XUGzRg6sNdcbLVnFYjGZe1fFbJR0hN9QrlmNs+VZ3YWFgBWtvgr X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr38188798plp.291.1557209429646; Mon, 06 May 2019 23:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209429; cv=none; d=google.com; s=arc-20160816; b=Bqsdp9RtsfTS333aPvdCHbS/e7janSGM9SHEfriu4WbXQXofmVKQc2f8Gfo7/ymR63 Bb60xYTDdJ2XQ6IY//RRSW4j6nlSOvhDtGVy4kcXu/pJvkHiih9nFEhgXMvPOoIZVjko sNyZo5jgcRs7yR5YifeJcpDi3/OPH7cO1vz/PFROuptztRVvys8eKc9etuB+4CiMjviF ZIjCwYNlnkEZwgvdvOop2sIY1C62lUJCSfZmFPJtMXSD1vs7pvx7KG2BbFVY9Vxk3kob 6yqqpzC3JR4Ipyn4nlt19S1zxCLhrQc7XGjrULsfP6+JnmONBIi0xntJa0q+fdEc4vGj Hitg== 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=eUvY8XpqABQwC9GKuoaNZ1xQdpGSYWsmA3dukRRvzUUbQi9k3Id51JJmi5vVuNr4Z+ ukXoB+TshOwWqTVwW9rT1nKi7wmXdlKlm/UVq0Al3yA0XI8Gvih/rvOmU/+bR8ACjhnl devIIf5VgfzXP9AeBEnvAc3+MJMjriL5EBTrTMAJCqI6P9SQ4/ymBuBwsZDShKMH4Q/E tYXjUBctInEgaqTU2sd00AIaQ2YC6vA3kkI8geuOArvevbw5cyduqcXMdrYkrDm7AT+2 iAQY51QnHQZAQvStl+qJrtNQ6XQ8qvS+Jm12seUtgK4LX9+5f72Hp9kHv6who3Ta+vcr izxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zcT6IdJy; 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 e19si16940338pgv.63.2019.05.06.23.10.29; Mon, 06 May 2019 23:10:29 -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=zcT6IdJy; 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 S1726903AbfEGGK3 (ORCPT + 3 others); Tue, 7 May 2019 02:10:29 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:33605 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbfEGGK2 (ORCPT ); Tue, 7 May 2019 02:10:28 -0400 Received: by mail-pg1-f193.google.com with SMTP id h17so1752588pgv.0 for ; Mon, 06 May 2019 23:10:28 -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=zcT6IdJyApB7KuMxuSWwG5peXYnsSHChNqw51B358ycUWDId/NngGMOqGHnT3h3bSm qChmgQ9pGa5Yu+EMHMNgnlyKYIB+8jttgce0QhMdtSj38lOgaDPhUawls09xh0d5XiU9 XcUQsGp7Ng6At2b8JIe5cM9Fi4JL9LcN1RY7mpjCslKb9GSOd5Mhf/HsE8HqngQ8riLP Tn/Gs+4flfKLlVDKesVK3VuGQZKXSUi+yaLrRL2c29XWNjnhW/3qUQ/1SZeyFjforxBc bUG3zRsnRVBy6oLxJo+88AKeAdIeoUpkW0hyt61HMVCFbY41ZhTb9Ur818qX/RjkvnlV 3E3g== 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=tdYhahXJI1PGO8SJL9bUtadjzwe0qEaM0X1h9unC0ISUPVjYsAQIf/y6+55XMdwH5V RaDPpCcWaWDNFIMIZzeaet+a/srvJXiT7RydqCElXUimFhSWFARP6aRLuxzWNFPAgWeP L81Ro4ygK6X5NwQx1lXcgZuyyG1BtJ61KEJonGJF2H9Le742doPtlEucxqrtsl7uzt1p udyHdxsJEwpDdhDrgKkiqV+JKoF2L0dToD5hZ9WL1s7ESo2+46rym9+jBn9vOb90KeN1 lRzgEZkGty0z7oCo4UNjK6p6uQyuxltheiK5quZUMbA7zgqwB6ztIYAb+hGwznZezIGY BquQ== X-Gm-Message-State: APjAAAWItc/AJJxCJiCenvCgvdPA0GGdNx/f3LiOBMwkj5vPPFDCENl3 ga1CpLbZBCVKZs+hiHrvE1V+VA== X-Received: by 2002:a65:534b:: with SMTP id w11mr37576307pgr.210.1557209427968; Mon, 06 May 2019 23:10:27 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e184sm30786325pfc.102.2019.05.06.23.10.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 23:10:27 -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, Zubair.Kakakhel@imgtec.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 4/8] dmaengine: dma-jz4780: Let the core do the device node validation Date: Tue, 7 May 2019 14:09:41 +0800 Message-Id: <0b8b0597623608bee186c573511be127ae5939c0.1557206859.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 Tue May 7 06:09:42 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: 163477 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp938032ilm; Mon, 6 May 2019 23:10:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAT48YdXmdqj1O60ixZj/rmZ8mWtRa8R8NzRpmSMrFzlHFETNoGIpzEHkQP9MZLhKZQcPs X-Received: by 2002:a63:5c5f:: with SMTP id n31mr38061104pgm.325.1557209434667; Mon, 06 May 2019 23:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209434; cv=none; d=google.com; s=arc-20160816; b=VOvQK7MZP01SPfG3nOeXb8fFMsJlzu7IHQaatNIod406NoN5lBHszZYXSjbE+zpKeV ORjYJgSuWdXeGBTokqJTN1Fp0l76wO9gODRSk+MR2Lq9r8bpwETdBd0dpI8k+I9wrUyD tZUCuOUKjOysLhkxKF2vRaL7wstdXnDtHPzKuJPbJUnZxlFjHkx9SRqRGMgvFM0Rot0y l2huq8JhXAzbaARcThXVCohIJ4ErBuxyM8BNr7dyS3Ez8aTkuG7XPE8WXjMJ0mW/5rIC 5l+SBBHS3L55G84EIGynZGnXc6IdZn9XpG9+h6CDwkIBaozH4QETM6lbh4znejl9SE1m Gd9Q== 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=oYIOHQyLd6XznwM57vZkEW+MTvH/Sn2bel8Orp612p8i7hXHK4p1+c4l13w3wK61fj tqm/98tKGEZlxAnXK3x8RZb8Hu5fEAC179flLpbJzDTXxf+gMFrcWhfp9b3kfyGuX092 CF+vF+/bOJ1na7IC9QC8a/dxB6OTgSTdCGZnPkVsRcpJU0bLc2J573Qvx6cwgmmaiOG2 HfN5hhHRYWTG0mrJTmSoE1Figan0pFJyZ1gZxbRh0+Fu3fOgxsGJ3R4ciqznD15X/ng6 /jSP7yXLojrUoifS+2OXD6jMZYazyfjl/0jlPYmlVb/POeo/6B2h/FrcCcUzsfZsPnd7 1iVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uzv8EVMR; 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 n8si17006415plk.108.2019.05.06.23.10.34; Mon, 06 May 2019 23:10:34 -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=uzv8EVMR; 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 S1726491AbfEGGKe (ORCPT + 3 others); Tue, 7 May 2019 02:10:34 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35083 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbfEGGKd (ORCPT ); Tue, 7 May 2019 02:10:33 -0400 Received: by mail-pf1-f196.google.com with SMTP id t87so7502420pfa.2 for ; Mon, 06 May 2019 23:10:33 -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=uzv8EVMR3eIzQHGMxtSinQ33vYdmES17QK9vAF+is0gNJPHupQ6KVAf610h40rDqTl mKBgUTk+Ut4Bj4VyJSGfixnwuP75KxLZ3rR/dD2erhsgubg4C/SDOyF3lwNeXv/ZK/Uz vqb4YQm36emaqBt81ttPnG4INyLLePjLgEmt1v999Hrge64h4BYHk6qG/Mm0fiZHHeZ6 +SOakh5BXaVbgLcpXRF457kFitWiq+XbN65xMG0L42NrHyiIk6ZXZ65Ekx2ps3k33kBs wFL151kgbUjIgQ1PyFgu6oGhvnecnO7t3n2+7Rq3rM0GwUhfQR9XNOT1c9vmI362POjI D3/g== 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=L5XQ3pO39Fr3rrsR7KsI5EjHBWMR7xowhZiuU+0YUnIrpwtx3KOtyQ7joz547j2dCL k9Xx5PfUjIKcpvZvYlKysLKXsOUwVeH3PB3+I152N+3BNW0HLkMsKLnn5bGpOcBN6xFq OkFcHb+BnaJ4/eLKRWTbVqB5uQq5ABUM7idM7KGN4L2TTr7HGKb5bmhViiVoFwTlrihH fmds25FmtAU14A39QBap/ydAF76I/IzHnXWCgsjdwmINjZXKUbkgStPjVo57vFBzy9Ri mzRmPWztetjtWIh0oNK8BpJG8Xhg+Q2jSgqOtODrrgKWR8KCBHTpgx+8PDBXT8OH9jD/ ht8w== X-Gm-Message-State: APjAAAVD3ZNTHB2gwOH+5Cws+O7uJXM1KhJJV+VZ6p6LkhiS/ecsiOmQ b1sy6SzKEtJ3SUXT6rT6J6mRsQ== X-Received: by 2002:aa7:98c6:: with SMTP id e6mr226683pfm.191.1557209433209; Mon, 06 May 2019 23:10:33 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e184sm30786325pfc.102.2019.05.06.23.10.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 23:10:32 -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, Zubair.Kakakhel@imgtec.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 5/8] dmaengine: mmp_tdma: Let the core do the device node validation Date: Tue, 7 May 2019 14:09:42 +0800 Message-Id: <1c420603d220b1ab28f7d98165bb37feaf706f61.1557206859.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 Tue May 7 06:09:43 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: 163478 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp938092ilm; Mon, 6 May 2019 23:10:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYWq+8K6xRgKgp6ndfp0wsKxFTiOdbNEnwzJah+X6n11WradDztKJH0o2khxuEmJgvtDQH X-Received: by 2002:a62:5653:: with SMTP id k80mr25789853pfb.144.1557209439813; Mon, 06 May 2019 23:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209439; cv=none; d=google.com; s=arc-20160816; b=dAzpnqudqL9Wda1UqXlD8JS6HRteb2ya44Hd/1gqcDfWv568qS4kQLuv5R+o9/+KsP ULxluit96egjzsbrJelwiaKQHnRjAqEa3R98vR0SN5XMy9kDV/DBzfk2qad7vNRs08HD GlUDhMWnaMZORg2l48FXXdUhisuhSKDf6b0ay1TIHLS3bLx4nGWYSpqRhhrHTvAbC/Xs GoG/Aa5JPMIkSBF2tCXBof1n+oV+hFncwOGtiPFediczhdAvE3OJNBqdp487hw/n9jog yxJ3eqQsSHepJsD9clpwufT0tsQH5Ds65G5qxMZDHhAxcbxEBBRawWM3vTjJbIeBZvAx aafw== 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=Ht0ALxJP7cHIgX2BFiAkk68306jKX66WjGg+0heuSHt3H1zv8cmKca/OFlUFMMk/A5 VRHEvsD5ps+9PQrN6S0P5Nz0iVd1cUnopUnuzYNHYR4X6x1oDrG68J7g1vEB1RZSpu3P rcBE6ZTIa6TpAnuEIXSpbGT2ll+Q1Jg9l/zORftRpVUjxoGUpN4049ELczx2do3qKs67 YauNNyle0v2K7DoeYRlrRKvBZECq7EWocIUyfpUB1s90FNzt6EqZDLpJMtb4BFx/6RvT JROsJgVl3dwtAttBB0XjE+Xmu5p327q5L65JuR2PMq0X0Ki0R+/VtsxSzk5ZQmo4MmEV joAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EPTCkX6P; 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 o188si4244522pgo.489.2019.05.06.23.10.39; Mon, 06 May 2019 23:10:39 -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=EPTCkX6P; 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 S1726400AbfEGGKj (ORCPT + 3 others); Tue, 7 May 2019 02:10:39 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36810 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbfEGGKi (ORCPT ); Tue, 7 May 2019 02:10:38 -0400 Received: by mail-pf1-f193.google.com with SMTP id v80so8081709pfa.3 for ; Mon, 06 May 2019 23:10:38 -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=EPTCkX6PIWp6H6mHi0TmZyBHNTkNiDCOjwIvq4y+k7bAcUKgg+aAQYSeUiGtcEFhac uMQAb8Ce8bUqBZz0qzb3QD+1St8FT3LKJBOg2WJ79dLdgMiEnyhT6dED9GpA50HiDYXN g0cKvEmfcBjAZftLALFM6YJyyLCO2jGotOdpdiT+Jjqk4ZyUCejl/+4S7hjOJBIeAEgH EAM3+6a/PJghpLImXKKWgX2TNnpm0v9a0iYFb5ZHU9heUH6Nziw1o22ZNlXNQi/VzWyP yMjMvo3QcgAZii1n18z4Ol2nN+x5pdXG7MSREtWPwYDbLaQVwGa4WWigS7aVj5XMz8ac hXmQ== 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=odSiZxdGj1Uq3o/g83PfqFdHzAqxud8Ki0MeiJQgrntjMeKdI5gHjulY8t98Q1No9X Cy1+kSVNvZGzMJ4VJ3CMGCVaMwvY5WlIEYAx+Yr2z1gl0wMtV6zWghtOElK//pnkSnHK gk0TxsvJHaP1rc7XkgmVj1muaTV1AAgriPIQPXeSpOB+F0U71g9edH31tdIFzoLJPi6R 95O2OqbDddpYmDeuy3WGVmqrlqvl6C9EPHNwJhlJTcACqvODsAc+woOjeTws0X5ZSih0 Emp0czltyLs7DQ4cI/VRYbwQpjiE6LJ+XDivNlpaT7K9V5UhkpnKs/bsq7YjTYVkNyqo /xaQ== X-Gm-Message-State: APjAAAV3xbL5vFa8i1EP+w0W4MPkbUgHSoTmWQhX8tnEH8t6jfC/9xUb fbNE/Jve2S6rPgq3IyzFVGLK5w== X-Received: by 2002:aa7:90ca:: with SMTP id k10mr1280408pfk.20.1557209438341; Mon, 06 May 2019 23:10:38 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e184sm30786325pfc.102.2019.05.06.23.10.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 23:10:37 -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, Zubair.Kakakhel@imgtec.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 6/8] dmaengine: mxs-dma: Let the core do the device node validation Date: Tue, 7 May 2019 14:09:43 +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 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 Tue May 7 06:09:44 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: 163479 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp938205ilm; Mon, 6 May 2019 23:10:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSKM6WnK+KRpZs9L/nePX9xCJ78uMps79pyStuh5VoS4Sfe0h2fTQ9tAgpfx0PcX3Vn6iC X-Received: by 2002:a17:902:8d83:: with SMTP id v3mr38187023plo.283.1557209446631; Mon, 06 May 2019 23:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209446; cv=none; d=google.com; s=arc-20160816; b=CjC5+HqUora3gFyAP0dEqGu27OpdK9YrIrF4iVay9ay3ivXeYd1sjHx3i1ziaImC+s v6aqec98uIZjqewprSQnPyPzfMZ233r3F/a2Jjpw1pEIOBUIGngdfgLTXbgVDkGKPv00 io2xV1M7seUJumBcIRQQfhW0VOOO1HbvTlNe3pQ2zpDm+JrXfwD33Ilp+G6RgDHs1LOU 8w543FjXCTt0MA1mHInytOJ5sEQoUpIlh2Z2reshQPLlff7UHnTU1wQ4JTohtyVfXHVx EP3ptuFGYbw6e1ZAy1Jah+t9ekBFzJjyrTYK9m/Op9n3pN0B0cC4vyUh8IrdT4bR4+rZ boFA== 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=QS4oURfHIZFUpa7KdJQnPIiOEuTfxlscK4edcryrvp4=; b=Zv6FDcKeYM1xSTVSYeoTHIg7igaxy+xi7UQrgeroWc8+vHpvNfrxGQm1xNKZ3+Z6KY hi5ogKEWA1F2V3ErfUdu/S67ABiVqxEyBoMFBpQkjfKIL4eRr4mA//0yHNjr3u2X2UPT ZZ6fpftzfgwV4v5FPGylo/P155TlFmTjCYGpTJcU5Rej5nbEu7VAtu7K3xqKN2rLeasD J0DggFUQAo26YXaCXphY85r7/9Vo/s7ZIYRHK+4zjbipvUYIUGtDcvGixYxc7rvGlG5r qHJYzXcNtrNe8RFGordMsBUL9OPgTs7PtO7GJeh/dOWzGv5o5PMB/bGaJEVHk4fvCYLq 29zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=maZFVIBN; 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 x14si16921534pfm.179.2019.05.06.23.10.46; Mon, 06 May 2019 23:10:46 -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=maZFVIBN; 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 S1727121AbfEGGKp (ORCPT + 30 others); Tue, 7 May 2019 02:10:45 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33821 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfEGGKo (ORCPT ); Tue, 7 May 2019 02:10:44 -0400 Received: by mail-pg1-f196.google.com with SMTP id c13so7743160pgt.1 for ; Mon, 06 May 2019 23:10:43 -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=QS4oURfHIZFUpa7KdJQnPIiOEuTfxlscK4edcryrvp4=; b=maZFVIBNrGmfcQkxEh1uEEdXnaUgHkn3AsT3Rf/6klFaj6bfdmt1TliBoh7dY/CcSx YInGUoE9/OW4UzgCS1ptn9nWpJ97rk4CGoDlUcraSG3BFloczr+Y862nxym6+52jMg0z VIwqdFmTKB/etS/WqQfKc45L9vn2ZbxUpoSvWbYU0JTCOfaSy+jrOo47Hb3vNWNYuAA4 16TmzMN6uOMSc0NFoCSnkAm3i0sIMCtXl4saaqrFyn7gVT8BoIfXwfPQecLimNaDvq2z iuP/ykZ9Vpch7A1Z9HwQxiVZlsFLXcLjGq79ZTZy45jB9ERN2ejUJC9wkHSAv+p/yfXy D4XQ== 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=QS4oURfHIZFUpa7KdJQnPIiOEuTfxlscK4edcryrvp4=; b=H/eLbhPZJy/YH/uGrXXrk0+ELiVteOv+kZQ7MNTDymhQcXnkRawC4vnXAFFk5EeIsI 0W0qvphYfau/YENWy+gMmEQU6fPSu33l4VSiQ2ifSJuUQ6wjrrw8KTwmG8xjcO2OjGhm Acx4nWgRk8p2dDJtgXoBVKUAcno3RuHo7BN7t85b119/DFi49jQOYZTLXDXPNmGaHpQW UcBxMjE9uhnp8QG0GwHlqUXVcanmisp9dgodvLo5nj5Ss3TW7pVpdvamR0igEKS9nahN X9+tuoruBiPow9rnJPsZRAoRN61qH7L/TGJ6zbgOfFmUyPo95DJV0wCFdn/bEAn3M5PQ d6rA== X-Gm-Message-State: APjAAAVahru177VHzgHqV7D7ChAN9jBkxfOWzhEIVTt3Ws/Zy9oMNRLr 8RYZ1ltHXQEBFfszr8/DHNnT2Q== X-Received: by 2002:a63:42:: with SMTP id 63mr37776526pga.337.1557209443520; Mon, 06 May 2019 23:10:43 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e184sm30786325pfc.102.2019.05.06.23.10.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 23:10: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, Zubair.Kakakhel@imgtec.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 7/8] dmaengine: sh: rcar-dmac: Let the core do the device node validation Date: Tue, 7 May 2019 14:09:44 +0800 Message-Id: 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/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 2b4f256..9474d5b 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1632,8 +1632,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); @@ -1653,7 +1652,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 Tue May 7 06:09:45 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: 163480 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp938294ilm; Mon, 6 May 2019 23:10:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaxxrgsFi2vVQAcYoAyA3mtNqMh4UUIigMTSCuoiDuDZbQeZpHqIQhoTX1zKhqqJNveXP0 X-Received: by 2002:a63:d408:: with SMTP id a8mr36845578pgh.184.1557209451918; Mon, 06 May 2019 23:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557209451; cv=none; d=google.com; s=arc-20160816; b=W0ssWg0OqFM6EoXEHY1UT3/DssTbMIyq8KXRWkcOt1WQAZIhRMMDKKk3H4edckMllO pnLAEHdEg4J0e2+YLO3vxYbjGEaQhl6O0cEL+TU3RWcnz9ZL5SZjDhzk/bcdWjw76xEp s26jgeiL+R3Skro6CE6tlWKq/eNpHNDY1gpIqRjFGyr2H/7dtfto1Lv/vZh+kj3KqqhS dJzC9+UFKHRzrAiVzu+Wl6peJHLyk/o5A5JWJVQWlANV/2Om5sToM/h0sNV5yqcFuj/z YQZiKwRXgm4kl856YcPqWo2QquPR91Ez03AS280A02YNm5WjzCmjBGREARlUAX7WQJLy nOvg== 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=dKM3HHDqNI4ZTIWkNm8Jto2zEE/Fv+acrpOGGhZ1aeBuxVRK529urK+8Pt2W7YVQv3 2c1Ul0tFWZdXaNiYPHuCVSrBbFehpKNNvOrj92iyCGInwxa0bt70fiGUe8BCIoJ93sEU 25Ygh1Km6zW06hJEVu5Jro87Ohqbh1oTR5SNB/qQrK7H4oRFxOf8bLz9HO3JJyx4GM6k PQg0/u8p43f5waIOHWY2i9mhHGMiVkl6+6+1Ytf5lvqd9XgUoKZdvdo7J5kuP4eHTEqZ Uzj5WjcrwAUgGxmrZ+PmGQ+fyRR4+gel5Yixh4RcQQzqyrnETH/aLnytb8SPWP2nreSI RDag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S9Cy/p1G"; 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 e15si17733505pfn.31.2019.05.06.23.10.51; Mon, 06 May 2019 23:10:51 -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="S9Cy/p1G"; 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 S1727143AbfEGGKu (ORCPT + 30 others); Tue, 7 May 2019 02:10:50 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:38252 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfEGGKt (ORCPT ); Tue, 7 May 2019 02:10:49 -0400 Received: by mail-pf1-f195.google.com with SMTP id 10so8081878pfo.5 for ; Mon, 06 May 2019 23:10:49 -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=S9Cy/p1GeoEOtS8YQZgB0lYyFi1dHKS/HGpgplRm+Jl+6OwdRLa3AqzF/D5EUzwLum 6hKH5eF/hHqGo6nqyFFDunpeoF4PfUOZ4/3aiB1lh7Zg+TO0UrCiOOaD7NClpHGZAiY0 TW96Fv/P4Z05tGlR7xVhb505XEaI4omMP478SFFOL/CUS/3EEQurGtDg+8HfcBpLYr8W Sk+/f/aBON9i+QLuBzR1USCQJWELEUjdKzeNLt2a/DSVGTvrqPvpmw3vwNaYio7Muj4g 1s+6KN1usY/566XMORgT84favpF5luB63k/rnOCSRzVpCQhtbAJPLNl4Coh1vz8pOguZ +IIw== 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=UX14eARs7lWm8IdNL/DgVpFaht2oI9BAvAWk2MIo5LZF9dt4FdLqPP2LOkg0or48zK tvKU5GGb5+6ls3hcrsqMo2oTdnxQGgZwEdy8q+kqNxC+Z/g9lqljg4AyT8Dt/QI+WB9a Dj/8CKZwOQlXnylbtWw5bHwtbNJ15nxWVVbSwBqtyPIUqMbNqZC6aF+fO6x0m8IRfRIU +1o6ixZRuJV0Mw/S6MsgNmfKR0/3V4PyMJ182GQHjkG7AEzshv3dG1SfpZfc2CW8XaF0 tplfoQGKXHqHTnAWGzlw4Kuh+CanGmmcMP2/noCQVpwe4quOPSt/htTNMHj8u9SYw91h OTpQ== X-Gm-Message-State: APjAAAWv+j2IfzWBhgBVPq4mXUZPA1GxG4fHBXstdkYFutCSRq6tcqbV 99bToFMb2frQsvmxdnKj9XTdrA== X-Received: by 2002:a63:1706:: with SMTP id x6mr4603838pgl.280.1557209449086; Mon, 06 May 2019 23:10:49 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e184sm30786325pfc.102.2019.05.06.23.10.43 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 23:10:48 -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, Zubair.Kakakhel@imgtec.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 8/8] dmaengine: sh: usb-dmac: Let the core do the device node validation Date: Tue, 7 May 2019 14:09:45 +0800 Message-Id: <6dc4f90df68276e6c21f7e0087b91e95b153f85f.1557206859.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;