linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
@ 2019-07-05 13:43 Alexandru Ardelean
  2019-07-07 12:01 ` Jonathan Cameron
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandru Ardelean @ 2019-07-05 13:43 UTC (permalink / raw)
  To: linux-iio; +Cc: Alexandru Ardelean

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.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 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 3a20cb5d9bff..6c175eb1c7a7 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
  2019-07-05 13:43 [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position Alexandru Ardelean
@ 2019-07-07 12:01 ` Jonathan Cameron
  2019-08-11  9:28   ` Jonathan Cameron
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Cameron @ 2019-07-07 12:01 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, Matt Ranostay

+CC Matt as it's his driver.  His latest email is in .mailmap.

Jonathan


On Fri, 5 Jul 2019 16:43:55 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> 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.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
>  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 3a20cb5d9bff..6c175eb1c7a7 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 = {



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
  2019-07-07 12:01 ` Jonathan Cameron
@ 2019-08-11  9:28   ` Jonathan Cameron
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2019-08-11  9:28 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Alexandru Ardelean, linux-iio, Matt Ranostay

On Sun, 7 Jul 2019 13:01:06 +0100
Jonathan Cameron <jonathan.cameron@huawei.com> wrote:

> +CC Matt as it's his driver.  His latest email is in .mailmap.
Bump for Matt.  Please give this one a quick look.

Thanks,

Jonathan

> 
> Jonathan
> 
> 
> On Fri, 5 Jul 2019 16:43:55 +0300
> Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> 
> > 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.
> > 
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > ---
> >  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 3a20cb5d9bff..6c175eb1c7a7 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 = {  
> 
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
  2019-10-06  1:56 ` Matt Ranostay
@ 2019-10-06  9:27   ` Jonathan Cameron
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2019-10-06  9:27 UTC (permalink / raw)
  To: Matt Ranostay
  Cc: Alexandru Ardelean, open list:IIO SUBSYSTEM AND DRIVERS,
	Peter Meerwald-Stadler, Hartmut Knaack

On Sat, 5 Oct 2019 18:56:48 -0700
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> On Fri, Sep 20, 2019 at 12:31 AM Alexandru Ardelean
> <alexandru.ardelean@analog.com> wrote:
> >
> > 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.
> >
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>  
> 
> Sorry didn't notice this till now. Looks good to me.
> 
> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> 
> > ---
> >  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 3a20cb5d9bff..6c175eb1c7a7 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
> >  


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
  2019-09-20  7:31 Alexandru Ardelean
  2019-09-20  7:37 ` Ardelean, Alexandru
@ 2019-10-06  1:56 ` Matt Ranostay
  2019-10-06  9:27   ` Jonathan Cameron
  1 sibling, 1 reply; 8+ messages in thread
From: Matt Ranostay @ 2019-10-06  1:56 UTC (permalink / raw)
  To: Alexandru Ardelean
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Peter Meerwald-Stadler,
	Jonathan Cameron, Hartmut Knaack

On Fri, Sep 20, 2019 at 12:31 AM Alexandru Ardelean
<alexandru.ardelean@analog.com> wrote:
>
> 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.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

Sorry didn't notice this till now. Looks good to me.

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  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 3a20cb5d9bff..6c175eb1c7a7 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
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
  2019-09-20  7:37 ` Ardelean, Alexandru
@ 2019-10-05 15:12   ` Jonathan Cameron
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2019-10-05 15:12 UTC (permalink / raw)
  To: Ardelean, Alexandru; +Cc: linux-iio, matt.ranostay, pmeerw, knaack.h

Matt! Looking for your input on this one if possible.

Thanks,

Jonathan


On Fri, 20 Sep 2019 07:37:56 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:

> On Fri, 2019-09-20 at 10:31 +0300, Alexandru Ardelean wrote:
> > 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.
> >   
> 
> I just noticed this is a RESEND.
> The original is here:
> https://patchwork.kernel.org/patch/11032569/
> 
> I did not think that I probably already sent it before sending it again.
> 
> > The position of iio_triggered_buffer_postenable() is correct.
> > 
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > ---
> >  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 3a20cb5d9bff..6c175eb1c7a7 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 = {  


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
  2019-09-20  7:31 Alexandru Ardelean
@ 2019-09-20  7:37 ` Ardelean, Alexandru
  2019-10-05 15:12   ` Jonathan Cameron
  2019-10-06  1:56 ` Matt Ranostay
  1 sibling, 1 reply; 8+ messages in thread
From: Ardelean, Alexandru @ 2019-09-20  7:37 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, matt.ranostay, pmeerw, knaack.h

On Fri, 2019-09-20 at 10:31 +0300, Alexandru Ardelean wrote:
> 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.
> 

I just noticed this is a RESEND.
The original is here:
https://patchwork.kernel.org/patch/11032569/

I did not think that I probably already sent it before sending it again.

> The position of iio_triggered_buffer_postenable() is correct.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
>  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 3a20cb5d9bff..6c175eb1c7a7 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 = {

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
@ 2019-09-20  7:31 Alexandru Ardelean
  2019-09-20  7:37 ` Ardelean, Alexandru
  2019-10-06  1:56 ` Matt Ranostay
  0 siblings, 2 replies; 8+ messages in thread
From: Alexandru Ardelean @ 2019-09-20  7:31 UTC (permalink / raw)
  To: linux-iio; +Cc: matt.ranostay, pmeerw, jic23, knaack.h, Alexandru Ardelean

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.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 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 3a20cb5d9bff..6c175eb1c7a7 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-10-06  9:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05 13:43 [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position Alexandru Ardelean
2019-07-07 12:01 ` Jonathan Cameron
2019-08-11  9:28   ` Jonathan Cameron
2019-09-20  7:31 Alexandru Ardelean
2019-09-20  7:37 ` Ardelean, Alexandru
2019-10-05 15:12   ` Jonathan Cameron
2019-10-06  1:56 ` Matt Ranostay
2019-10-06  9:27   ` Jonathan Cameron

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).