FYI. I'll be a bit slow in merging these changes, I'm experiencing a
disk failure on my build machine, and I need to get it
fixed/replaced/another machine.

Bruce

On Tue, Nov 28, 2023 at 4:16 AM <[email protected]> wrote:
>
> From: Quanyang Wang <[email protected]>
>
> The kernel requires that the flag IRQCHIP_IMMUTABLE is set for irqchip
> structure in gpio driver, or else it complains with:
>
> gpio gpiochip0: (4009d700.siul2-gpio): not an immutable chip, please consider 
> fixing it!
>
> Signed-off-by: Quanyang Wang <[email protected]>
> ---
> Hi Bruce,
> Would you please help merge this patch to the branches:
>         v6.1/standard/preempt-rt/nxp-sdk-5.15/nxp-s32g
>         v6.1/standard/nxp-sdk-5.15/nxp-s32g
> Thanks,
> Quanyang
> ---
>  drivers/gpio/gpio-siul2-s32cc.c | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpio/gpio-siul2-s32cc.c b/drivers/gpio/gpio-siul2-s32cc.c
> index 668eab91859f2..5db92ad73772d 100644
> --- a/drivers/gpio/gpio-siul2-s32cc.c
> +++ b/drivers/gpio/gpio-siul2-s32cc.c
> @@ -153,7 +153,6 @@ struct siul2_gpio_dev {
>         struct regmap *irqmap;
>         struct regmap *eirqimcrsmap;
>         struct gpio_chip gc;
> -       struct irq_chip irq;
>
>         /* Mutual access to SIUL2 registers. */
>         raw_spinlock_t lock;
> @@ -473,6 +472,8 @@ static void siul2_gpio_irq_unmask(struct irq_data *data)
>                 return;
>         }
>
> +       gpiochip_enable_irq(gc, gpio);
> +
>         /* Disable interrupt */
>         regmap_update_bits(gpio_dev->irqmap, SIUL2_DIRER0, mask, 0);
>
> @@ -526,6 +527,8 @@ static void siul2_gpio_irq_mask(struct irq_data *data)
>         regmap_write(gpio_dev->eirqimcrsmap,
>                      SIUL2_EIRQ_REG(platdata->irqs[index].eirq),
>                      0);
> +
> +       gpiochip_disable_irq(gc, gpio);
>  }
>
>  static const struct regmap_config siul2_regmap_conf = {
> @@ -1101,6 +1104,16 @@ static int siul2_gpio_populate_names(struct device 
> *dev,
>         return 0;
>  }
>
> +static const struct irq_chip siul2_irqchip = {
> +       .name                   = "gpio-siul2",
> +       .irq_ack                = siul2_gpio_irq_mask,
> +       .irq_mask               = siul2_gpio_irq_mask,
> +       .irq_unmask             = siul2_gpio_irq_unmask,
> +       .irq_set_type           = siul2_gpio_irq_set_type,
> +       .flags = IRQCHIP_IMMUTABLE,
> +       GPIOCHIP_IRQ_RESOURCE_HELPERS,
> +};
> +
>  static int siul2_gpio_probe(struct platform_device *pdev)
>  {
>         int err = 0;
> @@ -1173,14 +1186,6 @@ static int siul2_gpio_probe(struct platform_device 
> *pdev)
>                 sizeof(*gpio_dev->pin_dir_bitmap);
>         gpio_dev->pin_dir_bitmap = devm_kzalloc(dev, bitmap_size,
>                                                 GFP_KERNEL);
> -       gpio_dev->irq = (struct irq_chip) {
> -               .name                   = dev_name(dev),
> -               .irq_ack                = siul2_gpio_irq_mask,
> -               .irq_mask               = siul2_gpio_irq_mask,
> -               .irq_unmask             = siul2_gpio_irq_unmask,
> -               .irq_set_type           = siul2_gpio_irq_set_type,
> -       };
> -
>         gc->parent = dev;
>         gc->label = dev_name(dev);
>
> @@ -1195,7 +1200,7 @@ static int siul2_gpio_probe(struct platform_device 
> *pdev)
>         gc->owner = THIS_MODULE;
>
>         girq = &gc->irq;
> -       girq->chip = &gpio_dev->irq;
> +       gpio_irq_chip_set_chip(girq, &siul2_irqchip);
>         girq->parent_handler = NULL;
>         girq->num_parents = 0;
>         girq->parents = NULL;
> --
> 2.36.1
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13319): 
https://lists.yoctoproject.org/g/linux-yocto/message/13319
Mute This Topic: https://lists.yoctoproject.org/mt/102847614/21656
Group Owner: [email protected]
Unsubscribe: 
https://lists.yoctoproject.org/g/linux-yocto/leave/6687884/21656/624485779/xyzzy
 [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to