All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: xen-devel@lists.xensource.com, Stefano.Stabellini@eu.citrix.com
Subject: Re: [PATCH] xen: initialize platform_pci even if xen_emul_unplug=never
Date: Wed, 21 Mar 2012 13:06:36 -0400	[thread overview]
Message-ID: <20120321170636.GF13722@phenom.dumpdata.com> (raw)
In-Reply-To: <1332338918-5225-1-git-send-email-imammedo@redhat.com>

On Wed, Mar 21, 2012 at 03:08:38PM +0100, Igor Mammedov wrote:
> 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.

Oh, good catch. Thx!
> 
> Fix it by allowing platform_pcii to ignore xen_emul_unplug=never,
> and do not intialize xen_[blk|net]front instead.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  drivers/block/xen-blkfront.c |    3 +++
>  drivers/net/xen-netfront.c   |    4 ++++
>  drivers/xen/platform-pci.c   |    5 -----
>  3 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 2f22874..d5e1ab9 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -1475,6 +1475,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 b161750..663b32c 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -47,6 +47,7 @@
>  #include <xen/xenbus.h>
>  #include <xen/events.h>
>  #include <xen/page.h>
> +#include <xen/platform_pci.h>
>  #include <xen/grant_table.h>
>  
>  #include <xen/interface/io/netif.h>
> @@ -1964,6 +1965,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);
>  }
>  
> -- 
> 1.7.5
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

      parent reply	other threads:[~2012-03-21 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21 14:08 [PATCH] xen: initialize platform_pci even if xen_emul_unplug=never Igor Mammedov
2012-03-21 14:39 ` Stefano Stabellini
2012-03-21 17:06 ` Konrad Rzeszutek Wilk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120321170636.GF13722@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=imammedo@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.