mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Lars-Peter Clausen <lars@metafoo.de>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	Thomas Gleixner <tglx@linutronix.de>
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>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>
Subject: Re: [RFC PATCH 1/2] genirq: Add runtime resume/suspend support for IRQ chips
Date: Thu, 12 Nov 2015 15:38:23 +0000	[thread overview]
Message-ID: <5644B26F.5060508@nvidia.com> (raw)
In-Reply-To: <5644A418.2020906@metafoo.de>


On 12/11/15 14:37, Lars-Peter Clausen wrote:
> On 11/12/2015 03:02 PM, Jon Hunter wrote:
> [...]
>>>>> One easy way out might be to always call pm_get/pm_but from
>>>>> bus_lock,/bus_unlock. This way the chip is guaranteed to be powered up when
>>>>> accessed happens. In addition pm_get is called when the IRQ is request and
>>>>> pm_put is called when the IRQ is release, this is to ensure the chip stays
>>>>> powered when it is actively monitoring the IRQ lines.
>>>>
>>>> Yes I had thought about that, but it is not quite that easy, because in
>>>> the case of request_irq() you don't want to pm_put() after the
>>>> bus_unlock(). However, the bus_lock/unlock() are good indicators of
>>>> different paths.
>>>
>>> You'd call pm_get() twice in request_irq() once from bus_lock() and once
>>> independently, that way you still have a reference even after the bus_unlock().
>>
>> Yes that is a possibility. However, there are places such as
>> show_interrupts() (kernel/irq/proc.c) and irq_gc_suspend() that do not
>> call bus_lock/unlock() which would need to be handled for PM. May be
>> these should also call bus_lock() as well?
> 
> show_interrupts() only accesses software state, not hardware state, or does it?

Good point. Today there only appears to be one user:

arch/powerpc/sysdev/fsl_msi.c:	.irq_print_chip = fsl_msi_print_chip,

This one is purely software. However, it would be easy to handle the
show_interrupts case if needed.

> suspend/resume is a bit tricky. It's kind of driver specific if it needs to
> actually access the hardware or whether the state is already shadowed in
> software. Maybe we can make this an exception for now and let drivers handle
> this on their own.

Yes I would agree with you on that.

Cheers
Jon


  reply	other threads:[~2015-11-12 15:38 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
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 [this message]
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=5644B26F.5060508@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=geert@linux-m68k.org \
    --cc=gnurou@gmail.com \
    --cc=grygorii.strashko@ti.com \
    --cc=jason@lakedaemon.net \
    --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=tglx@linutronix.de \
    --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

Powered by JetHome