[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220915113333.uwgazi6hoeskpeoi@soft-dev3-1.localhost>
Date: Thu, 15 Sep 2022 13:33:33 +0200
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
CC: "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>
Subject: Re: [PATCH v3] pinctrl: ocelot: Fix interrupt controller
The 09/09/2022 18:09, Andy Shevchenko wrote:
>
> On Fri, Sep 9, 2022 at 5:55 PM Horatiu Vultur
> <horatiu.vultur@...rochip.com> wrote:
>
> Thanks for an update, my comments below.
Thanks for all the help and sorry for late reply.
>
> ...
>
> > - dev_set_drvdata(dev, info->map);
> > + dev_set_drvdata(dev, info);
>
> I would also change it to platform_set_drvdata() to keep symmetry with
> ->remove().
Yes, I will change this.
>
> ...
>
> > +static int ocelot_pinctrl_remove(struct platform_device *pdev)
> > +{
> > + struct ocelot_pinctrl *info = platform_get_drvdata(pdev);
>
> > + destroy_workqueue(info->wq);
>
> Is it a synchronous operation? Anyway, what does guarantee that after
> this no other task can schedule a new work due to unmasking an
> interrupt? I think you need to be sure your device is quiescent before
> killing that workqueue. Something like synchronize_irq() +
> disable_irq() or equivalent? (I don't know for sure, you need to
> investigate it yourself and find the best suitable way).
I have look at descriptions of the functions (synchronize_irq(),
disable_irq()) and I think is enough to use only disable_irq().
I also tried something but it didn't have the expected result so I would
need to look more into this. I tried to use disable_irq on returned irq
inside ocelot_gpiochip_register but I was still getting interrupts after
that.
Also I was thinking actually to use gpiochip_remove() here in
ocelot_pinctrl_remove() before calling destroy_workqueue(). But then I
might have problems inside ocelot_irq_work(). I need to check more this.
>
> > + return 0;
> > +}
>
> --
> With Best Regards,
> Andy Shevchenko
--
/Horatiu
Powered by blists - more mailing lists