lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAE3SzaTJTi3bHnqNbAfQ3W2jHcmhQHqa2ZtKE7=2BnP+onJv-w@mail.gmail.com>
Date: Fri, 29 Aug 2025 00:16:47 +0530
From: Akshay Jindal <akshayaj.lkd@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: anshulusr@...il.com, jic23@...nel.org, dlechner@...libre.com, 
	nuno.sa@...log.com, andy@...nel.org, shuah@...nel.org, 
	linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] iio: light: ltr390: Implement runtime PM support

On Thu, Aug 28, 2025 at 7:17 AM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Wed, Aug 27, 2025 at 10:19 PM Akshay Jindal <akshayaj.lkd@...il.com> wrote:
> >
>
> > +static int ltr390_read_raw(struct iio_dev *iio_device,
> > +                          struct iio_chan_spec const *chan, int *val,
> > +                          int *val2, long mask)
> > +{
> > +       int ret, retval;
> > +       struct ltr390_data *data = iio_priv(iio_device);
> > +       struct device *dev = &data->client->dev;
> > +
> > +       ret = pm_runtime_resume_and_get(dev);
> > +       if (ret < 0)
> > +               dev_err(dev, "runtime PM failed to resume: %d\n", ret);
>
> If it fails, there is no point to read the value, it will be garbage
> or even can make the bus stuck.
>
My rationale behind this approach is that earlier ltr390_read_raw()
had all the functionality
of the .read_raw callback so the return value whether success or
failure was of the core functionality.
But now, since the core functionality has been relocated into
__ltr390_read_raw(), I felt the return value
ltr390_read_raw should be the return value of __ltr390_read_raw().
Hence I thought, it will be better to
just print dev_err for runtime PM failures and return the retval of
__ltr390_read_raw only.
Let me know your thoughts on this. Will make the change accordingly in
the next version.

Thanks,
Akshay

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ