Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527086pxf; Mon, 15 Mar 2021 11:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuxUpDCbSMByc14Qwqd5WPTXOmH0wonaZrUtx/7Hxuhj5ev2QuUo/4jYsNWUFWVglu3Xa7 X-Received: by 2002:aa7:c497:: with SMTP id m23mr31344262edq.74.1615833130385; Mon, 15 Mar 2021 11:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833130; cv=none; d=google.com; s=arc-20160816; b=vxilSQkR5FnwheWd0MbZ4BCakmPo4SGbMwdSNbeHC+zZnRlz8eUbFvcPQKbkw7Uc8Y umjR7Qkdl6jExKMVU+0cwEQAGn7WHkCKZlk9T6MWAsfhieBSW3Mij90YDLn2vrfEgFAq L3F2H5MiPYr70lC5UEpIrsBogQlTPQWp9R2/HyIcgwhYw4l3aoHewdC8YwGn8fTmnWwb BwXmX6dA3guRy+N2p/Q2Dawwcx93peFK0n9baMajHX5UBiQb4wiCG7R30MpIikQNkVhR NzQRMUmBw673XAhD/PeecotpoWVtc/0IrGiK+jkapikKvMhVHAwGyfE+wyty4cWVYyCC 6jiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Db4EiiXFmsUMcpwm1PhNBXD6X3tGra4tZyMXnZHAq2w=; b=M38jXtIyYOd2gqHb/LjJKeeTrRLPXeNOSLY+gWyrlQ0tLxdlKhyViD7vhF5ohMIFZ4 3ANwWR0tm2YkQlrYqJJ6GALwYXH/I03ly0pzmvdkytv+yj4QhBg2o9o1byP6mxo5VpCN T/KGywxeHGhmRZoBQBVIhzPOXGSWt2kRWfauhASt19CulGJY4KNlvKvREVmGKDrT5Wc8 fGNcKxeVDCyUSdicB0Jv2dXFD2M4u190zCZJKrNJPhCojv2k6utMfAU50IAkgEGFzJao CO+IJFSjXCcOYURop+9r3nSie7qUMzHZ0EJvMtweGBVKGcjWQNI1iqPqY6IYlPcw/dmt dYmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t+X+SrUE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si12089406ejf.242.2021.03.15.11.31.48; Mon, 15 Mar 2021 11:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t+X+SrUE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237433AbhCOOky (ORCPT + 99 others); Mon, 15 Mar 2021 10:40:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:48798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233567AbhCOOCF (ORCPT ); Mon, 15 Mar 2021 10:02:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AFDE064F0B; Mon, 15 Mar 2021 14:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816922; bh=GmxJ3oFJGKuwbkAxXweIFedbjp1KTNuSELERd50QxTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t+X+SrUED5n6vETxOpjtZDaaT9N5cPYfrGW6nORMQNkyCMGA5YJXxotIrodV/sNQ2 vy7XBYdCIuX3GDzinixUxDgLG+8cu/tvEVnuEKoFrEFZKTyWPVtSkIAkunQzcWi2Vr 0GyzAnR4ekLE9F89v/0OyBY1hyVa/VcCZsgz7ClQ= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bernhard , Stanislaw Gruszka , Mathias Nyman Subject: [PATCH 5.11 204/306] usb: xhci: do not perform Soft Retry for some xHCI hosts Date: Mon, 15 Mar 2021 14:54:27 +0100 Message-Id: <20210315135514.529350771@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Stanislaw Gruszka commit a4a251f8c23518899d2078c320cf9ce2fa459c9f upstream. On some systems rt2800usb and mt7601u devices are unable to operate since commit f8f80be501aa ("xhci: Use soft retry to recover faster from transaction errors") Seems that some xHCI controllers can not perform Soft Retry correctly, affecting those devices. To avoid the problem add xhci->quirks flag that restore pre soft retry xhci behaviour for affected xHCI controllers. Currently those are AMD_PROMONTORYA_4 and AMD_PROMONTORYA_2, since it was confirmed by the users: on those xHCI hosts issue happen and is gone after disabling Soft Retry. [minor commit message rewording for checkpatch -Mathias] Fixes: f8f80be501aa ("xhci: Use soft retry to recover faster from transaction errors") Cc: # 4.20+ Reported-by: Bernhard Tested-by: Bernhard Signed-off-by: Stanislaw Gruszka Signed-off-by: Mathias Nyman Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202541 Link: https://lore.kernel.org/r/20210311115353.2137560-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-pci.c | 5 +++++ drivers/usb/host/xhci-ring.c | 3 ++- drivers/usb/host/xhci.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -295,6 +295,11 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x9026) xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT; + if (pdev->vendor == PCI_VENDOR_ID_AMD && + (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2 || + pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4)) + xhci->quirks |= XHCI_NO_SOFT_RETRY; + if (xhci->quirks & XHCI_RESET_ON_RESUME) xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, "QUIRK: Resetting on resume"); --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2307,7 +2307,8 @@ static int process_bulk_intr_td(struct x remaining = 0; break; case COMP_USB_TRANSACTION_ERROR: - if ((ep_ring->err_count++ > MAX_SOFT_RETRY) || + if (xhci->quirks & XHCI_NO_SOFT_RETRY || + (ep_ring->err_count++ > MAX_SOFT_RETRY) || le32_to_cpu(slot_ctx->tt_info) & TT_SLOT) break; *status = 0; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1883,6 +1883,7 @@ struct xhci_hcd { #define XHCI_SKIP_PHY_INIT BIT_ULL(37) #define XHCI_DISABLE_SPARSE BIT_ULL(38) #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) +#define XHCI_NO_SOFT_RETRY BIT_ULL(40) unsigned int num_active_eps; unsigned int limit_active_eps;