qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <daahern@cisco.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 13/31] usb-ehci: drop EXECUTING checks.
Date: Mon, 06 Jun 2011 07:34:56 -0600	[thread overview]
Message-ID: <4DECD780.5020807@cisco.com> (raw)
In-Reply-To: <1307363962-27223-14-git-send-email-kraxel@redhat.com>

On 06/06/2011 06:39 AM, Gerd Hoffmann wrote:
> The state machine doesn't stop in EXECUTING state any more when async
> packets are in flight, so the checks are not needed any more and can
> be dropped.
> 
> Also kick out the check for the frame timer.  As we don't stop & sleep
> any more on async packets this is obsolete.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/usb-ehci.c |   32 ++------------------------------
>  1 files changed, 2 insertions(+), 30 deletions(-)
> 
> diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
> index e345a1c..8b1ae3a 100644
> --- a/hw/usb-ehci.c
> +++ b/hw/usb-ehci.c
> @@ -1437,17 +1437,6 @@ static int ehci_state_fetchentry(EHCIState *ehci, int async)
>      int again = 0;
>      uint32_t entry = ehci_get_fetch_addr(ehci, async);
>  
> -#if EHCI_DEBUG == 0
> -    if (qemu_get_clock_ns(vm_clock) / 1000 >= ehci->frame_end_usec) {
> -        if (async) {
> -            DPRINTF("FETCHENTRY: FRAME timer elapsed, exit state machine\n");
> -            goto out;
> -        } else {
> -            DPRINTF("FETCHENTRY: WARNING "
> -                    "- frame timer elapsed during periodic\n");
> -        }
> -    }
> -#endif
>      if (entry < 0x1000) {
>          DPRINTF("fetchentry: entry invalid (0x%08x)\n", entry);
>          ehci_set_state(ehci, async, EST_ACTIVE);
> @@ -1952,12 +1941,6 @@ static void ehci_advance_async_state(EHCIState *ehci)
>          }
>  
>          ehci_set_state(ehci, async, EST_WAITLISTHEAD);
> -        /* fall through */
> -
> -    case EST_FETCHENTRY:
> -        /* fall through */

Why drop this case too? As I recall that is needed for proper execution.

David

> -
> -    case EST_EXECUTING:
>          ehci_advance_state(ehci, async);
>          break;
>  
> @@ -2010,11 +1993,6 @@ static void ehci_advance_periodic_state(EHCIState *ehci)
>          ehci_advance_state(ehci, async);
>          break;
>  
> -    case EST_EXECUTING:
> -        DPRINTF("PERIODIC state adv for executing\n");
> -        ehci_advance_state(ehci, async);
> -        break;
> -
>      default:
>          /* this should only be due to a developer mistake */
>          fprintf(stderr, "ehci: Bad periodic state %d. "
> @@ -2063,11 +2041,7 @@ static void ehci_frame_timer(void *opaque)
>          if (frames - i > 10) {
>              skipped_frames++;
>          } else {
> -            // TODO could this cause periodic frames to get skipped if async
> -            // active?
> -            if (ehci_get_state(ehci, 1) != EST_EXECUTING) {
> -                ehci_advance_periodic_state(ehci);
> -            }
> +            ehci_advance_periodic_state(ehci);
>          }
>  
>          ehci->last_run_usec += FRAME_TIMER_USEC;
> @@ -2082,9 +2056,7 @@ static void ehci_frame_timer(void *opaque)
>      /*  Async is not inside loop since it executes everything it can once
>       *  called
>       */
> -    if (ehci_get_state(ehci, 0) != EST_EXECUTING) {
> -        ehci_advance_async_state(ehci);
> -    }
> +    ehci_advance_async_state(ehci);
>  
>      qemu_mod_timer(ehci->frame_timer, expire_time);
>  }

  reply	other threads:[~2011-06-06 13:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 12:38 [Qemu-devel] [PATCH 00/31] usb patch queue Gerd Hoffmann
2011-06-06 12:38 ` [Qemu-devel] [PATCH 01/31] usb-linux: catch ENODEV in more places Gerd Hoffmann
2011-06-06 12:38 ` [Qemu-devel] [PATCH 02/31] usb-ehci: trace mmio and usbsts Gerd Hoffmann
2011-06-06 12:38 ` [Qemu-devel] [PATCH 03/31] usb-ehci: trace state machine changes Gerd Hoffmann
2011-06-06 12:38 ` [Qemu-devel] [PATCH 04/31] usb-ehci: trace port state Gerd Hoffmann
2011-06-06 12:38 ` [Qemu-devel] [PATCH 05/31] usb-ehci: improve mmio tracing Gerd Hoffmann
2011-06-06 12:38 ` [Qemu-devel] [PATCH 06/31] usb-ehci: trace buffer copy Gerd Hoffmann
2011-06-06 12:38 ` [Qemu-devel] [PATCH 07/31] usb-ehci: add queue data struct Gerd Hoffmann
2011-06-06 12:38 ` [Qemu-devel] [PATCH 08/31] usb-ehci: multiqueue support Gerd Hoffmann
2011-06-06 14:50   ` David Ahern
2011-06-07  7:30     ` Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 09/31] usb-ehci: fix offset writeback in ehci_buffer_rw Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 10/31] usb-ehci: fix error handling Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 11/31] ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6) Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 12/31] usb: cancel async packets on unplug Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 13/31] usb-ehci: drop EXECUTING checks Gerd Hoffmann
2011-06-06 13:34   ` David Ahern [this message]
2011-06-06 13:57     ` David Ahern
2011-06-06 14:25       ` Gerd Hoffmann
2011-06-06 14:51         ` David Ahern
2011-06-06 12:39 ` [Qemu-devel] [PATCH 14/31] Fix USB mouse Set_Protocol behavior Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 15/31] The USB tablet should not claim boot protocol support Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 16/31] usb-ehci: itd handling fixes Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 17/31] usb-ehci: split trace calls to handle arg count limits Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 18/31] usb: documentation update Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 19/31] usb-linux: Get speed from sysfs rather then from the connectinfo ioctl Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 20/31] usb-linux: Teach about super speed Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 21/31] usb-linux: Don't do perror when errno is not set Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 22/31] usb-linux: Ensure devep != 0 Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 23/31] usb-linux: Don't try to open the same device twice Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 24/31] usb-linux: only cleanup in host_close when host_open was successful Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 25/31] usb: don't call usb_host_device_open from vl.c Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 26/31] usb-linux: Enlarge buffer for descriptors to 8192 bytes Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 27/31] usb-bus: Add knowledge of USB_SPEED_SUPER to usb_speed helper Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 28/31] usb-bus: Don't detach non attached devices on device exit Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 29/31] usb: Add defines for USB Serial Bus Release Number register Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 30/31] usb: Use defines for serial bus release number register for UHCI Gerd Hoffmann
2011-06-06 12:39 ` [Qemu-devel] [PATCH 31/31] usb: Use defines for serial bus release number register for EHCI Gerd Hoffmann

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=4DECD780.5020807@cisco.com \
    --to=daahern@cisco.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).