staging: comedi: addi_apci_3120: prevent deadlock in apci3120_ao_insn_write()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 20 Oct 2014 18:34:18 +0000 (11:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:58:36 +0000 (15:58 +0800)
commitce987a8a8f86c063c6332da83dfa514a1582c2f3
tree316d21b9b7ff9430f34218fc95476fe55b9393cd
parent695f34cef33421ac89dd77e5e047e131bb3f36c0
staging: comedi: addi_apci_3120: prevent deadlock in apci3120_ao_insn_write()

The DA_READY bit (0x0001) in the status register needs to be set before the
analog outputs can be updated.

Use comedi_timeout() to prevent a deadlock condition while waiting for the
DA_READY bit to get set.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c