xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH 5/5] xen/irq: The Xen hypervisor cleans up the PIRQs if the other domain forgot.
Date: Thu, 14 Apr 2011 11:30:14 -0400	[thread overview]
Message-ID: <1302795014-13289-6-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1302795014-13289-1-git-send-email-konrad.wilk@oracle.com>

And if the other domain forgot to clean up its PIRQs we don't need
to fail the operation. Just take a note of it and continue on.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/events.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index e4e8e9a..e51f3c5 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -728,7 +728,14 @@ int xen_destroy_irq(int irq)
 		unmap_irq.pirq = info->u.pirq.pirq;
 		unmap_irq.domid = info->u.pirq.domid;
 		rc = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap_irq);
-		if (rc) {
+		/* If another domain quits without making the pci_disable_msix
+		 * call, the Xen hypervisor takes care of freeing the PIRQs
+		 * (free_domain_pirqs).
+		 */
+		if ((rc == -ESRCH && info->u.pirq.domid != DOMID_SELF))
+			printk(KERN_INFO "domain %d does not have %d anymore\n",
+				info->u.pirq.domid, info->u.pirq.pirq);
+		else if (rc) {
 			printk(KERN_WARNING "unmap irq failed %d\n", rc);
 			goto out;
 		}
-- 
1.7.1

  parent reply	other threads:[~2011-04-14 15:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14 15:30 [PATCH] Provide infrastructure changes for backends (especially pciback) for 2.6.40 Konrad Rzeszutek Wilk
2011-04-14 15:30 ` [PATCH 1/5] xen/pci: Add xen_[find|register|unregister]_device_domain_owner functions Konrad Rzeszutek Wilk
2011-04-14 15:30 ` [PATCH 2/5] xen/irq: Check if the PCI device is owned by a domain different than DOMID_SELF Konrad Rzeszutek Wilk
2011-04-14 15:30 ` [PATCH 3/5] xen/irq: Add support to check if IRQ line is shared with other domains Konrad Rzeszutek Wilk
2011-04-14 15:30 ` [PATCH 4/5] xen/irq: Export 'xen_pirq_from_irq' function Konrad Rzeszutek Wilk
2011-04-14 15:30 ` Konrad Rzeszutek Wilk [this message]
2011-04-18 15:20 ` [PATCH] Provide infrastructure changes for backends (and blkback) for 2.6.40 Konrad Rzeszutek Wilk
2011-04-18 15:20 ` [PATCH] xen/p2m/m2p/gnttab: Support GNTMAP_host_map in the M2P override 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=1302795014-13289-6-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).