Commit ada8b675 authored by Lorenzo Pieralisi's avatar Lorenzo Pieralisi Committed by Bjorn Helgaas
Browse files

ARM/PCI: Replace panic with WARN messages on failures



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: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarJingoo Han <jingoohan1@gmail.com>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: Marc Zyngier <marc.zyngier@arm.com>
parent aa4a5c0d
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -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++) {
	for (nr = busnr = 0; nr < hw->nr_controllers; nr++) {
		sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
		sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
		if (!sys)
		if (WARN(!sys, "PCI: unable to allocate sys data!"))
			panic("PCI: unable to allocate sys data!");
			break;


#ifdef CONFIG_PCI_MSI
#ifdef CONFIG_PCI_MSI
		sys->msi_ctrl = hw->msi_ctrl;
		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,
				sys->bus = pci_scan_root_bus(parent, sys->busnr,
						hw->ops, sys, &sys->resources);
						hw->ops, sys, &sys->resources);


			if (!sys->bus)
			if (WARN(!sys->bus, "PCI: unable to scan bus!")) {
				panic("PCI: unable to scan bus!");
				kfree(sys);
				break;
			}


			busnr = sys->bus->busn_res.end + 1;
			busnr = sys->bus->busn_res.end + 1;