diff mbox

ehci: remove hack

Message ID 1334659467-6548-1-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann April 17, 2012, 10:44 a.m. UTC
To answer the question in the comment removed by this patch:  I think
this was needed because several places in the ehci emulation did not
check the T bit of link entries correctly and thus might have followed
invalid references.  See commit 2a5ff735dc1074171a0cbb1dc228d6d6e907f571
---
 hw/usb/hcd-ehci.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

Comments

Kevin Wolf April 17, 2012, 10:54 a.m. UTC | #1
Am 17.04.2012 12:44, schrieb Gerd Hoffmann:
> To answer the question in the comment removed by this patch:  I think
> this was needed because several places in the ehci emulation did not
> check the T bit of link entries correctly and thus might have followed
> invalid references.  See commit 2a5ff735dc1074171a0cbb1dc228d6d6e907f571
> ---
>  hw/usb/hcd-ehci.c |   16 ----------------
>  1 files changed, 0 insertions(+), 16 deletions(-)

Missing SoB?

Kevin
Hans de Goede April 17, 2012, 12:30 p.m. UTC | #2
Hi,

On 04/17/2012 12:44 PM, Gerd Hoffmann wrote:
> To answer the question in the comment removed by this patch:  I think
> this was needed because several places in the ehci emulation did not
> check the T bit of link entries correctly and thus might have followed
> invalid references.  See commit 2a5ff735dc1074171a0cbb1dc228d6d6e907f571
> ---
>   hw/usb/hcd-ehci.c |   16 ----------------
>   1 files changed, 0 insertions(+), 16 deletions(-)
>
> diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
> index 23631a4..f42fdc5 100644
> --- a/hw/usb/hcd-ehci.c
> +++ b/hw/usb/hcd-ehci.c
> @@ -133,7 +133,6 @@
>   #define NB_MAXINTRATE    8        // Max rate at which controller issues ints
>   #define NB_PORTS         6        // Number of downstream ports
>   #define BUFF_SIZE        5*4096   // Max bytes to transfer per transaction
> -#define MAX_ITERATIONS   20       // Max number of QH before we break the loop
>   #define MAX_QH           100      // Max allowable queue heads in a chain
>
>   /*  Internal periodic / asynchronous schedule state machine states
> @@ -1934,21 +1933,6 @@ static void ehci_advance_state(EHCIState *ehci,
>       int iter = 0;
>

         ^^^^^^^^^
You probably want to remove the declaration of iter as well. Other then that ACK.

>       do {
> -        if (ehci_get_state(ehci, async) == EST_FETCHQH) {
> -            iter++;
> -            /* if we are roaming a lot of QH without executing a qTD
> -             * something is wrong with the linked list. TO-DO: why is
> -             * this hack needed?
> -             */
> -            assert(iter<  MAX_ITERATIONS);
> -#if 0
> -            if (iter>  MAX_ITERATIONS) {
> -                DPRINTF("\n*** advance_state: bailing on MAX ITERATIONS***\n");
> -                ehci_set_state(ehci, async, EST_ACTIVE);
> -                break;
> -            }
> -#endif
> -        }
>           switch(ehci_get_state(ehci, async)) {
>           case EST_WAITLISTHEAD:
>               again = ehci_state_waitlisthead(ehci, async);

Regards,

Hans
diff mbox

Patch

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 23631a4..f42fdc5 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -133,7 +133,6 @@ 
 #define NB_MAXINTRATE    8        // Max rate at which controller issues ints
 #define NB_PORTS         6        // Number of downstream ports
 #define BUFF_SIZE        5*4096   // Max bytes to transfer per transaction
-#define MAX_ITERATIONS   20       // Max number of QH before we break the loop
 #define MAX_QH           100      // Max allowable queue heads in a chain
 
 /*  Internal periodic / asynchronous schedule state machine states
@@ -1934,21 +1933,6 @@  static void ehci_advance_state(EHCIState *ehci,
     int iter = 0;
 
     do {
-        if (ehci_get_state(ehci, async) == EST_FETCHQH) {
-            iter++;
-            /* if we are roaming a lot of QH without executing a qTD
-             * something is wrong with the linked list. TO-DO: why is
-             * this hack needed?
-             */
-            assert(iter < MAX_ITERATIONS);
-#if 0
-            if (iter > MAX_ITERATIONS) {
-                DPRINTF("\n*** advance_state: bailing on MAX ITERATIONS***\n");
-                ehci_set_state(ehci, async, EST_ACTIVE);
-                break;
-            }
-#endif
-        }
         switch(ehci_get_state(ehci, async)) {
         case EST_WAITLISTHEAD:
             again = ehci_state_waitlisthead(ehci, async);