From: Thomas Gleixner <tglx@linutronix.de>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Jason Cooper <jason@lakedaemon.net>,
Marc Zyngier <marc.zyngier@arm.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Thierry Reding <thierry.reding@gmail.com>,
Kevin Hilman <khilman@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-tegra@vger.kernel.org,
Soren Brinkmann <soren.brinkmann@xilinx.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
Grygorii Strashko <grygorii.strashko@ti.com>
Subject: Re: [RFC PATCH 1/2] genirq: Add runtime resume/suspend support for IRQ chips
Date: Tue, 10 Nov 2015 10:26:27 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.11.1511101017190.3915@nanos> (raw)
In-Reply-To: <1447166377-19707-2-git-send-email-jonathanh@nvidia.com>
Jon,
On Tue, 10 Nov 2015, Jon Hunter wrote:
> void (*irq_suspend)(struct irq_data *data);
> void (*irq_resume)(struct irq_data *data);
> + int (*irq_runtime_suspend)(struct irq_data *data);
> + int (*irq_runtime_resume)(struct irq_data *data);
> void (*irq_pm_shutdown)(struct irq_data *data);
So this is the second patch within a few days which adds that just
with different names:
http://lkml.kernel.org/r/1446668160-17522-2-git-send-email-soren.brinkmann@xilinx.com
Can you folks please tell me which of the names is the correct one?
> +/* Inline functions for support of irq chips that require runtime pm */
> +static inline int chip_runtime_resume(struct irq_desc *desc)
> +{
> + if (!desc->irq_data.chip->irq_runtime_resume)
> + return 0;
> +
> + return desc->irq_data.chip->irq_runtime_resume(&desc->irq_data);
> +}
> +
> +static inline int chip_runtime_suspend(struct irq_desc *desc)
> +{
> + if (!desc->irq_data.chip->irq_runtime_suspend)
> + return 0;
> +
> + return desc->irq_data.chip->irq_runtime_suspend(&desc->irq_data);
We really don't need a return value for that one.
> +}
> +
> #define _IRQ_DESC_CHECK (1 << 0)
> #define _IRQ_DESC_PERCPU (1 << 1)
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 0eebaeef317b..66e33df73140 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -1116,6 +1116,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
> if (!try_module_get(desc->owner))
> return -ENODEV;
>
> + ret = chip_runtime_resume(desc);
> + if (ret < 0)
> + return ret;
Leaks module ref count.
> +
> new->irq = irq;
>
> /*
> @@ -1393,6 +1397,7 @@ out_thread:
> put_task_struct(t);
> }
> out_mput:
> + chip_runtime_suspend(desc);
> module_put(desc->owner);
> return ret;
> }
> @@ -1506,6 +1511,7 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
> }
> }
>
> + chip_runtime_suspend(desc);
> module_put(desc->owner);
> kfree(action->secondary);
> return action;
> @@ -1792,6 +1798,7 @@ static struct irqaction *__free_percpu_irq(unsigned int irq, void __percpu *dev_
>
> unregister_handler_proc(irq, action);
>
> + chip_runtime_suspend(desc);
Where is the corresponding call in request_percpu_irq() ?
Can you folks please agree on something which is correct and complete?
Thanks,
tglx
next prev parent reply other threads:[~2015-11-10 15:27 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 14:39 [RFC PATCH 0/2] Add support for Tegra210 AGIC Jon Hunter
2015-11-10 14:39 ` [RFC PATCH 1/2] genirq: Add runtime resume/suspend support for IRQ chips Jon Hunter
2015-11-10 15:26 ` Thomas Gleixner [this message]
2015-11-10 15:58 ` Jon Hunter
2015-11-10 16:47 ` Grygorii Strashko
2015-11-10 18:07 ` Lars-Peter Clausen
2015-11-11 10:13 ` Jon Hunter
2015-11-11 15:41 ` Grygorii Strashko
2015-11-12 10:59 ` Jon Hunter
2015-11-12 13:20 ` Lars-Peter Clausen
2015-11-12 13:29 ` Grygorii Strashko
2015-11-12 13:34 ` Lars-Peter Clausen
2015-11-13 18:07 ` Grygorii Strashko
2015-11-12 13:35 ` Jon Hunter
2015-11-12 13:47 ` Lars-Peter Clausen
2015-11-12 14:02 ` Jon Hunter
2015-11-12 14:37 ` Lars-Peter Clausen
2015-11-12 15:38 ` Jon Hunter
2015-11-12 17:04 ` Sören Brinkmann
2015-11-12 23:20 ` Kevin Hilman
2015-11-13 9:01 ` Jon Hunter
2015-11-13 20:01 ` Thomas Gleixner
2015-11-16 9:46 ` Jon Hunter
2015-11-16 9:49 ` Geert Uytterhoeven
2015-11-16 10:34 ` Jon Hunter
2015-11-16 10:48 ` Geert Uytterhoeven
2015-11-17 11:57 ` Jon Hunter
2015-11-10 14:39 ` [RFC PATCH 2/2] irqchip/gic: Add support for tegra AGIC interrupt controller Jon Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.11.1511101017190.3915@nanos \
--to=tglx@linutronix.de \
--cc=geert@linux-m68k.org \
--cc=gnurou@gmail.com \
--cc=grygorii.strashko@ti.com \
--cc=jason@lakedaemon.net \
--cc=jonathanh@nvidia.com \
--cc=khilman@kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=soren.brinkmann@xilinx.com \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®