From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com, JBeulich@novell.com, jeremy@goop.org, ian.campbell@citrix.com, joe@perches.com Cc: Jan Beulich <jbeulich@novell.com>, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Subject: [PATCH 5/6] xen/pci: make bus notifier handler return sane values Date: Fri, 26 Aug 2011 14:44:29 -0400 [thread overview] Message-ID: <1314384270-19850-6-git-send-email-konrad.wilk@oracle.com> (raw) In-Reply-To: <1314384270-19850-1-git-send-email-konrad.wilk@oracle.com> From: Jan Beulich <JBeulich@novell.com> Notifier functions are expected to return NOTIFY_* codes, not -E... ones. In particular, since the respective hypercalls failing is not fatal to the operation of the Dom0 kernel, it must be avoided to return negative values here as those would make it appear as if NOTIFY_STOP_MASK wa set, suppressing further notification calls to other interested parties (which is also why we don't want to use notifier_from_errno() here). While at it, also notify the user of a failed hypercall. Signed-off-by: Jan Beulich <jbeulich@novell.com> [v1: Added dev_err and the disable MSI/MSI-X call] [v2: Removed the disable MSI/MSI-X call] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- drivers/xen/pci.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index cef4baf..02c402b 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c @@ -96,13 +96,16 @@ static int xen_pci_notifier(struct notifier_block *nb, r = xen_remove_device(dev); break; default: - break; + return NOTIFY_DONE; } - - return r; + if (r) + dev_err(dev, "Failed to %s - passthrough or MSI/MSI-X might fail!\n", + action == BUS_NOTIFY_ADD_DEVICE ? "add" : + (action == BUS_NOTIFY_DEL_DEVICE ? "delete" : "?")); + return NOTIFY_OK; } -struct notifier_block device_nb = { +static struct notifier_block device_nb = { .notifier_call = xen_pci_notifier, }; -- 1.7.4.1
WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com, JBeulich@novell.com, jeremy@goop.org, ian.campbell@citrix.com, joe@perches.com Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Subject: [PATCH 5/6] xen/pci: make bus notifier handler return sane values Date: Fri, 26 Aug 2011 14:44:29 -0400 [thread overview] Message-ID: <1314384270-19850-6-git-send-email-konrad.wilk@oracle.com> (raw) In-Reply-To: <1314384270-19850-1-git-send-email-konrad.wilk@oracle.com> From: Jan Beulich <JBeulich@novell.com> Notifier functions are expected to return NOTIFY_* codes, not -E... ones. In particular, since the respective hypercalls failing is not fatal to the operation of the Dom0 kernel, it must be avoided to return negative values here as those would make it appear as if NOTIFY_STOP_MASK wa set, suppressing further notification calls to other interested parties (which is also why we don't want to use notifier_from_errno() here). While at it, also notify the user of a failed hypercall. Signed-off-by: Jan Beulich <jbeulich@novell.com> [v1: Added dev_err and the disable MSI/MSI-X call] [v2: Removed the disable MSI/MSI-X call] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- drivers/xen/pci.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index cef4baf..02c402b 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c @@ -96,13 +96,16 @@ static int xen_pci_notifier(struct notifier_block *nb, r = xen_remove_device(dev); break; default: - break; + return NOTIFY_DONE; } - - return r; + if (r) + dev_err(dev, "Failed to %s - passthrough or MSI/MSI-X might fail!\n", + action == BUS_NOTIFY_ADD_DEVICE ? "add" : + (action == BUS_NOTIFY_DEL_DEVICE ? "delete" : "?")); + return NOTIFY_OK; } -struct notifier_block device_nb = { +static struct notifier_block device_nb = { .notifier_call = xen_pci_notifier, }; -- 1.7.4.1
next prev parent reply other threads:[~2011-08-26 18:44 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-26 18:44 [PATCH v2] Xen PCI and Xen SWIOTLB patches for 3.2 Konrad Rzeszutek Wilk 2011-08-26 18:44 ` [PATCH 1/6] xen-pcifront: Update warning comment to use 'e820_host' option Konrad Rzeszutek Wilk 2011-08-26 18:44 ` Konrad Rzeszutek Wilk 2011-08-26 18:44 ` [PATCH 2/6] xen-swiotlb: Retry up three times to allocate Xen-SWIOTLB Konrad Rzeszutek Wilk 2011-08-26 18:44 ` [PATCH 3/6] xen-swiotlb: Fix wrong panic Konrad Rzeszutek Wilk 2011-08-26 18:44 ` [PATCH 4/6] xen-swiotlb: fix printk and panic args Konrad Rzeszutek Wilk 2011-08-26 18:44 ` Konrad Rzeszutek Wilk [this message] 2011-08-26 18:44 ` [PATCH 5/6] xen/pci: make bus notifier handler return sane values Konrad Rzeszutek Wilk 2011-08-26 18:44 ` [PATCH 6/6] xen-swiotlb: When doing coherent alloc/dealloc check before swizzling the MFNs 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=1314384270-19850-6-git-send-email-konrad.wilk@oracle.com \ --to=konrad.wilk@oracle.com \ --cc=JBeulich@novell.com \ --cc=ian.campbell@citrix.com \ --cc=jeremy@goop.org \ --cc=joe@perches.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: linkBe 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.