From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Yuan Yao <yao.yuan-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: marex-ynQEQJNshbs@public.gmane.org,
LW-bxm8fMRDkQLDiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
fugang.duan-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v9 3/3] i2c: imx: add DMA support for freescale i2c driver
Date: Sat, 8 Nov 2014 18:35:13 +0100 [thread overview]
Message-ID: <20141108173513.GA4900@katana> (raw)
In-Reply-To: <1413025032-14958-4-git-send-email-yao.yuan-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]
Hi,
mostly looking good...
> +#define IMX_I2C_DMA_THRESHOLD 16
Have you guessed or measured this value? A comment about this value
would be nice.
>
> +struct imx_i2c_dma {
> + struct dma_chan *chan_tx;
> + struct dma_chan *chan_rx;
> + struct dma_chan *chan_using;
> + struct completion cmd_complete;
> + dma_addr_t dma_buf;
> + unsigned int dma_len;
> + unsigned int dma_transfer_dir;
> + unsigned int dma_data_dir;
Please use proper types as there are things like 'enum
dma_data_direction' and the likes...
> + dmaengine_submit(txdesc);
This can fail, too. Use dma_submit_error() to check.
> + result = wait_for_completion_interruptible_timeout(
> + &i2c_imx->dma->cmd_complete,
> + msecs_to_jiffies(IMX_I2C_DMA_TIMEOUT));
Have you tested signals extensively? I can't really recommend the
_intrruptible_ here. I don't see any cleaning up to get the bus to a
consistent state again. Most people drop the interruptible sooner or
later.
> + /* Init DMA config if support*/
> + i2c_imx_dma_request(i2c_imx, phy_addr);
Make this function void? DMA is optional anyhow.
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-11-08 17:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-11 10:57 [PATCH v9 0/3] i2c: imx: add DMA support for freescale i2c driver Yuan Yao
2014-10-11 10:57 ` [PATCH v9 1/3] i2c: imx: Sort include headers alphabetically Yuan Yao
[not found] ` <1413025032-14958-1-git-send-email-yao.yuan-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-10-11 10:57 ` [PATCH v9 2/3] Documentation:add DMA support for freescale i2c driver Yuan Yao
2014-10-11 10:57 ` [PATCH v9 3/3] i2c: imx: add " Yuan Yao
2014-11-03 9:35 ` Yao Yuan
[not found] ` <1413025032-14958-4-git-send-email-yao.yuan-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-11-08 17:35 ` Wolfram Sang [this message]
2014-11-17 10:41 ` Yao Yuan
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=20141108173513.GA4900@katana \
--to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
--cc=LW-bxm8fMRDkQLDiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org \
--cc=fugang.duan-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marex-ynQEQJNshbs@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=yao.yuan-KZfg59tc24xl57MIdRCFDg@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).