From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
David Lechner <dlechner@baylibre.com>, <jic23@kernel.org>,
<nuno.sa@analog.com>, <andy@kernel.org>, <robh@kernel.org>,
<conor+dt@kernel.org>, <krzk+dt@kernel.org>,
<linux-iio@vger.kernel.org>, <s32@nxp.com>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
<chester62515@gmail.com>, <mbrugger@suse.com>,
<ghennadi.procopciuc@oss.nxp.com>
Subject: Re: [PATCH v2 2/2] iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms
Date: Fri, 12 Sep 2025 15:21:27 +0100 [thread overview]
Message-ID: <20250912152127.000039fe@huawei.com> (raw)
In-Reply-To: <5e279cf72409504861c80bb4d2e4e5f6bc59d94c.camel@gmail.com>
On Fri, 12 Sep 2025 09:19:43 +0100
Nuno Sá <noname.nuno@gmail.com> wrote:
> On Fri, 2025-09-12 at 08:38 +0300, Andy Shevchenko wrote:
> > On Fri, Sep 12, 2025 at 2:03 AM Daniel Lezcano
> > <daniel.lezcano@linaro.org> wrote:
> > > On 11/09/2025 22:10, David Lechner wrote:
> > > > On 9/10/25 10:57 AM, Daniel Lezcano wrote:
> >
> > [ ... ]
> >
> > > > > + /* iio_push_to_buffers_with_timestamp should not be called
> > > > > + * with dma_samples as parameter. The samples will be
> > > > > smashed
> > > > > + * if timestamp is enabled.
> > > > > + */
> >
> > /*
> > * Btw, comment style for multi-line
> > * comments is wrong for this subsystem.
> > * Use this as an example, Also, refer to
> > * the function as func(), i.e. mind the parentheses.
> > */
> >
> > > > > + timestamp = iio_get_time_ns(indio_dev);
> > > > > + ret = iio_push_to_buffers_with_timestamp(indio_dev,
> > > > > + info->buffer,
> > > > > + timestamp);
> > > >
> > > > Is it OK to call this with spinlock held? It looks like it can call
> > > > devm_krealloc() which may sleep.
> > >
> > > It should be ok, devm_krealloc is in the code path of
> > > iio_push_to_buffers_with_ts_unaligned(), not in
> > > iio_push_to_buffers_with_timestamp()
> >
> > This is a good observation, can we document this in the respective
> > kernel-doc:s please? Also add might_sleep().might_sleep_if() in the
> > appropriate functions.
>
> That's a good idea!
Agreed. I'd forgotten that hidden allocation was there in the unaligned()
variant. A might_sleep() seems wise.
>
> - Nuno Sá
next prev parent reply other threads:[~2025-09-12 14:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 15:57 [PATCH v2 0/2] NXP SAR ADC IIO driver for s32g2/3 platforms Daniel Lezcano
2025-09-10 15:57 ` [PATCH v2 1/2] dt-bindings: iio: adc: Add the NXP SAR ADC " Daniel Lezcano
2025-09-10 15:57 ` [PATCH v2 2/2] iio: adc: Add the NXP SAR ADC support for the " Daniel Lezcano
2025-09-10 17:32 ` Jonathan Cameron
2025-09-11 12:55 ` Daniel Lezcano
2025-09-11 13:26 ` David Lechner
2025-09-12 14:17 ` Jonathan Cameron
2025-09-12 15:10 ` Nuno Sá
2025-09-12 14:18 ` Jonathan Cameron
2025-09-11 20:10 ` David Lechner
2025-09-11 23:03 ` Daniel Lezcano
2025-09-12 5:38 ` Andy Shevchenko
2025-09-12 8:19 ` Nuno Sá
2025-09-12 14:21 ` Jonathan Cameron [this message]
2025-09-12 6:00 ` Andy Shevchenko
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=20250912152127.000039fe@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=chester62515@gmail.com \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=ghennadi.procopciuc@oss.nxp.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbrugger@suse.com \
--cc=noname.nuno@gmail.com \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=s32@nxp.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).