From: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Tim Michals <tcmichals-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Subject: [PATCH 1/2] i2c: mxs: Handle i2c DMA failure properly
Date: Sun, 18 Nov 2012 06:25:07 +0100 [thread overview]
Message-ID: <1353216308-7338-1-git-send-email-marex@denx.de> (raw)
Properly terminate the DMA transfer in case the DMA PIO transfer
or setup fails for any reason.
Signed-off-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
Cc: Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Tim Michals <tcmichals-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
drivers/i2c/busses/i2c-mxs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index 286ca19..0670da7 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -287,12 +287,14 @@ read_init_dma_fail:
select_init_dma_fail:
dma_unmap_sg(i2c->dev, &i2c->sg_io[0], 1, DMA_TO_DEVICE);
select_init_pio_fail:
+ dmaengine_terminate_all(i2c->dmach);
return -EINVAL;
/* Write failpath. */
write_init_dma_fail:
dma_unmap_sg(i2c->dev, i2c->sg_io, 2, DMA_TO_DEVICE);
write_init_pio_fail:
+ dmaengine_terminate_all(i2c->dmach);
return -EINVAL;
}
--
1.7.10.4
next reply other threads:[~2012-11-18 5:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-18 5:25 Marek Vasut [this message]
[not found] ` <1353216308-7338-1-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2012-11-18 5:25 ` [PATCH 2/2] i2c: mxs: Do not disable the I2C SMBus quick mode Marek Vasut
[not found] ` <CANqk_c-3t2Kn3cQjwzoSzMrKMD-W_0JByD4U=Bp_ZA3_seyuig@mail.gmail.com>
[not found] ` <CANqk_c-3t2Kn3cQjwzoSzMrKMD-W_0JByD4U=Bp_ZA3_seyuig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-19 15:19 ` Marek Vasut
[not found] ` <CANqk_c92YYzCKjT7ehfXpmGhJC8p0BDSNoW3vC71J9q89=XUaQ@mail.gmail.com>
[not found] ` <CANqk_c92YYzCKjT7ehfXpmGhJC8p0BDSNoW3vC71J9q89=XUaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-19 18:13 ` Marek Vasut
[not found] ` <CANqk_c9xk6mtiA5NpvoLy3bSdKPhF7yAUWfe_rRefZLMeOeHNQ@mail.gmail.com>
[not found] ` <CANqk_c9xk6mtiA5NpvoLy3bSdKPhF7yAUWfe_rRefZLMeOeHNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-19 20:02 ` Marek Vasut
2012-11-20 11:36 ` Fabio Estevam
[not found] ` <1353216308-7338-2-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2012-11-22 22:05 ` Wolfram Sang
2012-11-19 9:25 ` [PATCH 1/2] i2c: mxs: Handle i2c DMA failure properly Wolfram Sang
[not found] ` <20121119092531.GE7775-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-19 14:00 ` Marek Vasut
[not found] ` <201211191500.32205.marex-ynQEQJNshbs@public.gmane.org>
2012-11-20 8:39 ` Wolfram Sang
[not found] ` <20121120083946.GB14722-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-20 8:47 ` Marek Vasut
[not found] ` <201211200947.36430.marex-ynQEQJNshbs@public.gmane.org>
2012-11-20 8:54 ` Wolfram Sang
2012-11-22 22:04 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353216308-7338-1-git-send-email-marex@denx.de \
--to=marex-ynqeqjnshbs@public.gmane.org \
--cc=festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tcmichals-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).