From: Jun Gao <jun.gao@mediatek.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: srv_heupstream@mediatek.com, linux-i2c@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
yingjoe.chen@mediatek.com
Subject: Re: [I2C] About warning 'DMA-API: device driver maps memory from stack'
Date: Sat, 16 Sep 2017 17:33:59 +0800 [thread overview]
Message-ID: <1505554439.31793.76.camel@mhfsdcap03> (raw)
In-Reply-To: <20170902215829.3jpwmbyy27cpu5rm@ninjato>
On Sat, 2017-09-02 at 23:58 +0200, Wolfram Sang wrote:
> Hi,
>
> nice to see someone else interested in the I2C & DMA topic.
>
> Please check this series which I sent out recently:
>
> "[RFC PATCH v4 0/6] i2c: document DMA handling and add helpers for it"
>
> In that series, I proposed...
>
> > 3. kmalloc data buffer instead of local variables buf in function
> > i2c_smbus_xfer_emulated(...)
>
> ... this solution. Although I have to check Mauro's general response to
> the series first. I'd be interested in what you think of the series,
> too.
Sorry for late reply.
As you said in "[RFC,v4,3/6]i2c: add docs to clarify DMA handling". Most
i2c_msgs are register accesses and thus, small messages. And
"[RFC,v4,4/6] i2c: sh_mobile: use helper to decide if DMA is useful".
Maybe the solution as below will be better. Other drivers which will use
i2c would not have to make buffer DMA safe especially register
accesses(they like to use local variables when data_len = 1 or 2).
solution:
2. use FIFO mode when length<=fifo_depth(mtk i2c fifo_depth=8), use
the flag "I2C_M_DMA_SAFE" to check buffer for DMA mode when
length>fifo_depth in i2c-mt65xx.c .
Thanks.
>
> Kind regards,
>
> Wolfram
>
prev parent reply other threads:[~2017-09-16 9:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-02 12:08 [I2C] About warning 'DMA-API: device driver maps memory from stack' Jun Gao
2017-09-02 21:58 ` Wolfram Sang
2017-09-16 9:33 ` Jun Gao [this message]
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=1505554439.31793.76.camel@mhfsdcap03 \
--to=jun.gao@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=srv_heupstream@mediatek.com \
--cc=wsa@the-dreams.de \
--cc=yingjoe.chen@mediatek.com \
/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).