<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/pci/msi, branch linux-6.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-07-10T21:41:08Z</updated>
<entry>
<title>PCI/MSI: Prevent recursive locking in pci_msix_write_tph_tag()</title>
<updated>2025-07-10T21:41:08Z</updated>
<author>
<name>Himanshu Madhani</name>
</author>
<published>2025-07-08T22:25:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=68ea85df15d111d82fc474cbe104174791169355'/>
<id>urn:sha1:68ea85df15d111d82fc474cbe104174791169355</id>
<content type='text'>
pci_msix_write_tph_tag() takes the per device MSI descriptor mutex and then
invokes msi_domain_get_virq(), which takes the same mutex again. That
obviously results in a system hang which is exposed by a softlockup or
lockdep warning.

Move the lock guard after the invocation of msi_domain_get_virq() to fix
this.

[ tglx: Massage changelog by adding a proper explanation and removing the
  	not really useful stacktrace ]

Fixes: d5124a9957b2 ("PCI/MSI: Provide a sane mechanism for TPH")
Reported-by: Jorge Lopez &lt;jorge.jo.lopez@oracle.com&gt;
Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Jorge Lopez &lt;jorge.jo.lopez@oracle.com&gt;
Link: https://lore.kernel.org/all/20250708222530.1041477-1-himanshu.madhani@oracle.com
</content>
</entry>
<entry>
<title>PCI/MSI: Size device MSI domain with the maximum number of vectors</title>
<updated>2025-06-04T09:19:25Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2025-06-03T14:18:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cc82d99b13c1ad04e3dff9182b7953a8dba10b6'/>
<id>urn:sha1:9cc82d99b13c1ad04e3dff9182b7953a8dba10b6</id>
<content type='text'>
Zenghui reports that since 1396e89e09f0 ("genirq/msi: Move prepare() call
to per-device allocation"), his Multi-MSI capable device isn't working
anymore.

This is a consequence of 15c72f824b32 ("PCI/MSI: Add support for per device
MSI[X] domains"), which always creates a MSI domain of size 1, even in the
presence of Multi-MSI.

While this was somehow working until then, moving the .prepare() call ends
up sizing the ITS table with a tiny value for this device, and making the
endpoint driver unhappy.

Instead, always create the domain and call the .prepare() helper with the
maximum expected size.

Fixes: 1396e89e09f0 ("genirq/msi: Move prepare() call to per-device allocation")
Fixes: 15c72f824b32 ("PCI/MSI: Add support for per device MSI[X] domains")
Reported-by: Zenghui Yu &lt;yuzenghui@huawei.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Zenghui Yu &lt;yuzenghui@huawei.com&gt;
Reviewed-by: Lorenzo Pieralisi &lt;lpieralisi@kernel.org&gt;
Link: https://lore.kernel.org/all/20250603141801.915305-1-maz@kernel.org
Closes: https://lore.kernel.org/r/0b1d7aec-1eac-a9cd-502a-339e216e08a1@huawei.com
</content>
</entry>
<entry>
<title>Merge tag 'irq-msi-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2025-05-27T15:15:26Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2025-05-27T15:15:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=44ed0f35df343d00b8d38006854f96e333104a66'/>
<id>urn:sha1:44ed0f35df343d00b8d38006854f96e333104a66</id>
<content type='text'>
Pull MSI updates from Thomas Gleixner:
 "Updates for the MSI subsystem (core code and PCI):

   - Switch the MSI descriptor locking to lock guards

   - Replace a broken and naive implementation of PCI/MSI-X control word
     updates in the PCI/TPH driver with a properly serialized variant in
     the PCI/MSI core code.

   - Remove the MSI descriptor abuse in the SCCI/UFS/QCOM driver by
     replacing the direct access to the MSI descriptors with the proper
     API function calls. People will never understand that APIs exist
     for a reason...

   - Provide core infrastructre for the upcoming PCI endpoint library
     extensions. Currently limited to ARM GICv3+, but in theory
     extensible to other architectures.

   - Provide a MSI domain::teardown() callback, which allows drivers to
     undo the effects of the prepare() callback.

   - Move the MSI domain::prepare() callback invocation to domain
     creation time to avoid redundant (and in case of ARM/GIC-V3-ITS
     confusing) invocations on every allocation.

     In combination with the new teardown callback this removes some
     ugly hacks in the GIC-V3-ITS driver, which pretended to work around
     the short comings of the core code so far. With this update the
     code is correct by design and implementation.

   - Make the irqchip MSI library globally available, provide a MSI
     parent domain creation helper and convert a bunch of (PCI/)MSI
     drivers over to the modern MSI parent mechanism. This is the first
     step to get rid of at least one incarnation of the three PCI/MSI
     management schemes.

   - The usual small cleanups and improvements"

* tag 'irq-msi-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (33 commits)
  PCI/MSI: Use bool for MSI enable state tracking
  PCI: tegra: Convert to MSI parent infrastructure
  PCI: xgene: Convert to MSI parent infrastructure
  PCI: apple: Convert to MSI parent infrastructure
  irqchip/msi-lib: Honour the MSI_FLAG_NO_AFFINITY flag
  irqchip/mvebu: Convert to msi_create_parent_irq_domain() helper
  irqchip/gic: Convert to msi_create_parent_irq_domain() helper
  genirq/msi: Add helper for creating MSI-parent irq domains
  irqchip: Make irq-msi-lib.h globally available
  irqchip/gic-v3-its: Use allocation size from the prepare call
  genirq/msi: Engage the .msi_teardown() callback on domain removal
  genirq/msi: Move prepare() call to per-device allocation
  irqchip/gic-v3-its: Implement .msi_teardown() callback
  genirq/msi: Add .msi_teardown() callback as the reverse of .msi_prepare()
  irqchip/gic-v3-its: Add support for device tree msi-map and msi-mask
  dt-bindings: PCI: pci-ep: Add support for iommu-map and msi-map
  irqchip/gic-v3-its: Set IRQ_DOMAIN_FLAG_MSI_IMMUTABLE for ITS
  irqdomain: Add IRQ_DOMAIN_FLAG_MSI_IMMUTABLE and irq_domain_is_msi_immutable()
  platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all()
  genirq/msi: Rename msi_[un]lock_descs()
  ...
</content>
</entry>
<entry>
<title>PCI/MSI: Use bool for MSI enable state tracking</title>
<updated>2025-05-21T19:28:53Z</updated>
<author>
<name>Hans Zhang</name>
</author>
<published>2025-05-16T16:52:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e7bca76e3fed58437dcd7f747d1c8d98507379e'/>
<id>urn:sha1:4e7bca76e3fed58437dcd7f747d1c8d98507379e</id>
<content type='text'>
Convert pci_msi_enable and pci_msi_enabled() to use bool type for clarity.
No functional changes, only code cleanup.

Signed-off-by: Hans Zhang &lt;hans.zhang@cixtech.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/all/20250516165223.125083-2-18255117159@163.com

</content>
</entry>
<entry>
<title>PCI/MSI: Add an option to write MSIX ENTRY_DATA before any reads</title>
<updated>2025-04-15T06:32:18Z</updated>
<author>
<name>Jonathan Currier</name>
</author>
<published>2024-11-17T23:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf761e3dacc6ad5f65a4886d00da1f9681e6805a'/>
<id>urn:sha1:cf761e3dacc6ad5f65a4886d00da1f9681e6805a</id>
<content type='text'>
Commit 7d5ec3d36123 ("PCI/MSI: Mask all unused MSI-X entries") introduced a
readl() from ENTRY_VECTOR_CTRL before the writel() to ENTRY_DATA.

This is correct, however some hardware, like the Sun Neptune chips, the NIU
module, will cause an error and/or fatal trap if any MSIX table entry is
read before the corresponding ENTRY_DATA field is written to.

Add an optional early writel() in msix_prepare_msi_desc().

Fixes: 7d5ec3d36123 ("PCI/MSI: Mask all unused MSI-X entries")
Signed-off-by: Jonathan Currier &lt;dullfire@yahoo.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20241117234843.19236-2-dullfire@yahoo.com
</content>
</entry>
<entry>
<title>PCI/MSI: Provide a sane mechanism for TPH</title>
<updated>2025-04-09T18:47:30Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2025-03-19T10:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d5124a9957b2a8d728a86ea8462e0c404acae016'/>
<id>urn:sha1:d5124a9957b2a8d728a86ea8462e0c404acae016</id>
<content type='text'>
The PCI/TPH driver fiddles with the MSI-X control word of an active
interrupt completely unserialized against concurrent operations issued
from the interrupt core. It also brings the PCI/MSI-X internal cached
control word out of sync.

Provide a function, which has the required serialization and keeps the
control word cache in sync.

Unfortunately this requires to look up and lock the interrupt descriptor,
which should be only done in the interrupt core code. But confining this
particular oddity in the PCI/MSI core is the lesser of all evil. A
interrupt core implementation would require a larger pile of infrastructure
and indirections for dubious value.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/all/20250319105506.683663807@linutronix.de




</content>
</entry>
<entry>
<title>PCI/MSI: Switch msix_capability_init() to guard(msi_desc_lock)</title>
<updated>2025-04-09T18:47:30Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2025-03-19T10:56:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=891146645e5d55166847b8e004a30fb9f8b03266'/>
<id>urn:sha1:891146645e5d55166847b8e004a30fb9f8b03266</id>
<content type='text'>
Split the lock protected functionality of msix_capability_init() out into a
helper function and use guard(msi_desc_lock) to replace the lock/unlock
pair.

Simplify the error path in the helper function by utilizing a custom
cleanup to get rid of the remaining gotos.

No functional change intended.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/all/20250319105506.564105011@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Switch msi_capability_init() to guard(msi_desc_lock)</title>
<updated>2025-04-09T18:47:30Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2025-03-19T10:56:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f11cc2af8f4b3d5e81dd9b8fb1a9185a6ca6e7db'/>
<id>urn:sha1:f11cc2af8f4b3d5e81dd9b8fb1a9185a6ca6e7db</id>
<content type='text'>
Split the lock protected functionality of msi_capability_init() out into a
helper function and use guard(msi_desc_lock) to replace the lock/unlock
pair.

No functional change intended.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/all/20250319105506.504992208@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Use __free() for affinity masks</title>
<updated>2025-04-09T18:47:30Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2025-03-19T10:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c0ba4f9d25eb35a8ef882115c9f9c2084acc4e7'/>
<id>urn:sha1:5c0ba4f9d25eb35a8ef882115c9f9c2084acc4e7</id>
<content type='text'>
Let cleanup handle the freeing of the affinity mask. That prepares for
switching the MSI descriptor locking to a guard().

No functional change.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/all/20250319105506.444764312@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Set pci_dev:: Msi_enabled late</title>
<updated>2025-04-09T18:47:29Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2025-03-19T10:56:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0c44a5ec3552f89c47dac9903d99c22d796d87f'/>
<id>urn:sha1:b0c44a5ec3552f89c47dac9903d99c22d796d87f</id>
<content type='text'>
The comment claiming that pci_dev::msi_enabled has to be set across setup
is a leftover from ancient code versions. Nothing in the setup code
requires the flag to be set anymore.

Set it in the success path and remove the extra goto label.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/all/20250319105506.383222333@linutronix.de

</content>
</entry>
</feed>
