linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: gpio: xgene-sb: set valid IRQ type in to_irq()
@ 2020-04-01 17:49 Brian Masney
  2020-04-06  7:16 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Masney @ 2020-04-01 17:49 UTC (permalink / raw)
  To: linus.walleij, bgolaszewski; +Cc: linux-gpio, linux-kernel, dhoward

xgene-sb is setup to be a hierarchical IRQ chip with the GIC as the
parent chip. xgene_gpio_sb_to_irq() currently sets the default IRQ type
to IRQ_TYPE_NONE, which the GIC loudly complains about with a WARN_ON().
Let's set the initial default to a sane value (IRQ_TYPE_EDGE_RISING)
that was determined by decoding the ACPI tables on affected hardware:

    Device (_SB.GPSB)
    {
        Name (_HID, "APMC0D15")  // _HID: Hardware ID
        Name (_CID, "APMC0D15")  // _CID: Compatible ID
        Name (_UID, "GPIOSB")  // _UID: Unique ID
        ...
        Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
        {
            ...
            Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
            {
                0x00000048,
            }
            ...
        }
    }

This can be overridden later as needed with irq_set_irq_type().

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/gpio/gpio-xgene-sb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index 25d86441666e..b45bfa9baa26 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -122,7 +122,7 @@ static int xgene_gpio_sb_to_irq(struct gpio_chip *gc, u32 gpio)
 	fwspec.fwnode = gc->parent->fwnode;
 	fwspec.param_count = 2;
 	fwspec.param[0] = GPIO_TO_HWIRQ(priv, gpio);
-	fwspec.param[1] = IRQ_TYPE_NONE;
+	fwspec.param[1] = IRQ_TYPE_EDGE_RISING;
 	return irq_create_fwspec_mapping(&fwspec);
 }
 
-- 
2.25.1


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

* Re: [PATCH] drivers: gpio: xgene-sb: set valid IRQ type in to_irq()
  2020-04-01 17:49 [PATCH] drivers: gpio: xgene-sb: set valid IRQ type in to_irq() Brian Masney
@ 2020-04-06  7:16 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2020-04-06  7:16 UTC (permalink / raw)
  To: Brian Masney; +Cc: Linus Walleij, linux-gpio, LKML, dhoward

śr., 1 kwi 2020 o 19:49 Brian Masney <bmasney@redhat.com> napisał(a):
>
> xgene-sb is setup to be a hierarchical IRQ chip with the GIC as the
> parent chip. xgene_gpio_sb_to_irq() currently sets the default IRQ type
> to IRQ_TYPE_NONE, which the GIC loudly complains about with a WARN_ON().
> Let's set the initial default to a sane value (IRQ_TYPE_EDGE_RISING)
> that was determined by decoding the ACPI tables on affected hardware:
>
>     Device (_SB.GPSB)
>     {
>         Name (_HID, "APMC0D15")  // _HID: Hardware ID
>         Name (_CID, "APMC0D15")  // _CID: Compatible ID
>         Name (_UID, "GPIOSB")  // _UID: Unique ID
>         ...
>         Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
>         {
>             ...
>             Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
>             {
>                 0x00000048,
>             }
>             ...
>         }
>     }
>
> This can be overridden later as needed with irq_set_irq_type().
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/gpio/gpio-xgene-sb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
> index 25d86441666e..b45bfa9baa26 100644
> --- a/drivers/gpio/gpio-xgene-sb.c
> +++ b/drivers/gpio/gpio-xgene-sb.c
> @@ -122,7 +122,7 @@ static int xgene_gpio_sb_to_irq(struct gpio_chip *gc, u32 gpio)
>         fwspec.fwnode = gc->parent->fwnode;
>         fwspec.param_count = 2;
>         fwspec.param[0] = GPIO_TO_HWIRQ(priv, gpio);
> -       fwspec.param[1] = IRQ_TYPE_NONE;
> +       fwspec.param[1] = IRQ_TYPE_EDGE_RISING;
>         return irq_create_fwspec_mapping(&fwspec);
>  }
>
> --
> 2.25.1
>

Patch applied, thanks!

Bartosz

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

end of thread, other threads:[~2020-04-06  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 17:49 [PATCH] drivers: gpio: xgene-sb: set valid IRQ type in to_irq() Brian Masney
2020-04-06  7:16 ` Bartosz Golaszewski

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