From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "Cui, Dexuan" <dexuan.cui@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] [pv-ops] fix dom0 S3 when MSI is used.
Date: Thu, 18 Mar 2010 18:03:15 -0700 [thread overview]
Message-ID: <4BA2CD53.5090109@goop.org> (raw)
In-Reply-To: <ED3036A092A28F4C91B0B4360DD128EABDFB4D46@shzsmsx502.ccr.corp.intel.com>
On 03/17/2010 01:46 AM, Cui, Dexuan wrote:
> The old commit a234848f works only when the device supports D3hot; when the
> device only supports D3cold, the device doesn't work properly after resuming
> from Dom0 S3.
>
What branches should I apply this to? Both 2.6.31 and .32, or just .32?
> A better workaround is invoking the PHYSDEVOP_restore_msi hypercall.
> The patch reverts the old commit and invokes the hypercall.
>
Is this a new hypercall?
Aside from that, it looks fine as a stopgap until we do MSI properly.
Thanks,
J
> Signed-off-by: Dexuan Cui<dexuan.cui@intel.com>
>
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index b40c6d0..c6bffe2 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -20,6 +20,7 @@
> #include<asm/errno.h>
> #include<asm/io.h>
>
> +#include<asm/xen/hypercall.h>
> #include<asm/xen/hypervisor.h>
>
> #include "pci.h"
> @@ -271,8 +272,7 @@ void write_msi_msg(unsigned int irq, struct msi_msg *msg)
> {
> struct irq_desc *desc = irq_to_desc(irq);
>
> - if (!xen_initial_domain())
> - write_msi_msg_desc(desc, msg);
> + write_msi_msg_desc(desc, msg);
> }
>
> static int msi_free_irqs(struct pci_dev* dev);
> @@ -347,6 +347,20 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
>
> void pci_restore_msi_state(struct pci_dev *dev)
> {
> + if (xen_initial_domain()) {
> + struct physdev_restore_msi physdev;
> +
> + if (!dev->msi_enabled&& !dev->msix_enabled)
> + return;
> +
> + pci_intx_for_msi(dev, 0);
> +
> + physdev.bus = dev->bus->number;
> + physdev.devfn = dev->devfn;
> + HYPERVISOR_physdev_op(PHYSDEVOP_restore_msi,&physdev);
> +
> + return;
> + }
> __pci_restore_msi_state(dev);
> __pci_restore_msix_state(dev);
> }
> diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
> index ac5de37..516d2b4 100644
> --- a/include/xen/interface/physdev.h
> +++ b/include/xen/interface/physdev.h
> @@ -144,6 +144,13 @@ struct physdev_manage_pci {
> uint8_t devfn;
> };
>
> +#define PHYSDEVOP_restore_msi 19
> +struct physdev_restore_msi {
> + /* IN */
> + uint8_t bus;
> + uint8_t devfn;
> +};
> +
> #define PHYSDEVOP_manage_pci_add_ext 20
> struct physdev_manage_pci_ext {
> /* IN */
>
next prev parent reply other threads:[~2010-03-19 1:03 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-27 2:26 [Pv-ops][PATCH] Netback multiple tasklet support Xu, Dongxiao
2009-11-27 9:42 ` Ian Campbell
2009-11-27 16:08 ` Xu, Dongxiao
2009-11-27 16:15 ` Ian Pratt
2009-11-27 16:57 ` Xu, Dongxiao
2009-11-28 13:15 ` Ian Pratt
2009-12-02 10:17 ` Xu, Dongxiao
2009-12-03 21:28 ` Jeremy Fitzhardinge
2009-12-04 2:13 ` Xu, Dongxiao
2009-12-04 2:33 ` Jeremy Fitzhardinge
2009-12-08 9:22 ` Xu, Dongxiao
2009-12-09 20:23 ` Jeremy Fitzhardinge
2009-12-10 3:29 ` Xu, Dongxiao
2009-12-10 18:01 ` Jeremy Fitzhardinge
2009-12-11 1:34 ` Xu, Dongxiao
2010-04-26 14:27 ` [Pv-ops][PATCH 0/3] Resend: Netback multiple thread support Xu, Dongxiao
2010-04-27 0:19 ` Konrad Rzeszutek Wilk
2010-04-27 0:40 ` Xu, Dongxiao
2010-04-27 3:02 ` Xu, Dongxiao
2010-04-27 10:49 ` Steven Smith
2010-04-27 18:37 ` Jeremy Fitzhardinge
2010-04-28 9:31 ` Steven Smith
2010-04-28 11:36 ` Xu, Dongxiao
2010-04-28 12:04 ` Steven Smith
2010-04-28 13:33 ` Xu, Dongxiao
2010-04-30 7:35 ` Steven Smith
2010-04-28 10:27 ` Xu, Dongxiao
2010-04-28 11:51 ` Steven Smith
2010-04-28 12:23 ` Xu, Dongxiao
2010-04-28 12:43 ` Jan Beulich
2010-04-30 7:29 ` Steven Smith
2010-04-30 8:27 ` Jan Beulich
2009-12-10 9:07 ` [Pv-ops][PATCH] Netback multiple tasklet support Ian Campbell
2009-12-10 17:54 ` Jeremy Fitzhardinge
2009-12-10 18:07 ` Ian Campbell
2009-12-11 8:34 ` Jan Beulich
2009-12-11 9:34 ` Ian Campbell
2009-12-11 14:24 ` Konrad Rzeszutek Wilk
2010-03-17 8:46 ` [PATCH] [pv-ops] fix dom0 S3 when MSI is used Cui, Dexuan
2010-03-17 14:28 ` Konrad Rzeszutek Wilk
2010-03-18 3:05 ` Cui, Dexuan
2010-03-19 1:04 ` Jeremy Fitzhardinge
2010-03-19 1:03 ` Jeremy Fitzhardinge [this message]
2010-03-19 1:29 ` Cui, Dexuan
2010-01-13 10:17 ` [Pv-ops][PATCH] Netback multiple tasklet support Jan Beulich
2010-01-14 16:55 ` Ian Campbell
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=4BA2CD53.5090109@goop.org \
--to=jeremy@goop.org \
--cc=dexuan.cui@intel.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.