All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ARM: PCI: bios32: replace panic with WARN messages on failures
@ 2015-07-24 16:13 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 22+ messages in thread
From: Lorenzo Pieralisi @ 2015-07-24 16:13 UTC (permalink / raw)
  To: linux-arm-kernel, linux-pci
  Cc: Lorenzo Pieralisi, Bjorn Helgaas, Russell King, Marc Zyngier,
	James Morse, Gabriele Paoloni, Jayachandran C, Pratyush Anand,
	Arnd Bergmann, Jingoo Han, Simon Horman, Thomas Petazzoni,
	Thierry Reding, Michal Simek

In the ARM PCI bios32 layer, failures to dynamically allocate pci_sys_data
for a PCI bus, or a PCI bus scan failure have to be considered serious
warnings but they should not trigger a system panic so that at least the
system is given a chance to be debugged.

This patch replaces the panic statements with WARN() messages to
improve error reporting in the ARM PCI bios32 layer.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/kernel/bios32.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index fcbbbb1..a5c782c 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -459,8 +459,8 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
 
 	for (nr = busnr = 0; nr < hw->nr_controllers; nr++) {
 		sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
-		if (!sys)
-			panic("PCI: unable to allocate sys data!");
+		if (WARN(!sys, "PCI: unable to allocate sys data!"))
+			break;
 
 #ifdef CONFIG_PCI_MSI
 		sys->msi_ctrl = hw->msi_ctrl;
@@ -489,8 +489,10 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
 				sys->bus = pci_scan_root_bus(parent, sys->busnr,
 						hw->ops, sys, &sys->resources);
 
-			if (!sys->bus)
-				panic("PCI: unable to scan bus!");
+			if (WARN(!sys->bus, "PCI: unable to scan bus!")) {
+				kfree(sys);
+				break;
+			}
 
 			busnr = sys->bus->busn_res.end + 1;
 
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-07-27 11:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-24 16:13 [PATCH v2 1/2] ARM: PCI: bios32: replace panic with WARN messages on failures Lorenzo Pieralisi
2015-07-24 16:13 ` Lorenzo Pieralisi
2015-07-24 16:13 ` [PATCH v2 2/2] ARM: pci: kill pcibios_msi_controller Lorenzo Pieralisi
2015-07-24 16:13   ` Lorenzo Pieralisi
2015-07-26 15:25   ` Jayachandran C.
2015-07-26 18:16     ` Lorenzo Pieralisi
2015-07-26 18:16       ` Lorenzo Pieralisi
2015-07-26 18:43       ` Jayachandran C.
2015-07-26 19:00         ` Lorenzo Pieralisi
2015-07-26 19:00           ` Lorenzo Pieralisi
2015-07-27  7:26         ` Marc Zyngier
2015-07-27  7:26           ` Marc Zyngier
2015-07-26 18:58   ` Russell King - ARM Linux
2015-07-26 18:58     ` Russell King - ARM Linux
2015-07-27  9:40     ` Lorenzo Pieralisi
2015-07-27  9:40       ` Lorenzo Pieralisi
2015-07-27 10:54       ` Russell King - ARM Linux
2015-07-27 10:54         ` Russell King - ARM Linux
2015-07-27 11:09         ` Lorenzo Pieralisi
2015-07-27 11:09           ` Lorenzo Pieralisi
2015-07-24 16:54 ` [PATCH v2 1/2] ARM: PCI: bios32: replace panic with WARN messages on failures Marc Zyngier
2015-07-24 16:54   ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.