From 905a83211825d11716192043527ed7f84b0572a7 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 4 Mar 2014 11:29:45 -0700 Subject: [PATCH] staging: comedi: pcl818: fix (*cancel) when cmd->stop_src == TRIG_NONE When using DMA, the async command (*cancel) operation is delayed until the current DMA transfer is complete. When the DMA transfer finishes the interrupt routine detects this and calls the (*cancel) again which should then cancel the async command. The current logic does not work when cmd->stop_src == TRIG_NONE. In this case the (*cancel) function keeps delaying the cancel. The actual DMA does stop because the DMA handler is not called to setup the next transfer but the (*cancel) code is never executed. Rename the 'irq_was_now_closed' flag in the private data to 'ai_cmd_canceled' to clarify what it is. Only set the flag in the (*cancel) when a DMA transfer is running and the async command has not already been canceled. The interrupt routine then does not need all the extra checks. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed