Re: [PATCH] dmaengine: shdma: fix a race condition in __ld_cleanup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux