Received: by 10.223.185.116 with SMTP id b49csp6372672wrg; Wed, 28 Feb 2018 08:20:35 -0800 (PST) X-Google-Smtp-Source: AH8x225Q9Ox9tzSen4QVG5SOoggXtRubIxxxIb3fRXVCcEBy+/mnQ2nl535yfjg0gRRCIv3afSXo X-Received: by 10.99.109.79 with SMTP id i76mr14162979pgc.402.1519834835118; Wed, 28 Feb 2018 08:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519834835; cv=none; d=google.com; s=arc-20160816; b=z9HX4iCq1OM0ht5ka/q2GnWBL0L+CvzPbmnsBOF4FuyZ0W0CZR+d1tjOpHKfKAd0n0 SuKCOU41oXAPsIv4mvhPv/z5urLmuD83iXJrfldUNwD6ZQHlquZatxIjw2ylGZd4nqUI 5u8ln1RnHmmGuwWDWNt1u/boIsCC7f9iMVS9gH9nkmlKizG/9IQL4Ueiu7arDe7pZxFG lpZru0A50hqu5D5yHH5vn1TX8l9tvf2aIN8dhkcV0nyCDS7qulajA99DQmP5wfRU8fDI IMJTeP8mFrywE9VHDL3YlixO80VVlXVWucAWfBWtQNMqxLvKQChjbtDAhK+hWMKOu0Gg sc8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=UM7BHowCip/1HYZrkyTNwaEkO+LQI/D5DyUenLim6r0=; b=QSsBKhoHWp4v/OvW8BRVYbJE8B5E5qQ+HZC9IHu8kXH0EmWoDJKS/b1xO20GndeUt5 b5+0Z3cEmyhZdEiREVlotVmtp96gwk0ArjGULXgb+YIAZcvbtsyORXwoRjYEZRzx7xs+ KgqJ228Xm3E1Un42TOd78hkPzYkcxy7TMs5l6/rn93EGNqRoL9mzRBO5T4+Th6lWo5cH Mp2hI0l3BovgwkAl/3c6wnbzxMHfjOYaOeKupIeZw66ZVPJkk/7r+6G2YFCNKmF39wxy 65gndElMAKMfP23R5e3BB+iWLDJ5IW+uYq8rMX8Sj/plb4opvROBOiKQMUiwbutXgDL6 GUsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z96-v6si1511421plh.35.2018.02.28.08.20.20; Wed, 28 Feb 2018 08:20:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935033AbeB1QR7 (ORCPT + 99 others); Wed, 28 Feb 2018 11:17:59 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35273 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932298AbeB1QR5 (ORCPT ); Wed, 28 Feb 2018 11:17:57 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yu-0006Xi-DJ; Wed, 28 Feb 2018 15:22:32 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Ye-0008Q4-7T; Wed, 28 Feb 2018 15:22:16 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Mathias Nyman" , "Greg Kroah-Hartman" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 046/254] xhci: Don't show incorrect WARN message about events for empty rings In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Mathias Nyman commit e4ec40ec4b260efcca15089de4285a0a3411259b upstream. xHC can generate two events for a short transfer if the short TRB and last TRB in the TD are not the same TRB. The driver will handle the TD after the first short event, and remove it from its internal list. Driver then incorrectly prints a warning for the second event: "WARN Event TRB for slot x ep y with no TDs queued" Fix this by not printing a warning if we get a event on a empty list if the previous event was a short event. Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- drivers/usb/host/xhci-ring.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2442,12 +2442,16 @@ static int handle_tx_event(struct xhci_h */ if (list_empty(&ep_ring->td_list)) { /* - * A stopped endpoint may generate an extra completion - * event if the device was suspended. Don't print - * warnings. + * Don't print wanings if it's due to a stopped endpoint + * generating an extra completion event if the device + * was suspended. Or, a event for the last TRB of a + * short TD we already got a short event for. + * The short TD is already removed from the TD list. */ + if (!(trb_comp_code == COMP_STOP || - trb_comp_code == COMP_STOP_INVAL)) { + trb_comp_code == COMP_STOP_INVAL || + ep_ring->last_td_was_short)) { xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n", TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), ep_index);