From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B84DCC2D0C3 for ; Mon, 16 Dec 2019 18:15:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F9ED206E0 for ; Mon, 16 Dec 2019 18:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576520146; bh=LmkIYTRoq1puurBJPSSi6hdYB2es2hW23ta6JZXP8dM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UfKfNkk5R4+jYFS7SUMjqeTYXMjaLqpaiNBMsxiV26yOtxYva4W6YB6Nh4P9r4BCl lErODV65YFFZROqrd1rgkliC3o0cESLHp2MW8XsuC9lFT0f/MXCe903tPtpzDq34WH XnrCyn1q/njK6X5dP+cnTp3EBA93ZfDC6//oeHdE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731425AbfLPSPp (ORCPT ); Mon, 16 Dec 2019 13:15:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:37014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731227AbfLPSPk (ORCPT ); Mon, 16 Dec 2019 13:15:40 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70857206EC; Mon, 16 Dec 2019 18:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576520139; bh=LmkIYTRoq1puurBJPSSi6hdYB2es2hW23ta6JZXP8dM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0JhXlgslmnVNsucXbc6sZ9pQSQpw9h5gj+btk7MHgF8+OEjtW7SNd4PusbWk1gqhT 7kPKotzo771YJRNkT3glxMDKSEohDbsSGD//gC5RVIeR6sZI2wUrv+adaS8OTxfdiT E/4iv0nd35GaD7tnXBSR7c+P3JPrHiwUwgb8swP8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eli Billauer , Ard Biesheuvel , Mathias Nyman Subject: [PATCH 5.4 031/177] xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour. Date: Mon, 16 Dec 2019 18:48:07 +0100 Message-Id: <20191216174824.601464541@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174811.158424118@linuxfoundation.org> References: <20191216174811.158424118@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathias Nyman commit 7ff11162808cc2ec66353fc012c58bb449c892c3 upstream. xhci driver claims it needs XHCI_TRUST_TX_LENGTH quirk for both Broadcom/Cavium and a Renesas xHC controllers. The quirk was inteded for handling false "success" complete event for transfers that had data left untransferred. These transfers should complete with "short packet" events instead. In these two new cases the false "success" completion is reported after a "short packet" if the TD consists of several TRBs. xHCI specs 4.10.1.1.2 say remaining TRBs should report "short packet" as well after the first short packet in a TD, but this issue seems so common it doesn't make sense to add the quirk for all vendors. Turn these events into short packets automatically instead. This gets rid of the "The WARN Successful completion on short TX for slot 1 ep 1: needs XHCI_TRUST_TX_LENGTH quirk" warning in many cases. Cc: Reported-by: Eli Billauer Reported-by: Ard Biesheuvel Tested-by: Eli Billauer Tested-by: Ard Biesheuvel Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20191211142007.8847-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-ring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2377,7 +2377,8 @@ static int handle_tx_event(struct xhci_h case COMP_SUCCESS: if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) break; - if (xhci->quirks & XHCI_TRUST_TX_LENGTH) + if (xhci->quirks & XHCI_TRUST_TX_LENGTH || + ep_ring->last_td_was_short) trb_comp_code = COMP_SHORT_PACKET; else xhci_warn_ratelimited(xhci,