Skip to contentSkip to conversation

PCI: Support BAR sizes up to 8TB

PATCH Applied Dongdong Liu 2 participants 4 messages Jan 18, 2022 – Mar 3, 2022 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: Support BAR sizes up to 8TB

Current kernel reports disabling BAR if device with a 4TB BAR as it only supports BAR size to 128GB.

pci 0000:01:00.0: disabling BAR 4:
[mem 0x00000000-0x3ffffffffff 64bit pref] (bad alignment 0x40000000000)

Increase the maximum BAR size from 128GB to 8TB for future expansion.

---
 drivers/pci/setup-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/setup-bus.c +1 -1
index 547396ec50b5..a7893bf2f580 100644
@@ -994,7 +994,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
 {
 	struct pci_dev *dev;
 	resource_size_t min_align, align, size, size0, size1;
-	resource_size_t aligns[18]; /* Alignments from 1MB to 128GB */
+	resource_size_t aligns[24]; /* Alignments from 1MB to 8TB */
 	int order, max_order;
 	struct resource *b_res = find_bus_resource_of_type(bus,
 					mask | IORESOURCE_PREFETCH, type);
Signature · 1 line
2.33.0
#1 lore raw

Hi

Gentle ping...

Quoted 27 lines · Dongdong Liu

Current kernel reports disabling BAR if device with a 4TB BAR as it only supports BAR size to 128GB.

pci 0000:01:00.0: disabling BAR 4:
[mem 0x00000000-0x3ffffffffff 64bit pref] (bad alignment 0x40000000000)

Increase the maximum BAR size from 128GB to 8TB for future expansion.

---
 drivers/pci/setup-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/setup-bus.c +1 -1
index 547396ec50b5..a7893bf2f580 100644
@@ -994,7 +994,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
 {
 	struct pci_dev *dev;
 	resource_size_t min_align, align, size, size0, size1;
-	resource_size_t aligns[18]; /* Alignments from 1MB to 128GB */
+	resource_size_t aligns[24]; /* Alignments from 1MB to 8TB */
 	int order, max_order;
 	struct resource *b_res = find_bus_resource_of_type(bus,
 					mask | IORESOURCE_PREFETCH, type);
#2 lore raw
In reply to Dongdong Liu

Hi Bjorn

Could you help to review this patch, I hope this patch can be applied for 5.18.

Thanks,
Dongdong

Quoted 27 lines · Dongdong Liu

Current kernel reports disabling BAR if device with a 4TB BAR as it only supports BAR size to 128GB.

pci 0000:01:00.0: disabling BAR 4:
[mem 0x00000000-0x3ffffffffff 64bit pref] (bad alignment 0x40000000000)

Increase the maximum BAR size from 128GB to 8TB for future expansion.

---
 drivers/pci/setup-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/setup-bus.c +1 -1
index 547396ec50b5..a7893bf2f580 100644
@@ -994,7 +994,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
 {
 	struct pci_dev *dev;
 	resource_size_t min_align, align, size, size0, size1;
-	resource_size_t aligns[18]; /* Alignments from 1MB to 128GB */
+	resource_size_t aligns[24]; /* Alignments from 1MB to 8TB */
 	int order, max_order;
 	struct resource *b_res = find_bus_resource_of_type(bus,
 					mask | IORESOURCE_PREFETCH, type);
#3 lore raw
In reply to Dongdong Liu
Quoted 9 lines · Dongdong Liu

Current kernel reports disabling BAR if device with a 4TB BAR as it only supports BAR size to 128GB.

pci 0000:01:00.0: disabling BAR 4:
[mem 0x00000000-0x3ffffffffff 64bit pref] (bad alignment 0x40000000000)

Increase the maximum BAR size from 128GB to 8TB for future expansion.

Applied to pci/enumeration for v5.18, thanks!

Quoted 20 lines
---
 drivers/pci/setup-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/setup-bus.c +1 -1
index 547396ec50b5..a7893bf2f580 100644
@@ -994,7 +994,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
 {
 	struct pci_dev *dev;
 	resource_size_t min_align, align, size, size0, size1;
-	resource_size_t aligns[18]; /* Alignments from 1MB to 128GB */
+	resource_size_t aligns[24]; /* Alignments from 1MB to 8TB */
 	int order, max_order;
 	struct resource *b_res = find_bus_resource_of_type(bus,
 					mask | IORESOURCE_PREFETCH, type);
Signature · 1 line
2.33.0