Thread (5 messages) flat view 5 messages, 3 authors, 2026-02-19

Re: [PATCH] powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices

From: Nilay Shroff <hidden>
Date: 2026-02-19 17:33:26
Also in: linux-pci


On 2/19/26 12:52 PM, Vivian Wang wrote:
On 2/18/26 01:45, Nilay Shroff wrote:
quoted
Recent changes [1] replaced the use of no_64bit_msi with msi_addr_mask.
As a result, msi_addr_mask is now expected to be initialized to
DMA_BIT_MASK(64) when a pci_dev is set up. However, this initialization
was missed on powerpc due to differences in the device initialization
path compared to other architectures. Due to this, now pci device probe
method fails on powerpc system.

On powerpc systems, struct pci_dev instances are created from device
tree nodes via of_create_pci_dev(). Because msi_addr_mask was not
initialized there, it remained zero. Later, during MSI setup,
msi_verify_entries() validates the programmed MSI address against
pdev->msi_addr_mask. Since the mask was not set correctly, the
validation fails, causing PCI driver probe failures for devices on
powerpc systems.
Thanks for catching this. I had naively assumed that pci_setup_device()
was the right place for adding this initialization, and didn't think of
other possibilities.

I grep'd for pci_alloc_dev() and found these uses:

  * of_create_pci_dev() in arch/powerpc/kernel/pci_of_scan.c (this patch)
  * of_create_pci_dev() in arch/sparc/kernel/pci.c (*same missed init*)
  * drivers/char/agp/{alpha,parisc}-agp.c (fake pci_dev, should be fine)
  * drivers/scsi/megaraid.c (copying from existing pci_dev, should be fine)

So, while we're at it, can we fix the SPARC one as well in v2? The code
seems similar to what we do for powerpc.
Yes I can do that but I don't have access to SPARC machine so I can't validate 
it. However I'd add SPARC maintainers and mailing list for review and so someone
might help.
quoted
Initialize pdev->msi_addr_mask to DMA_BIT_MASK(64) in
of_create_pci_dev() so that MSI address validation succeeds and device
probe works as expected.

[1] https://lore.kernel.org/all/20260129-pci-msi-addr-mask-v4-0-70da998f2750@iscas.ac.cn/ (local)
Nit: Link seems redundant given the Fixes tag below.
Ack

Thanks,
--Nilay

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help