From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>,
antoniu.miclaus@analog.com, lars@metafoo.de,
Michael.Hennerich@analog.com, dlechner@baylibre.com,
nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ti-ads7138: explicitly include <linux/slab.h>
Date: Fri, 24 Apr 2026 14:33:45 +0300 [thread overview]
Message-ID: <aetVGYQcq1NAJb7k@ashevche-desk.local> (raw)
In-Reply-To: <20260424113600.4e76fdb7@jic23-huawei>
On Fri, Apr 24, 2026 at 11:36:00AM +0100, Jonathan Cameron wrote:
> On Fri, 24 Apr 2026 12:07:24 +0300
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > On Fri, Apr 24, 2026 at 12:18:10PM +0400, Giorgi Tchankvetadze wrote:
...
> > WRT to the kmalloc() use, wouldn't it be simply better to use
> > i2c_master_send_dmasafe() and kill that kmalloc() dance in the driver?
>
> That sounds backwards. IIRC i2c_master_send_dmasafe() needs a heap allocation
> to ensure a DMA safe buffer. See i2c_get_dma_safe_msg_buf() and
> the check on I2C_M_DMA_SAFE.
Ah, I thought it's opposite, but looking at the usage it seems like it's host
controller driver responsibility to use DMA or not for the transfer.
Why do we need to have kmalloc() here at all? I don't understand that.
> This function is just overly flexible.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-04-24 11:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 8:18 Giorgi Tchankvetadze
2026-04-24 9:07 ` Andy Shevchenko
2026-04-24 10:36 ` Jonathan Cameron
2026-04-24 11:33 ` Andy Shevchenko [this message]
2026-04-24 16:57 ` Jonathan Cameron
2026-04-27 11:29 ` Giorgi Tchankvetadze
2026-04-28 18:14 ` Jonathan Cameron
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=aetVGYQcq1NAJb7k@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=dlechner@baylibre.com \
--cc=giorgitchankvetadze1997@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.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
all inboxes | Powered by JetHome®