<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/irq/debugfs.c, branch v6.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-01-15T20:38:53Z</updated>
<entry>
<title>genirq: Remove IRQ_MOVE_PCNTXT and related code</title>
<updated>2025-01-15T20:38:53Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-12-10T10:34:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f94a18249b7f9131f3ca8eacf07f21050747ebd7'/>
<id>urn:sha1:f94a18249b7f9131f3ca8eacf07f21050747ebd7</id>
<content type='text'>
Now that x86 is converted over to use the IRQCHIP_MOVE_DEFERRED flags,
remove IRQ*_MOVE_PCNTXT and related code.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/all/20241210103335.626707225@linutronix.de


</content>
</entry>
<entry>
<title>genirq: Provide IRQCHIP_MOVE_DEFERRED</title>
<updated>2025-01-15T09:56:22Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-12-10T10:34:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a648eb3a3f79e9736a59b28783700c2c691db419'/>
<id>urn:sha1:a648eb3a3f79e9736a59b28783700c2c691db419</id>
<content type='text'>
The logic of GENERIC_PENDING_IRQ is backwards for historical reasons. Most
interrupt controllers allow to move the interrupt from arbitrary
contexts. If GENERIC_PENDING_IRQ is enabled by an architecture to support a
chip, which requires the affinity change to happen in interrupt context,
all other chips have to be marked with IRQF_MOVE_PCNTXT.

That's tedious and there is no real good reason for the extra flags in the
irq descriptor and the irq data status fields. In fact the decision whether
interrupts can be moved in arbitrary context or not is a property of the
interrupt chip.

To simplify adoption for RISC-V provide a new mechanism which is enabled
via a config switch and allows to add a flag to irq_chip::flags to request
that interrupt affinity changes are deferred. Setting the top level chip of
an interrupt evaluates the flag and maps it into the existing logic.

The config switch and the various PCNTXT flags are temporary until x86 is
converted over to this scheme. This intermediate step also allows trivial
backporting of the mechanism to plug the affinity change race of various
RISC-V interrupt controllers.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/all/20241210103335.500314436@linutronix.de

</content>
</entry>
<entry>
<title>genirq/debugfs: Print irqdomain flags as human-readable strings</title>
<updated>2024-06-03T10:24:51Z</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2024-05-29T09:16:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cb06c9826991c746039d076df10d40819f88a6bc'/>
<id>urn:sha1:cb06c9826991c746039d076df10d40819f88a6bc</id>
<content type='text'>
Improve the readability of irqdomain debugging information in debugfs by
printing the flags field of domain files as human-readable strings instead
of a raw bitmask, which aligned with the existing style used for irqchip
flags in the irq debug files.

Before:
	#cat :cpus:cpu@0:interrupt-controller
	name:   :cpus:cpu@0:interrupt-controller
	 size:   0
	 mapped: 2
	 flags:  0x00000003

After:
	#cat :cpus:cpu@0:interrupt-controller
	name:   :cpus:cpu@0:interrupt-controller
	 size:   0
	 mapped: 3
	 flags:  0x00000003
	            IRQ_DOMAIN_FLAG_HIERARCHY
	            IRQ_DOMAIN_NAME_ALLOCATED

Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20240529091628.3666379-1-ruanjinjie@huawei.com

</content>
</entry>
<entry>
<title>x86/apic/msi: Fix misconfigured non-maskable MSI quirk</title>
<updated>2023-10-26T11:53:06Z</updated>
<author>
<name>Koichiro Den</name>
<email>den@valinux.co.jp</email>
</author>
<published>2023-10-26T03:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b56ebe7c896dc78b5865ec2c4b1dae3c93537517'/>
<id>urn:sha1:b56ebe7c896dc78b5865ec2c4b1dae3c93537517</id>
<content type='text'>
commit ef8dd01538ea ("genirq/msi: Make interrupt allocation less
convoluted"), reworked the code so that the x86 specific quirk for affinity
setting of non-maskable PCI/MSI interrupts is not longer activated if
necessary.

This could be solved by restoring the original logic in the core MSI code,
but after a deeper analysis it turned out that the quirk flag is not
required at all.

The quirk is only required when the PCI/MSI device cannot mask the MSI
interrupts, which in turn also prevents reservation mode from being enabled
for the affected interrupt.

This allows ot remove the NOMASK quirk bit completely as msi_set_affinity()
can instead check whether reservation mode is enabled for the interrupt,
which gives exactly the same answer.

Even in the momentary non-existing case that the reservation mode would be
not set for a maskable MSI interrupt this would not cause any harm as it
just would cause msi_set_affinity() to go needlessly through the
functionaly equivalent slow path, which works perfectly fine with maskable
interrupts as well.

Rework msi_set_affinity() to query the reservation mode and remove all
NOMASK quirk logic from the core code.

[ tglx: Massaged changelog ]

Fixes: ef8dd01538ea ("genirq/msi: Make interrupt allocation less convoluted")
Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Koichiro Den &lt;den@valinux.co.jp&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20231026032036.2462428-1-den@valinux.co.jp
</content>
</entry>
<entry>
<title>genirq: Allow fasteoi handler to resend interrupts on concurrent handling</title>
<updated>2023-06-16T11:22:35Z</updated>
<author>
<name>James Gowans</name>
<email>jgowans@amazon.com</email>
</author>
<published>2023-06-08T12:00:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c15eeb5362c48dd27d51bd72e8873341fa9383c'/>
<id>urn:sha1:9c15eeb5362c48dd27d51bd72e8873341fa9383c</id>
<content type='text'>
There is a class of interrupt controllers out there that, once they
have signalled a given interrupt number, will still signal incoming
instances of the *same* interrupt despite the original interrupt
not having been EOIed yet.

As long as the new interrupt reaches the *same* CPU, nothing bad
happens, as that CPU still has its interrupts globally disabled,
and we will only take the new interrupt once the interrupt has
been EOIed.

However, things become more "interesting" if an affinity change comes
in while the interrupt is being handled. More specifically, while
the per-irq lock is being dropped. This results in the affinity change
taking place immediately. At this point, there is nothing that prevents
the interrupt from firing on the new target CPU. We end-up with the
interrupt running concurrently on two CPUs, which isn't a good thing.

And that's where things become worse: the new CPU notices that the
interrupt handling is in progress (irq_may_run() return false), and
*drops the interrupt on the floor*.

The whole race looks like this:

           CPU 0             |          CPU 1
-----------------------------|-----------------------------
interrupt start              |
  handle_fasteoi_irq         | set_affinity(CPU 1)
    handler                  |
    ...                      | interrupt start
    ...                      |   handle_fasteoi_irq -&gt; early out
  handle_fasteoi_irq return  | interrupt end
interrupt end                |

If the interrupt was an edge, too bad. The interrupt is lost, and
the system will eventually die one way or another. Not great.

A way to avoid this situation is to detect this problem at the point
we handle the interrupt on the new target. Instead of dropping the
interrupt, use the resend mechanism to force it to be replayed.

Also, in order to limit the impact of this workaround to the pathetic
architectures that require it, gate it behind a new irq flag aptly
named IRQD_RESEND_WHEN_IN_PROGRESS.

Suggested-by: Marc Zyngier &lt;maz@kernel.org&gt;
Signed-off-by: James Gowans &lt;jgowans@amazon.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Marc Zyngier &lt;maz@kernel.org&gt;
Cc: KarimAllah Raslan &lt;karahmed@amazon.com&gt;
Cc: Yipeng Zou &lt;zouyipeng@huawei.com&gt;
Cc: Zhang Jianhua &lt;chris.zjh@huawei.com&gt;
[maz: reworded commit mesage]
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20230608120021.3273400-3-jgowans@amazon.com
</content>
</entry>
<entry>
<title>genirq: Return a const cpumask from irq_data_get_affinity_mask</title>
<updated>2022-07-07T08:38:04Z</updated>
<author>
<name>Samuel Holland</name>
<email>samuel@sholland.org</email>
</author>
<published>2022-07-01T20:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d0b8298818b623f5fa51d5c49e1a142d3618ac9'/>
<id>urn:sha1:4d0b8298818b623f5fa51d5c49e1a142d3618ac9</id>
<content type='text'>
Now that the irq_data_update_affinity helper exists, enforce its use
by returning a a const cpumask from irq_data_get_affinity_mask.

Since the previous commit already updated places that needed to call
irq_data_update_affinity, this commit updates the remaining code that
either did not modify the cpumask or immediately passed the modified
mask to irq_set_affinity.

Signed-off-by: Samuel Holland &lt;samuel@sholland.org&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20220701200056.46555-8-samuel@sholland.org
</content>
</entry>
<entry>
<title>gpio: Don't fiddle with irqchips marked as immutable</title>
<updated>2022-04-19T14:22:25Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2022-04-19T14:18:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6c846d026d490b2383d395bc8e7b06336219667b'/>
<id>urn:sha1:6c846d026d490b2383d395bc8e7b06336219667b</id>
<content type='text'>
In order to move away from gpiolib messing with the internals of
unsuspecting irqchips, add a flag by which irqchips advertise
that they are not to be messed with, and do solemnly swear that
they correctly call into the gpiolib helpers when required.

Also nudge the users into converting their drivers to the
new model.

Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reviewed-by: Bartosz Golaszewski &lt;brgl@bgdev.pl&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20220419141846.598305-2-maz@kernel.org
</content>
</entry>
<entry>
<title>genirq/debugfs: Use irq_print_chip() when provided by irqchip</title>
<updated>2022-02-15T11:22:34Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2022-02-10T09:27:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0a25cb5544f4f01d2e7c06164555fd9cd6eb64fd'/>
<id>urn:sha1:0a25cb5544f4f01d2e7c06164555fd9cd6eb64fd</id>
<content type='text'>
Since irqchips have the option to implement irq_print_chip, use this
when available to output the irqchip name in debugfs.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20220215112154.1360040-1-maz@kernel.org
</content>
</entry>
<entry>
<title>Merge branch 'irq/qcom-pdc-wakeup' into irq/irqchip-next</title>
<updated>2020-10-06T10:28:03Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2020-10-06T10:28:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=04e8c5b2fa9a2ad66496c810562454fc324446a8'/>
<id>urn:sha1:04e8c5b2fa9a2ad66496c810562454fc324446a8</id>
<content type='text'>
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
</content>
</entry>
<entry>
<title>genirq/PM: Introduce IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND flag</title>
<updated>2020-10-06T10:23:41Z</updated>
<author>
<name>Maulik Shah</name>
<email>mkshah@codeaurora.org</email>
</author>
<published>2020-09-28T04:32:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90428a8eb4947f9c7c905a178f3520dc7e2ee6d2'/>
<id>urn:sha1:90428a8eb4947f9c7c905a178f3520dc7e2ee6d2</id>
<content type='text'>
An interrupt that is disabled/masked but set for wakeup may still need to
be able to wake up the system from sleep states like "suspend to RAM".

To that effect, introduce the IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND flag.
If the irqchip have this flag set, the irq PM code will enable/unmask
the irqs that are marked for wakeup, but that are in a disabled state.

On resume, such irqs will be restored back to their disabled state.

Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Maulik Shah &lt;mkshah@codeaurora.org&gt;
[maz: commit message fix-up]
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Tested-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Link: https://lore.kernel.org/r/1601267524-20199-4-git-send-email-mkshah@codeaurora.org
</content>
</entry>
</feed>
