Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4025302pxf; Tue, 23 Mar 2021 00:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIpRd05pfVFANsaX9WNmInyfOvI95IJp2jm0Hf9y1hbp4OD/ZkXsSbtZFsg7UaqSYrwFZp X-Received: by 2002:aa7:cd63:: with SMTP id ca3mr3084564edb.265.1616483134875; Tue, 23 Mar 2021 00:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616483134; cv=none; d=google.com; s=arc-20160816; b=pd3MEK3xIu9v/US9hbBj8p1sSGAJybWdQzNCqfo0vaZXu1LeTwet4FQh8tVQ8izzp+ YHD4OCmWqSSWpbiURPNzU0uDzP/Kr/2a4zTqJrou0yirhJHE5KgWHBfPr+82SAH51BiQ LIt9KNJjmxF4u6o/T1HDEK7sQw3OL4U9Tmbt312uBGwGTXC+DKhoEh/pgcJ72H2CicM7 cIoDAasv/gOiLEyfcPK0VwUHGvjjY/EZgik4k2sKbZEY2gqRrkRtVXySF9G2I+RI2wmP +xI1W78WI5fHdjPQnd5s6BDlbXoAShANm19AQLsUkUYhJycUVaXZ9yc40BCMeTVr4BmH gZwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Z9JTZXk8mw05hWtAZRJilvXcNyRtl+GxcwjgdUIQ1Vg=; b=vRaEBD1XqMwy990aEEa156BC4Ih7KIakFwD0voef7HvpdPt8ZUNvKc0V/M1umQi/N+ ZqDz0XJIYLHlLKRat73R8ugY0r31NtE1Ywr5Zc/79zFuJ/G3rPQhWc7al3LRChtoSAKe 6cWK0FSpwT8liJs4/oZ1hhQRXzW7YtaOZR8ZTKxQmF9btjbiaA9T9J2t4fUfgBOlmATC Fu7JECtg04NTapmZdMmwVX818NeguF6vrLtuWBF/YJobhBZhMzWW7QEyiZ1yfCbnf2hn ODu2U13FkSg1tiiKuLtMF8bV0kRaeCu73T7YZ7Nb1m5Vk4cP1vFw4ljvTh8vI4Ty/RBv RBHw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si13039108ejn.599.2021.03.23.00.05.12; Tue, 23 Mar 2021 00:05:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbhCWHDw (ORCPT + 99 others); Tue, 23 Mar 2021 03:03:52 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:40147 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230057AbhCWHDR (ORCPT ); Tue, 23 Mar 2021 03:03:17 -0400 X-UUID: a9aab06c83aa4df482b0fef13ac9fd41-20210323 X-UUID: a9aab06c83aa4df482b0fef13ac9fd41-20210323 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2101752130; Tue, 23 Mar 2021 15:03:13 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 23 Mar 2021 15:03:12 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 23 Mar 2021 15:03:11 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring , Mathias Nyman CC: Chunfeng Yun , Matthias Brugger , , , , , , Sergei Shtylyov , Eddie Hung , Nicolas Boichat Subject: [PATCH v2 04/13] usb: xhci-mtk: fix broken streams issue on 0.96 xHCI Date: Tue, 23 Mar 2021 15:02:46 +0800 Message-ID: <1616482975-17841-4-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1616482975-17841-1-git-send-email-chunfeng.yun@mediatek.com> References: <1616482975-17841-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MediaTek 0.96 xHCI controller on some platforms does not support bulk stream even HCCPARAMS says supporting, due to MaxPSASize is set a default value 1 by mistake, here use XHCI_BROKEN_STREAMS quirk to fix it. Fixes: 94a631d91ad3 ("usb: xhci-mtk: check hcc_params after adding primary hcd") Signed-off-by: Chunfeng Yun --- v2: no changes --- drivers/usb/host/xhci-mtk.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 57bcfdfa0465..1b9f10048fe0 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -388,6 +388,13 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |= XHCI_SPURIOUS_SUCCESS; if (mtk->lpm_support) xhci->quirks |= XHCI_LPM_SUPPORT; + + /* + * MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream, + * and it's 3 when support it. + */ + if (xhci->hci_version < 0x100 && HCC_MAX_PSA(xhci->hcc_params) == 4) + xhci->quirks |= XHCI_BROKEN_STREAMS; } /* called during probe() after chip reset completes */ @@ -549,7 +556,8 @@ static int xhci_mtk_probe(struct platform_device *pdev) if (ret) goto put_usb3_hcd; - if (HCC_MAX_PSA(xhci->hcc_params) >= 4) + if (HCC_MAX_PSA(xhci->hcc_params) >= 4 && + !(xhci->quirks & XHCI_BROKEN_STREAMS)) xhci->shared_hcd->can_do_streams = 1; ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); -- 2.18.0