From: Vinod Koul <vinod.koul@intel.com>
To: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
devicetree@vger.kernel.org, linux@arm.linux.org.uk,
pawel.moll@arm.com, ijc+devicetree@hellion.org.uk,
linux-kernel@vger.kernel.org, robh+dt@kernel.org,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Kumar Gala <galak@codeaurora.org>,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/4] dmaengine: Add STM32 DMA driver
Date: Wed, 14 Oct 2015 19:44:33 +0530 [thread overview]
Message-ID: <20151014141433.GT27370@localhost> (raw)
In-Reply-To: <CAOAejn3QOzrd952MztVTah4UbpNs1OabwkxhEtp15Mqz0B7LXA@mail.gmail.com>
On Wed, Oct 14, 2015 at 03:07:16PM +0200, M'boumba Cedric Madianga wrote:
> >> +static inline uint32_t stm32_dma_read(struct stm32_dma_device *dmadev, u32 reg)
> >
> > this and few other could be made more readable
>
> Ok, I could replace uint32_t by u32. Is it what you expect ?
> For others, I don't see how I could make it more readable.
> Could you please give me more details to help me ? Thanks in advance
Yes that is one and also aplitting this up so that it fits within 80chars
while not sacrficing readablity...
> >> + } else if ((status & STM32_DMA_FEI) && (sfcr & STM32_DMA_SFCR_FEIE)) {
> >> + dev_err(chan2dev(chan), "DMA error: received FEI event\n");
> >> + stm32_dma_irq_clear(chan, STM32_DMA_FEI);
> >> + chan->status = DMA_ERROR;
> >> + spin_unlock(&chan->vchan.lock);
> >> + return IRQ_HANDLED;
> >
> > this is repeat of above apart from err print!!
>
> Not only for print as we also need that to define which bit to clear
> in the IRQ status.
> In that way we will be sure to handle each interrupt event.
You can print error type based on status, or print the whole status but
handle it same for all three cases
> >> + enum dma_status status;
> >> + unsigned long flags;
> >> + unsigned int residue;
> >> +
> >> + status = dma_cookie_status(c, cookie, state);
> >> + if (status == DMA_COMPLETE)
> >> + return status;
> >> +
> >> + if (!state)
> >> + return chan->status;
> > why channel status and not status from dma_cookie_status()?
>
> If status is different than DMA_COMPLETE it seems better to use channel status.
> Indeed, in that way, we have the possibility to notify that there is a
> potential error in the bus via DMA_ERROR.
> But if I return status from dma_cookie_status(), I will always notify
> DMA_IN_PROGRESS.
No, you are supposed to return the descriptor status and not channel status!
--
~Vinod
next prev parent reply other threads:[~2015-10-14 14:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 14:05 [PATCH v2 0/4] Add support for STM32 DMA M'boumba Cedric Madianga
2015-10-13 14:05 ` [PATCH v2 1/4] dt-bindings: Document the STM32 DMA bindings M'boumba Cedric Madianga
2015-10-14 8:54 ` M'boumba Cedric Madianga
2015-10-13 14:05 ` [PATCH v2 2/4] dmaengine: Add STM32 DMA driver M'boumba Cedric Madianga
[not found] ` <1444745127-1105-3-git-send-email-cedric.madianga-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-13 14:34 ` Daniel Thompson
[not found] ` <561D1689.90703-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-14 7:54 ` M'boumba Cedric Madianga
2015-10-14 8:52 ` Daniel Thompson
[not found] ` <561E17EA.6000900-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-14 8:57 ` M'boumba Cedric Madianga
2015-10-14 13:17 ` M'boumba Cedric Madianga
[not found] ` <CAOAejn2pcFSn3Hf=j6zgg6Ui6GjJZrtRch6ywByHaVLsTLMk6A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-14 13:29 ` Daniel Thompson
2015-10-14 13:41 ` M'boumba Cedric Madianga
2015-10-14 14:24 ` Daniel Thompson
[not found] ` <561E658D.1070900-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-14 15:26 ` M'boumba Cedric Madianga
2015-10-14 15:28 ` Daniel Thompson
[not found] ` <561E7497.1050105-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-14 15:41 ` M'boumba Cedric Madianga
[not found] ` <CAOAejn0chZD5mgi8WrW3ow3APUHTJOYP4=G2jCZ_Po4qe9eACw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-15 4:07 ` Vinod Koul
2015-10-14 11:16 ` Vinod Koul
2015-10-14 13:07 ` M'boumba Cedric Madianga
2015-10-14 14:14 ` Vinod Koul [this message]
2015-10-13 14:05 ` [PATCH v2 3/4] ARM: dts: Add STM32 DMA support for STM32F429 MCU M'boumba Cedric Madianga
2015-10-13 14:05 ` [PATCH v2 4/4] ARM: configs: Add STM32 DMA support in STM32 defconfig M'boumba Cedric Madianga
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151014141433.GT27370@localhost \
--to=vinod.koul@intel.com \
--cc=cedric.madianga@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).