Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1667175

Re: [PATCH 4/4] i2c: rcar: check for DMA-capable buffers

From Wolfram Sang <wsa@the-dreams.de>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] i2c: rcar: check for DMA-capable buffers
Date 2017-06-15 21:20 +0200
Message-ID <tSItb-6vK-5@gated-at.bofh.it> (permalink)
References <tSHQt-5ZL-9@gated-at.bofh.it> <tSHQt-5ZL-7@gated-at.bofh.it> <tSI0a-63s-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

> > -       /* Do not use DMA if it's not available or for messages < 8 bytes */
> > -       if (IS_ERR(chan) || msg->len < 8)
> > +       if (IS_ERR(chan) || msg->len < RCAR_DMA_THRESHOLD || priv->flags & ID_P_NODMA)
> 
> Might be more efficient to check for ID_P_NODMA first instead of msg->len.

I think most of the I2C transfers are smaller (like reading/writing one
register) than the threshold, so this "should" be more efficient. Plus,
honestly, I also think this is a micro-optimization which is largely
depending on the use-case. Can we agree on that?

> > -       read = msg->flags & I2C_M_RD;
> > +       /* we need to check here because we need the 'current' context */
> > +       if (i2c_check_msg_for_dma(msg, RCAR_DMA_THRESHOLD, NULL) == -EFAULT) {
> > +               dev_dbg(dev, "skipping DMA for this whole transfer\n");
> 
> Adding reason for skipping will be helpful.

The I2C core helper will immediately print before that the buffer is not
DMA capable. Do you think this together will do?

Thanks for your input,

   Wolfram

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4/4] i2c: rcar: check for DMA-capable buffers Wolfram Sang <wsa+renesas@sang-engineering.com> - 2017-06-15 20:40 +0200
  Re: [PATCH 4/4] i2c: rcar: check for DMA-capable buffers Shuah Khan <shuahkhan@gmail.com> - 2017-06-15 20:50 +0200
    Re: [PATCH 4/4] i2c: rcar: check for DMA-capable buffers Wolfram Sang <wsa@the-dreams.de> - 2017-06-15 21:20 +0200
      Re: [PATCH 4/4] i2c: rcar: check for DMA-capable buffers Shuah Khan <shuah@kernel.org> - 2017-06-15 21:50 +0200

csiph-web