[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250912152127.000039fe@huawei.com>
Date: Fri, 12 Sep 2025 15:21:27 +0100
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Nuno Sá <noname.nuno@...il.com>
CC: Andy Shevchenko <andy.shevchenko@...il.com>, Daniel Lezcano
<daniel.lezcano@...aro.org>, David Lechner <dlechner@...libre.com>,
<jic23@...nel.org>, <nuno.sa@...log.com>, <andy@...nel.org>,
<robh@...nel.org>, <conor+dt@...nel.org>, <krzk+dt@...nel.org>,
<linux-iio@...r.kernel.org>, <s32@....com>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>, <chester62515@...il.com>, <mbrugger@...e.com>,
<ghennadi.procopciuc@....nxp.com>
Subject: Re: [PATCH v2 2/2] iio: adc: Add the NXP SAR ADC support for the
s32g2/3 platforms
On Fri, 12 Sep 2025 09:19:43 +0100
Nuno Sá <noname.nuno@...il.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@...aro.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á
Powered by blists - more mailing lists