From: H Hartley Sweeten Date: Tue, 4 Mar 2014 18:29:45 +0000 (-0700) Subject: staging: comedi: pcl818: fix (*cancel) when cmd->stop_src == TRIG_NONE X-Git-Tag: v3.15-rc1~139^2~658 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=905a83211825d11716192043527ed7f84b0572a7;p=pandora-kernel.git 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-diff-tree failed