On 01/10/15 10:30, Hamza Farooq wrote: > Hi, > > Sorry if I'm out of context. I saw this thread and found it very > similar to the problem that we have fixed with the renesas sh-sci > serial driver. We have made the two handlers (dma packet complete and > timer expired) mutually exclusive by using spinlocks. Additionally, > the race condition has been handled by not stopping the dma engine in > timer expiry handler. If the both happen at the same time, let the dma > packet complete handler push the data, by simply exiting the timer > handler. If the interrupts are redirected to CPU in timer expiry > handler, do it _only_ when you are sure no more data is coming in. Yes that is the key. I guess if flow-control is used, then you can prevent more data coming, otherwise I am not sure. > The development history can be viewed at Geert Uytterhoeven's renesas > drivers tree: > https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git > > Interesting files are drivers/tty/serial/sh-sci and drivers/dma/sh/rcar-dmac.c Which branch are you referring to? Is this not in the mainline yet. Thanks for the info! Jon -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html