* dma: coh901318: Fix a double-lock bug
From: Jia-Ju Bai @ 2018-11-06 3:33 UTC (permalink / raw)
To: linus.walleij, vkoul, dan.j.williams
Cc: linux-arm-kernel, dmaengine, linux-kernel, Jia-Ju Bai
The function coh901318_alloc_chan_resources() calls spin_lock_irqsave()
before calling coh901318_config().
But coh901318_config() calls spin_lock_irqsave() again in its
definition, which may cause a double-lock bug.
Because coh901318_config() is only called by
coh901318_alloc_chan_resources(), the bug fix is to remove the
calls to spin-lock and -unlock functions in coh901318_config().
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/dma/coh901318.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
index eebaba3d9e78..fd862a478738 100644
--- a/drivers/dma/coh901318.c
+++ b/drivers/dma/coh901318.c
@@ -1807,8 +1807,6 @@ static int coh901318_config(struct coh901318_chan *cohc,
int channel = cohc->id;
void __iomem *virtbase = cohc->base->virtbase;
- spin_lock_irqsave(&cohc->lock, flags);
-
if (param)
p = param;
else
@@ -1828,8 +1826,6 @@ static int coh901318_config(struct coh901318_chan *cohc,
coh901318_set_conf(cohc, p->config);
coh901318_set_ctrl(cohc, p->ctrl_lli_last);
- spin_unlock_irqrestore(&cohc->lock, flags);
-
return 0;
}
^ permalink raw reply related
* [v3,1/4] Revert "dmaengine: imx-sdma: Use GFP_NOWAIT for dma allocations"
From: Robin Gong @ 2018-11-06 3:40 UTC (permalink / raw)
To: vkoul@kernel.org, l.stach@pengutronix.de
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
dl-linux-imx
From: Lucas Stach <l.stach@pengutronix.de>
This reverts commit c1199875d327, as this depends on another commit
that is going to be reverted.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
---
drivers/dma/imx-sdma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index b4ec2d2..3bca5e0 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1194,8 +1194,8 @@ static int sdma_alloc_bd(struct sdma_desc *desc)
{
int ret = 0;
- desc->bd = dma_pool_alloc(desc->sdmac->bd_pool, GFP_NOWAIT,
- &desc->bd_phys);
+ desc->bd = dma_pool_alloc(desc->sdmac->bd_pool, GFP_ATOMIC,
+ &desc->bd_phys);
if (!desc->bd) {
ret = -ENOMEM;
goto out;
^ permalink raw reply related
* [v3,2/4] Revert "dmaengine: imx-sdma: alloclate bd memory from dma pool"
From: Robin Gong @ 2018-11-06 3:40 UTC (permalink / raw)
To: vkoul@kernel.org, l.stach@pengutronix.de
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
dl-linux-imx
From: Lucas Stach <l.stach@pengutronix.de>
This reverts commit fe5b85c656bc. The SDMA engine needs the descriptors to
be contiguous in memory. As the dma pool API is only able to provide a
single descriptor per alloc invocation there is no guarantee that multiple
descriptors satisfy this requirement. Also the code in question is broken
as it only allocates memory for a single descriptor, without looking at the
number of descriptors required for the transfer, leading to out-of-bounds
accesses when the descriptors are written.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
---
drivers/dma/imx-sdma.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 3bca5e0..8d2fec8 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -24,7 +24,6 @@
#include <linux/spinlock.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
-#include <linux/dmapool.h>
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
@@ -376,7 +375,6 @@ struct sdma_channel {
u32 shp_addr, per_addr;
enum dma_status status;
struct imx_dma_data data;
- struct dma_pool *bd_pool;
};
#define IMX_DMA_SG_LOOP BIT(0)
@@ -1192,10 +1190,11 @@ static int sdma_request_channel0(struct sdma_engine *sdma)
static int sdma_alloc_bd(struct sdma_desc *desc)
{
+ u32 bd_size = desc->num_bd * sizeof(struct sdma_buffer_descriptor);
int ret = 0;
- desc->bd = dma_pool_alloc(desc->sdmac->bd_pool, GFP_ATOMIC,
- &desc->bd_phys);
+ desc->bd = dma_zalloc_coherent(NULL, bd_size, &desc->bd_phys,
+ GFP_ATOMIC);
if (!desc->bd) {
ret = -ENOMEM;
goto out;
@@ -1206,7 +1205,9 @@ static int sdma_alloc_bd(struct sdma_desc *desc)
static void sdma_free_bd(struct sdma_desc *desc)
{
- dma_pool_free(desc->sdmac->bd_pool, desc->bd, desc->bd_phys);
+ u32 bd_size = desc->num_bd * sizeof(struct sdma_buffer_descriptor);
+
+ dma_free_coherent(NULL, bd_size, desc->bd, desc->bd_phys);
}
static void sdma_desc_free(struct virt_dma_desc *vd)
@@ -1272,10 +1273,6 @@ static int sdma_alloc_chan_resources(struct dma_chan *chan)
if (ret)
goto disable_clk_ahb;
- sdmac->bd_pool = dma_pool_create("bd_pool", chan->device->dev,
- sizeof(struct sdma_buffer_descriptor),
- 32, 0);
-
return 0;
disable_clk_ahb:
@@ -1304,9 +1301,6 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
clk_disable(sdma->clk_ipg);
clk_disable(sdma->clk_ahb);
-
- dma_pool_destroy(sdmac->bd_pool);
- sdmac->bd_pool = NULL;
}
static struct sdma_desc *sdma_transfer_init(struct sdma_channel *sdmac,
^ permalink raw reply related
* [v3,3/4] dmaengine: imx-sdma: implement channel termination via worker
From: Robin Gong @ 2018-11-06 3:40 UTC (permalink / raw)
To: vkoul@kernel.org, l.stach@pengutronix.de
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
dl-linux-imx
From: Lucas Stach <l.stach@pengutronix.de>
The dmaengine documentation states that device_terminate_all may be
asynchronous and need not wait for the active transfers to stop.
This allows us to move most of the functionality currently implemented
in the sdma channel termination function to run in a worker, outside
of any atomic context. Moving this out of atomic context has two
benefits: we can now sleep while waiting for the channel to terminate,
instead of busy waiting and the freeing of the dma descriptors happens
with IRQs enabled, getting rid of a warning in the dma mapping code.
As the termination is now async, we need to implement the
device_synchronize dma engine function which simply waits for the
worker to finish its execution.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
---
drivers/dma/imx-sdma.c | 51 +++++++++++++++++++++++++++++++++++++-------------
1 file changed, 38 insertions(+), 13 deletions(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 8d2fec8..03d46f1 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -32,6 +32,7 @@
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_dma.h>
+#include <linux/workqueue.h>
#include <asm/irq.h>
#include <linux/platform_data/dma-imx-sdma.h>
@@ -375,6 +376,7 @@ struct sdma_channel {
u32 shp_addr, per_addr;
enum dma_status status;
struct imx_dma_data data;
+ struct work_struct terminate_worker;
};
#define IMX_DMA_SG_LOOP BIT(0)
@@ -1025,31 +1027,49 @@ static int sdma_disable_channel(struct dma_chan *chan)
return 0;
}
-
-static int sdma_disable_channel_with_delay(struct dma_chan *chan)
+static void sdma_channel_terminate_work(struct work_struct *work)
{
- struct sdma_channel *sdmac = to_sdma_chan(chan);
+ struct sdma_channel *sdmac = container_of(work, struct sdma_channel,
+ terminate_worker);
unsigned long flags;
LIST_HEAD(head);
- sdma_disable_channel(chan);
- spin_lock_irqsave(&sdmac->vc.lock, flags);
- vchan_get_all_descriptors(&sdmac->vc, &head);
- sdmac->desc = NULL;
- spin_unlock_irqrestore(&sdmac->vc.lock, flags);
- vchan_dma_desc_free_list(&sdmac->vc, &head);
-
/*
* According to NXP R&D team a delay of one BD SDMA cost time
* (maximum is 1ms) should be added after disable of the channel
* bit, to ensure SDMA core has really been stopped after SDMA
* clients call .device_terminate_all.
*/
- mdelay(1);
+ usleep_range(1000, 2000);
+
+ spin_lock_irqsave(&sdmac->vc.lock, flags);
+ vchan_get_all_descriptors(&sdmac->vc, &head);
+ sdmac->desc = NULL;
+ spin_unlock_irqrestore(&sdmac->vc.lock, flags);
+ vchan_dma_desc_free_list(&sdmac->vc, &head);
+}
+
+static int sdma_disable_channel_async(struct dma_chan *chan)
+{
+ struct sdma_channel *sdmac = to_sdma_chan(chan);
+
+ sdma_disable_channel(chan);
+
+ if (sdmac->desc)
+ schedule_work(&sdmac->terminate_worker);
return 0;
}
+static void sdma_channel_synchronize(struct dma_chan *chan)
+{
+ struct sdma_channel *sdmac = to_sdma_chan(chan);
+
+ vchan_synchronize(&sdmac->vc);
+
+ flush_work(&sdmac->terminate_worker);
+}
+
static void sdma_set_watermarklevel_for_p2p(struct sdma_channel *sdmac)
{
struct sdma_engine *sdma = sdmac->sdma;
@@ -1287,7 +1307,9 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
struct sdma_channel *sdmac = to_sdma_chan(chan);
struct sdma_engine *sdma = sdmac->sdma;
- sdma_disable_channel_with_delay(chan);
+ sdma_disable_channel_async(chan);
+
+ sdma_channel_synchronize(chan);
if (sdmac->event_id0)
sdma_event_disable(sdmac, sdmac->event_id0);
@@ -1993,6 +2015,8 @@ static int sdma_probe(struct platform_device *pdev)
sdmac->channel = i;
sdmac->vc.desc_free = sdma_desc_free;
+ INIT_WORK(&sdmac->terminate_worker,
+ sdma_channel_terminate_work);
/*
* Add the channel to the DMAC list. Do not add channel 0 though
* because we need it internally in the SDMA driver. This also means
@@ -2044,7 +2068,8 @@ static int sdma_probe(struct platform_device *pdev)
sdma->dma_device.device_prep_slave_sg = sdma_prep_slave_sg;
sdma->dma_device.device_prep_dma_cyclic = sdma_prep_dma_cyclic;
sdma->dma_device.device_config = sdma_config;
- sdma->dma_device.device_terminate_all = sdma_disable_channel_with_delay;
+ sdma->dma_device.device_terminate_all = sdma_disable_channel_async;
+ sdma->dma_device.device_synchronize = sdma_channel_synchronize;
sdma->dma_device.src_addr_widths = SDMA_DMA_BUSWIDTHS;
sdma->dma_device.dst_addr_widths = SDMA_DMA_BUSWIDTHS;
sdma->dma_device.directions = SDMA_DMA_DIRECTIONS;
^ permalink raw reply related
* [v3,4/4] dmaengine: imx-sdma: use GFP_NOWAIT for dma descriptor allocations
From: Robin Gong @ 2018-11-06 3:40 UTC (permalink / raw)
To: vkoul@kernel.org, l.stach@pengutronix.de
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
dl-linux-imx
From: Lucas Stach <l.stach@pengutronix.de>
DMA buffer descriptors aren't allocated from atomic context, so they
can use the less heavyweigth GFP_NOWAIT.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
---
drivers/dma/imx-sdma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 03d46f1..cb1b44d 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1214,7 +1214,7 @@ static int sdma_alloc_bd(struct sdma_desc *desc)
int ret = 0;
desc->bd = dma_zalloc_coherent(NULL, bd_size, &desc->bd_phys,
- GFP_ATOMIC);
+ GFP_NOWAIT);
if (!desc->bd) {
ret = -ENOMEM;
goto out;
^ permalink raw reply related
* [RESEND,1/7] dmaengine: sprd: Remove direction usage from struct dma_slave_config
From: Baolin Wang @ 2018-11-06 5:01 UTC (permalink / raw)
To: dan.j.williams, vkoul, eric.long
Cc: broonie, baolin.wang, dmaengine, linux-kernel
The direction field of struct dma_slave_config was marked deprecated,
thus remove the usage.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 38d4e4f..c226dc93 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;
}
^ permalink raw reply related
* [RESEND,2/7] dmaengine: sprd: Get transfer residue depending on the transfer direction
From: Baolin Wang @ 2018-11-06 5:01 UTC (permalink / raw)
To: dan.j.williams, vkoul, eric.long
Cc: broonie, baolin.wang, dmaengine, linux-kernel
From: Eric Long <eric.long@spreadtrum.com>
Add one field to save the transfer direction for struct sprd_dma_desc,
which is used to get correct transfer residue depending on the transfer
direction.
[Baolin Wang adds one field to present the transfer direction]
Signed-off-by: Eric Long <eric.long@spreadtrum.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index c226dc93..4f3587b 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -159,6 +159,7 @@ struct sprd_dma_chn_hw {
struct sprd_dma_desc {
struct virt_dma_desc vd;
struct sprd_dma_chn_hw chn_hw;
+ enum dma_transfer_direction dir;
};
/* dma channel description */
@@ -331,6 +332,17 @@ static void sprd_dma_stop_and_disable(struct sprd_dma_chn *schan)
sprd_dma_disable_chn(schan);
}
+static unsigned long sprd_dma_get_src_addr(struct sprd_dma_chn *schan)
+{
+ unsigned long addr, addr_high;
+
+ addr = readl(schan->chn_base + SPRD_DMA_CHN_SRC_ADDR);
+ addr_high = readl(schan->chn_base + SPRD_DMA_CHN_WARP_PTR) &
+ SPRD_DMA_HIGH_ADDR_MASK;
+
+ return addr | (addr_high << SPRD_DMA_HIGH_ADDR_OFFSET);
+}
+
static unsigned long sprd_dma_get_dst_addr(struct sprd_dma_chn *schan)
{
unsigned long addr, addr_high;
@@ -534,7 +546,12 @@ static enum dma_status sprd_dma_tx_status(struct dma_chan *chan,
else
pos = 0;
} else if (schan->cur_desc && schan->cur_desc->vd.tx.cookie == cookie) {
- pos = sprd_dma_get_dst_addr(schan);
+ struct sprd_dma_desc *sdesc = to_sprd_dma_desc(vd);
+
+ if (sdesc->dir == DMA_DEV_TO_MEM)
+ pos = sprd_dma_get_dst_addr(schan);
+ else
+ pos = sprd_dma_get_src_addr(schan);
} else {
pos = 0;
}
@@ -804,6 +821,8 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan,
if (!sdesc)
return NULL;
+ sdesc->dir = dir;
+
for_each_sg(sgl, sg, sglen, i) {
len = sg_dma_len(sg);
^ permalink raw reply related
* [RESEND,3/7] dmaengine: sprd: Fix the last link-list configuration
From: Baolin Wang @ 2018-11-06 5:01 UTC (permalink / raw)
To: dan.j.williams, vkoul, eric.long
Cc: broonie, baolin.wang, dmaengine, linux-kernel
From: Eric Long <eric.long@spreadtrum.com>
We will pass sglen as 0 configure the last link-list configuration
when filling the descriptor, which will cause the incorrect link-list
configuration. Thus we should check if the sglen is 0 to configure
the correct link-list configuration.
Signed-off-by: Eric Long <eric.long@spreadtrum.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 4f3587b..e6a74dc 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -697,7 +697,8 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,
hw->cfg |= SPRD_DMA_LINKLIST_EN;
/* link-list index */
- temp = (sg_index + 1) % sglen;
+ temp = sglen ? (sg_index + 1) % sglen : 0;
+
/* Next link-list configuration's physical address offset */
temp = temp * sizeof(*hw) + SPRD_DMA_CHN_SRC_ADDR;
/*
^ permalink raw reply related
* [RESEND,4/7] dmaengine: sprd: Set cur_desc as NULL when free or terminate one dma channel
From: Baolin Wang @ 2018-11-06 5:01 UTC (permalink / raw)
To: dan.j.williams, vkoul, eric.long
Cc: broonie, baolin.wang, dmaengine, linux-kernel
From: Eric Long <eric.long@spreadtrum.com>
It will be failed to start one new transfer if the channel started one
none interrupt transfer before, since we will only set the schan->cur_desc
as NULL depending on the transfer interrupt now. Thus we should set
schan->cur_desc as NULL when free or terminate one dma channel to
avoid this issue.
Signed-off-by: Eric Long <eric.long@spreadtrum.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index e6a74dc..1b39661 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -439,6 +439,7 @@ static void sprd_dma_stop(struct sprd_dma_chn *schan)
sprd_dma_stop_and_disable(schan);
sprd_dma_unset_uid(schan);
sprd_dma_clear_int(schan);
+ schan->cur_desc = NULL;
}
static bool sprd_dma_check_trans_done(struct sprd_dma_desc *sdesc,
^ permalink raw reply related
* [RESEND,5/7] dmaengine: sprd: Support DMA link-list cyclic callback
From: Baolin Wang @ 2018-11-06 5:01 UTC (permalink / raw)
To: dan.j.williams, vkoul, eric.long
Cc: broonie, baolin.wang, dmaengine, linux-kernel
From: Eric Long <eric.long@spreadtrum.com>
The Spreadtrum DMA link-list mode is always one cyclic transfer,
so we should clear the SPRD_DMA_LLIST_END flag for the link-list
configuration. Moreover add cyclic callback support for the cyclic
transfer.
Signed-off-by: Eric Long <eric.long@spreadtrum.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 1b39661..cefe42f 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -463,7 +463,7 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id)
struct sprd_dma_desc *sdesc;
enum sprd_dma_req_mode req_type;
enum sprd_dma_int_type int_type;
- bool trans_done = false;
+ bool trans_done = false, cyclic = false;
u32 i;
while (irq_status) {
@@ -478,13 +478,19 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id)
sdesc = schan->cur_desc;
- /* Check if the dma request descriptor is done. */
- trans_done = sprd_dma_check_trans_done(sdesc, int_type,
- req_type);
- if (trans_done == true) {
- vchan_cookie_complete(&sdesc->vd);
- schan->cur_desc = NULL;
- sprd_dma_start(schan);
+ /* cyclic mode schedule callback */
+ cyclic = schan->linklist.phy_addr ? true : false;
+ if (cyclic == true) {
+ vchan_cyclic_callback(&sdesc->vd);
+ } else {
+ /* Check if the dma request descriptor is done. */
+ trans_done = sprd_dma_check_trans_done(sdesc, int_type,
+ req_type);
+ if (trans_done == true) {
+ vchan_cookie_complete(&sdesc->vd);
+ schan->cur_desc = NULL;
+ sprd_dma_start(schan);
+ }
}
spin_unlock(&schan->vc.lock);
}
@@ -692,9 +698,6 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,
/* link-list configuration */
if (schan->linklist.phy_addr) {
- if (sg_index == sglen - 1)
- hw->frg_len |= SPRD_DMA_LLIST_END;
-
hw->cfg |= SPRD_DMA_LINKLIST_EN;
/* link-list index */
^ permalink raw reply related
* [RESEND,6/7] dmaengine: sprd: Support DMA 2-stage transfer mode
From: Baolin Wang @ 2018-11-06 5:01 UTC (permalink / raw)
To: dan.j.williams, vkoul, eric.long
Cc: broonie, baolin.wang, dmaengine, linux-kernel
From: Eric Long <eric.long@spreadtrum.com>
The Spreadtrum DMA controller supports channel 2-stage tansfer mode,
that means we can request 2 dma channels, one for source channel, and
another one for destination channel. Once the source channel's transaction
is done, it will trigger the destination channel's transaction automatically
by hardware signal.
Signed-off-by: Eric Long <eric.long@spreadtrum.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 98 +++++++++++++++++++++++++++++++++++++++++-
include/linux/dma/sprd-dma.h | 62 ++++++++++++++++++++++++--
2 files changed, 156 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index cefe42f..50d6569 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -36,6 +36,8 @@
#define SPRD_DMA_GLB_CHN_EN_STS 0x1c
#define SPRD_DMA_GLB_DEBUG_STS 0x20
#define SPRD_DMA_GLB_ARB_SEL_STS 0x24
+#define SPRD_DMA_GLB_2STAGE_GRP1 0x28
+#define SPRD_DMA_GLB_2STAGE_GRP2 0x2c
#define SPRD_DMA_GLB_REQ_UID(uid) (0x4 * ((uid) - 1))
#define SPRD_DMA_GLB_REQ_UID_OFFSET 0x2000
@@ -57,6 +59,18 @@
#define SPRD_DMA_CHN_SRC_BLK_STEP 0x38
#define SPRD_DMA_CHN_DES_BLK_STEP 0x3c
+/* SPRD_DMA_GLB_2STAGE_GRP register definition */
+#define SPRD_DMA_GLB_2STAGE_EN BIT(24)
+#define SPRD_DMA_GLB_CHN_INT_MASK GENMASK(23, 20)
+#define SPRD_DMA_GLB_LIST_DONE_TRG BIT(19)
+#define SPRD_DMA_GLB_TRANS_DONE_TRG BIT(18)
+#define SPRD_DMA_GLB_BLOCK_DONE_TRG BIT(17)
+#define SPRD_DMA_GLB_FRAG_DONE_TRG BIT(16)
+#define SPRD_DMA_GLB_TRG_OFFSET 16
+#define SPRD_DMA_GLB_DEST_CHN_MASK GENMASK(13, 8)
+#define SPRD_DMA_GLB_DEST_CHN_OFFSET 8
+#define SPRD_DMA_GLB_SRC_CHN_MASK GENMASK(5, 0)
+
/* SPRD_DMA_CHN_INTC register definition */
#define SPRD_DMA_INT_MASK GENMASK(4, 0)
#define SPRD_DMA_INT_CLR_OFFSET 24
@@ -118,6 +132,10 @@
#define SPRD_DMA_SRC_TRSF_STEP_OFFSET 0
#define SPRD_DMA_TRSF_STEP_MASK GENMASK(15, 0)
+/* define DMA channel mode & trigger mode mask */
+#define SPRD_DMA_CHN_MODE_MASK GENMASK(7, 0)
+#define SPRD_DMA_TRG_MODE_MASK GENMASK(7, 0)
+
/* define the DMA transfer step type */
#define SPRD_DMA_NONE_STEP 0
#define SPRD_DMA_BYTE_STEP 1
@@ -170,6 +188,8 @@ struct sprd_dma_chn {
struct dma_slave_config slave_cfg;
u32 chn_num;
u32 dev_id;
+ enum sprd_dma_chn_mode chn_mode;
+ enum sprd_dma_trg_mode trg_mode;
struct sprd_dma_desc *cur_desc;
};
@@ -206,6 +226,16 @@ static inline struct sprd_dma_desc *to_sprd_dma_desc(struct virt_dma_desc *vd)
return container_of(vd, struct sprd_dma_desc, vd);
}
+static void sprd_dma_glb_update(struct sprd_dma_dev *sdev, u32 reg,
+ u32 mask, u32 val)
+{
+ u32 orig = readl(sdev->glb_base + reg);
+ u32 tmp;
+
+ tmp = (orig & ~mask) | val;
+ writel(tmp, sdev->glb_base + reg);
+}
+
static void sprd_dma_chn_update(struct sprd_dma_chn *schan, u32 reg,
u32 mask, u32 val)
{
@@ -389,6 +419,49 @@ static enum sprd_dma_req_mode sprd_dma_get_req_type(struct sprd_dma_chn *schan)
return (frag_reg >> SPRD_DMA_REQ_MODE_OFFSET) & SPRD_DMA_REQ_MODE_MASK;
}
+static int sprd_dma_set_2stage_config(struct sprd_dma_chn *schan)
+{
+ struct sprd_dma_dev *sdev = to_sprd_dma_dev(&schan->vc.chan);
+ u32 val, chn = schan->chn_num + 1;
+
+ switch (schan->chn_mode) {
+ case SPRD_DMA_SRC_CHN0:
+ val = chn & SPRD_DMA_GLB_SRC_CHN_MASK;
+ val |= BIT(schan->trg_mode - 1) << SPRD_DMA_GLB_TRG_OFFSET;
+ val |= SPRD_DMA_GLB_2STAGE_EN;
+ sprd_dma_glb_update(sdev, SPRD_DMA_GLB_2STAGE_GRP1, val, val);
+ break;
+
+ case SPRD_DMA_SRC_CHN1:
+ val = chn & SPRD_DMA_GLB_SRC_CHN_MASK;
+ val |= BIT(schan->trg_mode - 1) << SPRD_DMA_GLB_TRG_OFFSET;
+ val |= SPRD_DMA_GLB_2STAGE_EN;
+ sprd_dma_glb_update(sdev, SPRD_DMA_GLB_2STAGE_GRP2, val, val);
+ break;
+
+ case SPRD_DMA_DST_CHN0:
+ val = (chn << SPRD_DMA_GLB_DEST_CHN_OFFSET) &
+ SPRD_DMA_GLB_DEST_CHN_MASK;
+ val |= SPRD_DMA_GLB_2STAGE_EN;
+ sprd_dma_glb_update(sdev, SPRD_DMA_GLB_2STAGE_GRP1, val, val);
+ break;
+
+ case SPRD_DMA_DST_CHN1:
+ val = (chn << SPRD_DMA_GLB_DEST_CHN_OFFSET) &
+ SPRD_DMA_GLB_DEST_CHN_MASK;
+ val |= SPRD_DMA_GLB_2STAGE_EN;
+ sprd_dma_glb_update(sdev, SPRD_DMA_GLB_2STAGE_GRP2, val, val);
+ break;
+
+ default:
+ dev_err(sdev->dma_dev.dev, "invalid channel mode setting %d\n",
+ schan->chn_mode);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static void sprd_dma_set_chn_config(struct sprd_dma_chn *schan,
struct sprd_dma_desc *sdesc)
{
@@ -423,6 +496,13 @@ static void sprd_dma_start(struct sprd_dma_chn *schan)
schan->cur_desc = to_sprd_dma_desc(vd);
/*
+ * Set 2-stage configuration if the channel starts one 2-stage
+ * transfer.
+ */
+ if (schan->chn_mode && sprd_dma_set_2stage_config(schan))
+ return;
+
+ /*
* Copy the DMA configuration from DMA descriptor to this hardware
* channel.
*/
@@ -617,6 +697,7 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,
{
struct sprd_dma_dev *sdev = to_sprd_dma_dev(chan);
struct sprd_dma_chn *schan = to_sprd_dma_chan(chan);
+ enum sprd_dma_chn_mode chn_mode = schan->chn_mode;
u32 req_mode = (flags >> SPRD_DMA_REQ_SHIFT) & SPRD_DMA_REQ_MODE_MASK;
u32 int_mode = flags & SPRD_DMA_INT_MASK;
int src_datawidth, dst_datawidth, src_step, dst_step;
@@ -628,7 +709,16 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,
dev_err(sdev->dma_dev.dev, "invalid source step\n");
return src_step;
}
- dst_step = SPRD_DMA_NONE_STEP;
+
+ /*
+ * For 2-stage transfer, destination channel step can not be 0,
+ * since destination device is AON IRAM.
+ */
+ if (chn_mode == SPRD_DMA_DST_CHN0 ||
+ chn_mode == SPRD_DMA_DST_CHN1)
+ dst_step = src_step;
+ else
+ dst_step = SPRD_DMA_NONE_STEP;
} else {
dst_step = sprd_dma_get_step(slave_cfg->dst_addr_width);
if (dst_step < 0) {
@@ -855,6 +945,12 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan,
}
}
+ /* Set channel mode and trigger mode for 2-stage transfer */
+ schan->chn_mode =
+ (flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK;
+ schan->trg_mode =
+ (flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK;
+
ret = sprd_dma_fill_desc(chan, &sdesc->chn_hw, 0, 0, src, dst, len,
dir, flags, slave_cfg);
if (ret) {
diff --git a/include/linux/dma/sprd-dma.h b/include/linux/dma/sprd-dma.h
index b42b80e5..ab82df6 100644
--- a/include/linux/dma/sprd-dma.h
+++ b/include/linux/dma/sprd-dma.h
@@ -3,9 +3,65 @@
#ifndef _SPRD_DMA_H_
#define _SPRD_DMA_H_
-#define SPRD_DMA_REQ_SHIFT 16
-#define SPRD_DMA_FLAGS(req_mode, int_type) \
- ((req_mode) << SPRD_DMA_REQ_SHIFT | (int_type))
+#define SPRD_DMA_REQ_SHIFT 8
+#define SPRD_DMA_TRG_MODE_SHIFT 16
+#define SPRD_DMA_CHN_MODE_SHIFT 24
+#define SPRD_DMA_FLAGS(chn_mode, trg_mode, req_mode, int_type) \
+ ((chn_mode) << SPRD_DMA_CHN_MODE_SHIFT | \
+ (trg_mode) << SPRD_DMA_TRG_MODE_SHIFT | \
+ (req_mode) << SPRD_DMA_REQ_SHIFT | (int_type))
+
+/*
+ * The Spreadtrum DMA controller supports channel 2-stage tansfer, that means
+ * we can request 2 dma channels, one for source channel, and another one for
+ * destination channel. Each channel is independent, and has its own
+ * configurations. Once the source channel's transaction is done, it will
+ * trigger the destination channel's transaction automatically by hardware
+ * signal.
+ *
+ * To support 2-stage tansfer, we must configure the channel mode and trigger
+ * mode as below definition.
+ */
+
+/*
+ * enum sprd_dma_chn_mode: define the DMA channel mode for 2-stage transfer
+ * @SPRD_DMA_CHN_MODE_NONE: No channel mode setting which means channel doesn't
+ * support the 2-stage transfer.
+ * @SPRD_DMA_SRC_CHN0: Channel used as source channel 0.
+ * @SPRD_DMA_SRC_CHN1: Channel used as source channel 1.
+ * @SPRD_DMA_DST_CHN0: Channel used as destination channel 0.
+ * @SPRD_DMA_DST_CHN1: Channel used as destination channel 1.
+ *
+ * Now the DMA controller can supports 2 groups 2-stage transfer.
+ */
+enum sprd_dma_chn_mode {
+ SPRD_DMA_CHN_MODE_NONE,
+ SPRD_DMA_SRC_CHN0,
+ SPRD_DMA_SRC_CHN1,
+ SPRD_DMA_DST_CHN0,
+ SPRD_DMA_DST_CHN1,
+};
+
+/*
+ * enum sprd_dma_trg_mode: define the DMA channel trigger mode for 2-stage
+ * transfer
+ * @SPRD_DMA_NO_TRG: No trigger setting.
+ * @SPRD_DMA_FRAG_DONE_TRG: Trigger the transaction of destination channel
+ * automatically once the source channel's fragment request is done.
+ * @SPRD_DMA_BLOCK_DONE_TRG: Trigger the transaction of destination channel
+ * automatically once the source channel's block request is done.
+ * @SPRD_DMA_TRANS_DONE_TRG: Trigger the transaction of destination channel
+ * automatically once the source channel's transfer request is done.
+ * @SPRD_DMA_LIST_DONE_TRG: Trigger the transaction of destination channel
+ * automatically once the source channel's link-list request is done.
+ */
+enum sprd_dma_trg_mode {
+ SPRD_DMA_NO_TRG,
+ SPRD_DMA_FRAG_DONE_TRG,
+ SPRD_DMA_BLOCK_DONE_TRG,
+ SPRD_DMA_TRANS_DONE_TRG,
+ SPRD_DMA_LIST_DONE_TRG,
+};
/*
* enum sprd_dma_req_mode: define the DMA request mode
^ permalink raw reply related
* [RESEND,7/7] dmaengine: sprd: Add me as one of the module authors
From: Baolin Wang @ 2018-11-06 5:01 UTC (permalink / raw)
To: dan.j.williams, vkoul, eric.long
Cc: broonie, baolin.wang, dmaengine, linux-kernel
From: Eric Long <eric.long@spreadtrum.com>
Add me as one of the module authors.
Signed-off-by: Eric Long <eric.long@spreadtrum.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 50d6569..e2f0167 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -1226,4 +1226,5 @@ static int __maybe_unused sprd_dma_runtime_resume(struct device *dev)
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("DMA driver for Spreadtrum");
MODULE_AUTHOR("Baolin Wang <baolin.wang@spreadtrum.com>");
+MODULE_AUTHOR("Eric Long <eric.long@spreadtrum.com>");
MODULE_ALIAS("platform:sprd-dma");
^ permalink raw reply related
* [1/2] firmware: add nowarn variant of request_firmware_nowait()
From: kbuild test robot @ 2018-11-06 8:20 UTC (permalink / raw)
To: Lucas Stach
Cc: kbuild-all, Luis R . Rodriguez, Vinod Koul, Greg Kroah-Hartman,
dmaengine, linux-kernel, patchwork-lst, kernel
Hi Lucas,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v4.20-rc1 next-20181106]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Lucas-Stach/firmware-add-nowarn-variant-of-request_firmware_nowait/20181106-052228
reproduce: make htmldocs
All warnings (new ones prefixed by >>):
include/net/mac80211.h:1001: warning: Function parameter or member 'status.is_valid_ack_signal' not described in 'ieee80211_tx_info'
include/net/mac80211.h:1001: warning: Function parameter or member 'status.status_driver_data' not described in 'ieee80211_tx_info'
include/net/mac80211.h:1001: warning: Function parameter or member 'driver_rates' not described in 'ieee80211_tx_info'
include/net/mac80211.h:1001: warning: Function parameter or member 'pad' not described in 'ieee80211_tx_info'
include/net/mac80211.h:1001: warning: Function parameter or member 'rate_driver_data' not described in 'ieee80211_tx_info'
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params '
net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.signal' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.chain_signal' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_retries' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_failed' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack_signal' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.ack_signal_filled' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.avg_ack_signal' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info'
net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.msdu' not described in 'sta_info'
kernel/rcu/tree.c:685: warning: Excess function parameter 'irq' description in 'rcu_nmi_exit'
include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf'
include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf'
include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf'
include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf'
include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf'
include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf'
include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array'
include/linux/gpio/driver.h:375: warning: Function parameter or member 'init_valid_mask' not described in 'gpio_chip'
include/linux/iio/hw-consumer.h:1: warning: no structured comments found
>> drivers/base/firmware_loader/main.c:884: warning: Function parameter or member 'module' not described in 'request_firmware_nowait_nowarn'
>> drivers/base/firmware_loader/main.c:884: warning: Function parameter or member 'uevent' not described in 'request_firmware_nowait_nowarn'
>> drivers/base/firmware_loader/main.c:884: warning: Function parameter or member 'name' not described in 'request_firmware_nowait_nowarn'
>> drivers/base/firmware_loader/main.c:884: warning: Function parameter or member 'device' not described in 'request_firmware_nowait_nowarn'
>> drivers/base/firmware_loader/main.c:884: warning: Function parameter or member 'gfp' not described in 'request_firmware_nowait_nowarn'
>> drivers/base/firmware_loader/main.c:884: warning: Function parameter or member 'context' not described in 'request_firmware_nowait_nowarn'
>> drivers/base/firmware_loader/main.c:884: warning: Function parameter or member 'cont' not described in 'request_firmware_nowait_nowarn'
include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry'
drivers/mtd/nand/raw/nand_base.c:603: warning: Excess function parameter 'mtd' description in 'panic_nand_wait'
drivers/mtd/nand/raw/nand_base.c:603: warning: Excess function parameter 'mtd' description in 'panic_nand_wait'
include/linux/regulator/driver.h:227: warning: Function parameter or member 'resume' not described in 'regulator_ops'
arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb'
arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb'
arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb'
arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb'
arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb'
drivers/slimbus/stream.c:1: warning: no structured comments found
include/linux/spi/spi.h:177: warning: Function parameter or member 'driver_override' not described in 'spi_device'
drivers/target/target_core_device.c:1: warning: no structured comments found
drivers/usb/typec/bus.c:1: warning: no structured comments found
drivers/usb/typec/class.c:1: warning: no structured comments found
include/linux/w1.h:281: warning: Function parameter or member 'of_match_table' not described in 'w1_family'
fs/direct-io.c:257: warning: Excess function parameter 'offset' description in 'dio_complete'
fs/file_table.c:1: warning: no structured comments found
fs/libfs.c:477: warning: Excess function parameter 'available' description in 'simple_write_end'
fs/posix_acl.c:646: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode'
fs/posix_acl.c:646: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode'
fs/posix_acl.c:646: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:183: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:254: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_invalidate_range_start_gfx'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:302: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_invalidate_range_start_hsa'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:382: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:383: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_leaf'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_leaf'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'start' not described in 'for_each_amdgpu_vm_pt_leaf'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'end' not described in 'for_each_amdgpu_vm_pt_leaf'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_leaf'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'entry' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:848: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_func'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_func'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_func'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_func'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_func'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_func'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1356: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_func'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_huge'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_huge'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'level' not described in 'amdgpu_vm_update_huge'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_huge'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_huge'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_huge'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_huge'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1523: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_huge'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3096: warning: Function parameter or member 'pasid' not described in 'amdgpu_vm_make_compute'
include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver'
include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver'
include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver'
include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver'
include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver'
include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver'
include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver'
include/drm/drm_drv.h:609: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver'
include/drm/drm_mode_config.h:869: warning: Function parameter or member 'quirk_addfb_prefer_xbgr_30bpp' not described in 'drm_mode_config'
drivers/gpu/drm/drm_fourcc.c:112: warning: Function parameter or member 'dev' not described in 'drm_driver_legacy_fb_format'
drivers/gpu/drm/drm_fourcc.c:112: warning: Excess function parameter 'native' description in 'drm_driver_legacy_fb_format'
drivers/gpu/drm/i915/i915_vma.h:49: warning: cannot understand function prototype: 'struct i915_vma '
drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found
drivers/gpu/drm/i915/intel_guc_fwif.h:554: warning: cannot understand function prototype: 'struct guc_log_buffer_state '
drivers/gpu/drm/i915/i915_trace.h:1: warning: no structured comments found
include/linux/skbuff.h:862: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'list' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'head_frag' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'encapsulation' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'csum_valid' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'csum_level' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'offload_fwd_mark' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'offload_mr_fwd_mark' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff'
include/linux/skbuff.h:862: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff'
include/net/sock.h:238: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_portpair' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_cookie' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_listener' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common'
include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock'
include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.len' not described in 'sock'
include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.head' not described in 'sock'
vim +884 drivers/base/firmware_loader/main.c
871
872 /**
873 * request_firmware_nowait_nowarn() - async version of request_firmware_nowarn
874 *
875 * Similar in fucntion to request_firmware_nowait(), but doesn't print a warning
876 * when the firmware file could not be found.
877 */
878 int
879 request_firmware_nowait_nowarn(
880 struct module *module, bool uevent,
881 const char *name, struct device *device, gfp_t gfp, void *context,
882 void (*cont)(const struct firmware *fw, void *context))
883 {
> 884 return _request_firmware_nowait(module, uevent, name, device, gfp,
885 context, cont, true);
886
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply
* [1/6] dma: tegra: avoid overflow of byte tracking
From: Dmitry Osipenko @ 2018-11-06 13:11 UTC (permalink / raw)
To: Ben Dooks, dan.j.williams, vkoul; +Cc: ldewangan, dmaengine, linux-tegra
On 31.10.2018 19:03, Ben Dooks wrote:
> The dma_desc->bytes_transferred counter tracks the number of bytes
> moved by the DMA channel. This is then used to calculate the information
> passed back in the in the tegra_dma_tx_status callback, which is usually
> fine.
>
> When the DMA channel is configured as continous, then the bytes_transferred
> counter will increase over time and eventually overflow to become negative
> so the residue count will become invalid and the ALSA sound-dma code will
> report invalid hardware pointer values to the application. This results in
> some users becoming confused about the playout position and putting audio
> data in the wrong place.
>
> To fix this issue, always ensure the bytes_transferred field is modulo the
> size of the request. We only do this for the case of the cyclic transfer
> done ISR as anyone attempting to move 2GiB of DMA data in one transfer
> is unlikely.
>
> Note, we don't fix the issue that we should /never/ transfer a negative
> number of bytes so we could make those fields unsigned.
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/dma/tegra20-apb-dma.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index 9a558e30c461..8219ab88a507 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -636,7 +636,10 @@ static void handle_cont_sngl_cycle_dma_done(struct tegra_dma_channel *tdc,
>
> sgreq = list_first_entry(&tdc->pending_sg_req, typeof(*sgreq), node);
> dma_desc = sgreq->dma_desc;
> - dma_desc->bytes_transferred += sgreq->req_len;
> + /* if we dma for long enough the transfer count will wrap */
> + dma_desc->bytes_transferred =
> + (dma_desc->bytes_transferred + sgreq->req_len) %
> + dma_desc->bytes_requested;
>
> /* Callback need to be call */
> if (!dma_desc->cb_count)
>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
^ permalink raw reply
* [2/6] dma: tegra: make byte counters unsigned int
From: Dmitry Osipenko @ 2018-11-06 13:11 UTC (permalink / raw)
To: Ben Dooks, dan.j.williams, vkoul; +Cc: ldewangan, dmaengine, linux-tegra
On 31.10.2018 19:03, Ben Dooks wrote:
> The buffer byte request length and counter are declared as signed integers
> but the values should never be below zero, so make these unsigned integers
> instead.
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/dma/tegra20-apb-dma.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index 8219ab88a507..adfd918baedc 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -155,7 +155,7 @@ struct tegra_dma_channel_regs {
> */
> struct tegra_dma_sg_req {
> struct tegra_dma_channel_regs ch_regs;
> - int req_len;
> + unsigned int req_len;
> bool configured;
> bool last_sg;
> struct list_head node;
> @@ -169,8 +169,8 @@ struct tegra_dma_sg_req {
> */
> struct tegra_dma_desc {
> struct dma_async_tx_descriptor txd;
> - int bytes_requested;
> - int bytes_transferred;
> + unsigned int bytes_requested;
> + unsigned int bytes_transferred;
> enum dma_status dma_status;
> struct list_head node;
> struct list_head tx_list;
>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
^ permalink raw reply
* [3/6] dma: tegra: fix incorrect case of DMA
From: Dmitry Osipenko @ 2018-11-06 13:14 UTC (permalink / raw)
To: Ben Dooks, dan.j.williams, vkoul; +Cc: ldewangan, dmaengine, linux-tegra
On 31.10.2018 19:03, Ben Dooks wrote:
> The use of Dma is annoying, since it is an acronym so should be all
> upper case. Fix this throughout the driver.
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/dma/tegra20-apb-dma.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index adfd918baedc..4f7d1e576d03 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -146,7 +146,7 @@ struct tegra_dma_channel_regs {
> };
>
> /*
> - * tegra_dma_sg_req: Dma request details to configure hardware. This
> + * tegra_dma_sg_req: DMA request details to configure hardware. This
> * contains the details for one transfer to configure DMA hw.
> * The client's request for data transfer can be broken into multiple
> * sub-transfer as per requester details and hw support.
> @@ -574,7 +574,7 @@ static bool handle_continuous_head_request(struct tegra_dma_channel *tdc,
> struct tegra_dma_sg_req *hsgreq = NULL;
>
> if (list_empty(&tdc->pending_sg_req)) {
> - dev_err(tdc2dev(tdc), "Dma is running without req\n");
> + dev_err(tdc2dev(tdc), "DMA is running without req\n");
> tegra_dma_stop(tdc);
> return false;
> }
> @@ -922,7 +922,7 @@ static int get_transfer_param(struct tegra_dma_channel *tdc,
> return 0;
>
> default:
> - dev_err(tdc2dev(tdc), "Dma direction is not supported\n");
> + dev_err(tdc2dev(tdc), "DMA direction is not supported\n");
> return -EINVAL;
> }
> return -EINVAL;
> @@ -988,7 +988,7 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
>
> dma_desc = tegra_dma_desc_get(tdc);
> if (!dma_desc) {
> - dev_err(tdc2dev(tdc), "Dma descriptors not available\n");
> + dev_err(tdc2dev(tdc), "DMA descriptors not available\n");
> return NULL;
> }
> INIT_LIST_HEAD(&dma_desc->tx_list);
> @@ -1008,14 +1008,14 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
> if ((len & 3) || (mem & 3) ||
> (len > tdc->tdma->chip_data->max_dma_count)) {
> dev_err(tdc2dev(tdc),
> - "Dma length/memory address is not supported\n");
> + "DMA length/memory address is not supported\n");
> tegra_dma_desc_put(tdc, dma_desc);
> return NULL;
> }
>
> sg_req = tegra_dma_sg_req_get(tdc);
> if (!sg_req) {
> - dev_err(tdc2dev(tdc), "Dma sg-req not available\n");
> + dev_err(tdc2dev(tdc), "DMA sg-req not available\n");
> tegra_dma_desc_put(tdc, dma_desc);
> return NULL;
> }
> @@ -1147,7 +1147,7 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
> while (remain_len) {
> sg_req = tegra_dma_sg_req_get(tdc);
> if (!sg_req) {
> - dev_err(tdc2dev(tdc), "Dma sg-req not available\n");
> + dev_err(tdc2dev(tdc), "DMA sg-req not available\n");
> tegra_dma_desc_put(tdc, dma_desc);
> return NULL;
> }
>
There is also:
if (!tdc->config_init) {
dev_err(tdc2dev(tdc), "dma channel is not configured\n");
return NULL;
}
that could be fixed too and with that:
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
^ permalink raw reply
* dmaengine: sa11x0: unexport sa11x0_dma_filter_fn and clean up
From: Russell King @ 2018-11-06 13:45 UTC (permalink / raw)
To: linux-arm-kernel, Vinod Koul; +Cc: Dan Williams, dmaengine
As we now have no users of sa11x0_dma_filter_fn() in the tree, we can
unexport this function, and remove the now unused header file.
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/dma/sa11x0-dma.c | 21 ++++++++-------------
include/linux/sa11x0-dma.h | 24 ------------------------
2 files changed, 8 insertions(+), 37 deletions(-)
delete mode 100644 include/linux/sa11x0-dma.h
diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c
index b31d07c7d93c..784d5f1a473b 100644
--- a/drivers/dma/sa11x0-dma.c
+++ b/drivers/dma/sa11x0-dma.c
@@ -17,7 +17,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
-#include <linux/sa11x0-dma.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -830,6 +829,14 @@ static const struct dma_slave_map sa11x0_dma_map[] = {
{ "sa11x0-ssp", "rx", "Ser4SSPRc" },
};
+static bool sa11x0_dma_filter_fn(struct dma_chan *chan, void *param)
+{
+ struct sa11x0_dma_chan *c = to_sa11x0_dma_chan(chan);
+ const char *p = param;
+
+ return !strcmp(c->name, p);
+}
+
static int sa11x0_dma_init_dmadev(struct dma_device *dmadev,
struct device *dev)
{
@@ -1087,18 +1094,6 @@ static struct platform_driver sa11x0_dma_driver = {
.remove = sa11x0_dma_remove,
};
-bool sa11x0_dma_filter_fn(struct dma_chan *chan, void *param)
-{
- if (chan->device->dev->driver == &sa11x0_dma_driver.driver) {
- struct sa11x0_dma_chan *c = to_sa11x0_dma_chan(chan);
- const char *p = param;
-
- return !strcmp(c->name, p);
- }
- return false;
-}
-EXPORT_SYMBOL(sa11x0_dma_filter_fn);
-
static int __init sa11x0_dma_init(void)
{
return platform_driver_register(&sa11x0_dma_driver);
diff --git a/include/linux/sa11x0-dma.h b/include/linux/sa11x0-dma.h
deleted file mode 100644
index 65839a58b8e5..000000000000
--- a/include/linux/sa11x0-dma.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SA11x0 DMA Engine support
- *
- * Copyright (C) 2012 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#ifndef __LINUX_SA11X0_DMA_H
-#define __LINUX_SA11X0_DMA_H
-
-struct dma_chan;
-
-#if defined(CONFIG_DMA_SA11X0) || defined(CONFIG_DMA_SA11X0_MODULE)
-bool sa11x0_dma_filter_fn(struct dma_chan *, void *);
-#else
-static inline bool sa11x0_dma_filter_fn(struct dma_chan *c, void *d)
-{
- return false;
-}
-#endif
-
-#endif
^ permalink raw reply related
* [1/3] clk: bcm2835: make license text and module license match
From: Stephen Boyd @ 2018-11-06 17:35 UTC (permalink / raw)
To: Chris Boot, Eric Anholt, Florian Meier, Martin Sperl,
Stefan Wahren
Cc: Michael Turquette, Mark Brown, Vinod Koul, linux-clk, dmaengine,
linux-spi, linux-arm-kernel
Quoting Stefan Wahren (2018-10-23 04:06:06)
> The license text is specifying GPL v2 or later but the MODULE_LICENSE
> is set to GPL v2 which means GNU Public License v2 only. So choose the
> license text as the correct one.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
Applied to clk-next
^ permalink raw reply
* [v1,1/2] dt-bindings: dmaengine: dw-dmac: add protection control property
From: Christian Lamparter @ 2018-11-06 18:36 UTC (permalink / raw)
To: Rob Herring
Cc: dmaengine, devicetree, Dan Williams, Vinod Koul, Andy Shevchenko,
Viresh Kumar, Mark Rutland
On Tuesday, November 6, 2018 12:06:52 AM CET Rob Herring wrote:
> On Sun, Nov 04, 2018 at 06:01:38PM +0100, Christian Lamparter wrote:
> > This patch adds the per-channel dma protection control
> > prop-encoded-array and dt-binding definitions (including
> > definitions for the existing channel allocation and priority
> > order values based on include/linux/platform_data/dma-dw.h)
> > for the DesignWare AHB Central Direct Memory Access Controller.
> >
> > Note: The protection control signals are one-to-one mapped to
> > the AHB HPROT[1:3] signals. The HPROT0 (Data Access) is
> > always hardwired to 1 for this controller.
> >
> > Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> > ---
> > .../devicetree/bindings/dma/snps-dma.txt | 4 ++++
> > MAINTAINERS | 4 +++-
> > include/dt-bindings/dma/dw-dmac.h | 20 +++++++++++++++++++
> > 3 files changed, 27 insertions(+), 1 deletion(-)
> > create mode 100644 include/dt-bindings/dma/dw-dmac.h
> >
> > diff --git a/Documentation/devicetree/bindings/dma/snps-dma.txt b/Documentation/devicetree/bindings/dma/snps-dma.txt
> > index 39e2b26be344..72b4984a4c18 100644
> > --- a/Documentation/devicetree/bindings/dma/snps-dma.txt
> > +++ b/Documentation/devicetree/bindings/dma/snps-dma.txt
> > @@ -27,6 +27,10 @@ Optional properties:
> > general purpose DMA channel allocator. False if not passed.
> > - multi-block: Multi block transfers supported by hardware. Array property with
> > one cell per channel. 0: not supported, 1 (default): supported.
> > +- snps,dma-protection-control: Channel's AHB HPROT[3:1] protection setting.
> > + Array property with one cell per channel. The default value for a channel
> > + is 0 (for non-cacheable, strongly ordered, unprivileged data access).
>
> IIRC, 'strongly ordered' is outside the scope of AHB (and AXI)
> definitions. There is a mapping of SO page table entries to bus control
> signals, but that's part of the cpu and outside the scope of this doc.
Ok, the "stongly ordered" is the term I got from the ARM AMBA specification as
the AMCC/APM Hardware document links to it. However, in the PROTCTL register
description it reads "non-buffered":
"The AMBA Specification recommends that the default value of HPROT indicates
a non-cached, non-buffered, privileged data access. The reset value is
used to indicate such an access. HPROT[0] is tied high because all transfers
are data accesses, as there are no opcode fetches."
> > + Refer to include/dt-bindings/dma/dw-dmac.h for possible values.
>
> Do you really need this to be per channel rather than just per platform?
> If anything, the optimal setting is probably based on the memory address
> (device, on-chip RAM, or DRAM), not the channel.
For my APM82181 and PPC460EX SoCs "the platform" approach would work just
fine. I made this "per-channel" because the HPROT bits can be configured
for each dma channel individually. But as far as the APM82181 (and PPC460EX)
are concerned: They both are PowerPC-SoCs and the AHB is not even the main bus.
Instead the dw-dmac DMA-Controller is bundled together with two
SATA-II Controllers behind a bidirectional PLB4-To-AHB-bridge that
interfaces with the rest of the system. The funkyness stems from the
bridge that tries to translate, buffer and modify the data (including
the HPROT signals) to make everything "fit" more or less.
So, I'll make the snps,dma-protection-control property a single "u32"
and apply it to all the channels for the v2.
> I'd expect for most platforms, bufferable works without any s/w issue
> (and should be more correct in that coherent allocations are bufferable
> (at least for ARM). Cacheable probably has no effect as most systems
> don't have coherent i/o (again, at least for ARM).
I think I would it leave this decision to the arch. Because from what I
can tell (based on grepping the kernel source): the dw-dmac is used by
various ARM, ARC, PowerPC and x86 machines. (The avr32 arch used to be
a user too, but it has been dropped in 4.12.). And I don't want to
accidentally break those. Or, @Viresh Kumar what's your opinion?
> > Example:
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index dacba23b80b4..c35998e20e9d 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -14107,9 +14107,11 @@ SYNOPSYS DESIGNWARE DMAC DRIVER
> > M: Viresh Kumar <vireshk@kernel.org>
> > R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > S: Maintained
> > +F: Documentation/devicetree/bindings/dma/snps-dma.txt
> > +F: drivers/dma/dw/
> > +F: include/dt-bindings/dma/dw-dmac.h
> > F: include/linux/dma/dw.h
> > F: include/linux/platform_data/dma-dw.h
> > -F: drivers/dma/dw/
> >
> > SYNOPSYS DESIGNWARE ENTERPRISE ETHERNET DRIVER
> > M: Jose Abreu <Jose.Abreu@synopsys.com>
> > diff --git a/include/dt-bindings/dma/dw-dmac.h b/include/dt-bindings/dma/dw-dmac.h
> > new file mode 100644
> > index 000000000000..9152a6e2406c
> > --- /dev/null
> > +++ b/include/dt-bindings/dma/dw-dmac.h
> > @@ -0,0 +1,20 @@
> > +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
> > +
> > +#ifndef __DT_BINDINGS_DMA_DW_DMAC_H__
> > +#define __DT_BINDINGS_DMA_DW_DMAC_H__
> > +
> > +#define DW_DMAC_CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */
> > +#define DW_DMAC_CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */
> > +#define DW_DMAC_CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */
> > +#define DW_DMAC_CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */
>
> These seem unrelated?
they belong to the existing chan_allocation_order and the chan_priority DT
properties. The values are matching what is already in the existing
include/linux/platform_data/dma-dw.h. But Ok, I'll leave them out in the next
version.
> > +
> > +/*
> > + * Protection Control bits provide protection against illegal transactions.
> > + * The protection bits[0:2] are one-to-one mapped to AHB HPROT[3:1] signals.
> > + * The AHB HPROT[0] bit is hardwired to 1: Data Access.
> > + */
> > +#define DW_DMAC_HPROT1_PRIVILEGED_MODE (1 << 0) /* Privileged Mode */
> > +#define DW_DMAC_HPROT2_BUFFERABLE (1 << 1) /* DMA is bufferable */
> > +#define DW_DMAC_HPROT3_CACHEABLE (1 << 2) /* DMA is cacheable */
> > +
> > +#endif /* __DT_BINDINGS_DMA_DW_DMAC_H__ */
>
^ permalink raw reply
* [3/6] dma: tegra: fix incorrect case of DMA
From: Ben Dooks @ 2018-11-07 8:27 UTC (permalink / raw)
To: Dmitry Osipenko; +Cc: dan.j.williams, vkoul, ldewangan, dmaengine, linux-tegra
On 2018-11-06 13:14, Dmitry Osipenko wrote:
> On 31.10.2018 19:03, Ben Dooks wrote:
>> The use of Dma is annoying, since it is an acronym so should be all
>> upper case. Fix this throughout the driver.
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>> drivers/dma/tegra20-apb-dma.c | 14 +++++++-------
>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/dma/tegra20-apb-dma.c
>> b/drivers/dma/tegra20-apb-dma.c
>> index adfd918baedc..4f7d1e576d03 100644
>> --- a/drivers/dma/tegra20-apb-dma.c
>> +++ b/drivers/dma/tegra20-apb-dma.c
>> @@ -146,7 +146,7 @@ struct tegra_dma_channel_regs {
>> };
>>
>> /*
>> - * tegra_dma_sg_req: Dma request details to configure hardware. This
>> + * tegra_dma_sg_req: DMA request details to configure hardware. This
>> * contains the details for one transfer to configure DMA hw.
>> * The client's request for data transfer can be broken into multiple
>> * sub-transfer as per requester details and hw support.
>> @@ -574,7 +574,7 @@ static bool handle_continuous_head_request(struct
>> tegra_dma_channel *tdc,
>> struct tegra_dma_sg_req *hsgreq = NULL;
>>
>> if (list_empty(&tdc->pending_sg_req)) {
>> - dev_err(tdc2dev(tdc), "Dma is running without req\n");
>> + dev_err(tdc2dev(tdc), "DMA is running without req\n");
>> tegra_dma_stop(tdc);
>> return false;
>> }
>> @@ -922,7 +922,7 @@ static int get_transfer_param(struct
>> tegra_dma_channel *tdc,
>> return 0;
>>
>> default:
>> - dev_err(tdc2dev(tdc), "Dma direction is not supported\n");
>> + dev_err(tdc2dev(tdc), "DMA direction is not supported\n");
>> return -EINVAL;
>> }
>> return -EINVAL;
>> @@ -988,7 +988,7 @@ static struct dma_async_tx_descriptor
>> *tegra_dma_prep_slave_sg(
>>
>> dma_desc = tegra_dma_desc_get(tdc);
>> if (!dma_desc) {
>> - dev_err(tdc2dev(tdc), "Dma descriptors not available\n");
>> + dev_err(tdc2dev(tdc), "DMA descriptors not available\n");
>> return NULL;
>> }
>> INIT_LIST_HEAD(&dma_desc->tx_list);
>> @@ -1008,14 +1008,14 @@ static struct dma_async_tx_descriptor
>> *tegra_dma_prep_slave_sg(
>> if ((len & 3) || (mem & 3) ||
>> (len > tdc->tdma->chip_data->max_dma_count)) {
>> dev_err(tdc2dev(tdc),
>> - "Dma length/memory address is not supported\n");
>> + "DMA length/memory address is not supported\n");
>> tegra_dma_desc_put(tdc, dma_desc);
>> return NULL;
>> }
>>
>> sg_req = tegra_dma_sg_req_get(tdc);
>> if (!sg_req) {
>> - dev_err(tdc2dev(tdc), "Dma sg-req not available\n");
>> + dev_err(tdc2dev(tdc), "DMA sg-req not available\n");
>> tegra_dma_desc_put(tdc, dma_desc);
>> return NULL;
>> }
>> @@ -1147,7 +1147,7 @@ static struct dma_async_tx_descriptor
>> *tegra_dma_prep_dma_cyclic(
>> while (remain_len) {
>> sg_req = tegra_dma_sg_req_get(tdc);
>> if (!sg_req) {
>> - dev_err(tdc2dev(tdc), "Dma sg-req not available\n");
>> + dev_err(tdc2dev(tdc), "DMA sg-req not available\n");
>> tegra_dma_desc_put(tdc, dma_desc);
>> return NULL;
>> }
>>
>
>
> There is also:
>
> if (!tdc->config_init) {
> dev_err(tdc2dev(tdc), "dma channel is not configured\n");
> return NULL;
> }
>
> that could be fixed too and with that:
>
> Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Thanks, fixed for next patch series.
^ permalink raw reply
* [5/6] dma: tegra: add tracepoints to driver
From: Ben Dooks @ 2018-11-07 10:02 UTC (permalink / raw)
To: Steven Rostedt
Cc: dan.j.williams, vkoul, ldewangan, dmaengine, linux-tegra,
Ingo Molnar
On 2018-10-12 18:01, Steven Rostedt wrote:
> On Fri, 12 Oct 2018 10:44:53 +0100
> Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>
>> Add some trace-points to the driver to allow for debuging via the
>> trace pipe.
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>> Cc: Ingo Molnar <mingo@redhat.com> (maintainer:TRACING)
>> Cc: Steven Rostedt <rostedt@goodmis.org> (maintainer:TRACING)
>> ---
>> drivers/dma/tegra20-apb-dma.c | 8 ++++
>> include/trace/events/tegra_apb_dma.h | 63
>> ++++++++++++++++++++++++++++
>> 2 files changed, 71 insertions(+)
>> create mode 100644 include/trace/events/tegra_apb_dma.h
>>
>> diff --git a/drivers/dma/tegra20-apb-dma.c
>> b/drivers/dma/tegra20-apb-dma.c
>> index ce2888f67254..96095a3b7edd 100644
>> --- a/drivers/dma/tegra20-apb-dma.c
>> +++ b/drivers/dma/tegra20-apb-dma.c
>> @@ -38,6 +38,9 @@
>>
>> #include "dmaengine.h"
>>
>> +#define CREATE_TRACE_POINTS
>> +#include <trace/events/tegra_apb_dma.h>
>> +
>> #define TEGRA_APBDMA_GENERAL 0x0
>> #define TEGRA_APBDMA_GENERAL_ENABLE BIT(31)
>>
>> @@ -672,6 +675,8 @@ static void tegra_dma_tasklet(unsigned long data)
>> dmaengine_desc_get_callback(&dma_desc->txd, &cb);
>> cb_count = dma_desc->cb_count;
>> dma_desc->cb_count = 0;
>> + trace_tegra_dma_complete_cb(&tdc->dma_chan, cb_count,
>> + cb.callback);
>> spin_unlock_irqrestore(&tdc->lock, flags);
>> while (cb_count--)
>> dmaengine_desc_callback_invoke(&cb, NULL);
>> @@ -688,6 +693,7 @@ static irqreturn_t tegra_dma_isr(int irq, void
>> *dev_id)
>>
>> spin_lock_irqsave(&tdc->lock, flags);
>>
>> + trace_tegra_dma_isr(&tdc->dma_chan, irq);
>> status = tdc_read(tdc, TEGRA_APBDMA_CHAN_STATUS);
>> if (status & TEGRA_APBDMA_STATUS_ISE_EOC) {
>> tdc_write(tdc, TEGRA_APBDMA_CHAN_STATUS, status);
>> @@ -931,6 +937,8 @@ static enum dma_status tegra_dma_tx_status(struct
>> dma_chan *dc,
>> dma_set_residue(txstate, residual);
>> }
>>
>> + trace_tegra_dma_tx_status(&tdc->dma_chan, cookie,
>> + txstate ? txstate->residue : -1);
>
> Why just pass in txstate and put that logic into the trace event code?
>
> See below.
>
>> spin_unlock_irqrestore(&tdc->lock, flags);
>> return ret;
>> }
>> diff --git a/include/trace/events/tegra_apb_dma.h
>> b/include/trace/events/tegra_apb_dma.h
>> new file mode 100644
>> index 000000000000..80d6f0cf4c36
>> --- /dev/null
>> +++ b/include/trace/events/tegra_apb_dma.h
>> @@ -0,0 +1,63 @@
>> +#if !defined(_TRACE_TEGRA_APB_DMA_H) ||
>> defined(TRACE_HEADER_MULTI_READ)
>> +#define _TRACE_TEGRA_APM_DMA_H
>> +
>> +#include <linux/tracepoint.h>
>> +#include <linux/dmaengine.h>
>> +
>> +#undef TRACE_SYSTEM
>> +#define TRACE_SYSTEM tegra_apb_dma
>> +
>> +TRACE_EVENT(tegra_dma_tx_status,
>> + TP_PROTO(struct dma_chan *dc, s32 cookie, u32 residue),
>
> TP_PROTO(struct dma_chan *dc, s32 cookie,
> struct dma_tx_state *txstate),
>
>> + TP_ARGS(dc, cookie, residue),
>
> TP_ARGS(dc, cookie, txstate),
>
>> + TP_STRUCT__entry(
>> + __field(struct dma_chan *, dc)
>> + __field(__s32, cookie)
>> + __field(__u32, residue)
>> + ),
>> + TP_fast_assign(
>> + __entry->dc = dc;
>> + __entry->cookie = cookie;
>> + __entry->residue = residue;
>
> __entry->residue = txstate ? txstate->residue : -1;
>
>
>> + ),
>> + TP_printk("channel %s: dma cookie %d, residue %u",
>> + dev_name(&__entry->dc->dev->device),
>
> The dev_name must be done in the TP_fast_assign part (use __string).
> What you have here can crash the system. That is, you saved the dc
> pointer into the ring buffer. Now that dc pointer may be freed, and
> then when you read the ring buffer, we are now dereferencing the stale
> and freed dc pointer and BOOM!
>
>
>> + __entry->cookie, __entry->residue)
>> +);
>> +
>> +TRACE_EVENT(tegra_dma_complete_cb,
>> + TP_PROTO(struct dma_chan *dc, int count, void *ptr),
>> + TP_ARGS(dc, count, ptr),
>> + TP_STRUCT__entry(
>> + __field(struct dma_chan *, dc)
>> + __field(int, count)
>> + __field(void *, ptr)
>> + ),
>> + TP_fast_assign(
>> + __entry->dc = dc;
>> + __entry->count = count;
>> + __entry->ptr = ptr;
>> + ),
>> + TP_printk("channel %s: done %d, ptr %p",
>> + dev_name(&__entry->dc->dev->device),
>
> Same here.
>
>> + __entry->count, __entry->ptr)
>> +);
>> +
>> +TRACE_EVENT(tegra_dma_isr,
>> + TP_PROTO(struct dma_chan *dc, int irq),
>> + TP_ARGS(dc, irq),
>> + TP_STRUCT__entry(
>> + __field(struct dma_chan *, dc)
>> + __field(int, irq)
>> + ),
>> + TP_fast_assign(
>> + __entry->dc = dc;
>> + __entry->irq = irq;
>> + ),
>> + TP_printk("%s: irq %d\n", dev_name(&__entry->dc->dev->device),
>
> And here.
thank you for the review, v3 will hopefully have all these fixed.
^ permalink raw reply
* [3/6] dma: tegra: fix incorrect case of DMA
From: Dmitry Osipenko @ 2018-11-07 12:04 UTC (permalink / raw)
To: Ben Dooks; +Cc: dan.j.williams, vkoul, ldewangan, dmaengine, linux-tegra
On 07.11.2018 11:27, Ben Dooks wrote:
>
>
> On 2018-11-06 13:14, Dmitry Osipenko wrote:
>> On 31.10.2018 19:03, Ben Dooks wrote:
>>> The use of Dma is annoying, since it is an acronym so should be all
>>> upper case. Fix this throughout the driver.
>>>
>>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>>> ---
>>> drivers/dma/tegra20-apb-dma.c | 14 +++++++-------
>>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
>>> index adfd918baedc..4f7d1e576d03 100644
>>> --- a/drivers/dma/tegra20-apb-dma.c
>>> +++ b/drivers/dma/tegra20-apb-dma.c
>>> @@ -146,7 +146,7 @@ struct tegra_dma_channel_regs {
>>> };
>>>
>>> /*
>>> - * tegra_dma_sg_req: Dma request details to configure hardware. This
>>> + * tegra_dma_sg_req: DMA request details to configure hardware. This
>>> * contains the details for one transfer to configure DMA hw.
>>> * The client's request for data transfer can be broken into multiple
>>> * sub-transfer as per requester details and hw support.
>>> @@ -574,7 +574,7 @@ static bool handle_continuous_head_request(struct tegra_dma_channel *tdc,
>>> struct tegra_dma_sg_req *hsgreq = NULL;
>>>
>>> if (list_empty(&tdc->pending_sg_req)) {
>>> - dev_err(tdc2dev(tdc), "Dma is running without req\n");
>>> + dev_err(tdc2dev(tdc), "DMA is running without req\n");
>>> tegra_dma_stop(tdc);
>>> return false;
>>> }
>>> @@ -922,7 +922,7 @@ static int get_transfer_param(struct tegra_dma_channel *tdc,
>>> return 0;
>>>
>>> default:
>>> - dev_err(tdc2dev(tdc), "Dma direction is not supported\n");
>>> + dev_err(tdc2dev(tdc), "DMA direction is not supported\n");
>>> return -EINVAL;
>>> }
>>> return -EINVAL;
>>> @@ -988,7 +988,7 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
>>>
>>> dma_desc = tegra_dma_desc_get(tdc);
>>> if (!dma_desc) {
>>> - dev_err(tdc2dev(tdc), "Dma descriptors not available\n");
>>> + dev_err(tdc2dev(tdc), "DMA descriptors not available\n");
>>> return NULL;
>>> }
>>> INIT_LIST_HEAD(&dma_desc->tx_list);
>>> @@ -1008,14 +1008,14 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
>>> if ((len & 3) || (mem & 3) ||
>>> (len > tdc->tdma->chip_data->max_dma_count)) {
>>> dev_err(tdc2dev(tdc),
>>> - "Dma length/memory address is not supported\n");
>>> + "DMA length/memory address is not supported\n");
>>> tegra_dma_desc_put(tdc, dma_desc);
>>> return NULL;
>>> }
>>>
>>> sg_req = tegra_dma_sg_req_get(tdc);
>>> if (!sg_req) {
>>> - dev_err(tdc2dev(tdc), "Dma sg-req not available\n");
>>> + dev_err(tdc2dev(tdc), "DMA sg-req not available\n");
>>> tegra_dma_desc_put(tdc, dma_desc);
>>> return NULL;
>>> }
>>> @@ -1147,7 +1147,7 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
>>> while (remain_len) {
>>> sg_req = tegra_dma_sg_req_get(tdc);
>>> if (!sg_req) {
>>> - dev_err(tdc2dev(tdc), "Dma sg-req not available\n");
>>> + dev_err(tdc2dev(tdc), "DMA sg-req not available\n");
>>> tegra_dma_desc_put(tdc, dma_desc);
>>> return NULL;
>>> }
>>>
>>
>>
>> There is also:
>>
>> if (!tdc->config_init) {
>> dev_err(tdc2dev(tdc), "dma channel is not configured\n");
>> return NULL;
>> }
>>
>> that could be fixed too and with that:
>>
>> Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
>
> Thanks, fixed for next patch series.
>
if (!hsgreq->configured) {
tegra_dma_stop(tdc);
dev_err(tdc2dev(tdc), "Error in dma transfer, aborting dma\n");
tegra_dma_abort_all(tdc);
return false;
}
Please change that one too for consistency. The rest looks okay.
^ permalink raw reply
* [resend] dma: sh: convert to SPDX identifiers
From: Kuninori Morimoto @ 2018-11-08 6:32 UTC (permalink / raw)
To: Vinod Koul; +Cc: dmaengine
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
This patch updates license to use SPDX-License-Identifier
instead of verbose license text.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
drivers/dma/sh/Kconfig | 1 +
include/linux/shdma-base.h | 7 ++-----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/sh/Kconfig b/drivers/dma/sh/Kconfig
index 6e0685f..1c46754 100644
--- a/drivers/dma/sh/Kconfig
+++ b/drivers/dma/sh/Kconfig
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# DMA engine configuration for sh
#
diff --git a/include/linux/shdma-base.h b/include/linux/shdma-base.h
index d927647..6dfd05e 100644
--- a/include/linux/shdma-base.h
+++ b/include/linux/shdma-base.h
@@ -1,4 +1,5 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0
+ *
* Dmaengine driver base library for DMA controllers, found on SH-based SoCs
*
* extracted from shdma.c and headers
@@ -7,10 +8,6 @@
* Copyright (C) 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
* Copyright (C) 2009 Renesas Solutions, Inc. All rights reserved.
* Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
*/
#ifndef SHDMA_BASE_H
^ permalink raw reply related
* dmaengine: rcar-dmac: Document R8A774A1 bindings
From: Fabrizio Castro @ 2018-11-08 11:03 UTC (permalink / raw)
To: Fabrizio Castro, Vinod Koul, Rob Herring, Mark Rutland
Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Simon Horman, Geert Uytterhoeven,
Chris Paterson, Biju Das, linux-renesas-soc@vger.kernel.org
Dear All,
Who is the best person to take this patch?
Thanks,
Fab
> From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Sent: 14 August 2018 13:32
> Subject: [PATCH] dmaengine: rcar-dmac: Document R8A774A1 bindings
>
> Renesas' RZ/G2M (R8A774A1) SoC has DMA controllers compatible
> with this driver, therefore document RZ/G2M specific bindings.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Reviewed-by: Biju Das <biju.das@bp.renesas.com>
> ---
> Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt
> b/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt
> index 946229c..2de2eed 100644
> --- a/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt
> +++ b/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt
> @@ -1,6 +1,6 @@
> * Renesas R-Car (RZ/G) DMA Controller Device Tree bindings
>
> -Renesas R-Car Generation 2 SoCs have multiple multi-channel DMA
> +Renesas R-Car (Gen 2/3) and RZ/G SoCs have multiple multi-channel DMA
> controller instances named DMAC capable of serving multiple clients. Channels
> can be dedicated to specific clients or shared between a large number of
> clients.
> @@ -19,6 +19,7 @@ Required Properties:
> - "renesas,dmac-r8a7743" (RZ/G1M)
> - "renesas,dmac-r8a7745" (RZ/G1E)
> - "renesas,dmac-r8a77470" (RZ/G1C)
> +- "renesas,dmac-r8a774a1" (RZ/G2M)
> - "renesas,dmac-r8a7790" (R-Car H2)
> - "renesas,dmac-r8a7791" (R-Car M2-W)
> - "renesas,dmac-r8a7792" (R-Car V2H)
> --
> 2.7.4
Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
^ permalink raw reply
* dmaengine: rcar-dmac: Document R8A774A1 bindings
From: Simon Horman @ 2018-11-08 12:23 UTC (permalink / raw)
To: Fabrizio Castro
Cc: Vinod Koul, Rob Herring, Mark Rutland, dmaengine@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Geert Uytterhoeven, Chris Paterson, Biju Das,
linux-renesas-soc@vger.kernel.org
Hi Fabrizio,
I believe this one is for Vinod.
On Thu, Nov 08, 2018 at 11:03:53AM +0000, Fabrizio Castro wrote:
> Dear All,
>
> Who is the best person to take this patch?
>
> Thanks,
> Fab
>
> > From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Sent: 14 August 2018 13:32
> > Subject: [PATCH] dmaengine: rcar-dmac: Document R8A774A1 bindings
> >
> > Renesas' RZ/G2M (R8A774A1) SoC has DMA controllers compatible
> > with this driver, therefore document RZ/G2M specific bindings.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Reviewed-by: Biju Das <biju.das@bp.renesas.com>
> > ---
> > Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt
> > b/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt
> > index 946229c..2de2eed 100644
> > --- a/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt
> > +++ b/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.txt
> > @@ -1,6 +1,6 @@
> > * Renesas R-Car (RZ/G) DMA Controller Device Tree bindings
> >
> > -Renesas R-Car Generation 2 SoCs have multiple multi-channel DMA
> > +Renesas R-Car (Gen 2/3) and RZ/G SoCs have multiple multi-channel DMA
> > controller instances named DMAC capable of serving multiple clients. Channels
> > can be dedicated to specific clients or shared between a large number of
> > clients.
> > @@ -19,6 +19,7 @@ Required Properties:
> > - "renesas,dmac-r8a7743" (RZ/G1M)
> > - "renesas,dmac-r8a7745" (RZ/G1E)
> > - "renesas,dmac-r8a77470" (RZ/G1C)
> > +- "renesas,dmac-r8a774a1" (RZ/G2M)
> > - "renesas,dmac-r8a7790" (R-Car H2)
> > - "renesas,dmac-r8a7791" (R-Car M2-W)
> > - "renesas,dmac-r8a7792" (R-Car V2H)
> > --
> > 2.7.4
>
>
>
>
> Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox