Re: [PATCH 1/3] spi: spi-xilinx: Remove ISR race condition
From: Mark Brown
Date: Tue Jun 04 2013 - 13:32:44 EST
On Tue, Jun 04, 2013 at 04:02:34PM +0200, Michal Simek wrote:
> The ISR currently consumes the rx buffer data and re-enables transmission
> from within interrupt context. This is bad because if the interrupt
> occurs again before the ISR exits, the new interrupt will be erroneously
> cleared by the still completing ISR.
> Simplified the ISR by just setting the completion variable and exiting with
> no action. Then just looped the transmit functionality in
> xilinx_spi_txrx_bufs().
Applied but this is a bit sad, having to defer the refill to process
context means that we're adding extra latency which takes us further
away from being able to saturate the bus. There ought to be a way to
avoid the issue though I can't think of a non-racy one - I guess level
triggered interrupts aren't an option?
Attachment:
signature.asc
Description: Digital signature