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 C89E0C43603 for ; Mon, 16 Dec 2019 18:35:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E77D2082E for ; Mon, 16 Dec 2019 18:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576521334; bh=LmkIYTRoq1puurBJPSSi6hdYB2es2hW23ta6JZXP8dM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GfSlOSugglzaRgrQ1kTRY2iYlF07HiCJGkJMquz7O+cIoMXFDskUuxHxvAkdsLuRv CWPIt9IWDWub3sZheS8U9uUg+RHdUV8rPQztnp4nj6Jc6ObsAjXBqIqYhtMmi0Ze6C cFiVYNwEJ5OAgtEyXl7Urfnz5JUBefhoPUzRrHE0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730377AbfLPSfd (ORCPT ); Mon, 16 Dec 2019 13:35:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:49280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727816AbfLPSH7 (ORCPT ); Mon, 16 Dec 2019 13:07:59 -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 C245D206E0; Mon, 16 Dec 2019 18:07:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519679; bh=LmkIYTRoq1puurBJPSSi6hdYB2es2hW23ta6JZXP8dM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mh2mLwfOb2wJmi8G+YMQDnEqmTVQoW7YvzkcnLXrKNMJR97wlPHhU9sAAT17oKlPQ jEjjVnxGbISc7RgMD3SuGQCI3XfPuAmwZp9TObsQQNX5/w0KlDrqpGEZG6NTWpq7JA t1p2cwxUGnZOCMQ9qPq53ELP9SVR511EgLrN+KD8= 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.3 024/180] xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour. Date: Mon, 16 Dec 2019 18:47:44 +0100 Message-Id: <20191216174811.329785964@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174806.018988360@linuxfoundation.org> References: <20191216174806.018988360@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,