From: Vinod Koul <vinod.koul@intel.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] dmaengine: shdma: fix a race condition in __ld_cleanup()
Date: Wed, 12 Nov 2014 10:56:51 +0000 [thread overview]
Message-ID: <20141112105705.GG24582@intel.com> (raw)
In-Reply-To: <1412820540-4892-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>
On Thu, Oct 09, 2014 at 11:09:00AM +0900, Yoshihiro Shimoda wrote:
> This patch fixes a race condition about a list of shdma-base driver.
> If we don't apply this patch, a dma slave driver (especially a usb
> peripheral driver) may not be able to start the transfer.
>
> If a dma slave driver has a callback, __ld_cleanup() will call
> the callback before this driver removes the list. After the callback,
> since the return value of __ld_cleanup() is not zero,
> shdma_chan_ld_cleanup() calls __ld_cleanup() again. And, __ld_clean()
> will removes the list.
>
> At this time, if a dma slave driver calls dmaengine_submit() before
> this driver removes the list, this driver will set schan->pm_state
> to SHDMA_PM_PENDING in shdma_tx_submit(). And then, even if a dma
> slave driver calls dma_async_issue_pending(), this driver don't
> start the transfer because the schan->pm_state is SHDMA_PM_PENDING
> in shdma_issue_pending().
>
> So, this patch adds a new condition in __ld_clean() to check if the
> schan->pm_state is SHDMA_PM_PENDING or not.
Applied, thanks
--
~Vinod
prev parent reply other threads:[~2014-11-12 10:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-09 2:09 [PATCH] dmaengine: shdma: fix a race condition in __ld_cleanup() Yoshihiro Shimoda
2014-10-11 17:27 ` Laurent Pinchart
2014-11-12 10:56 ` Vinod Koul [this message]
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=20141112105705.GG24582@intel.com \
--to=vinod.koul@intel.com \
--cc=linux-sh@vger.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