From patchwork Sun Aug 18 08:55:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 1148823 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46B9sz55Fxz9s3Z for ; Sun, 18 Aug 2019 18:57:11 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6DB18C21CB6; Sun, 18 Aug 2019 08:55:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6758AC21CB6; Sun, 18 Aug 2019 08:55:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2D6DEC21C4A; Sun, 18 Aug 2019 08:55:35 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 8E0CAC21C4A for ; Sun, 18 Aug 2019 08:55:34 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 94A3CB0E2; Sun, 18 Aug 2019 08:55:33 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Sun, 18 Aug 2019 10:55:24 +0200 Message-Id: X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Cc: Marek Vasut , Andre Przywara , Joe Hershberger , Sven Schwermer , York Sun , Michal Suchanek , Chris Packham Subject: [U-Boot] [PATCH v5 1/5] usb_kdb: only process events successfully received X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Causes unbound key repeat on error otherwise. Signed-off-by: Michal Suchanek --- v2: fix indentation v4: fix ! condition to >= 0 v5: fix commit message typo --- common/usb_kbd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 387373746147..e0c1e6d2b796 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -340,10 +340,9 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev) struct usb_kbd_pdata *data = dev->privptr; /* Submit a interrupt transfer request */ - usb_submit_int_msg(dev, data->intpipe, &data->new[0], data->intpktsize, - data->intinterval); - - usb_kbd_irq_worker(dev); + if (usb_submit_int_msg(dev, data->intpipe, &data->new[0], + data->intpktsize, data->intinterval) >= 0) + usb_kbd_irq_worker(dev); #elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) || \ defined(CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE) #if defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP)