Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1551736 > unrolled thread
| Started by | M'boumba Cedric Madianga <cedric.madianga@gmail.com> |
|---|---|
| First post | 2017-01-05 09:20 +0100 |
| Last post | 2017-01-10 06:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH RESEND] dmaengine: stm32-dma: Add error messages if xlate fails M'boumba Cedric Madianga <cedric.madianga@gmail.com> - 2017-01-05 09:20 +0100
Re: [PATCH RESEND] dmaengine: stm32-dma: Add error messages if xlate fails Vinod Koul <vinod.koul@intel.com> - 2017-01-10 06:30 +0100
| From | M'boumba Cedric Madianga <cedric.madianga@gmail.com> |
|---|---|
| Date | 2017-01-05 09:20 +0100 |
| Subject | [PATCH RESEND] dmaengine: stm32-dma: Add error messages if xlate fails |
| Message-ID | <sWbrb-bR-17@gated-at.bofh.it> |
This patch adds some error messages when a slave device fails to request a
channel.
Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
Reviewed-by: Ludovic BARRE <ludovic.barre@st.com>
---
Resolve conflicts issue
---
drivers/dma/stm32-dma.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index fc9738e..4eacd9d 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -987,30 +987,36 @@ static struct dma_chan *stm32_dma_of_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
{
struct stm32_dma_device *dmadev = ofdma->of_dma_data;
+ struct device *dev = dmadev->ddev.dev;
struct stm32_dma_cfg cfg;
struct stm32_dma_chan *chan;
struct dma_chan *c;
- if (dma_spec->args_count < 3)
+ if (dma_spec->args_count < 4) {
+ dev_err(dev, "Bad number of cells\n");
return NULL;
+ }
cfg.channel_id = dma_spec->args[0];
cfg.request_line = dma_spec->args[1];
cfg.stream_config = dma_spec->args[2];
- cfg.threshold = 0;
+ cfg.threshold = dma_spec->args[3];
- if ((cfg.channel_id >= STM32_DMA_MAX_CHANNELS) || (cfg.request_line >=
- STM32_DMA_MAX_REQUEST_ID))
+ if ((cfg.channel_id >= STM32_DMA_MAX_CHANNELS) ||
+ (cfg.request_line >= STM32_DMA_MAX_REQUEST_ID)) {
+ dev_err(dev, "Bad channel and/or request id\n");
return NULL;
-
- if (dma_spec->args_count > 3)
- cfg.threshold = dma_spec->args[3];
+ }
chan = &dmadev->chan[cfg.channel_id];
c = dma_get_slave_channel(&chan->vchan.chan);
- if (c)
- stm32_dma_set_config(chan, &cfg);
+ if (!c) {
+ dev_err(dev, "No more channel avalaible\n");
+ return NULL;
+ }
+
+ stm32_dma_set_config(chan, &cfg);
return c;
}
--
1.9.1
[toc] | [next] | [standalone]
| From | Vinod Koul <vinod.koul@intel.com> |
|---|---|
| Date | 2017-01-10 06:30 +0100 |
| Subject | Re: [PATCH RESEND] dmaengine: stm32-dma: Add error messages if xlate fails |
| Message-ID | <sXXaq-5IN-37@gated-at.bofh.it> |
| In reply to | #1551736 |
On Thu, Jan 05, 2017 at 09:09:40AM +0100, M'boumba Cedric Madianga wrote: > This patch adds some error messages when a slave device fails to request a > channel. Applied now -- ~Vinod
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web