From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Linux I2C <linux-i2c@vger.kernel.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 2/4] i2c: add docs to clarify DMA handling
Date: Tue, 6 Jun 2017 12:37:33 +0200 [thread overview]
Message-ID: <CAMuHMdWv9hBtYO_Xqwx_A64anC=4d3o_EE7FOSbknPYb-N5X8g@mail.gmail.com> (raw)
In-Reply-To: <20170606102447.cftuyhtx7zo2fe2g@ninjato>
Hi Wolfram,
On Tue, Jun 6, 2017 at 12:24 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>> > +Therefore, it is *not* mandatory that the buffer of an i2c message is DMA safe.
>> > +It does not seem reasonable to apply additional burdens when the feature is so
>> > +rarely used. However, it is recommended to use a DMA-safe buffer, if your
>> > +message size is likely applicable for DMA (FIXME: > 8 byte?).
>>
>> So you expect drivers to fall back to PIO automatically if the buffer is
>> not DMA safe. Sounds good to me.
>
> Yes, I strongly recommend that. Otherwise, drivers can always deal with
> bounce buffers on their own.
>
>> However, your check for a DMA-capable buffer is invoked only if
>> CONFIG_DMA_API_DEBUG is enabled:
>
> is *NOT* enabled!
Oops ;-)
>> #if !defined(CONFIG_DMA_API_DEBUG)
>> if (!virt_addr_valid(msg->buf) || object_is_on_stack(msg->buf)) {
>> pr_debug("msg buffer to 0x%04x might not be DMA capable\n",
>> msg->addr);
>> return -EFAULT;
>> }
>> #endif
>>
>
> The #if block is there because DMA_API_DEBUG does a lot more, but if the
> check in the helper is enabled, the core will fall back to PIO and you
> won't get the additional info from DMA_API_DEBUG.
>
> I think this needs a comment :)
>
> Now OK?
So it won't fall back to PIO if CONFIG_DMA_API_DEBUG is enabled?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2017-06-06 10:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-06 9:20 [RFC PATCH 0/4] i2c: document DMA handling and add helper Wolfram Sang
2017-06-06 9:20 ` [RFC PATCH 1/4] i2c: add helper to determine if DMA is favoured Wolfram Sang
2017-06-06 9:20 ` [RFC PATCH 2/4] i2c: add docs to clarify DMA handling Wolfram Sang
2017-06-06 10:03 ` Geert Uytterhoeven
2017-06-06 10:24 ` Wolfram Sang
2017-06-06 10:37 ` Geert Uytterhoeven [this message]
2017-06-06 10:54 ` Wolfram Sang
2017-06-06 11:12 ` Geert Uytterhoeven
2017-06-06 11:23 ` Wolfram Sang
2017-06-06 15:29 ` Geert Uytterhoeven
2017-06-06 9:20 ` [RFC PATCH 3/4] i2c: sh_mobile: use helper to decide if DMA is used Wolfram Sang
2017-06-06 9:20 ` [RFC PATCH 4/4] i2c: rcar: check for DMA-capable buffers 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='CAMuHMdWv9hBtYO_Xqwx_A64anC=4d3o_EE7FOSbknPYb-N5X8g@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=wsa@the-dreams.de \
/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).