From patchwork Sun Nov 11 15:47:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150768 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155460ljp; Sun, 11 Nov 2018 07:47:22 -0800 (PST) X-Google-Smtp-Source: AJdET5cMrNKWqtCGDH3wkq8MHKXITkx9BP7K3u82jjMfOETe/xsLCyFBEYXPeD1aHEU5UgotxYbL X-Received: by 2002:a65:4208:: with SMTP id c8-v6mr14199197pgq.335.1541951242655; Sun, 11 Nov 2018 07:47:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951242; cv=none; d=google.com; s=arc-20160816; b=ILxvkkkqK7Q86dcpSGh8aLJaK3ClYIwHVG659gpqu4BLNgGO7UEi7zYB+y+VIX8nGH vDqizhzBHlu8+oYMBlQIMaBBTdh0DtCyhPfi7gD9sFFujPleIAWCCfiGhKSvlkxbFC9a 2egVfl0kcOoAjgVox8EEr3ssulTJVRG9o4sgzdS3Gsd4zC1SVps90QcYyftk7hjD6Ldn yo9k2n5g4O1VLrjncJQ9vTfNB9Z12NKXZa9UJVlInEYaj83ezUm3zyzCtmORqPZWtdbi cs4Kd9PDyoxRktHs0r+t1p6UmhdHoAl4e6yul331vM8+nebIyREAI2s9x36kIFvL9teJ 7R0Q== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=kRHPQiJsYRW3DFfjFJZ7qEYJPmxAzxT204JIrDY6S18=; b=w8B8Ob9tZzDeFhRzu27r8RFHzEVOue1PI442ZH2Qw9bQ4knuy3pMW1s2tzpOjxPAee dg/xP330SWml6n8VpHx+2x4ypxax2HqdS3q9QfKwn5ls8gyUwSKK4ve0Ynx1K6Ku4Smc nzGxnVXhDZqvMvDpyk5cyPjro0IzcaEU77SWsYBxiUvfprTXJ6dXQUnAtm/HisE9+ynb 4Am09nwKUpe310L5r2/6INhuZdWL1mLGWD0XhgKuu3hJ9Seq9REEfzpVGYc/UugUtNpx 2LEUQ1l+HgMx/HqUrC7lXtjsLMnP99eiWVWIdisXU7eLec4rr14mzD5RgpR24hVlc9ZQ DBGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=juo1vL2s; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184si13183057pgd.523.2018.11.11.07.47.22; Sun, 11 Nov 2018 07:47:22 -0800 (PST) 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=@kernel.org header.s=default header.b=juo1vL2s; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728667AbeKLBgO (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:55988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgO (ORCPT ); Sun, 11 Nov 2018 20:36:14 -0500 Received: from vkoul-mobl.Dlink (unknown [49.207.50.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 22BBA21479; Sun, 11 Nov 2018 15:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951241; bh=aWVFRndksWzo+EVLWXTRn9U1Q6ZA9c9OOUAOGsNkqRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=juo1vL2sox/qzSZPczCoJSMh693YggwlHXE4cXtX6Y5QZM/3WqFAylE7Ur8BsuWFo DFc/X/KTY/3O+S3A0TCF3lv4a40saBGRK24eKLP2m1UajMoDnRujdAfbO5hb4znJkD pSW/LKFE5DikXc0ojLxkZLz3sCgB04NBYW3rLurs= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul Subject: [PATCH 1/5] dmaengine: mmp_pdma: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:06 +0530 Message-Id: <20181111154710.26904-2-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181111154710.26904-1-vkoul@kernel.org> References: <20181111154710.26904-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/mmp_pdma.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) -- 2.14.4 diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index eb3a1f42ab06..334bab92d26d 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -96,6 +96,7 @@ struct mmp_pdma_chan { struct dma_async_tx_descriptor desc; struct mmp_pdma_phy *phy; enum dma_transfer_direction dir; + struct dma_slave_config slave_config; struct mmp_pdma_desc_sw *cyclic_first; /* first desc_sw if channel * is in cyclic mode */ @@ -140,6 +141,10 @@ struct mmp_pdma_device { #define to_mmp_pdma_dev(dmadev) \ container_of(dmadev, struct mmp_pdma_device, device) +static int mmp_pdma_config_write(struct dma_chan *dchan, + struct dma_slave_config *cfg, + enum dma_transfer_direction direction); + static void set_desc(struct mmp_pdma_phy *phy, dma_addr_t addr) { u32 reg = (phy->idx << 4) + DDADR; @@ -537,6 +542,8 @@ mmp_pdma_prep_slave_sg(struct dma_chan *dchan, struct scatterlist *sgl, chan->byte_align = false; + mmp_pdma_config_write(dchan, &chan->slave_config, dir); + for_each_sg(sgl, sg, sg_len, i) { addr = sg_dma_address(sg); avail = sg_dma_len(sgl); @@ -619,6 +626,7 @@ mmp_pdma_prep_dma_cyclic(struct dma_chan *dchan, return NULL; chan = to_mmp_pdma_chan(dchan); + mmp_pdma_config_write(dchan, &chan->slave_config, direction); switch (direction) { case DMA_MEM_TO_DEV: @@ -684,8 +692,9 @@ mmp_pdma_prep_dma_cyclic(struct dma_chan *dchan, return NULL; } -static int mmp_pdma_config(struct dma_chan *dchan, - struct dma_slave_config *cfg) +static int mmp_pdma_config_write(struct dma_chan *dchan, + struct dma_slave_config *cfg, + enum dma_transfer_direction direction) { struct mmp_pdma_chan *chan = to_mmp_pdma_chan(dchan); u32 maxburst = 0, addr = 0; @@ -694,12 +703,12 @@ static int mmp_pdma_config(struct dma_chan *dchan, if (!dchan) return -EINVAL; - if (cfg->direction == DMA_DEV_TO_MEM) { + if (direction == DMA_DEV_TO_MEM) { chan->dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC; maxburst = cfg->src_maxburst; width = cfg->src_addr_width; addr = cfg->src_addr; - } else if (cfg->direction == DMA_MEM_TO_DEV) { + } else if (direction == DMA_MEM_TO_DEV) { chan->dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG; maxburst = cfg->dst_maxburst; width = cfg->dst_addr_width; @@ -720,7 +729,7 @@ static int mmp_pdma_config(struct dma_chan *dchan, else if (maxburst == 32) chan->dcmd |= DCMD_BURST32; - chan->dir = cfg->direction; + chan->dir = direction; chan->dev_addr = addr; /* FIXME: drivers should be ported over to use the filter * function. Once that's done, the following two lines can @@ -732,6 +741,15 @@ static int mmp_pdma_config(struct dma_chan *dchan, return 0; } +static int mmp_pdma_config(struct dma_chan *dchan, + struct dma_slave_config *cfg) +{ + struct mmp_pdma_chan *chan = to_mmp_pdma_chan(dchan); + + memcpy(&chan->slave_config, cfg, sizeof(*cfg)); + return 0; +} + static int mmp_pdma_terminate_all(struct dma_chan *dchan) { struct mmp_pdma_chan *chan = to_mmp_pdma_chan(dchan); From patchwork Sun Nov 11 15:47:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150769 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155483ljp; Sun, 11 Nov 2018 07:47:24 -0800 (PST) X-Google-Smtp-Source: AJdET5czd4VJ/eT8EaF9QgPohhpRs/1Ts9OKfuTNpq55IAdQzucbzghkLDkowwpL/7R+RpkmnCKn X-Received: by 2002:a17:902:2006:: with SMTP id n6-v6mr16825381pla.131.1541951244302; Sun, 11 Nov 2018 07:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951244; cv=none; d=google.com; s=arc-20160816; b=teot6XXg5UuVklqW6AGD2JPW65HL1rcm4nKag/LMSKmBcG4YBxgDG23SAcg1yQmme2 QmYHKkkj93FH6g6wGpMOik39w4wjBXH0wTQ1HSAxYRAu0p9EoJERx+U3BHzyiSpwur0j 6C4zJDSFtZdemsFMSxT3+WT9RmMMQig0wjvbzPRSzXYjtbFZlY/UMBibmAYvXwOTdVIz toMkOCLQYkvjkzk6YpDQMLZhEPxP505pI73bzUTSz8Jgx++VJLHmcVKDHlnXHwrRAk7N OotmI0pJCreegj5LEyKsZ58PXQzlJ957ct2cDKsq2J6o7+t70fTUNYveDjGjfLF8oAro 5pXw== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=B67kg5Ls36Qdi9luSW6o8iSphnQfP8Ay3/GekzeE8VM=; b=aB3B2rHBvAdS5cwIotWREci6fwrsYM2QiQqS4PpxMlvcGuyyOmF1z1S0JhLp9BagYx T0NSKvalLxSso4MUyDUc3lyjDFLGFQJQfPeXbTD0BHIAhS3BS9MCk7EgGa0M6MIBpbuu TzCKgWrHHiN/o1NUbcm8cdZEEwaau4KuleeFoOrxYCLEDRDbK79DKGZJGtw7Yk3NeUtQ xbumqtqEPEL+793TqBhkxHtN7ltKAkd0gfvYBCTW59p5tAN3LJ2yPd8SakMXXytBmTEF nJklXIPnnEmzrBy7zNtazL+Negj/FIWNAcl1G9JPnmXDE6DhsRXMAmNGLNdF+69GHB/n cUBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qmkM+Cx6; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184si13183057pgd.523.2018.11.11.07.47.24; Sun, 11 Nov 2018 07:47:24 -0800 (PST) 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=@kernel.org header.s=default header.b=qmkM+Cx6; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728669AbeKLBgQ (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:55994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgQ (ORCPT ); Sun, 11 Nov 2018 20:36:16 -0500 Received: from vkoul-mobl.Dlink (unknown [49.207.50.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0BE721104; Sun, 11 Nov 2018 15:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951243; bh=HsTz2YtH+Ke9fSLD5uIy2NnpBw0ooE+VHEfDA2+A3fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qmkM+Cx6vph2EbO8aRH8DvzCdFIbxY+hZq2NglLdcg6PVQ5dPwbM7tafVZJZnatys l6moWaIKVlD3EHIXg7H24MeLg7Hj5Ipc8zb1AX+2T3iw4nfVJzwkWypwUAAXsieebA gDUuknF7CqzM1jb2Ttt+9yBONkLRz6s/PWm5PZWM= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Baolin Wang Subject: [PATCH 2/5] dmaengine: sprd: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:07 +0530 Message-Id: <20181111154710.26904-3-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181111154710.26904-1-vkoul@kernel.org> References: <20181111154710.26904-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/sprd-dma.c | 3 --- 1 file changed, 3 deletions(-) -- 2.14.4 diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 38d4e4f07c66..c226dc93e401 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -847,9 +847,6 @@ static int sprd_dma_slave_config(struct dma_chan *chan, struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); struct dma_slave_config *slave_cfg = &schan->slave_cfg; - if (!is_slave_direction(config->direction)) - return -EINVAL; - memcpy(slave_cfg, config, sizeof(*config)); return 0; } From patchwork Sun Nov 11 15:47:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150770 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155527ljp; Sun, 11 Nov 2018 07:47:26 -0800 (PST) X-Google-Smtp-Source: AJdET5cdW1poh7R0b7xHmB7CdxnRgbz1d28k9U2EnFQ2bMmFb/zmCz720or0mfBE97WBDVafSO9q X-Received: by 2002:a63:e19:: with SMTP id d25mr14373094pgl.272.1541951246835; Sun, 11 Nov 2018 07:47:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951246; cv=none; d=google.com; s=arc-20160816; b=nL3XdL+/s6zmFEbDVLZsBp0KGR4Ej+l6SkOqgjZZM838aiHsgiuvGRWyLjL4rT12Xy gFXHkOPyyAOmP/BYjycg4JrV/pi/iBnX6QWsquN7GrI8Jj15rQjwknFnZfGjQ+erkOb9 5ChBMhexNNXW6NmDLpDL03nRtbK5OBXK7xE92AgzNzOEpXl25XRFhsSvpYhITQqbdX0g qdfUHvHLbkWKZg1Lt1SKdo3Xr6LYPnhOo62Ia+bBai2rANUa8YuD30Em3tNrhAaXH6F5 dwLe+EqnHU6xrpegJymEu7bcjrFn9HBSqh0rWVj7sbmhzIcvTpgTa9hkjPQDVpeT5qQb jSgQ== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=BRF0tMrirb+Q+G5LDkQD8amqMD7vRelK+5QVtCcqdhk=; b=zZ6HirZLSj5b48K8fa7fbyo1DTTxiUNBbjeLZaS64jxldDs9XNwi2zKNC52DyzwcpE YyByrwZaRsHuuKGzYw5O6fKXdNNvXVKv7cBAMNGzH8a90WIVPhvNdnUfx1RjsaSlXhc8 0K9aKXxZIemUsDY6DUIqruHOMcgXB1L15z8tQPfGrv9G5xYkSnozQknK7947uTMKBmA7 wlUWMZlGctiEGxy0DUKDcFSsvkFOnNHxhoG6hof8wmqz8gUcSjrG9c+mZn6TGR3J4Zs5 Vtje6uE/sJyQCGIF84EuUNcsvTooljordzbX1b3nFpl7flOosyLgUQbWqiH8/5Tv8R4w BTrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mDFb6Fkb; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184si13183057pgd.523.2018.11.11.07.47.26; Sun, 11 Nov 2018 07:47:26 -0800 (PST) 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=@kernel.org header.s=default header.b=mDFb6Fkb; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728675AbeKLBgT (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:56002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgT (ORCPT ); Sun, 11 Nov 2018 20:36:19 -0500 Received: from vkoul-mobl.Dlink (unknown [49.207.50.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 08F3520866; Sun, 11 Nov 2018 15:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951245; bh=jKVqLaGlGtDo6BMoJO5QV5TJTYEIt7DflhaBqF/luY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mDFb6FkbxUFf8wsV0qL/gPuJ4IPQKAreCK2BrERH+A1ByWHFDX23ywpLKBFlUqs42 bHS7m2XsT6LUqHDBYeIVbcj3KCAybH2zvQmFK297etT21iyKtmDZpu7nSoSwf4eCbK /8xCUy7RFaVDJbb2sooyppL3kj58Bi+kVKkbzZ/8= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Robin Gong Subject: [PATCH 3/5] dmaengine: imx-sdma: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:08 +0530 Message-Id: <20181111154710.26904-4-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181111154710.26904-1-vkoul@kernel.org> References: <20181111154710.26904-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/imx-sdma.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) -- 2.14.4 Signed-off-by: Robin Gong Tested-by:.. or you may review the patch and provide Reviewed-by:... or diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index b4ec2d20e661..49ac851bb352 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -335,6 +335,7 @@ struct sdma_desc { * @sdma: pointer to the SDMA engine for this channel * @channel: the channel number, matches dmaengine chan_id + 1 * @direction: transfer type. Needed for setting SDMA script + * @slave_config Slave configuration * @peripheral_type: Peripheral type. Needed for setting SDMA script * @event_id0: aka dma request line * @event_id1: for channels that use 2 events @@ -362,6 +363,7 @@ struct sdma_channel { struct sdma_engine *sdma; unsigned int channel; enum dma_transfer_direction direction; + struct dma_slave_config slave_config; enum sdma_peripheral_type peripheral_type; unsigned int event_id0; unsigned int event_id1; @@ -440,6 +442,10 @@ struct sdma_engine { struct sdma_buffer_descriptor *bd0; }; +static int sdma_config_write(struct dma_chan *chan, + struct dma_slave_config *dmaengine_cfg, + enum dma_transfer_direction direction); + static struct sdma_driver_data sdma_imx31 = { .chnenbl0 = SDMA_CHNENBL0_IMX31, .num_events = 32, @@ -1415,6 +1421,8 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( struct scatterlist *sg; struct sdma_desc *desc; + sdma_config_write(chan, &sdmac->slave_config, direction); + desc = sdma_transfer_init(sdmac, direction, sg_len); if (!desc) goto err_out; @@ -1499,6 +1507,8 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( dev_dbg(sdma->dev, "%s channel: %d\n", __func__, channel); + sdma_config_write(chan, &sdmac->slave_config, direction); + desc = sdma_transfer_init(sdmac, direction, num_periods); if (!desc) goto err_out; @@ -1554,17 +1564,18 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( return NULL; } -static int sdma_config(struct dma_chan *chan, - struct dma_slave_config *dmaengine_cfg) +static int sdma_config_write(struct dma_chan *chan, + struct dma_slave_config *dmaengine_cfg, + enum dma_transfer_direction direction) { struct sdma_channel *sdmac = to_sdma_chan(chan); - if (dmaengine_cfg->direction == DMA_DEV_TO_MEM) { + if (direction == DMA_DEV_TO_MEM) { sdmac->per_address = dmaengine_cfg->src_addr; sdmac->watermark_level = dmaengine_cfg->src_maxburst * dmaengine_cfg->src_addr_width; sdmac->word_size = dmaengine_cfg->src_addr_width; - } else if (dmaengine_cfg->direction == DMA_DEV_TO_DEV) { + } else if (direction == DMA_DEV_TO_DEV) { sdmac->per_address2 = dmaengine_cfg->src_addr; sdmac->per_address = dmaengine_cfg->dst_addr; sdmac->watermark_level = dmaengine_cfg->src_maxburst & @@ -1578,10 +1589,20 @@ static int sdma_config(struct dma_chan *chan, dmaengine_cfg->dst_addr_width; sdmac->word_size = dmaengine_cfg->dst_addr_width; } - sdmac->direction = dmaengine_cfg->direction; + sdmac->direction = direction; return sdma_config_channel(chan); } +static int sdma_config(struct dma_chan *chan, + struct dma_slave_config *dmaengine_cfg) +{ + struct sdma_channel *sdmac = to_sdma_chan(chan); + + memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg)); + + return 0; +} + static enum dma_status sdma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, struct dma_tx_state *txstate) From patchwork Sun Nov 11 15:47:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150771 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155546ljp; Sun, 11 Nov 2018 07:47:28 -0800 (PST) X-Google-Smtp-Source: AJdET5cOoJNxiNU4BWPDdyNBJwgZYwPzkZT1pfvPMWiGfKLmVJV8CQi8CZe3+GmLRoJgGD1gfq/j X-Received: by 2002:a63:ef47:: with SMTP id c7mr14521929pgk.386.1541951248668; Sun, 11 Nov 2018 07:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951248; cv=none; d=google.com; s=arc-20160816; b=BOQ4JXebSbw+LOe1Uy7AVYoGh5HWusTBaZpzjp4IZL0ANpzw9iUA+i6A7sG2eR0VTq vgtQwwKuecA205yE04QYZPiPtipziazQLhmPZh+5F4hGd3Oyf9qroMzgUj/6X5Sz6giW Ap7GbzQ1EuvSTKl09dyZrOOLuNhV2Pql4+2ipmbG0zgEYxX7SYOC3ek94id/yf5YI0tD Ot2y9e8csIOdO2pvVEPl7krY4OE4Qdyy3DY4GuunubnpEiXC1l3oResNB1daF+U3MXIR RPbezrJHhNJ+RUiyWSy4IwSB+g5scMJ3jc8fUbERHpT1Q8PWeZnbfNQNq594apt8jgmo pQcg== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=XWwABUNdrsYtSjsjpC+FjROp/FQ4i/depCmxd5Ry1OA=; b=kLjE/PLfuUx56SdRU4KxIcfRqKOng+uURn67NbFbkcOOqkJdOe5ZMWVA6Bpv94FiN+ 78MjHmXgG50gC0pqTPqC0R+ig7wJ+Bk0MPsk7GIrrOtxpqJVK0avaQeL006tOFlw8kf3 jL9qnjj/1XblI8qWAdndRqvsUpOqmCmRMWeHtT10iEVCJtgHxt8GqaIjbRKw/3mhJPIh BqRCWh/Ick/nCaERNiYN/4A+fBgygxrnLEcsZLIOVeZ2s9X2HVouapCo23j3hcIudORa 19CQKt0di7FpUS7ORtOT4OQ42r0Fd6ed7d3gqHrKrvEXTLIkMuoDn1J9zI+Vm6/bJO7l orfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gP84qO1Y; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184si13183057pgd.523.2018.11.11.07.47.28; Sun, 11 Nov 2018 07:47:28 -0800 (PST) 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=@kernel.org header.s=default header.b=gP84qO1Y; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728704AbeKLBgU (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:56010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgU (ORCPT ); Sun, 11 Nov 2018 20:36:20 -0500 Received: from vkoul-mobl.Dlink (unknown [49.207.50.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2DD0321104; Sun, 11 Nov 2018 15:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951247; bh=bIW9bR06N1/HXYWtT10dORcB09VCICEnJCyDIxZqilQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gP84qO1YrTFOM+LPHlzmIubnpqrG0ok8+XTzRSVgqhcDTNiCtGfWd7R2VaRq4+pqs fQ8vHOkxtNzQTWwp7FtG6ORq1975EQv35EDsve+Y4arbTQH02BDzpe2ijGQHoLBM8W p/UuCoS5fIfhxFKe81nbWghGQo5rhX8QknYXXEY0= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul Subject: [PATCH 4/5] dmaengine: pl330: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:09 +0530 Message-Id: <20181111154710.26904-5-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181111154710.26904-1-vkoul@kernel.org> References: <20181111154710.26904-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/pl330.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) -- 2.14.4 diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 88750a34e859..cff1b143fff5 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -448,6 +448,7 @@ struct dma_pl330_chan { /* DMA-mapped view of the FIFO; may differ if an IOMMU is present */ dma_addr_t fifo_dma; enum dma_data_direction dir; + struct dma_slave_config slave_config; /* for cyclic capability */ bool cyclic; @@ -542,6 +543,10 @@ struct _xfer_spec { struct dma_pl330_desc *desc; }; +static int pl330_config_write(struct dma_chan *chan, + struct dma_slave_config *slave_config, + enum dma_transfer_direction direction); + static inline bool _queue_full(struct pl330_thread *thrd) { return thrd->req[0].desc != NULL && thrd->req[1].desc != NULL; @@ -2220,20 +2225,21 @@ static int fixup_burst_len(int max_burst_len, int quirks) return max_burst_len; } -static int pl330_config(struct dma_chan *chan, - struct dma_slave_config *slave_config) +static int pl330_config_write(struct dma_chan *chan, + struct dma_slave_config *slave_config, + enum dma_transfer_direction direction) { struct dma_pl330_chan *pch = to_pchan(chan); pl330_unprep_slave_fifo(pch); - if (slave_config->direction == DMA_MEM_TO_DEV) { + if (direction == DMA_MEM_TO_DEV) { if (slave_config->dst_addr) pch->fifo_addr = slave_config->dst_addr; if (slave_config->dst_addr_width) pch->burst_sz = __ffs(slave_config->dst_addr_width); pch->burst_len = fixup_burst_len(slave_config->dst_maxburst, pch->dmac->quirks); - } else if (slave_config->direction == DMA_DEV_TO_MEM) { + } else if (direction == DMA_DEV_TO_MEM) { if (slave_config->src_addr) pch->fifo_addr = slave_config->src_addr; if (slave_config->src_addr_width) @@ -2245,6 +2251,16 @@ static int pl330_config(struct dma_chan *chan, return 0; } +static int pl330_config(struct dma_chan *chan, + struct dma_slave_config *slave_config) +{ + struct dma_pl330_chan *pch = to_pchan(chan); + + memcpy(&pch->slave_config, slave_config, sizeof(*slave_config)); + + return 0; +} + static int pl330_terminate_all(struct dma_chan *chan) { struct dma_pl330_chan *pch = to_pchan(chan); @@ -2661,6 +2677,8 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( return NULL; } + pl330_config_write(chan, &pch->slave_config, direction); + if (!pl330_prep_slave_fifo(pch, direction)) return NULL; @@ -2815,6 +2833,8 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, if (unlikely(!pch || !sgl || !sg_len)) return NULL; + pl330_config_write(chan, &pch->slave_config, direction); + if (!pl330_prep_slave_fifo(pch, direction)) return NULL; From patchwork Sun Nov 11 15:47:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150772 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155572ljp; Sun, 11 Nov 2018 07:47:31 -0800 (PST) X-Google-Smtp-Source: AJdET5ezqRLWC65p5OqPuy4ir4OKfZS83CB4+5llsFfQm/6mLjLK/PythNJmBTfU5rZi3j5kLLc1 X-Received: by 2002:a62:714a:: with SMTP id m71-v6mr17409921pfc.89.1541951250919; Sun, 11 Nov 2018 07:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951250; cv=none; d=google.com; s=arc-20160816; b=KyNVfLEm4tDiIHLAS2R4+9lFPr4XtnN8HJdzgyHafCVKuHTeqcmI6Jw5CEyVb2a+yX M6XRc8RUqlW+OqPtnczIuAlsSX+6RhVkNbX20zDwic7ZcG72Vd+yrsg2o7QNcMD6ITic gJg+m+w5q+cpxfx3So6/E7hKc1NfQQnQYMopfSB7xO29oESZh/+w5KovLSGyYbBw9j5H 1ZcKn6F6aLdchjBLr4K2Q76y8ggyWqUNnf7zY91xtuAmxQEzq1g1cp1q/kLLvsOGFLTx Xg+5lT5wkAfGzV0U6eIKdARhnUNhaJKTOQSBY4JrxH8xmU6l5o7L/rTt7uaDpidvo817 Rifg== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=vOwPJ2zIWGA1Oekba2Ze6PG8M8nQcIoo3dtHOO12DjI=; b=eTJMRyFAWOxOlRRiWpNDrAHJozxrj7n6nlGQ67zi1r/Dllv19b3clmurEMmMzs6VF7 BjIi7WQ8WY3bVehEX5P2M9MD7yMlF3SdDhf8pSxeTbOdAYnqXkRUo7fwiz8yofHVKnsD L+OAyli3klNEIm+gDRxZXUzp40CPYe3s52w4flzre2Fg7qX9dcUCkNVOfSi3JFltuXW9 rqTWBV3fA5YRolXaHDbOiXhPHzdxEPepdKUXbcj04uk5cAQZICmooIwZUGMEXNvOJAKJ t2c4PNHJ2JYpol9BmjyvQoq/tsa+YnPb9761uF6ItpTW3qT25ywCWOPwZE5NiOrHfvPd kpDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZvN8J5kp; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184si13183057pgd.523.2018.11.11.07.47.30; Sun, 11 Nov 2018 07:47:30 -0800 (PST) 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=@kernel.org header.s=default header.b=ZvN8J5kp; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728706AbeKLBgX (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:56016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgX (ORCPT ); Sun, 11 Nov 2018 20:36:23 -0500 Received: from vkoul-mobl.Dlink (unknown [49.207.50.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 076FF21479; Sun, 11 Nov 2018 15:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951249; bh=OCKBFRvaknMPpC4BRtQscYyEqqD8Vaypv5wqnZ242WQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZvN8J5kpgklT49y+uyVoh2QkU/wrop3hL0WBCx7wb5pNNTPDw5RmFCE2vm8Kc3KoG 2obEoCFeVZv+rr9fpIRwmn2QsmAyWDoiBGjO3oODF6uhu4umpYXy54qIx5EkoftqjC bCDnf+k3XbD4kuyb7Y7J2g9168MTotZZZF16iCZQ= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Linus Walleij Subject: [PATCH 5/5] dmaengine: ste_dma40: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:10 +0530 Message-Id: <20181111154710.26904-6-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181111154710.26904-1-vkoul@kernel.org> References: <20181111154710.26904-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/ste_dma40.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) -- 2.14.4 Reviewed-by: Linus Walleij diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 5e328bd10c27..907ae97a3ef4 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -442,6 +442,7 @@ struct d40_base; * @queue: Queued jobs. * @prepare_queue: Prepared jobs. * @dma_cfg: The client configuration of this dma channel. + * @slave_config: DMA slave configuration. * @configured: whether the dma_cfg configuration is valid * @base: Pointer to the device instance struct. * @src_def_cfg: Default cfg register setting for src. @@ -468,6 +469,7 @@ struct d40_chan { struct list_head queue; struct list_head prepare_queue; struct stedma40_chan_cfg dma_cfg; + struct dma_slave_config slave_config; bool configured; struct d40_base *base; /* Default register configurations */ @@ -625,6 +627,10 @@ static void __iomem *chan_base(struct d40_chan *chan) #define chan_err(d40c, format, arg...) \ d40_err(chan2dev(d40c), format, ## arg) +static int d40_set_runtime_config_write(struct dma_chan *chan, + struct dma_slave_config *config, + enum dma_transfer_direction direction); + static int d40_pool_lli_alloc(struct d40_chan *d40c, struct d40_desc *d40d, int lli_len) { @@ -2216,6 +2222,8 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, return NULL; } + d40_set_runtime_config_write(dchan, &chan->slave_config, direction); + spin_lock_irqsave(&chan->lock, flags); desc = d40_prep_desc(chan, sg_src, sg_len, dma_flags); @@ -2634,11 +2642,22 @@ dma40_config_to_halfchannel(struct d40_chan *d40c, return 0; } -/* Runtime reconfiguration extension */ static int d40_set_runtime_config(struct dma_chan *chan, struct dma_slave_config *config) { struct d40_chan *d40c = container_of(chan, struct d40_chan, chan); + + memcpy(&d40c->slave_config, config, sizeof(*config)); + + return 0; +} + +/* Runtime reconfiguration extension */ +static int d40_set_runtime_config_write(struct dma_chan *chan, + struct dma_slave_config *config, + enum dma_transfer_direction direction) +{ + struct d40_chan *d40c = container_of(chan, struct d40_chan, chan); struct stedma40_chan_cfg *cfg = &d40c->dma_cfg; enum dma_slave_buswidth src_addr_width, dst_addr_width; dma_addr_t config_addr; @@ -2655,7 +2674,7 @@ static int d40_set_runtime_config(struct dma_chan *chan, dst_addr_width = config->dst_addr_width; dst_maxburst = config->dst_maxburst; - if (config->direction == DMA_DEV_TO_MEM) { + if (direction == DMA_DEV_TO_MEM) { config_addr = config->src_addr; if (cfg->dir != DMA_DEV_TO_MEM) @@ -2671,7 +2690,7 @@ static int d40_set_runtime_config(struct dma_chan *chan, if (dst_maxburst == 0) dst_maxburst = src_maxburst; - } else if (config->direction == DMA_MEM_TO_DEV) { + } else if (direction == DMA_MEM_TO_DEV) { config_addr = config->dst_addr; if (cfg->dir != DMA_MEM_TO_DEV) @@ -2689,7 +2708,7 @@ static int d40_set_runtime_config(struct dma_chan *chan, } else { dev_err(d40c->base->dev, "unrecognized channel direction %d\n", - config->direction); + direction); return -EINVAL; } @@ -2746,12 +2765,12 @@ static int d40_set_runtime_config(struct dma_chan *chan, /* These settings will take precedence later */ d40c->runtime_addr = config_addr; - d40c->runtime_direction = config->direction; + d40c->runtime_direction = direction; dev_dbg(d40c->base->dev, "configured channel %s for %s, data width %d/%d, " "maxburst %d/%d elements, LE, no flow control\n", dma_chan_name(chan), - (config->direction == DMA_DEV_TO_MEM) ? "RX" : "TX", + (direction == DMA_DEV_TO_MEM) ? "RX" : "TX", src_addr_width, dst_addr_width, src_maxburst, dst_maxburst);