Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2239201ybb; Fri, 27 Mar 2020 01:36:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt0oPhXgN+mZkbvQl47EB32MAXQf2YpwEbuvW0dXXS2ma61QNq/GY7Wk026GfOjjoFq3im1 X-Received: by 2002:a4a:8041:: with SMTP id y1mr7483634oof.65.1585298160794; Fri, 27 Mar 2020 01:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585298160; cv=none; d=google.com; s=arc-20160816; b=syIJO0ZUu5w71fKKbVdHbEfd5VedLF3evmqILXpORBsfyucVlzXdfwTpASFSAhoUTO L4f2dqqH6GQdpbIMA4KPZ8J36CDZWHoxBPirRfUASq08cp6o7BR2b6PrMHbBqH+XIukP EYIf8L1XLOqUeB30fCBqcgAFXaVMEsGUvFhj256+x454u1KYOIdF6cwhw4ALC5hpB7QN j7UsKUY9EfPmvfGmWYZ9ZEMuNYe73duM2h3jgdAjupngChgIdoEbZWcv7dAhqr9pGW8G 6HEkm2jSSZEn74aU6uKeJKYKT8skUrObHPcAkg6QgGzx77oO61SnBjZIUESrIntZASqS uxZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:from:references:in-reply-to :message-id:date:dkim-signature; bh=WSA/a9WLyv0t2iB+6cprQ8gS7s0Totdr2JoMKMExfTE=; b=YgHzIPaoI3RE7HQrI5Ct2OWTrQU2CM98dDFX6258dYo1IukOAStFI2HsQ1tSbTzwQf xyUXJ2c2AQud5ucdD9IFf4HcN5pmnVnQAZXVkh8ZUI7DTNDGcs1ADwjWXanqHl5UOw2L YyEe5dBKPzz3tOv84sBZ502O+vKH9oUg6jhV6KrlnR2eaAbbJSKIBE/K0zyj5P7a1ZnO XUOMb9/QXWy98PMmSm9YR3nlNRRwGFUqIXqYnyEzbd87HfchmF9augj1OTNeDyX9LZi1 jYGqjyG20YDmjujsWimzraJNDL1u/F1MyxiGDyws6xNok6n7Xf+Kl6/3Bm+n9vDHZOtC RJ1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b="hurRws/l"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h66si187358oif.53.2020.03.27.01.35.47; Fri, 27 Mar 2020 01:36:00 -0700 (PDT) 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; dkim=pass header.i=@synopsys.com header.s=mail header.b="hurRws/l"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727252AbgC0IfZ (ORCPT + 99 others); Fri, 27 Mar 2020 04:35:25 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:40788 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbgC0IfZ (ORCPT ); Fri, 27 Mar 2020 04:35:25 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 7FF93C0F99; Fri, 27 Mar 2020 08:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1585298124; bh=NWAeJc+FAl9dC27fp2efai9R07gAZkuqfeVwWFD9/2c=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=hurRws/lM5BOAKjYYXgmD6gZkhxdDaSY11DpazIyQXtzkhekPOG/fuPEXJNX/3+gc FsNEAK2uLFoAeWhTr9ui7snK2mWWHhHaZW+aBOtYfj/AQc+ss1g/VzJV+xg1P23Gqw +nRaVLq32FQN1k4hM+6jr7qCJf43Or3sTagMFeoviDWGX/KEg6sOymg1hSlcsfRomG wSquvSbuTPCSi6Qi0bXHwYbOi5nF68eHaZiGLwsdi7ocolQ1cGpc8r8h9UfM50AWy5 gPH9lC9S//1kVYxh3DJrWljTUztZzVHfyJD7ZobTqQgY7cEZgECcc7q9sKfOzem9Sb RfGsaW0+jaq1w== Received: from tejas-VirtualBox (joglekar-e7480.internal.synopsys.com [10.146.16.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPSA id 475D2A005B; Fri, 27 Mar 2020 08:35:21 +0000 (UTC) Received: by tejas-VirtualBox (sSMTP sendmail emulation); Fri, 27 Mar 2020 14:05:18 +0530 Date: Fri, 27 Mar 2020 14:05:18 +0530 Message-Id: In-Reply-To: References: From: Tejas Joglekar Subject: [RFC PATCH 2/4] usb: xhci: Set quirk for XHCI_CONSOLIDATE_SG_LIST To: Tejas Joglekar , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Mathias Nyman Cc: John Youn Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit enables the quirk when the consolidate_trbs property is set for the Synopsys xHC. This patch fixes the SNPS xHC hang issue when the data is scattered across small buffers which does not make atleast MPS size for given TRB cache size of SNPS xHC. Signed-off-by: Tejas Joglekar --- drivers/usb/host/xhci-pci.c | 3 +++ drivers/usb/host/xhci-plat.c | 3 +++ drivers/usb/host/xhci.h | 1 + 3 files changed, 7 insertions(+) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 766b74723e64..cdda8e2de1c2 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -268,6 +268,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) pdev->device == 0x9026) xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT; + if (pdev->vendor == PCI_VENDOR_ID_SYNOPSYS) + xhci->quirks |= XHCI_CONSOLIDATE_SG_LIST; + if (xhci->quirks & XHCI_RESET_ON_RESUME) xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, "QUIRK: Resetting on resume"); diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 315b4552693c..8333c78dcf03 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -289,6 +289,9 @@ static int xhci_plat_probe(struct platform_device *pdev) if (device_property_read_bool(tmpdev, "quirk-broken-port-ped")) xhci->quirks |= XHCI_BROKEN_PORT_PED; + if (device_property_read_bool(tmpdev, "consolidate-sgl")) + xhci->quirks |= XHCI_CONSOLIDATE_SG_LIST; + device_property_read_u32(tmpdev, "imod-interval-ns", &xhci->imod_interval); } diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 3289bb516201..a093eeaec70e 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1873,6 +1873,7 @@ struct xhci_hcd { #define XHCI_DEFAULT_PM_RUNTIME_ALLOW BIT_ULL(33) #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) +#define XHCI_CONSOLIDATE_SG_LIST BIT_ULL(36) unsigned int num_active_eps; unsigned int limit_active_eps; -- 2.11.0