Ira Snyder 6c15d7afbb carma-fpga: fix race between data dumping and DMA callback
When the system is under heavy load, we occasionally saw a problem where
the system would get a legitimate interrupt when they should be
disabled.

This was caused by the data_dma_cb() DMA callback unconditionally
re-enabling FPGA interrupts even when data dumping is disabled. When
data dumping was re-enabled, the irq handler would fire while a DMA was
in progress. The "BUG_ON(priv->inflight != NULL);" during the second
invocation of the DMA callback caused the system to crash.

To fix the issue, the priv->enabled boolean is moved under the
protection of the priv->lock spinlock. The DMA callback checks the
boolean to know whether to re-enable FPGA interrupts before it returns.

Now that it is fixed, the driver keeps FPGA interrupts disabled when it
expects that they are disabled, fixing the bug.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-02-27 11:33:59 +11:00
..
2012-02-06 14:37:52 -05:00
2012-01-26 18:36:48 +00:00
2012-02-02 14:00:43 +05:30
2012-02-09 15:41:29 -05:00
2012-02-08 19:06:30 -08:00
2012-02-01 19:35:21 +01:00
2012-02-17 10:29:33 +01:00
2012-02-24 16:08:51 -08:00
2012-02-01 15:26:00 -05:00
2012-01-13 10:12:23 -08:00
2012-02-24 08:56:51 -08:00
2012-01-11 23:58:47 -05:00