diff mbox series

PM / wakeirq: move to use request_irq by IRQF_NO_AUTOEN flag

Message ID 1621496098-50271-1-git-send-email-tiantao6@hisilicon.com (mailing list archive)
State Awaiting Upstream
Delegated to: Rafael Wysocki
Headers show
Series PM / wakeirq: move to use request_irq by IRQF_NO_AUTOEN flag | expand

Commit Message

tiantao (H) May 20, 2021, 7:34 a.m. UTC
request_irq() after setting IRQ_NOAUTOEN as below
irq_set_status_flags(irq, IRQ_NOAUTOEN);
request_irq(dev, irq...);
can be replaced by request_irq() with IRQF_NO_AUTOEN flag.

this change is just to simplify the code, no actual functional changes.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/base/power/wakeirq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki May 21, 2021, 4:57 p.m. UTC | #1
On Thu, May 20, 2021 at 9:35 AM Tian Tao <tiantao6@hisilicon.com> wrote:
>
> request_irq() after setting IRQ_NOAUTOEN as below
> irq_set_status_flags(irq, IRQ_NOAUTOEN);
> request_irq(dev, irq...);
> can be replaced by request_irq() with IRQF_NO_AUTOEN flag.
>
> this change is just to simplify the code, no actual functional changes.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

Tony, what do you think?

> ---
>  drivers/base/power/wakeirq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
> index 8e02108..3bad326 100644
> --- a/drivers/base/power/wakeirq.c
> +++ b/drivers/base/power/wakeirq.c
> @@ -182,7 +182,6 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
>
>         wirq->dev = dev;
>         wirq->irq = irq;
> -       irq_set_status_flags(irq, IRQ_NOAUTOEN);
>
>         /* Prevent deferred spurious wakeirqs with disable_irq_nosync() */
>         irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
> @@ -192,7 +191,8 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
>          * so we use a threaded irq.
>          */
>         err = request_threaded_irq(irq, NULL, handle_threaded_wake_irq,
> -                                  IRQF_ONESHOT, wirq->name, wirq);
> +                                  IRQF_ONESHOT | IRQF_NO_AUTOEN,
> +                                  wirq->name, wirq);
>         if (err)
>                 goto err_free_name;
>
> --
> 2.7.4
>
Tony Lindgren May 21, 2021, 6:09 p.m. UTC | #2
* Rafael J. Wysocki <rafael@kernel.org> [210521 16:57]:
> On Thu, May 20, 2021 at 9:35 AM Tian Tao <tiantao6@hisilicon.com> wrote:
> >
> > request_irq() after setting IRQ_NOAUTOEN as below
> > irq_set_status_flags(irq, IRQ_NOAUTOEN);
> > request_irq(dev, irq...);
> > can be replaced by request_irq() with IRQF_NO_AUTOEN flag.
> >
> > this change is just to simplify the code, no actual functional changes.
> >
> > Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> 
> Tony, what do you think?

Sounds good to me:

Reviewed-by: Tony Lindgren <tony@atomide.com>

> > ---
> >  drivers/base/power/wakeirq.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
> > index 8e02108..3bad326 100644
> > --- a/drivers/base/power/wakeirq.c
> > +++ b/drivers/base/power/wakeirq.c
> > @@ -182,7 +182,6 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
> >
> >         wirq->dev = dev;
> >         wirq->irq = irq;
> > -       irq_set_status_flags(irq, IRQ_NOAUTOEN);
> >
> >         /* Prevent deferred spurious wakeirqs with disable_irq_nosync() */
> >         irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
> > @@ -192,7 +191,8 @@ int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
> >          * so we use a threaded irq.
> >          */
> >         err = request_threaded_irq(irq, NULL, handle_threaded_wake_irq,
> > -                                  IRQF_ONESHOT, wirq->name, wirq);
> > +                                  IRQF_ONESHOT | IRQF_NO_AUTOEN,
> > +                                  wirq->name, wirq);
> >         if (err)
> >                 goto err_free_name;
> >
> > --
> > 2.7.4
> >
Rafael J. Wysocki May 24, 2021, 2:07 p.m. UTC | #3
On Fri, May 21, 2021 at 8:09 PM Tony Lindgren <tony@atomide.com> wrote:
>
> * Rafael J. Wysocki <rafael@kernel.org> [210521 16:57]:
> > On Thu, May 20, 2021 at 9:35 AM Tian Tao <tiantao6@hisilicon.com> wrote:
> > >
> > > request_irq() after setting IRQ_NOAUTOEN as below
> > > irq_set_status_flags(irq, IRQ_NOAUTOEN);
> > > request_irq(dev, irq...);
> > > can be replaced by request_irq() with IRQF_NO_AUTOEN flag.
> > >
> > > this change is just to simplify the code, no actual functional changes.
> > >
> > > Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> >
> > Tony, what do you think?
>
> Sounds good to me:
>
> Reviewed-by: Tony Lindgren <tony@atomide.com>

Applied as 5.14 material, thanks!
diff mbox series

Patch

diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index 8e02108..3bad326 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -182,7 +182,6 @@  int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
 
 	wirq->dev = dev;
 	wirq->irq = irq;
-	irq_set_status_flags(irq, IRQ_NOAUTOEN);
 
 	/* Prevent deferred spurious wakeirqs with disable_irq_nosync() */
 	irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
@@ -192,7 +191,8 @@  int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
 	 * so we use a threaded irq.
 	 */
 	err = request_threaded_irq(irq, NULL, handle_threaded_wake_irq,
-				   IRQF_ONESHOT, wirq->name, wirq);
+				   IRQF_ONESHOT | IRQF_NO_AUTOEN,
+				   wirq->name, wirq);
 	if (err)
 		goto err_free_name;