mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-17 16:15:18 +00:00
i2c: rcar: cleanup DMA for all kinds of failure
[ Upstream commit31d86033a0
] DMA needs to be cleaned up not only on timeout, but on all errors where it has been setup before. Fixes:73e8b05283
("i2c: rcar: add DMA support") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5832fa5bd0
commit
fd83130bdb
1 changed files with 5 additions and 1 deletions
|
@ -761,8 +761,12 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
|
|||
|
||||
time_left = wait_event_timeout(priv->wait, priv->flags & ID_DONE,
|
||||
num * adap->timeout);
|
||||
if (!time_left) {
|
||||
|
||||
/* cleanup DMA if it couldn't complete properly due to an error */
|
||||
if (priv->dma_direction != DMA_NONE)
|
||||
rcar_i2c_cleanup_dma(priv);
|
||||
|
||||
if (!time_left) {
|
||||
rcar_i2c_init(priv);
|
||||
ret = -ETIMEDOUT;
|
||||
} else if (priv->flags & ID_NACK) {
|
||||
|
|
Loading…
Reference in a new issue