From: viresh kumar <viresh.kumar@st.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>,
"Koul, Vinod" <vinod.koul@intel.com>,
Dan Williams <dan.j.williams@intel.com>
Cc: Linus WALLEIJ <linus.walleij@stericsson.com>,
amitgoel <amit.goel@st.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Armando VISCONTI <armando.visconti@st.com>,
Shiraz HASHIM <shiraz.hashim@st.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: dmaengine: Can we schedule new transfer from dma callback routine??
Date: Fri, 15 Apr 2011 12:15:43 +0530 [thread overview]
Message-ID: <4DA7E997.3080402@st.com> (raw)
In-Reply-To: <20110411085603.GA13041@n2100.arm.linux.org.uk>
On 04/11/2011 02:26 PM, Russell King - ARM Linux wrote:
> On Mon, Apr 11, 2011 at 01:25:04PM +0530, viresh kumar wrote:
>>
>> Hello,
>>
>> In dw_dmac.c driver, dwc_descriptor_complete() routine, following is
>> mentioned before calling callback:
>>
>> /*
>> * The API requires that no submissions are done from a
>> * callback, so we don't need to drop the lock here
>> */
>> if (callback)
>> callback(param);
>>
>> Does this hold true for dmaengine??
>
> Not for slave devices - see Dan's reply:
>
> http://lists.arm.linux.org.uk/lurker/message/20101223.005313.a38d7bf0.en.html
>
> As the slave API hasn't been well documented, there's a lot of
> inconsistency of behaviour between DMA engine slave implementations.
> I'd suggest at least fixing slave DMA engine drivers to ensure that:
>
> (a) the callback is always called in tasklet context
> (b) the callback can submit new slave transactions (iow, the spinlock
> which prep_slave_sg takes must not be held during the callback.)
>
> The way that others solve this is to move the completed txd structures
> to a local 'completed' list, and then walk this list after the spinlocks
> have been dropped.
>
Hello,
There is one more issue in the current DW_DMAC driver.
As most of interrupt processing is done in tasklet, spin_lock_bh() is used in almost
every routine.
Now, if some driver is calling these routines from interrupt context or with interrupt
disabled, we get KERN_WARN() messages due to following in kernel/softirq.c:
static inline void _local_bh_enable_ip(unsigned long ip)
{
WARN_ON_ONCE(in_irq() || irqs_disabled());
...
}
Should i minimize processing in tasklets, so that spin_lock_bh is not required anymore,
as in drivers/dma/amba-pl08x.c (tasklet for every channel) or is there some other way of
doing it.
Currently, drivers/tty/serial/amba-pl011.c is calling from interrupt context or with
interrupt disabled.
--
viresh
next prev parent reply other threads:[~2011-04-15 6:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-11 7:55 dmaengine: Can we schedule new transfer from dma callback routine?? viresh kumar
2011-04-11 8:56 ` Russell King - ARM Linux
2011-04-11 10:39 ` viresh kumar
2011-04-15 6:45 ` viresh kumar [this message]
2011-04-15 9:15 ` Russell King - ARM Linux
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=4DA7E997.3080402@st.com \
--to=viresh.kumar@st.com \
--cc=amit.goel@st.com \
--cc=armando.visconti@st.com \
--cc=dan.j.williams@intel.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=shiraz.hashim@st.com \
--cc=vinod.koul@intel.com \
/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