All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH 4/6] [pciback] Register the owner (domain) of the PCI device.
Date: Wed, 09 Dec 2009 13:13:00 -0800	[thread overview]
Message-ID: <4B2012DC.2040404@goop.org> (raw)
In-Reply-To: <1260391901-16685-5-git-send-email-konrad.wilk@oracle.com>

On 12/09/09 12:51, Konrad Rzeszutek Wilk wrote:
> When the front-end and back-end start negotiating we register
> the domain that will use the PCI device. Furthermore during shutdown
> of guest or unbinding of the PCI device (and unloading of module)
> from pciback we unregister the domain owner.
>   Please enter the commit message for your changes. Lines starting
>    
Looks like a stray.

> Signed-off-by: Konrad Rzeszutek Wilk<konrad.wilk@oracle.com>
> ---
>   drivers/xen/pciback/pci_stub.c |    3 +++
>   drivers/xen/pciback/xenbus.c   |   12 ++++++++++++
>   2 files changed, 15 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/xen/pciback/pci_stub.c b/drivers/xen/pciback/pci_stub.c
> index c65c7c1..00018c1 100644
> --- a/drivers/xen/pciback/pci_stub.c
> +++ b/drivers/xen/pciback/pci_stub.c
> @@ -14,6 +14,7 @@
>   #include<linux/wait.h>
>   #include<asm/atomic.h>
>   #include<xen/events.h>
> +#include<asm/xen/pci.h>
>   #include "pciback.h"
>   #include "conf_space.h"
>   #include "conf_space_quirks.h"
> @@ -87,6 +88,8 @@ static void pcistub_device_release(struct kref *kref)
>
>   	dev_dbg(&psdev->dev->dev, "pcistub_device_release\n");
>
> +	unregister_device_owner(psdev->dev);
> +
>   	/* Clean-up the device */
>   	pciback_reset_device(psdev->dev);
>   	pciback_config_free_dyn_fields(psdev->dev);
> diff --git a/drivers/xen/pciback/xenbus.c b/drivers/xen/pciback/xenbus.c
> index efec585..e33a688 100644
> --- a/drivers/xen/pciback/xenbus.c
> +++ b/drivers/xen/pciback/xenbus.c
> @@ -10,6 +10,7 @@
>   #include<linux/workqueue.h>
>   #include<xen/xenbus.h>
>   #include<xen/events.h>
> +#include<asm/xen/pci.h>
>   #include<linux/workqueue.h>
>   #include "pciback.h"
>
> @@ -221,6 +222,14 @@ static int pciback_export_device(struct pciback_device *pdev,
>   	if (err)
>   		goto out;
>
> +	dev_info(&dev->dev, "registering for %d\n", pdev->xdev->otherend_id);
>    
_dbg, to match unregistering message?

> +	if (register_device_owner(dev, pdev->xdev->otherend_id) != 0) {
> +		dev_err(&dev->dev, "device has been assigned to another " \
> +			"domain! Over-writting the ownership, but beware.\n");
> +		unregister_device_owner(dev);
> +		register_device_owner(dev, pdev->xdev->otherend_id);
> +	}
> +
>   	/* TODO: It'd be nice to export a bridge and have all of its children
>   	 * get exported with it. This may be best done in xend (which will
>   	 * have to calculate resource usage anyway) but we probably want to
> @@ -251,6 +260,9 @@ static int pciback_remove_device(struct pciback_device *pdev,
>   		goto out;
>   	}
>
> +	dev_dbg(&dev->dev, "unregistering for %d\n", pdev->xdev->otherend_id);
> +	unregister_device_owner(dev);
> +
>   	pciback_release_pci_dev(pdev, dev);
>
>   out:
>    

  parent reply	other threads:[~2009-12-09 21:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 20:51 [PATCH PCIBACK] Konrad Rzeszutek Wilk
2009-12-09 20:51 ` [PATCH 1/6] Revert "In xen_create_msi_irq, extract the domain id of the MSI device." Konrad Rzeszutek Wilk
2009-12-09 20:51   ` [PATCH 2/6] Provide a mechanism to register domain owner of a PCI device Konrad Rzeszutek Wilk
2009-12-09 20:51     ` [PATCH 3/6] [events] Check if the PCI device is owner by a domain different than DOMID_SELF Konrad Rzeszutek Wilk
2009-12-09 20:51       ` [PATCH 4/6] [pciback] Register the owner (domain) of the PCI device Konrad Rzeszutek Wilk
2009-12-09 20:51         ` [PATCH 5/6] [pciback] Remove the vestiges of CONFIG_PCI_GUESTDEV Konrad Rzeszutek Wilk
2009-12-09 20:51           ` [PATCH 6/6] [pciback] Remove deprecated routine to find domain owner of PCI device Konrad Rzeszutek Wilk
2009-12-09 21:13         ` Jeremy Fitzhardinge [this message]
2009-12-09 21:11     ` [PATCH 2/6] Provide a mechanism to register domain owner of a " Jeremy Fitzhardinge
2009-12-09 21:14 ` [PATCH PCIBACK] Jeremy Fitzhardinge
2009-12-09 22:43   ` Konrad Rzeszutek Wilk
2009-12-09 22:43     ` [PATCH 1/6] Revert "In xen_create_msi_irq, extract the domain id of the MSI device." Konrad Rzeszutek Wilk
2009-12-09 22:43       ` [PATCH 2/6] Provide a mechanism to register domain owner of a PCI device Konrad Rzeszutek Wilk
2009-12-09 22:43         ` [PATCH 3/6] [events] Check if the PCI device is owner by a domain different than DOMID_SELF Konrad Rzeszutek Wilk
2009-12-09 22:43           ` [PATCH 4/6] [pciback] Register the owner (domain) of the PCI device Konrad Rzeszutek Wilk
2009-12-09 22:43             ` [PATCH 5/6] [pciback] Remove the vestiges of CONFIG_PCI_GUESTDEV Konrad Rzeszutek Wilk
2009-12-09 22:43               ` [PATCH 6/6] [pciback] Remove deprecated routine to find domain owner of PCI device Konrad Rzeszutek Wilk
2009-12-09 23:33         ` [PATCH 2/6] Provide a mechanism to register domain owner of a " Jeremy Fitzhardinge
  -- strict thread matches above, loose matches on Subject: below --
2009-12-09 16:29 [PATCH PV_OPS] Konrad Rzeszutek Wilk
2009-12-09 16:29 ` [PATCH 1/6] Revert "In xen_create_msi_irq, extract the domain id of the MSI device." Konrad Rzeszutek Wilk
2009-12-09 16:29   ` [PATCH 2/6] [xen-pci] Provide a mechanism to register domain owner of a PCI device Konrad Rzeszutek Wilk
2009-12-09 16:29     ` [PATCH 3/6] [events] Check if the PCI device is owner by a domain different than DOMID_SELF Konrad Rzeszutek Wilk
2009-12-09 16:29       ` [PATCH 4/6] [pciback] Register the owner (domain) of the PCI device Konrad Rzeszutek Wilk

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=4B2012DC.2040404@goop.org \
    --to=jeremy@goop.org \
    --cc=konrad.wilk@oracle.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.