Skip to contentSkip to conversation

powerpc: isa-bridge: Fix ISA mmapping when "ranges" is not present

PATCH Applied Rob Herring 4 participants 5 messages May 5, 2023 – Jul 3, 2023 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: isa-bridge: Fix ISA mmapping when "ranges" is not present

Commit e4ab08be5b49 ("powerpc/isa-bridge: Remove open coded "ranges" parsing") broke PASemi Nemo board booting. The issue is the ISA I/O range was not getting mapped as the logic to handle no "ranges" was inverted. If phb_io_base_phys is non-zero, then the ISA range defaults to the first 64K of the PCI I/O space. phb_io_base_phys should only be 0 when looking for a non-PCI ISA region.

Fixes e4ab08be5b49 ("powerpc/isa-bridge: Remove open coded "ranges" parsing")

---
Untested, but I think this should fix the issue.

 arch/powerpc/kernel/isa-bridge.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/kernel/isa-bridge.c +3 -2
index 85bdd7d3652f..48e0eaf1ad61 100644
@@ -93,11 +93,12 @@ static int process_ISA_OF_ranges(struct device_node *isa_node,
 	}
 
 inval_range:
-	if (!phb_io_base_phys) {
+	if (phb_io_base_phys) {
 		pr_err("no ISA IO ranges or unexpected isa range, mapping 64k\n");
 		remap_isa_base(phb_io_base_phys, 0x10000);
+		return 0;
 	}
-	return 0;
+	return -EINVAL;
 }
 
 
Signature · 1 line
2.39.2
Tested-by on v1 1/1
#1 lore raw
Quoted 26 lines · Rob Herring

Commit e4ab08be5b49 ("powerpc/isa-bridge: Remove open coded "ranges" parsing") broke PASemi Nemo board booting. The issue is the ISA I/O range was not getting mapped as the logic to handle no "ranges" was inverted. If phb_io_base_phys is non-zero, then the ISA range defaults to the first 64K of the PCI I/O space. phb_io_base_phys should only be 0 when looking for a non-PCI ISA region.

Fixes e4ab08be5b49 ("powerpc/isa-bridge: Remove open coded "ranges" parsing")

---
Untested, but I think this should fix the issue.

  arch/powerpc/kernel/isa-bridge.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/kernel/isa-bridge.c +0 -1
index 85bdd7d3652f..48e0eaf1ad61 100644
@@ -93,11 +93,12 @@ static int process_ISA_OF_ranges(struct device_node *isa_node,
  	}
 
  inval_range:
-	if (!phb_io_base_phys) {

arch/powerpc/kernel/isa-bridge.c static int process_ISA_OF_ranges(struct device_node *isa_node, · line 104

Quoted 10 lines
arch/powerpc/kernel/isa-bridge.c +3 -1
+	if (phb_io_base_phys) {
  		pr_err("no ISA IO ranges or unexpected isa range, mapping 64k\n");
  		remap_isa_base(phb_io_base_phys, 0x10000);
+		return 0;
  	}
-	return 0;
+	return -EINVAL;
  }
 
 

The Nemo board boots with this patch. Thanks a lot for your help!

#2 lore raw
In reply to Rob Herring
Quoted 8 lines · Rob Herring

Commit e4ab08be5b49 ("powerpc/isa-bridge: Remove open coded "ranges" parsing") broke PASemi Nemo board booting. The issue is the ISA I/O range was not getting mapped as the logic to handle no "ranges" was inverted. If phb_io_base_phys is non-zero, then the ISA range defaults to the first 64K of the PCI I/O space. phb_io_base_phys should only be 0 when looking for a non-PCI ISA region.

[...]

Applied to powerpc/fixes.

[1/1] powerpc: isa-bridge: Fix ISA mmapping when "ranges" is not present

      https://git.kernel.org/powerpc/c/79de36042eecb684e0f748d17ba52f365fde0d65

cheers

#3 lore raw
Quoted 8 lines · Michael Ellerman
Quoted 7 lines · Rob Herring

Commit e4ab08be5b49 ("powerpc/isa-bridge: Remove open coded "ranges" parsing") broke PASemi Nemo board booting. The issue is the ISA I/O range was not getting mapped as the logic to handle no "ranges" was inverted. If phb_io_base_phys is non-zero, then the ISA range defaults to the first 64K of the PCI I/O space. phb_io_base_phys should only be 0 when looking for a non-PCI ISA region.

Quoted 7 lines
Quoted 1 line

[...]

Applied to powerpc/fixes.

[1/1] powerpc: isa-bridge: Fix ISA mmapping when "ranges" is not present

       https://git.kernel.org/powerpc/c/79de36042eecb684e0f748d17ba52f365fde0d65

cheers

Hello Michael,

This patch has already been applied. Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4927cb98f0eeaa5dbeac882e8372f4b16dc62624

Thanks,
Christian

#4 lore raw
Quoted 12 lines · Christian Zigotzky
Quoted 11 lines · Michael Ellerman
Quoted 8 lines · Rob Herring

Commit e4ab08be5b49 ("powerpc/isa-bridge: Remove open coded "ranges" parsing") broke PASemi Nemo board booting. The issue is the ISA I/O range was not getting mapped as the logic to handle no "ranges" was inverted. If phb_io_base_phys is non-zero, then the ISA range defaults to the first 64K of the PCI I/O space. phb_io_base_phys should only be 0 when looking for a non-PCI ISA region.

[...]

Applied to powerpc/fixes.

Quoted 8 lines
Quoted 4 lines

[1/1] powerpc: isa-bridge: Fix ISA mmapping when "ranges" is not present

       https://git.kernel.org/powerpc/c/79de36042eecb684e0f748d17ba52f365fde0d65

cheers

Hello Michael,

This patch has already been applied. Link:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4927cb98f0eeaa5dbeac882e8372f4b16dc62624

Yes, it's actually the same commit. I'm just catching up on sending the thanks emails. Sorry for the confusion.

cheers