Skip to contentSkip to conversation

x86/PCI: Disable e820 usage for the resource allocation

PATCH In review Andy Shevchenko 4 participants 9 messages Jun 13, 2022 – Jun 14, 2022

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

PATCH 1/1 x86/PCI: Disable e820 usage for the resource allocation

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

---
 arch/x86/include/asm/pci_x86.h | 1 +
 arch/x86/pci/acpi.c            | 2 +-
 arch/x86/pci/intel_mid_pci.c   | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/include/asm/pci_x86.h +1 -0
index f52a886d35cf..503f83fbc686 100644
@@ -126,6 +126,7 @@ extern const struct pci_raw_ops *raw_pci_ext_ops;
 extern const struct pci_raw_ops pci_mmcfg;
 extern const struct pci_raw_ops pci_direct_conf1;
 extern bool port_cf9_safe;
+extern bool pci_use_e820;
 
 /* arch_initcall level */
 #ifdef CONFIG_PCI_DIRECT
arch/x86/pci/acpi.c +1 -1
index a4f43054bc79..ac2f220d50fc 100644
@@ -20,7 +20,7 @@ struct pci_root_info {
 #endif
 };
 
-static bool pci_use_e820 = true;
+bool pci_use_e820 = true;
 static bool pci_use_crs = true;
 static bool pci_ignore_seg;
 
arch/x86/pci/intel_mid_pci.c +1 -0
index 8edd62206604..7869b86bff04 100644
@@ -313,6 +313,7 @@ int __init intel_mid_pci_init(void)
 	pcibios_enable_irq = intel_mid_pci_irq_enable;
 	pcibios_disable_irq = intel_mid_pci_irq_disable;
 	pci_root_ops = intel_mid_pci_ops;
+	pci_use_e820 = false;
 	pci_soc_mode = 1;
 	/* Continue with standard init */
 	acpi_noirq_set();
Signature · 1 line
2.35.1
#1 lore raw

Hi,

Quoted 8 lines · Andy Shevchenko

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

Andy, thank you for the patch. Commit 4c5e242d3e93 has also been causing issues for other platforms, so I've submitted a revert of it here:

https://lore.kernel.org/linux-pci/[email protected]/T/#u

can you please give the revert a try, and confirm that that fixes the Intel MID platform issue too ?

Regards,

Hans

Quoted 43 lines
---
 arch/x86/include/asm/pci_x86.h | 1 +
 arch/x86/pci/acpi.c            | 2 +-
 arch/x86/pci/intel_mid_pci.c   | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/include/asm/pci_x86.h +1 -0
index f52a886d35cf..503f83fbc686 100644
@@ -126,6 +126,7 @@ extern const struct pci_raw_ops *raw_pci_ext_ops;
 extern const struct pci_raw_ops pci_mmcfg;
 extern const struct pci_raw_ops pci_direct_conf1;
 extern bool port_cf9_safe;
+extern bool pci_use_e820;
 
 /* arch_initcall level */
 #ifdef CONFIG_PCI_DIRECT
arch/x86/pci/acpi.c +1 -1
index a4f43054bc79..ac2f220d50fc 100644
@@ -20,7 +20,7 @@ struct pci_root_info {
 #endif
 };
 
-static bool pci_use_e820 = true;
+bool pci_use_e820 = true;
 static bool pci_use_crs = true;
 static bool pci_ignore_seg;
 
arch/x86/pci/intel_mid_pci.c +1 -0
index 8edd62206604..7869b86bff04 100644
@@ -313,6 +313,7 @@ int __init intel_mid_pci_init(void)
 	pcibios_enable_irq = intel_mid_pci_irq_enable;
 	pcibios_disable_irq = intel_mid_pci_irq_disable;
 	pci_root_ops = intel_mid_pci_ops;
+	pci_use_e820 = false;
 	pci_soc_mode = 1;
 	/* Continue with standard init */
 	acpi_noirq_set();
#2 lore raw
Quoted 10 lines · Hans de Goede
Quoted 8 lines · Andy Shevchenko

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

Quoted 7 lines

Andy, thank you for the patch. Commit 4c5e242d3e93 has also been causing issues for other platforms, so I've submitted a revert of it here:

https://lore.kernel.org/linux-pci/[email protected]/T/#u

can you please give the revert a try, and confirm that that fixes the Intel MID platform issue too ?

Nope, it doesn't fix. The problem is in flags checking as far as I can see. My patch is needed either we have yours or not.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 14 lines · Andy Shevchenko
Quoted 13 lines · Hans de Goede
Quoted 8 lines · Andy Shevchenko

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

Andy, thank you for the patch. Commit 4c5e242d3e93 has also been causing issues for other platforms, so I've submitted a revert of it here:

Quoted 7 lines
Quoted 4 lines

https://lore.kernel.org/linux-pci/[email protected]/T/#u

can you please give the revert a try, and confirm that that fixes the Intel MID platform issue too ?

Nope, it doesn't fix. The problem is in flags checking as far as I can see. My patch is needed either we have yours or not.

Hold on, it seems I have tried to build something that is not what I develop. Lemme retest.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
Quoted 17 lines · Andy Shevchenko
Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Hans de Goede
Quoted 8 lines · Andy Shevchenko

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

Andy, thank you for the patch. Commit 4c5e242d3e93 has also been causing issues for other platforms, so I've submitted a revert of it here:

https://lore.kernel.org/linux-pci/[email protected]/T/#u

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

can you please give the revert a try, and confirm that that fixes the Intel MID platform issue too ?

Nope, it doesn't fix. The problem is in flags checking as far as I can see. My patch is needed either we have yours or not.

Hold on, it seems I have tried to build something that is not what I develop. Lemme retest.

Yes, I have tested something weird. Now it works, but I will triple check and give my tag to your patch later on.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

Yeah, I blew it with 4c5e242d3e93. Can you provide more details on how the MID platforms broke? Since you set "pci_use_e820 = false" for MID below, I assume MID doesn't depend on the e820 clipping and thus should not break if we turn off clipping by default in 2023 as in 0ae084d5a674 ("x86/PCI: Disable E820 reserved region clipping starting in 2023"). But it'd be nice to see the dmesg log and make sure.

Quoted 46 lines
---
 arch/x86/include/asm/pci_x86.h | 1 +
 arch/x86/pci/acpi.c            | 2 +-
 arch/x86/pci/intel_mid_pci.c   | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/include/asm/pci_x86.h +1 -0
index f52a886d35cf..503f83fbc686 100644
@@ -126,6 +126,7 @@ extern const struct pci_raw_ops *raw_pci_ext_ops;
 extern const struct pci_raw_ops pci_mmcfg;
 extern const struct pci_raw_ops pci_direct_conf1;
 extern bool port_cf9_safe;
+extern bool pci_use_e820;
 
 /* arch_initcall level */
 #ifdef CONFIG_PCI_DIRECT
arch/x86/pci/acpi.c +1 -1
index a4f43054bc79..ac2f220d50fc 100644
@@ -20,7 +20,7 @@ struct pci_root_info {
 #endif
 };
 
-static bool pci_use_e820 = true;
+bool pci_use_e820 = true;
 static bool pci_use_crs = true;
 static bool pci_ignore_seg;
 
arch/x86/pci/intel_mid_pci.c +1 -0
index 8edd62206604..7869b86bff04 100644
@@ -313,6 +313,7 @@ int __init intel_mid_pci_init(void)
 	pcibios_enable_irq = intel_mid_pci_irq_enable;
 	pcibios_disable_irq = intel_mid_pci_irq_disable;
 	pci_root_ops = intel_mid_pci_ops;
+	pci_use_e820 = false;
 	pci_soc_mode = 1;
 	/* Continue with standard init */
 	acpi_noirq_set();
Signature · 1 line
2.35.1
#6 lore raw
Quoted 6 lines · Bjorn Helgaas
Quoted 5 lines · Andy Shevchenko

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Quoted 6 lines
Quoted 3 lines
Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

Yeah, I blew it with 4c5e242d3e93. Can you provide more details on how the MID platforms broke?

It's not so easy. The breakage seems affects the console driver and earlycon doesn't work. erlyprintk doesn't support 32-bit MMIO addresses (again, addresses, not data size). That said, there is nothing to show at all.

What I did, I have bisected to your patch, commented out the call and instead added a printk() to see what it does, and it basically removed all resources listed in _CRS.

Quoted 7 lines

Since you set "pci_use_e820 = false" for
MID below, I assume MID doesn't depend on the e820 clipping and thus should not break if we turn off clipping by default in 2023 as in 0ae084d5a674 ("x86/PCI: Disable E820 reserved region clipping starting in 2023").

But it'd be nice to see the dmesg log and make sure.

Nothing to provide (see above why), sorry.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw
Quoted 28 lines · Andy Shevchenko
Quoted 6 lines · Bjorn Helgaas
Quoted 5 lines · Andy Shevchenko

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Quoted 6 lines
Quoted 3 lines
Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

Yeah, I blew it with 4c5e242d3e93. Can you provide more details on how the MID platforms broke?

It's not so easy. The breakage seems affects the console driver and earlycon doesn't work. erlyprintk doesn't support 32-bit MMIO addresses (again, addresses, not data size). That said, there is nothing to show at all.

What I did, I have bisected to your patch, commented out the call and instead added a printk() to see what it does, and it basically removed all resources listed in _CRS.

Quoted 5 lines

Since you set "pci_use_e820 = false" for
MID below, I assume MID doesn't depend on the e820 clipping and thus should not break if we turn off clipping by default in 2023 as in 0ae084d5a674 ("x86/PCI: Disable E820 reserved region clipping starting in 2023").

Quoted 3 lines
Quoted 1 line

But it'd be nice to see the dmesg log and make sure.

Nothing to provide (see above why), sorry.

A dmesg log with a working kernel, especially from one with Hans' revert, which might have a little more logging about clipping, might have enough info to help figure this out.

Bjorn

#8 lore raw
Quoted 30 lines · Bjorn Helgaas
Quoted 28 lines · Andy Shevchenko
Quoted 6 lines · Bjorn Helgaas
Quoted 5 lines · Andy Shevchenko

The resource management improve for PCI on x86 broke booting of Intel MID platforms. It seems that the current code removes all available resources from the list and none of the PCI device may be initialized. Restore the old behaviour by force disabling the e820 usage for the resource allocation.

Quoted 6 lines
Quoted 3 lines
Fixes 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions")

Depends-on: fa6dae5d8208 ("x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions")

Yeah, I blew it with 4c5e242d3e93. Can you provide more details on how the MID platforms broke?

It's not so easy. The breakage seems affects the console driver and earlycon doesn't work. erlyprintk doesn't support 32-bit MMIO addresses (again, addresses, not data size). That said, there is nothing to show at all.

What I did, I have bisected to your patch, commented out the call and instead added a printk() to see what it does, and it basically removed all resources listed in _CRS.

Quoted 5 lines

Since you set "pci_use_e820 = false" for
MID below, I assume MID doesn't depend on the e820 clipping and thus should not break if we turn off clipping by default in 2023 as in 0ae084d5a674 ("x86/PCI: Disable E820 reserved region clipping starting in 2023").

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

But it'd be nice to see the dmesg log and make sure.

Nothing to provide (see above why), sorry.

A dmesg log with a working kernel, especially from one with Hans' revert, which might have a little more logging about clipping, might have enough info to help figure this out.

https://paste.debian.net/1244105/

(It has a lot of unrelated debug thingy, sorry I didn't cut that out)

Signature · 2 lines
With Best Regards,
Andy Shevchenko