From: Olaf Hering Date: Tue, 10 Jul 2012 13:31:39 +0000 (+0200) Subject: xen: enable platform-pci only in a Xen guest X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=38ad4f4b6cc713b3c42cb4252688ef5c296d7455;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git xen: enable platform-pci only in a Xen guest While debugging kexec issues in a PVonHVM guest I modified xen_hvm_platform() to return false to disable all PV drivers. This caused a crash in platform_pci_init() because it expects certain data structures to be initialized properly. To avoid such a crash make sure the driver is initialized only if running in a Xen guest. Signed-off-by: Olaf Hering Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c index 2389e581e23c..97ca359ae2bd 100644 --- a/drivers/xen/platform-pci.c +++ b/drivers/xen/platform-pci.c @@ -109,6 +109,9 @@ static int __devinit platform_pci_init(struct pci_dev *pdev, long mmio_addr, mmio_len; unsigned int max_nr_gframes; + if (!xen_domain()) + return -ENODEV; + i = pci_enable_device(pdev); if (i) return i;