Skip to contentSkip to conversation

pci: fix msi_addr_mask on powerpc and sparc systems

PATCH In review Nilay Shroff 9 participants 14 messages Feb 20 – Mar 3

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover pci: fix msi_addr_mask on powerpc and sparc systems

Hi,

Recent changes [1] which replaced pci_dev::no_64bit_msi with pci_dev::
msi_addr_mask inadvertently missed to initialize the pci_dev::msi_addr_mask to the DMA_BIT_MASK(64) on powerpc platform. Due to this, later the validation the programmed MSI address against the msi_addr_mask fails. This causes pci device probe method failures on powerpc platform. We also realized that similar issue could potentially happen on sparc system as well. So this series initializes pci_dev::msi_addr_mask to DMA_BIT_MASK(64) when pci_dev is instantiated for both powerpc and sparc platforms.

The first patch in the series fixes this on powerpc platform. The second patch fixes this issue on sparc platform. Please note that as I don't have access to the sparc platform, this patch was only compile tested on the sparc system. Anyone from the community is welcome to test it who has access to the sparc machine.

[1] https://lore.kernel.org/all/[email protected]/

Changes since v1:
- Initialize the pci_dev:msi_addr_mask on sparc platform (Vivian Wang)
- Some minor cosmetic fixes (Bjorn Helgaas)

Nilay Shroff (2):
powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

 arch/powerpc/kernel/pci_of_scan.c | 7 +++++++
 arch/sparc/kernel/pci.c           | 7 +++++++
 2 files changed, 14 insertions(+)
Signature · 1 line
2.52.0
#1 lore raw

PATCH v2 1/2 powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices

Recent changes 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 (x86) architecture. 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.

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.

Fixes 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask")
---
 arch/powerpc/kernel/pci_of_scan.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/powerpc/kernel/pci_of_scan.c +7 -0
index 756043dd06e9..fb9fbf0d1796 100644
@@ -212,6 +212,13 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
 	dev->error_state = pci_channel_io_normal;
 	dev->dma_mask = 0xffffffff;
 
+	/*
+	 * Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
+	 * if MSI (rather than MSI-X) capability does not have
+	 * PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
+	 */
+	dev->msi_addr_mask = DMA_BIT_MASK(64);
+
 	/* Early fixups, before probing the BARs */
 	pci_fixup_device(pci_fixup_early, dev);
 
Signature · 1 line
2.52.0
Tested-by on v2 1/2
#2 lore raw

Re: [PATCHv2 1/2] powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices

Quoted 50 lines · Nilay Shroff

Recent changes 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 (x86) architecture. 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 agains pdev->msi_addr_mask. Since the mask was not set correctly, the validation fails, causing PCI driver probe failures for devices on powerpc systems.

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.

Fixes 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask")

---
arch/powerpc/kernel/pci_of_scan.c | 7 +++++++

1 file changed, 7 insertions(+)
arch/powerpc/kernel/pci_of_scan.c +7 -0
index 756043dd06e9..fb9fbf0d1796 100644
@@ -212,6 +212,13 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
 dev->error_state = pci_channel_io_normal;
 dev->dma_mask = 0xffffffff;
 
+ /*
+ * Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
+ * if MSI (rather than MSI-X) capability does not have
+ * PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
+ */
+ dev->msi_addr_mask = DMA_BIT_MASK(64);
+
 /* Early fixups, before probing the BARs */
 pci_fixup_device(pci_fixup_early, dev);
 
Signature · 1 line
2.52.0

Tested on an IBM Power System LPAR (pseries).

On an unpatched kernel, all LPFC functions failed MSI/MSI-X setup with:

[    0.175139] Running MSI bitmap self-tests ...
[    1.521630] lpfc 0152:60:00.0: arch assigned 64-bit MSI address 0xffff3840 above device MSI address mask 0x0
[    1.536203] lpfc 0152:60:00.0: arch assigned 64-bit MSI address 0xffff3a00 above device MSI address mask 0x0
[    1.536318] lpfc 0152:60:00.0: 14: [    1.521874] 0:0484 PCI enable MSI-X failed (-5)
[    1.536321] lpfc 0152:60:00.0: 15: [    1.536251] 0:0488 PCI enable MSI mode failed (-5)

After applying this patch, lpfc driver probe completes successfully and MSI/MSI-X setup works normally.

[    0.206925] Running MSI bitmap self-tests ...
[    3.040737] lpfc 0152:60:00.1: 1:3238 Reducing IO channels to match number of MSI-X vectors, requested 32 got 2
[    4.162067] lpfc 0152:60:00.2: 2:3238 Reducing IO channels to match number of MSI-X vectors, requested 32 got 1
[    5.270672] lpfc 0152:60:00.3: 3:3238 Reducing IO channels to match number of MSI-X vectors, requested 32 got 1

Regards,
Venkat.

Reviewed-by Tested-by on v2 1/2
#3 lore raw

Re: [PATCHv2 1/2] powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices

In reply to Nilay Shroff
Quoted 15 lines · Nilay Shroff

Recent changes 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 (x86) architecture. 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.

Quoted 6 lines

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.

Fixes 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask")

I ran into this problem today. Great that it's already been fixed.

Nam

#4 lore raw

PATCH v2 2/2 sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

In reply to Nilay Shroff

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 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask")
---
 arch/sparc/kernel/pci.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/sparc/kernel/pci.c +7 -0
index b290107170e9..a4815d544781 100644
@@ -355,6 +355,13 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
 	dev->error_state = pci_channel_io_normal;
 	dev->dma_mask = 0xffffffff;
 
+	/*
+	 * Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
+	 * if MSI (rather than MSI-X) capability does not have
+	 * PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
+	 */
+	dev->msi_addr_mask = DMA_BIT_MASK(64);
+
 	if (of_node_name_eq(node, "pci")) {
 		/* a PCI-PCI bridge */
 		dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
Signature · 1 line
2.52.0
Tested-by on v2 2/2
#5 lore raw

Re: [PATCHv2 2/2] sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

Tested and passed on SPARC Enterprise T5220.

Without this patch, the e1000e would use intx.

Tested-by Han Gao <[email protected] <mailto:[email protected]>> # on SPARC Enterprise T5220
Quoted 42 lines · Nilay Shroff

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 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask")

---
arch/sparc/kernel/pci.c | 7 +++++++

1 file changed, 7 insertions(+)
arch/sparc/kernel/pci.c +7 -0
index b290107170e9..a4815d544781 100644
@@ -355,6 +355,13 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
 dev->error_state = pci_channel_io_normal;
 dev->dma_mask = 0xffffffff;
 
+ /*
+ * Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
+ * if MSI (rather than MSI-X) capability does not have
+ * PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
+ */
+ dev->msi_addr_mask = DMA_BIT_MASK(64);
+
 if (of_node_name_eq(node, "pci")) {
 /* a PCI-PCI bridge */
 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
Signature · 1 line
2.52.0
Tested-by
#6 lore raw

Re: [PATCHv2 2/2] sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

Quoted 34 lines · Han Gao

Tested and passed on SPARC Enterprise T5220.

Without this patch, the e1000e would use intx.

Tested-by Han Gao <[email protected] <mailto:[email protected]>> # on SPARC Enterprise T5220
Quoted 28 lines · Nilay Shroff

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 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask")

---
arch/sparc/kernel/pci.c | 7 +++++++

1 file changed, 7 insertions(+)
arch/sparc/kernel/pci.c +0 -0
index b290107170e9..a4815d544781 100644
@@ -355,6 +355,13 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
 dev->error_state = pci_channel_io_normal;
 dev->dma_mask = 0xffffffff;
 
Quoted 12 lines
Quoted 12 lines
arch/sparc/kernel/pci.c +7 -0
+ /*
+ * Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
+ * if MSI (rather than MSI-X) capability does not have
+ * PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
+ */
+ dev->msi_addr_mask = DMA_BIT_MASK(64);
+
 if (of_node_name_eq(node, "pci")) {
 /* a PCI-PCI bridge */
 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
Signature · 1 line
2.52.0
Tested-by on v2 2/2
#7 lore raw

Re: [PATCHv2 2/2] sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

In reply to Nilay Shroff

Tested and passed on SPARC Enterprise T5220.

Without this patch, the e1000e would use intx.

Quoted 42 lines · Nilay Shroff

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 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask")

---
arch/sparc/kernel/pci.c | 7 +++++++

1 file changed, 7 insertions(+)
arch/sparc/kernel/pci.c +7 -0
index b290107170e9..a4815d544781 100644
@@ -355,6 +355,13 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
 	dev->error_state = pci_channel_io_normal;
 	dev->dma_mask = 0xffffffff;
 
+	/*
+	 * Assume 64-bit addresses for MSI initially. Will be changed to 32-bit
+	 * if MSI (rather than MSI-X) capability does not have
+	 * PCI_MSI_FLAGS_64BIT. Can also be overridden by driver.
+	 */
+	dev->msi_addr_mask = DMA_BIT_MASK(64);
+
 	if (of_node_name_eq(node, "pci")) {
 		/* a PCI-PCI bridge */
 		dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
Signature · 1 line
2.52.0
Reviewed-by on the v2 series
#8 lore raw
In reply to Nilay Shroff

Hi Nilay,

Quoted 23 lines · Nilay Shroff

Hi,

Recent changes [1] which replaced pci_dev::no_64bit_msi with pci_dev::
msi_addr_mask inadvertently missed to initialize the pci_dev::msi_addr_mask to the DMA_BIT_MASK(64) on powerpc platform. Due to this, later the validation the programmed MSI address against the msi_addr_mask fails. This causes pci device probe method failures on powerpc platform. We also realized that similar issue could potentially happen on sparc system as well. So this series initializes pci_dev::msi_addr_mask to DMA_BIT_MASK(64) when pci_dev is instantiated for both powerpc and sparc platforms.

The first patch in the series fixes this on powerpc platform. The second patch fixes this issue on sparc platform. Please note that as I don't have access to the sparc platform, this patch was only compile tested on the sparc system. Anyone from the community is welcome to test it who has access to the sparc machine.

[1] https://lore.kernel.org/all/[email protected]/

Changes since v1:
- Initialize the pci_dev:msi_addr_mask on sparc platform (Vivian Wang)
- Some minor cosmetic fixes (Bjorn Helgaas)

Quoted 7 lines

Nilay Shroff (2):
powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

 arch/powerpc/kernel/pci_of_scan.c | 7 +++++++
 arch/sparc/kernel/pci.c           | 7 +++++++
 2 files changed, 14 insertions(+)

This series is:

With the caveat that I have neither powerpc nor sparc machines to test, so it really is only reviewed.

Thanks and with apologies,
Vivian "dramforever" Wang

#9 lore raw

Hi,

Quoted 35 lines · Vivian Wang

Hi Nilay,

Quoted 23 lines · Nilay Shroff

Hi,

Recent changes [1] which replaced pci_dev::no_64bit_msi with pci_dev::
msi_addr_mask inadvertently missed to initialize the pci_dev::msi_addr_mask to the DMA_BIT_MASK(64) on powerpc platform. Due to this, later the validation the programmed MSI address against the msi_addr_mask fails. This causes pci device probe method failures on powerpc platform. We also realized that similar issue could potentially happen on sparc system as well. So this series initializes pci_dev::msi_addr_mask to DMA_BIT_MASK(64) when pci_dev is instantiated for both powerpc and sparc platforms.

The first patch in the series fixes this on powerpc platform. The second patch fixes this issue on sparc platform. Please note that as I don't have access to the sparc platform, this patch was only compile tested on the sparc system. Anyone from the community is welcome to test it who has access to the sparc machine.

[1] https://lore.kernel.org/all/[email protected]/

Changes since v1:
- Initialize the pci_dev:msi_addr_mask on sparc platform (Vivian Wang)
- Some minor cosmetic fixes (Bjorn Helgaas)

Quoted 7 lines

Nilay Shroff (2):
powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

 arch/powerpc/kernel/pci_of_scan.c | 7 +++++++
 arch/sparc/kernel/pci.c           | 7 +++++++
 2 files changed, 14 insertions(+)
Quoted 6 lines

This series is:

With the caveat that I have neither powerpc nor sparc machines to test, so it really is only reviewed.

Then please make sure that the changes have been tested on actual hardware. We've seen some regressions with changes on SPARC that went in without testing.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#10 lore raw
In reply to Nilay Shroff

[cc->to powerpc, sparc maintainers for ack]

Quoted 23 lines · Nilay Shroff

Hi,

Recent changes [1] which replaced pci_dev::no_64bit_msi with pci_dev::
msi_addr_mask inadvertently missed to initialize the pci_dev::msi_addr_mask to the DMA_BIT_MASK(64) on powerpc platform. Due to this, later the validation the programmed MSI address against the msi_addr_mask fails. This causes pci device probe method failures on powerpc platform. We also realized that similar issue could potentially happen on sparc system as well. So this series initializes pci_dev::msi_addr_mask to DMA_BIT_MASK(64) when pci_dev is instantiated for both powerpc and sparc platforms.

The first patch in the series fixes this on powerpc platform. The second patch fixes this issue on sparc platform. Please note that as I don't have access to the sparc platform, this patch was only compile tested on the sparc system. Anyone from the community is welcome to test it who has access to the sparc machine.

[1] https://lore.kernel.org/all/[email protected]/

Changes since v1:
- Initialize the pci_dev:msi_addr_mask on sparc platform (Vivian Wang)
- Some minor cosmetic fixes (Bjorn Helgaas)

Quoted 7 lines

Nilay Shroff (2):
powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

 arch/powerpc/kernel/pci_of_scan.c | 7 +++++++
 arch/sparc/kernel/pci.c           | 7 +++++++
 2 files changed, 14 insertions(+)

These fix regressions on powerpc and sparc caused by 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask").

These fixes have been tested by Han Gao (SPARC Enterprise T5220), Nathaniel Roach (SPARC T5-2), and Venkat Rao Bagalkote (IBM Power System LPAR (pseries)).

It'd be great to have acks from the powerpc and sparc folks so they could be merged either by Thomas (who merged 386ced19e9a3) or me (via PCI tree).

Bjorn

maintainer Acked-by
#11 lore raw
Quoted 37 lines · Bjorn Helgaas

[cc->to powerpc, sparc maintainers for ack]

Quoted 23 lines · Nilay Shroff

Hi,

Recent changes [1] which replaced pci_dev::no_64bit_msi with pci_dev::
msi_addr_mask inadvertently missed to initialize the pci_dev::msi_addr_mask to the DMA_BIT_MASK(64) on powerpc platform. Due to this, later the validation the programmed MSI address against the msi_addr_mask fails. This causes pci device probe method failures on powerpc platform. We also realized that similar issue could potentially happen on sparc system as well. So this series initializes pci_dev::msi_addr_mask to DMA_BIT_MASK(64) when pci_dev is instantiated for both powerpc and sparc platforms.

The first patch in the series fixes this on powerpc platform. The second patch fixes this issue on sparc platform. Please note that as I don't have access to the sparc platform, this patch was only compile tested on the sparc system. Anyone from the community is welcome to test it who has access to the sparc machine.

[1] https://lore.kernel.org/all/[email protected]/

Changes since v1:
- Initialize the pci_dev:msi_addr_mask on sparc platform (Vivian Wang)
- Some minor cosmetic fixes (Bjorn Helgaas)

Quoted 7 lines

Nilay Shroff (2):
powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

  arch/powerpc/kernel/pci_of_scan.c | 7 +++++++
  arch/sparc/kernel/pci.c           | 7 +++++++
  2 files changed, 14 insertions(+)

These fix regressions on powerpc and sparc caused by 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask").

Quoted 5 lines

These fixes have been tested by Han Gao (SPARC Enterprise T5220), Nathaniel Roach (SPARC T5-2), and Venkat Rao Bagalkote (IBM Power System LPAR (pseries)).

It'd be great to have acks from the powerpc and sparc folks so they

Sorry for the delayed response, yes we tested this from our end.

Quoted 5 lines

could be merged either by Thomas (who merged 386ced19e9a3) or me (via PCI tree).

Bjorn

#12 lore raw
Quoted 36 lines · Madhavan Srinivasan
Quoted 35 lines · Bjorn Helgaas
Quoted 23 lines · Nilay Shroff

Hi,

Recent changes [1] which replaced pci_dev::no_64bit_msi with pci_dev::
msi_addr_mask inadvertently missed to initialize the pci_dev::msi_addr_mask to the DMA_BIT_MASK(64) on powerpc platform. Due to this, later the validation the programmed MSI address against the msi_addr_mask fails. This causes pci device probe method failures on powerpc platform. We also realized that similar issue could potentially happen on sparc system as well. So this series initializes pci_dev::msi_addr_mask to DMA_BIT_MASK(64) when pci_dev is instantiated for both powerpc and sparc platforms.

The first patch in the series fixes this on powerpc platform. The second patch fixes this issue on sparc platform. Please note that as I don't have access to the sparc platform, this patch was only compile tested on the sparc system. Anyone from the community is welcome to test it who has access to the sparc machine.

[1] https://lore.kernel.org/all/[email protected]/

Changes since v1:
- Initialize the pci_dev:msi_addr_mask on sparc platform (Vivian Wang)
- Some minor cosmetic fixes (Bjorn Helgaas)

Quoted 7 lines

Nilay Shroff (2):
powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

  arch/powerpc/kernel/pci_of_scan.c | 7 +++++++
  arch/sparc/kernel/pci.c           | 7 +++++++
  2 files changed, 14 insertions(+)

These fix regressions on powerpc and sparc caused by 386ced19e9a3 ("PCI/MSI: Convert the boolean no_64bit_msi flag to a DMA address mask").

Quoted 8 lines
Quoted 5 lines

These fixes have been tested by Han Gao (SPARC Enterprise T5220), Nathaniel Roach (SPARC T5-2), and Venkat Rao Bagalkote (IBM Power System LPAR (pseries)).

It'd be great to have acks from the powerpc and sparc folks so they

Sorry for the delayed response, yes we tested this from our end.

Added your ack to the powerpc patch, thank you very much!

#13 lore raw
In reply to Nilay Shroff
Quoted 23 lines · Nilay Shroff

Hi,

Recent changes [1] which replaced pci_dev::no_64bit_msi with pci_dev::
msi_addr_mask inadvertently missed to initialize the pci_dev::msi_addr_mask to the DMA_BIT_MASK(64) on powerpc platform. Due to this, later the validation the programmed MSI address against the msi_addr_mask fails. This causes pci device probe method failures on powerpc platform. We also realized that similar issue could potentially happen on sparc system as well. So this series initializes pci_dev::msi_addr_mask to DMA_BIT_MASK(64) when pci_dev is instantiated for both powerpc and sparc platforms.

The first patch in the series fixes this on powerpc platform. The second patch fixes this issue on sparc platform. Please note that as I don't have access to the sparc platform, this patch was only compile tested on the sparc system. Anyone from the community is welcome to test it who has access to the sparc machine.

[1] https://lore.kernel.org/all/[email protected]/

Changes since v1:
- Initialize the pci_dev:msi_addr_mask on sparc platform (Vivian Wang)
- Some minor cosmetic fixes (Bjorn Helgaas)

Quoted 7 lines

Nilay Shroff (2):
powerpc/pci: Initialize msi_addr_mask for OF-created PCI devices sparc/pci: Initialize msi_addr_mask for OF-created PCI devices

 arch/powerpc/kernel/pci_of_scan.c | 7 +++++++
 arch/sparc/kernel/pci.c           | 7 +++++++
 2 files changed, 14 insertions(+)

I applied both of these to pci/for-linus for v7.0 since they fix regressions.

Thanks to Han and Nathaniel for testing on sparc and Venkat and Nam for testing on powerpc.

Let me know if you have issues with these or prefer to merge via another tree; I'll be happy to drop.

Bjorn