All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines
@ 2018-06-18 16:09 Hans de Goede
  2018-06-18 16:44 ` Martin Kelly
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hans de Goede @ 2018-06-18 16:09 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hans de Goede, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, Martin Kelly,
	Jean-Baptiste Maneyrol

Commit 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
causes inv_mpu_core_probe() to fail if the IRQ does not have a
trigger-type setup.

This happens on machines where the mpu6050 is enumerated through ACPI and
an older Interrupt type ACPI resource is used for the interrupt, rather
then a GpioInt type type, causing the mpu6050 driver to no longer work
there. This happens on e.g. the Asus T100TA.

This commits makes the mpu6050 fallback to the old IRQF_TRIGGER_RISING
default if the irq-type is not setup, fixing this.

Fixes: 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
Cc: Martin Kelly <mkelly@xevo.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index f9c0624505a2..42618fe4f83e 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
 	}
 
 	irq_type = irqd_get_trigger_type(desc);
+	if (!irq_type)
+		irq_type = IRQF_TRIGGER_RISING;
 	if (irq_type == IRQF_TRIGGER_RISING)
 		st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
 	else if (irq_type == IRQF_TRIGGER_FALLING)
-- 
2.17.1


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

* Re: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines
  2018-06-18 16:09 [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines Hans de Goede
@ 2018-06-18 16:44 ` Martin Kelly
  2018-06-19  7:44 ` Jean-Baptiste Maneyrol
  2018-06-22 14:18 ` Jonathan Cameron
  2 siblings, 0 replies; 5+ messages in thread
From: Martin Kelly @ 2018-06-18 16:44 UTC (permalink / raw)
  To: Hans de Goede, Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, Jean-Baptiste Maneyrol

On 06/18/2018 09:09 AM, Hans de Goede wrote:
> Commit 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
> causes inv_mpu_core_probe() to fail if the IRQ does not have a
> trigger-type setup.
> 
> This happens on machines where the mpu6050 is enumerated through ACPI and
> an older Interrupt type ACPI resource is used for the interrupt, rather
> then a GpioInt type type, causing the mpu6050 driver to no longer work
> there. This happens on e.g. the Asus T100TA.
> 
> This commits makes the mpu6050 fallback to the old IRQF_TRIGGER_RISING
> default if the irq-type is not setup, fixing this.
> 
> Fixes: 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
> Cc: Martin Kelly <mkelly@xevo.com>
> Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>   drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> index f9c0624505a2..42618fe4f83e 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> @@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
>   	}
>   
>   	irq_type = irqd_get_trigger_type(desc);
> +	if (!irq_type)
> +		irq_type = IRQF_TRIGGER_RISING;
>   	if (irq_type == IRQF_TRIGGER_RISING)
>   		st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
>   	else if (irq_type == IRQF_TRIGGER_FALLING)
> 

Reviewed-by: Martin Kelly <mkelly@xevo.com>

Thanks, good catch! I had thought that irqd_get_trigger_type would work 
the same universally, but I see I was mistaken.

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

* Re: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines
  2018-06-18 16:09 [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines Hans de Goede
  2018-06-18 16:44 ` Martin Kelly
@ 2018-06-19  7:44 ` Jean-Baptiste Maneyrol
  2018-06-22 14:18 ` Jonathan Cameron
  2 siblings, 0 replies; 5+ messages in thread
From: Jean-Baptiste Maneyrol @ 2018-06-19  7:44 UTC (permalink / raw)
  To: Hans de Goede, Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, Martin Kelly


From: Hans de Goede <hdegoede@redhat.com>
Sent: Monday, June 18, 2018 18:09
To: Jonathan Cameron
Cc: Hans de Goede; Hartmut Knaack; Lars-Peter Clausen; Peter Meerwald-Stadl=
er; linux-iio@vger.kernel.org; Martin Kelly; Jean-Baptiste Maneyrol
Subject: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() fai=
lure on older ACPI based machines
=A0=20

CAUTION: This email originated from outside of the organization. Please mak=
e sure the sender is who they say they are and do not click links or open a=
ttachments unless you recognize the sender and know the content is safe.


Commit 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
causes inv_mpu_core_probe() to fail if the IRQ does not have a
trigger-type setup.

This happens on machines where the mpu6050 is enumerated through ACPI and
an older Interrupt type ACPI resource is used for the interrupt, rather
then a GpioInt type type, causing the mpu6050 driver to no longer work
there. This happens on e.g. the Asus T100TA.

This commits makes the mpu6050 fallback to the old IRQF_TRIGGER_RISING
default if the irq-type is not setup, fixing this.

Fixes: 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
Cc: Martin Kelly <mkelly@xevo.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
=A0drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++
=A01 file changed, 2 insertions(+)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/i=
nv_mpu6050/inv_mpu_core.c
index f9c0624505a2..42618fe4f83e 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, =
const char *name,
=A0=A0=A0=A0=A0=A0=A0 }

=A0=A0=A0=A0=A0=A0=A0 irq_type =3D irqd_get_trigger_type(desc);
+=A0=A0=A0=A0=A0=A0 if (!irq_type)
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 irq_type =3D IRQF_TRIGGER_RISIN=
G;
=A0=A0=A0=A0=A0=A0=A0 if (irq_type =3D=3D IRQF_TRIGGER_RISING)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 st->irq_mask =3D INV_MPU6050_=
ACTIVE_HIGH;
=A0=A0=A0=A0=A0=A0=A0 else if (irq_type =3D=3D IRQF_TRIGGER_FALLING)
--
2.17.1


Good catch indeed, thanks for testing and verifying.

Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>=

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

* Re: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines
  2018-06-18 16:09 [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines Hans de Goede
  2018-06-18 16:44 ` Martin Kelly
  2018-06-19  7:44 ` Jean-Baptiste Maneyrol
@ 2018-06-22 14:18 ` Jonathan Cameron
  2018-06-24 13:52   ` Jonathan Cameron
  2 siblings, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2018-06-22 14:18 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, Martin Kelly,
	Jean-Baptiste Maneyrol

On Mon, 18 Jun 2018 18:09:36 +0200
Hans de Goede <hdegoede@redhat.com> wrote:

> Commit 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
> causes inv_mpu_core_probe() to fail if the IRQ does not have a
> trigger-type setup.
> 
> This happens on machines where the mpu6050 is enumerated through ACPI and
> an older Interrupt type ACPI resource is used for the interrupt, rather
> then a GpioInt type type, causing the mpu6050 driver to no longer work
> there. This happens on e.g. the Asus T100TA.
> 
> This commits makes the mpu6050 fallback to the old IRQF_TRIGGER_RISING
> default if the irq-type is not setup, fixing this.
> 
> Fixes: 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
> Cc: Martin Kelly <mkelly@xevo.com>
> Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Sorry for the delay - traveling this week.  Will pick this up over the weekend
once I'm back home.

J

> ---
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> index f9c0624505a2..42618fe4f83e 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> @@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
>  	}
>  
>  	irq_type = irqd_get_trigger_type(desc);
> +	if (!irq_type)
> +		irq_type = IRQF_TRIGGER_RISING;
>  	if (irq_type == IRQF_TRIGGER_RISING)
>  		st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
>  	else if (irq_type == IRQF_TRIGGER_FALLING)



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

* Re: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines
  2018-06-22 14:18 ` Jonathan Cameron
@ 2018-06-24 13:52   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2018-06-24 13:52 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hans de Goede, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, Martin Kelly,
	Jean-Baptiste Maneyrol

On Fri, 22 Jun 2018 15:18:27 +0100
Jonathan Cameron <jonathan.cameron@huawei.com> wrote:

> On Mon, 18 Jun 2018 18:09:36 +0200
> Hans de Goede <hdegoede@redhat.com> wrote:
> 
> > Commit 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
> > causes inv_mpu_core_probe() to fail if the IRQ does not have a
> > trigger-type setup.
> > 
> > This happens on machines where the mpu6050 is enumerated through ACPI and
> > an older Interrupt type ACPI resource is used for the interrupt, rather
> > then a GpioInt type type, causing the mpu6050 driver to no longer work
> > there. This happens on e.g. the Asus T100TA.
> > 
> > This commits makes the mpu6050 fallback to the old IRQF_TRIGGER_RISING
> > default if the irq-type is not setup, fixing this.
> > 
> > Fixes: 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types")
> > Cc: Martin Kelly <mkelly@xevo.com>
> > Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
> > Signed-off-by: Hans de Goede <hdegoede@redhat.com>  
> 
> Sorry for the delay - traveling this week.  Will pick this up over the weekend
> once I'm back home.

Applied to the fixes-togreg branch of iio.git.  Aiming to do a pull request
later today.

Thanks,

Jonathan

> 
> J
> 
> > ---
> >  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> > index f9c0624505a2..42618fe4f83e 100644
> > --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> > +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> > @@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
> >  	}
> >  
> >  	irq_type = irqd_get_trigger_type(desc);
> > +	if (!irq_type)
> > +		irq_type = IRQF_TRIGGER_RISING;
> >  	if (irq_type == IRQF_TRIGGER_RISING)
> >  		st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
> >  	else if (irq_type == IRQF_TRIGGER_FALLING)  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2018-06-24 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 16:09 [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines Hans de Goede
2018-06-18 16:44 ` Martin Kelly
2018-06-19  7:44 ` Jean-Baptiste Maneyrol
2018-06-22 14:18 ` Jonathan Cameron
2018-06-24 13:52   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.