From: Igor Mammedov Date: Wed, 21 Mar 2012 14:08:38 +0000 (+0100) Subject: xen: initialize platform-pci even if xen_emul_unplug=never X-Git-Tag: upstream/snapshot3+hdmi~7550^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9136d207f0c05c96c6b9c980fa7f7fd541a65a8;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git xen: initialize platform-pci even if xen_emul_unplug=never When xen_emul_unplug=never is specified on kernel command line reading files from /sys/hypervisor is broken (returns -EBUSY). It is caused by xen_bus dependency on platform-pci and platform-pci isn't initialized when xen_emul_unplug=never is specified. Fix it by allowing platform-pci to ignore xen_emul_unplug=never, and do not intialize xen_[blk|net]front instead. Signed-off-by: Igor Mammedov Acked-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 9fd3ee2..4276ab0 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1452,6 +1452,9 @@ static int __init xlblk_init(void) if (!xen_domain()) return -ENODEV; + if (!xen_platform_pci_unplug) + return -ENODEV; + if (register_blkdev(XENVBD_MAJOR, DEV_NAME)) { printk(KERN_WARNING "xen_blk: can't get major %d with name %s\n", XENVBD_MAJOR, DEV_NAME); diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index fa67905..8cc0914 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -1956,6 +1957,9 @@ static int __init netif_init(void) if (xen_initial_domain()) return 0; + if (!xen_platform_pci_unplug) + return -ENODEV; + printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); return xenbus_register_frontend(&netfront_driver); diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c index 319dd0a..2389e58 100644 --- a/drivers/xen/platform-pci.c +++ b/drivers/xen/platform-pci.c @@ -186,11 +186,6 @@ static struct pci_driver platform_driver = { static int __init platform_pci_module_init(void) { - /* no unplug has been done, IGNORE hasn't been specified: just - * return now */ - if (!xen_platform_pci_unplug) - return -ENODEV; - return pci_register_driver(&platform_driver); }