From nobody Tue May 21 09:53:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553158854409918.3723800767884; Thu, 21 Mar 2019 02:00:54 -0700 (PDT) Received: from localhost ([127.0.0.1]:33509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6tZ7-0002y9-P7 for importer@patchew.org; Thu, 21 Mar 2019 05:00:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6tY9-0002V1-35 for qemu-devel@nongnu.org; Thu, 21 Mar 2019 04:59:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6tY8-0002Ov-4A for qemu-devel@nongnu.org; Thu, 21 Mar 2019 04:59:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43594) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6tY7-0002Jp-QF for qemu-devel@nongnu.org; Thu, 21 Mar 2019 04:59:44 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F39143082AF0 for ; Thu, 21 Mar 2019 08:52:16 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF7C019C57; Thu, 21 Mar 2019 08:52:13 +0000 (UTC) From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 21 Mar 2019 09:52:12 +0100 Message-Id: <20190321085212.10796-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 21 Mar 2019 08:52:17 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] ohci: don't die on ED_LINK_LIMIT overflow X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Stop processing the descriptor list instead. The next frame timer tick will resume the work Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1686705 Suggested-by: Gerd Hoffmann Signed-off-by: Laurent Vivier --- hw/usb/hcd-ohci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 196a9f72002d..81cf5ab7a5a7 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -1200,7 +1200,7 @@ static int ohci_service_ed_list(OHCIState *ohci, uint= 32_t head, int completion) if (head =3D=3D 0) return 0; =20 - for (cur =3D head; cur; cur =3D next_ed) { + for (cur =3D head; cur && link_cnt++ < ED_LINK_LIMIT; cur =3D next_ed)= { if (ohci_read_ed(ohci, cur, &ed)) { trace_usb_ohci_ed_read_error(cur); ohci_die(ohci); @@ -1209,11 +1209,6 @@ static int ohci_service_ed_list(OHCIState *ohci, uin= t32_t head, int completion) =20 next_ed =3D ed.next & OHCI_DPTR_MASK; =20 - if (++link_cnt > ED_LINK_LIMIT) { - ohci_die(ohci); - return 0; - } - if ((ed.head & OHCI_ED_H) || (ed.flags & OHCI_ED_K)) { uint32_t addr; /* Cancel pending packets for ED that have been paused. */ --=20 2.20.1