Skip to content

Commit 147dae1

Browse files
shroffnibjorn-helgaas
authored andcommitted
sparc/PCI: Initialize msi_addr_mask for OF-created PCI devices
Recent changes replaced the use of no_64bit_msi with msi_addr_mask, which is now expected to be initialized to DMA_BIT_MASK(64) during PCI device setup. On SPARC systems, this initialization was inadvertently missed for devices instantiated from device tree nodes, leaving msi_addr_mask unset for OF-created pci_dev instances. As a result, MSI address validation fails during probe, causing affected devices to fail initialization. Initialize pdev->msi_addr_mask to DMA_BIT_MASK(64) in of_create_pci_dev() so that MSI address validation succeeds and PCI device probing works as expected. Fixes: 386ced1 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask") Signed-off-by: Nilay Shroff <nilay@linux.ibm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Han Gao <gaohan@iscas.ac.cn> # SPARC Enterprise T5220 Tested-by: Nathaniel Roach <nroach44@nroach44.id.au> # SPARC T5-2 Reviewed-by: Vivian Wang <wangruikang@iscas.ac.cn> Link: https://patch.msgid.link/20260220070239.1693303-3-nilay@linux.ibm.com
1 parent 2185904 commit 147dae1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

arch/sparc/kernel/pci.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
355355
dev->error_state = pci_channel_io_normal;
356356
dev->dma_mask = 0xffffffff;
357357

358+
/*
359+
* Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
360+
* if MSI (rather than MSI-X) capability does not have
361+
* PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
362+
*/
363+
dev->msi_addr_mask = DMA_BIT_MASK(64);
364+
358365
if (of_node_name_eq(node, "pci")) {
359366
/* a PCI-PCI bridge */
360367
dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;

0 commit comments

Comments
 (0)