base: check for errors in dsp_wait_for_events()
authorFelipe Contreras <felipe.contreras@nokia.com>
Tue, 11 May 2010 16:18:26 +0000 (19:18 +0300)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Thu, 15 Jul 2010 10:48:33 +0000 (12:48 +0200)
commit934e13da115dd4a8038969178db28a8cb1844a45
tree4926c9351fdf30ba8fe7e1a81479ad05940a4753
parenta62b873cccff8598874444d63c7cfe3da7a1ead5
base: check for errors in dsp_wait_for_events()

Before, an error in wait_for_events() meant a timeout... now, with the
automatic recovery feature, it might mean a fatal error was triggered
and the driver is trying to reload the DSP.

Therefore, we need a way distinguish between different kinds of errors.

Also, it's important to know that some versions of dspbridge driver
return 0x80008017 instead of -ETIME so we need to check for the DSP_API
version. And since libc only stores errors -1 to -4095 to errno, we need
to do that ourselves when the error is out of the range.

Once dspbridge v3 is released, we should probably get rid of that hack.

Thanks to comments from Texas Instruments and Mark Nauwelaerts.

Cc: Deepak Chitriki <deepak.chitriki@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
src/dsp_bridge.c