i2c: imx: Fix reinit_completion() use
authorEsben Haabendal <eha@deif.com>
Mon, 9 Jul 2018 09:43:01 +0000 (11:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2018 10:16:38 +0000 (12:16 +0200)
commitea464580fef7a334d19f27538bc690168a821b5d
tree1d95270f78b4995baddbb60add5eb86cda0c94a9
parent60baabc37bc18323e6346d28fd7b70729e345703
i2c: imx: Fix reinit_completion() use

commit 9f9e3e0d4dd3338b3f3dde080789f71901e1e4ff upstream.

Make sure to call reinit_completion() before dma is started to avoid race
condition where reinit_completion() is called after complete() and before
wait_for_completion_timeout().

Signed-off-by: Esben Haabendal <eha@deif.com>
Fixes: ce1a78840ff7 ("i2c: imx: add DMA support for freescale i2c driver")
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-imx.c