Skip to contentSkip to conversation

ARM: fix debug prints relevant to PCI devices

PATCH Superseded Vidya Sagar 2 participants 3 messages Jun 5, 2014 – Jun 6, 2014 Arm (32-bit)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: fix debug prints relevant to PCI devices

As per PCIe spec, fast back-to-back transactions feature is not applicable to PCIe devices. Hence, do not print that fast back-to-back trasactions are disabled when there is a PCIe device found on the bus

---

v2:
* Modified has_pcie_dev type to bool and used pci_is_pcie() instead of pci_pcie_cap()
* replaced printk with pr_info

 arch/arm/kernel/bios32.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
arch/arm/kernel/bios32.c +7 -2
index 17a26c1..d48d9d3 100644
@@ -290,6 +290,7 @@ void pcibios_fixup_bus(struct pci_bus *bus)
 {
 	struct pci_dev *dev;
 	u16 features = PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_FAST_BACK;
+	bool has_pcie_dev = 0;
 
 	/*
 	 * Walk the devices on this bus, working out what we can
@@ -298,6 +299,8 @@ void pcibios_fixup_bus(struct pci_bus *bus)
 	list_for_each_entry(dev, &bus->devices, bus_list) {
 		u16 status;
 
+		if (!has_pcie_dev)
+			has_pcie_dev = pci_is_pcie(dev);
 		pci_read_config_word(dev, PCI_STATUS, &status);
 
 		/*
@@ -354,9 +357,11 @@ void pcibios_fixup_bus(struct pci_bus *bus)
 
 	/*
 	 * Report what we did for this bus
+	 * (only if the bus doesn't have even one PCIe device)
 	 */
-	printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n",
-		bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");
+	if (!has_pcie_dev)
+		pr_info(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n",
+			bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");
 }
 EXPORT_SYMBOL(pcibios_fixup_bus);
 
Signature · 1 line
1.8.1.5
#1 lore raw
Quoted 1 line · Vidya Sagar

* replaced printk with pr_info

[]

arch/arm/kernel/bios32.c

Quoted 1 line
arch/arm/kernel/bios32.c +0 -0

[]

arch/arm/kernel/bios32.c void pcibios_fixup_bus(struct pci_bus *bus) · line 364

Quoted 11 lines
arch/arm/kernel/bios32.c +4 -2
@@ -354,9 +357,11 @@ void pcibios_fixup_bus(struct pci_bus *bus)
 
 	/*
 	 * Report what we did for this bus
+	 * (only if the bus doesn't have even one PCIe device)
 	 */
-	printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n",
-		bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");
+	if (!has_pcie_dev)
+		pr_info(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n",
+			bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");

when you convert to pr_<level> you need to remove the KERN_<LEVEL> from the format string too.

#2 lore raw

oops... I missed it somehow. I'll post a new patch.

Quoted 35 lines

-----Original Message-----
From: Joe Perches [mailto:joe at perches.com]
Sent: Friday, June 06, 2014 9:53 AM
To: Vidya Sagar
Cc: linux at arm.linux.org.uk; bhelgaas at google.com;
wangyijing at huawei.com; thierry.reding at gmail.com;
jason at lakedaemon.net; will.deacon at arm.com; Stephen Warren; Krishna Thota; sagar.tv at gmail.com; linux-arm-kernel at lists.infradead.org; linux- kernel at vger.kernel.org
Subject: Re: [PATCH v2] ARM: fix debug prints relevant to PCI devices

Quoted 1 line · Vidya Sagar

* replaced printk with pr_info

[]

arch/arm/kernel/bios32.c

Quoted 1 line
arch/arm/kernel/bios32.c +0 -0

[]

arch/arm/kernel/bios32.c void pcibios_fixup_bus(struct pci_bus *bus) · line 358

Quoted 7 lines
arch/arm/kernel/bios32.c +1 -1
@@ -354,9 +357,11 @@ void pcibios_fixup_bus(struct pci_bus *bus)
 
 	/*
 	 * Report what we did for this bus
+	 * (only if the bus doesn't have even one PCIe device)
 	 */
-	printk(KERN_INFO "PCI: bus%d: Fast back to back transfers

%sabled\n",

arch/arm/kernel/bios32.c void pcibios_fixup_bus(struct pci_bus *bus) · line 359

Quoted 1 line
arch/arm/kernel/bios32.c +0 -1
-		bus->number, (features & PCI_COMMAND_FAST_BACK) ?

"en" : "dis");

arch/arm/kernel/bios32.c void pcibios_fixup_bus(struct pci_bus *bus) · line 363

Quoted 2 lines
arch/arm/kernel/bios32.c +2 -0
+	if (!has_pcie_dev)
+		pr_info(KERN_INFO "PCI: bus%d: Fast back to back transfers

%sabled\n",

arch/arm/kernel/bios32.c void pcibios_fixup_bus(struct pci_bus *bus) · line 364

Quoted 1 line
arch/arm/kernel/bios32.c +1 -0
+			bus->number, (features &

PCI_COMMAND_FAST_BACK) ? "en" : "dis");

when you convert to pr_<level> you need to remove the KERN_<LEVEL> from the format string too.