From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] genirq: Allow the irqchip state of an IRQ to be save/restored
Date: Wed, 29 Oct 2014 11:17:59 +0000 [thread overview]
Message-ID: <5450CCE7.7010803@arm.com> (raw)
In-Reply-To: <CACRpkdZjUPV1eWcJjT587kxJm2zyC+OEYD0Deid4wYPh8A-Z4w@mail.gmail.com>
On 29/10/14 10:12, Linus Walleij wrote:
> On Sat, Oct 25, 2014 at 12:14 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>
>> There is a number of cases where a kernel subsystem may want to
>> introspect the state of an interrupt at the irqchip level:
>>
>> - When a peripheral is shared between virtual machines, its interrupt
>> state becomes part of the guest's state, and must be switched accordingly.
>> KVM on arm/arm64 requires this for its guest-visible timer
>> - Some GPIO controllers seem to require peeking into the interrupt controller
>> they are connected to to report their internal state
>
> I'd like to know exactly what this means, for GPIO. As mentioned in
> conversation with Arnd, there is since before the case where a GPIO
> irqchip gets its irqs "stolen" by some other hardware that is in the
> always-on domain, and I call these "latent irqs".
It looks like a slightly different issue:
http://patchwork.ozlabs.org/patch/397657/
Basically, the GPIO chip cannot report its own state, and has to
introspect the parent irqchip to find out.
> There is a third usecase here since ages (pre-git) in
> arch/arm/mach-integrator/integrator_cp.c:
>
> /*
> * It seems that the card insertion interrupt remains active after
> * we've acknowledged it. We therefore ignore the interrupt, and
> * rely on reading it from the SIC. This also means that we must
> * clear the latched interrupt.
> */
> static unsigned int mmc_status(struct device *dev)
> {
> unsigned int status = readl(__io_address(0xca000000 + 4));
> writel(8, intcp_con_base + 8);
>
> return status & 8;
> }
>
> static struct mmci_platform_data mmc_data = {
> .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
> .status = mmc_status,
> .gpio_wp = -1,
> .gpio_cd = -1,
> };
>
> This just goes in and peeks around in the Integrator SIC, this
> patch would solve also this I think. Or are the added calls good
> for clearing the latched IRQ too?
Pretty funky. You could also use this to clear the pending bit (assuming
there is one on the CP). I'm amazed at the number of similar hacks that
are coming out of the wood now...
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2014-10-29 11:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-25 10:14 [PATCH 0/3] genirq: Saving/restoring the irqchip state of an irq line Marc Zyngier
2014-10-25 10:14 ` [PATCH 1/3] genirq: Allow the irqchip state of an IRQ to be save/restored Marc Zyngier
2014-10-25 19:35 ` Thomas Gleixner
2014-10-25 19:42 ` Thomas Gleixner
2014-10-27 11:47 ` Marc Zyngier
2014-11-19 19:10 ` Bjorn Andersson
2014-10-29 10:12 ` Linus Walleij
2014-10-29 11:17 ` Marc Zyngier [this message]
2014-10-31 9:57 ` Linus Walleij
2014-10-25 10:14 ` [PATCH 2/3] irqchip: GIC: Add support for irq_{get, set}_irqchip_state Marc Zyngier
2014-10-29 10:14 ` Linus Walleij
2014-10-29 10:22 ` Marc Zyngier
2014-10-25 10:14 ` [PATCH 3/3] irqchip: GICv3: " Marc Zyngier
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=5450CCE7.7010803@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).