2019-12-10 21:09:56

by Sasha Levin

[permalink] [raw]
Subject: [PATCH AUTOSEL 5.4 105/350] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position

From: Alexandru Ardelean <[email protected]>

[ Upstream commit 0c8a6e72f3c04bfe92a64e5e0791bfe006aabe08 ]

The iio_triggered_buffer_{predisable,postenable} functions attach/detach
the poll functions.

The iio_triggered_buffer_predisable() should be called last, to detach the
poll func after the devices has been suspended.

The position of iio_triggered_buffer_postenable() is correct.

Note this is not stable material. It's a fix in the logical
model rather fixing an actual bug. These are being tidied up
throughout the subsystem to allow more substantial rework that
was blocked by variations in how things were done.

Signed-off-by: Alexandru Ardelean <[email protected]>
Acked-by: Matt Ranostay <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/iio/chemical/atlas-ph-sensor.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
index 3a20cb5d9bffc..6c175eb1c7a7f 100644
--- a/drivers/iio/chemical/atlas-ph-sensor.c
+++ b/drivers/iio/chemical/atlas-ph-sensor.c
@@ -323,16 +323,16 @@ static int atlas_buffer_predisable(struct iio_dev *indio_dev)
struct atlas_data *data = iio_priv(indio_dev);
int ret;

- ret = iio_triggered_buffer_predisable(indio_dev);
+ ret = atlas_set_interrupt(data, false);
if (ret)
return ret;

- ret = atlas_set_interrupt(data, false);
+ pm_runtime_mark_last_busy(&data->client->dev);
+ ret = pm_runtime_put_autosuspend(&data->client->dev);
if (ret)
return ret;

- pm_runtime_mark_last_busy(&data->client->dev);
- return pm_runtime_put_autosuspend(&data->client->dev);
+ return iio_triggered_buffer_predisable(indio_dev);
}

static const struct iio_trigger_ops atlas_interrupt_trigger_ops = {
--
2.20.1


2019-12-15 16:02:11

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH AUTOSEL 5.4 105/350] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position

On Tue, 10 Dec 2019 16:03:30 -0500
Sasha Levin <[email protected]> wrote:

> From: Alexandru Ardelean <[email protected]>
>
> [ Upstream commit 0c8a6e72f3c04bfe92a64e5e0791bfe006aabe08 ]
>
> The iio_triggered_buffer_{predisable,postenable} functions attach/detach
> the poll functions.
>
> The iio_triggered_buffer_predisable() should be called last, to detach the
> poll func after the devices has been suspended.
>
> The position of iio_triggered_buffer_postenable() is correct.
>
> Note this is not stable material. It's a fix in the logical
> model rather fixing an actual bug. These are being tidied up
> throughout the subsystem to allow more substantial rework that
> was blocked by variations in how things were done.

See comment. This is not what I would consider stable material.

>
> Signed-off-by: Alexandru Ardelean <[email protected]>
> Acked-by: Matt Ranostay <[email protected]>
> Signed-off-by: Jonathan Cameron <[email protected]>
> Signed-off-by: Sasha Levin <[email protected]>
> ---
> drivers/iio/chemical/atlas-ph-sensor.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
> index 3a20cb5d9bffc..6c175eb1c7a7f 100644
> --- a/drivers/iio/chemical/atlas-ph-sensor.c
> +++ b/drivers/iio/chemical/atlas-ph-sensor.c
> @@ -323,16 +323,16 @@ static int atlas_buffer_predisable(struct iio_dev *indio_dev)
> struct atlas_data *data = iio_priv(indio_dev);
> int ret;
>
> - ret = iio_triggered_buffer_predisable(indio_dev);
> + ret = atlas_set_interrupt(data, false);
> if (ret)
> return ret;
>
> - ret = atlas_set_interrupt(data, false);
> + pm_runtime_mark_last_busy(&data->client->dev);
> + ret = pm_runtime_put_autosuspend(&data->client->dev);
> if (ret)
> return ret;
>
> - pm_runtime_mark_last_busy(&data->client->dev);
> - return pm_runtime_put_autosuspend(&data->client->dev);
> + return iio_triggered_buffer_predisable(indio_dev);
> }
>
> static const struct iio_trigger_ops atlas_interrupt_trigger_ops = {

2019-12-15 23:28:53

by Matt Ranostay

[permalink] [raw]
Subject: Re: [PATCH AUTOSEL 5.4 105/350] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position

On Sun, Dec 15, 2019 at 7:53 AM Jonathan Cameron
<[email protected]> wrote:
>
> On Tue, 10 Dec 2019 16:03:30 -0500
> Sasha Levin <[email protected]> wrote:
>
> > From: Alexandru Ardelean <[email protected]>
> >
> > [ Upstream commit 0c8a6e72f3c04bfe92a64e5e0791bfe006aabe08 ]
> >
> > The iio_triggered_buffer_{predisable,postenable} functions attach/detach
> > the poll functions.
> >
> > The iio_triggered_buffer_predisable() should be called last, to detach the
> > poll func after the devices has been suspended.
> >
> > The position of iio_triggered_buffer_postenable() is correct.
> >
> > Note this is not stable material. It's a fix in the logical
> > model rather fixing an actual bug. These are being tidied up
> > throughout the subsystem to allow more substantial rework that
> > was blocked by variations in how things were done.
>
> See comment. This is not what I would consider stable material.
>

Outside of the comment, which really isn't probably enough to avoid
the autoselection script from detecting it (could be "stable" in the
message alone selects it :) ),
is there any way to signal that a patch is "NOT for stable trees"?
Probably don't want to clutter up the commit messages of course.

- Matt

> >
> > Signed-off-by: Alexandru Ardelean <[email protected]>
> > Acked-by: Matt Ranostay <[email protected]>
> > Signed-off-by: Jonathan Cameron <[email protected]>
> > Signed-off-by: Sasha Levin <[email protected]>
> > ---
> > drivers/iio/chemical/atlas-ph-sensor.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
> > index 3a20cb5d9bffc..6c175eb1c7a7f 100644
> > --- a/drivers/iio/chemical/atlas-ph-sensor.c
> > +++ b/drivers/iio/chemical/atlas-ph-sensor.c
> > @@ -323,16 +323,16 @@ static int atlas_buffer_predisable(struct iio_dev *indio_dev)
> > struct atlas_data *data = iio_priv(indio_dev);
> > int ret;
> >
> > - ret = iio_triggered_buffer_predisable(indio_dev);
> > + ret = atlas_set_interrupt(data, false);
> > if (ret)
> > return ret;
> >
> > - ret = atlas_set_interrupt(data, false);
> > + pm_runtime_mark_last_busy(&data->client->dev);
> > + ret = pm_runtime_put_autosuspend(&data->client->dev);
> > if (ret)
> > return ret;
> >
> > - pm_runtime_mark_last_busy(&data->client->dev);
> > - return pm_runtime_put_autosuspend(&data->client->dev);
> > + return iio_triggered_buffer_predisable(indio_dev);
> > }
> >
> > static const struct iio_trigger_ops atlas_interrupt_trigger_ops = {
>

2019-12-19 17:35:33

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH AUTOSEL 5.4 105/350] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position

On Sun, Dec 15, 2019 at 03:25:27PM -0800, Matt Ranostay wrote:
>On Sun, Dec 15, 2019 at 7:53 AM Jonathan Cameron
><[email protected]> wrote:
>>
>> On Tue, 10 Dec 2019 16:03:30 -0500
>> Sasha Levin <[email protected]> wrote:
>>
>> > From: Alexandru Ardelean <[email protected]>
>> >
>> > [ Upstream commit 0c8a6e72f3c04bfe92a64e5e0791bfe006aabe08 ]
>> >
>> > The iio_triggered_buffer_{predisable,postenable} functions attach/detach
>> > the poll functions.
>> >
>> > The iio_triggered_buffer_predisable() should be called last, to detach the
>> > poll func after the devices has been suspended.
>> >
>> > The position of iio_triggered_buffer_postenable() is correct.
>> >
>> > Note this is not stable material. It's a fix in the logical
>> > model rather fixing an actual bug. These are being tidied up
>> > throughout the subsystem to allow more substantial rework that
>> > was blocked by variations in how things were done.
>>
>> See comment. This is not what I would consider stable material.
>>
>
>Outside of the comment, which really isn't probably enough to avoid
>the autoselection script from detecting it (could be "stable" in the
>message alone selects it :) ),
>is there any way to signal that a patch is "NOT for stable trees"?
>Probably don't want to clutter up the commit messages of course.

That commit message should have been enough, I'll add some more
filtering to catch instances like that.

--
Thanks,
Sasha