qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] ehci: fix Interrupt Threshold Control implementation
Date: Wed, 15 Aug 2012 14:57:22 +0200	[thread overview]
Message-ID: <502B9CB2.7050409@redhat.com> (raw)
In-Reply-To: <1345032008-29365-1-git-send-email-kraxel@redhat.com>

Hi,

On 08/15/2012 02:00 PM, Gerd Hoffmann wrote:
> First, not all interrupts are subject to Interrupt Threshold Control,
> some of them must be delivered without delay.
>
> Second, Interrupt Threshold Control state must be part of vmstate,
> otherwise we might loose IRQs on migration.

Looks good except for 2 things:

1) For some reason it does not fix my redirected usb mass storage device not
seen until lsusb issue, I will investigate this further
2) Does not apply cleanly to master, there is no vmstate_ehci.pre_seave
in master

Regards,

Hans



>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>   hw/usb/hcd-ehci.c |   12 ++++++++++--
>   1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
> index 2eeef29..b78bf44 100644
> --- a/hw/usb/hcd-ehci.c
> +++ b/hw/usb/hcd-ehci.c
> @@ -576,7 +576,12 @@ static inline void ehci_update_irq(EHCIState *s)
>   /* flag interrupt condition */
>   static inline void ehci_raise_irq(EHCIState *s, int intr)
>   {
> -    s->usbsts_pending |= intr;
> +    if (intr & (USBSTS_PCD | USBSTS_FLR | USBSTS_HSE)) {
> +        s->usbsts |= intr;
> +        ehci_update_irq(s);
> +    } else {
> +        s->usbsts_pending |= intr;
> +    }
>   }
>
>   /*
> @@ -2480,7 +2485,8 @@ static int usb_ehci_post_load(void *opaque, int version_id)
>
>   static const VMStateDescription vmstate_ehci = {
>       .name        = "ehci",
> -    .version_id  = 1,
> +    .version_id  = 2,
> +    .minimum_version_id  = 1,
>       .pre_save    = usb_ehci_pre_save,
>       .post_load   = usb_ehci_post_load,
>       .fields      = (VMStateField[]) {
> @@ -2488,6 +2494,8 @@ static const VMStateDescription vmstate_ehci = {
>           /* mmio registers */
>           VMSTATE_UINT32(usbcmd, EHCIState),
>           VMSTATE_UINT32(usbsts, EHCIState),
> +        VMSTATE_UINT32_V(usbsts_pending, EHCIState, 2),
> +        VMSTATE_UINT32_V(usbsts_frindex, EHCIState, 2),
>           VMSTATE_UINT32(usbintr, EHCIState),
>           VMSTATE_UINT32(frindex, EHCIState),
>           VMSTATE_UINT32(ctrldssegment, EHCIState),
>

      reply	other threads:[~2012-08-15 12:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15 12:00 [Qemu-devel] [PATCH] ehci: fix Interrupt Threshold Control implementation Gerd Hoffmann
2012-08-15 12:57 ` Hans de Goede [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=502B9CB2.7050409@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).