From patchwork Mon Feb 3 10:18:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 11362357 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5530313A4 for ; Mon, 3 Feb 2020 10:18:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 347CA2082E for ; Mon, 3 Feb 2020 10:18:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="a9l2v3Nk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727882AbgBCKSS (ORCPT ); Mon, 3 Feb 2020 05:18:18 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:57928 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727905AbgBCKSS (ORCPT ); Mon, 3 Feb 2020 05:18:18 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 013AIB5n127276; Mon, 3 Feb 2020 04:18:11 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1580725091; bh=77PyIHjs3pH2mbwM/5I/uOO043kgBRhE+aAAhTBWXeo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=a9l2v3NkXRj7wORqyU6ijhLntqTbFlpV7U/Lng+VpPF3B3o87OEcvkdB29HEe2w3m laNqX64ywRbYi5wD3Pqn79jIbRlwYTEU2jCn/p+lew1tPysuNz768LUvknyCqSS2hD u5H4CFMqV4+yV5oR7iACdPs+CmsNs6sy4QSnhv24= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 013AIB7K092879 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Feb 2020 04:18:11 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 3 Feb 2020 04:18:10 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 3 Feb 2020 04:18:10 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 013AI7mT040513; Mon, 3 Feb 2020 04:18:09 -0600 From: Peter Ujfalusi To: CC: , , Subject: [PATCH 1/3] dmaengine: Remove unused define for dma_request_slave_channel_reason() Date: Mon, 3 Feb 2020 12:18:04 +0200 Message-ID: <20200203101806.2441-2-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200203101806.2441-1-peter.ujfalusi@ti.com> References: <20200203101806.2441-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org No users left in the kernel, it can be removed. Signed-off-by: Peter Ujfalusi Reviewed-by: Geert Uytterhoeven --- include/linux/dmaengine.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 9f232b7618f1..6702df107d79 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1495,8 +1495,6 @@ static inline int dma_get_slave_caps(struct dma_chan *chan, } #endif -#define dma_request_slave_channel_reason(dev, name) dma_request_chan(dev, name) - static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx) { struct dma_slave_caps caps; From patchwork Mon Feb 3 10:18:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 11362361 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A0E013A4 for ; Mon, 3 Feb 2020 10:18:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AD452082E for ; Mon, 3 Feb 2020 10:18:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="HYNKCXyr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725999AbgBCKSZ (ORCPT ); Mon, 3 Feb 2020 05:18:25 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:57930 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727023AbgBCKSS (ORCPT ); Mon, 3 Feb 2020 05:18:18 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 013AIDDl127288; Mon, 3 Feb 2020 04:18:13 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1580725093; bh=WIVihqnSycLXDyolXt07z45P16RfSqFN74PakBFswQc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HYNKCXyrdjSTspK0uJHd8pdl0ZPPlWQaJyxbgYAbFuJP8VfMRPXN4pX89awzUvIsZ xLKDsO3ywfRmi8GS/FfSuBCu2BMlL/1kWieokk9H7edicZrwRJxISciOclRbmMjMUA XnxmQTqLgVgyWKEIKpCbGUnKpc4KoryZsJj9VS9E= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 013AIDr2039797 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Feb 2020 04:18:13 -0600 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 3 Feb 2020 04:18:12 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 3 Feb 2020 04:18:12 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 013AI7mU040513; Mon, 3 Feb 2020 04:18:11 -0600 From: Peter Ujfalusi To: CC: , , Subject: [PATCH 2/3] dmaengine: Mark dma_request_slave_channel() deprecated Date: Mon, 3 Feb 2020 12:18:05 +0200 Message-ID: <20200203101806.2441-3-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200203101806.2441-1-peter.ujfalusi@ti.com> References: <20200203101806.2441-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org New drivers should use dma_request_chan() instead dma_request_slave_channel() dma_request_slave_channel() is a simple wrapper for dma_request_chan() eating up the error code for channel request failure and makes deferred probing impossible. Move the dma_request_slave_channel() into the header as inline function, mark it as deprecated. Signed-off-by: Peter Ujfalusi --- drivers/dma/dmaengine.c | 18 ------------------ include/linux/dmaengine.h | 15 +++++++++------ 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 121231300d35..8ec2257a8d88 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -781,24 +781,6 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name) } EXPORT_SYMBOL_GPL(dma_request_chan); -/** - * dma_request_slave_channel - try to allocate an exclusive slave channel - * @dev: pointer to client device structure - * @name: slave channel name - * - * Returns pointer to appropriate DMA channel on success or NULL. - */ -struct dma_chan *dma_request_slave_channel(struct device *dev, - const char *name) -{ - struct dma_chan *ch = dma_request_chan(dev, name); - if (IS_ERR(ch)) - return NULL; - - return ch; -} -EXPORT_SYMBOL_GPL(dma_request_slave_channel); - /** * dma_request_chan_by_mask - allocate a channel satisfying certain capabilities * @mask: capabilities that the channel must satisfy diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 6702df107d79..4c522bf6ac25 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1440,7 +1440,6 @@ 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, 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); struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask); @@ -1470,11 +1469,6 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, { return NULL; } -static inline struct dma_chan *dma_request_slave_channel(struct device *dev, - const char *name) -{ - return NULL; -} static inline struct dma_chan *dma_request_chan(struct device *dev, const char *name) { @@ -1544,6 +1538,15 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx); #define dma_request_channel(mask, x, y) \ __dma_request_channel(&(mask), x, y, NULL) +/* Deprecated, please use dma_request_chan() directly */ +static inline struct dma_chan * __deprecated +dma_request_slave_channel(struct device *dev, const char *name) +{ + struct dma_chan *ch = dma_request_chan(dev, name); + + return IS_ERR(ch) ? NULL : ch; +} + static inline struct dma_chan *dma_request_slave_channel_compat(const dma_cap_mask_t mask, dma_filter_fn fn, void *fn_param, From patchwork Mon Feb 3 10:18:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 11362359 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 056D3138D for ; Mon, 3 Feb 2020 10:18:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D77F320658 for ; Mon, 3 Feb 2020 10:18:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="fDP89lzj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727918AbgBCKST (ORCPT ); Mon, 3 Feb 2020 05:18:19 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:54098 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727911AbgBCKSS (ORCPT ); Mon, 3 Feb 2020 05:18:18 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 013AIFsb118145; Mon, 3 Feb 2020 04:18:15 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1580725096; bh=QAD8MJEBJU3Ct4VsAMm9RYlxHl5Eot2UW/ytZA5ij2c=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fDP89lzjz0/qmrgLHNqhnc66MpWL0QVHIpbxQisA9zIITw6usQo3ujzGn0AS4Enle ZVzOexmlYcfu9voWeP3mK6AVp4y33/sAuuxDSoJINvKeRb3XFEfYVdZZvxnMsimP23 +j/6uCmJ/rcWOlfLdkpQSqxZxU1TNjN6u8cBoE0w= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 013AIF4j012117; Mon, 3 Feb 2020 04:18:15 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 3 Feb 2020 04:18:14 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 3 Feb 2020 04:18:14 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 013AI7mV040513; Mon, 3 Feb 2020 04:18:12 -0600 From: Peter Ujfalusi To: CC: , , Subject: [PATCH 3/3] dmaengine: Encourage dma_request_slave_channel_compat() users to migrate Date: Mon, 3 Feb 2020 12:18:06 +0200 Message-ID: <20200203101806.2441-4-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200203101806.2441-1-peter.ujfalusi@ti.com> References: <20200203101806.2441-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Users of dma_request_slave_channel_compat() can be migrated to dma_request_chan() by correct dma_slave_map for the platform. Start nagging users in hope that they will move. Signed-off-by: Peter Ujfalusi --- include/linux/dmaengine.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 4c522bf6ac25..581f6822a7a5 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1547,6 +1547,10 @@ dma_request_slave_channel(struct device *dev, const char *name) return IS_ERR(ch) ? NULL : ch; } +/* + * Please use dma_request_chan() directly. + * Legacy support should use dma_slave_map + dma_request_chan() + */ static inline struct dma_chan *dma_request_slave_channel_compat(const dma_cap_mask_t mask, dma_filter_fn fn, void *fn_param, @@ -1554,13 +1558,16 @@ static inline struct dma_chan { struct dma_chan *chan; - chan = dma_request_slave_channel(dev, name); - if (chan) + chan = dma_request_chan(dev, name); + if (!IS_ERR(chan)) return chan; if (!fn || !fn_param) return NULL; + dev_info(dev, "Please add dma_slave_map entry for %s:%s and migrate to" + " dma_request_chan()", dev_name(dev), name); + return __dma_request_channel(&mask, fn, fn_param, NULL); }