Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1857858pxb; Fri, 5 Mar 2021 01:05:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1emFv7/l5v4HTZGs80qI/ATfJJPexiCAP1db1/LydqG2Jsb1YGb+oV/fdyGkl+DfmL4Hb X-Received: by 2002:a05:6402:1c0a:: with SMTP id ck10mr8385220edb.318.1614935110117; Fri, 05 Mar 2021 01:05:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614935110; cv=none; d=google.com; s=arc-20160816; b=mqay5N8Y8AbDjMaRt8kbOpmUKT/F1oe5gakmnIzh1j5Gji06kD0VAGMVIBH+APtaXG ZN37rBhhmo/Fwfh1r2e5SfMDihPgotCm/v+AF/Z9qw1VqA89Q1a0l3KbmO9WvsuIgzTD ABSV7pQCmfRHF3W9IXt4Gfw6ofGELUMYBP7B8l9fbSsSaKJ/6eUkNDIj9g1w9iLvppy7 vMmHfAinsZ0OfRXH4Cy4K4g8s/E2EzVAIGMKyonGz1Z7oaTXqyevEmckNdtZpi5jkvew C78kjmzLMHTKBAojQvO9uQC8vHcHM/oHvhP7PnFQgn2TQwqBDjh7KtIEgKnqiiq+60Yr xBLw== 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=ielzmK28QgtBce2XJR/qO9UtIk/vuEIfxBWNdQgVx00=; b=bw0XUCKfz7/sayIStFFyFuC4U4Kn0KPPZBWL0BN7xTQyreee4HytfZiywpPw3GZr1V KGcVn7ACpIepfXcL6luVMpmWqbwmlEvfFhB3w/Iwq7DMNIrXccgqVLyyV2vJUPEOmP0K cRNrDHDzaj9uvvwXJcu7S9ug3vW5HYvNnkaMNdyQ21iIZgmABtLq+l6ReUfjAsaltXPF NMbN+EEEHIv8tydqDy/7DpBTu5Z2xSr/vtNbDyL/13zX3XV/mKRDTYJ7zLcmhII6uMu0 9ylPF5AT2o+6FegVpP8myOgwsJEGbT25vXGF4rb87KFTxaUlTqOSYip9DreNyT07Mub3 t+Xw== 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 hp15si1024602ejc.548.2021.03.05.01.04.47; Fri, 05 Mar 2021 01:05:10 -0800 (PST) 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 S230035AbhCEJDp (ORCPT + 99 others); Fri, 5 Mar 2021 04:03:45 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:59161 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229740AbhCEJD2 (ORCPT ); Fri, 5 Mar 2021 04:03:28 -0500 X-UUID: 5df9f42ae9be49f2b54e09f945e45cfe-20210305 X-UUID: 5df9f42ae9be49f2b54e09f945e45cfe-20210305 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] 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 1918660796; Fri, 05 Mar 2021 17:03:24 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 5 Mar 2021 17:03:22 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 5 Mar 2021 17:03:21 +0800 From: Chunfeng Yun To: Mathias Nyman , Greg Kroah-Hartman , Ikjoon Jang CC: Chunfeng Yun , Matthias Brugger , , , , , Nicolas Boichat , Eddie Hung Subject: [PATCH 11/17] usb: xhci-mtk: use @tt_info to check the FS/LS device is under a HS hub Date: Fri, 5 Mar 2021 17:02:49 +0800 Message-ID: <1614934975-15188-11-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1614934975-15188-1-git-send-email-chunfeng.yun@mediatek.com> References: <1614934975-15188-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 If the LS/FS device is connected to an external HS hub, the member @tt_info in xhci_virt_device struct in not NULL, use it to check whether a LS/FS device is under an exernal HS hub, then no need get the slot context of this device. Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk-sch.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index e75628f82706..1562875c04ab 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -678,7 +678,6 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd); struct xhci_hcd *xhci; struct xhci_ep_ctx *ep_ctx; - struct xhci_slot_ctx *slot_ctx; struct xhci_virt_device *virt_dev; struct mu3h_sch_ep_info *sch_ep; unsigned int ep_index; @@ -686,7 +685,6 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, xhci = hcd_to_xhci(hcd); virt_dev = xhci->devs[udev->slot_id]; ep_index = xhci_get_endpoint_index(&ep->desc); - slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); xhci_dbg(xhci, "%s() type:%d, speed:%d, mpkt:%d, dir:%d, ep:%p\n", @@ -694,7 +692,7 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, usb_endpoint_maxp(&ep->desc), usb_endpoint_dir_in(&ep->desc), ep); - if (!need_bw_sch(ep, udev->speed, slot_ctx->tt_info & TT_SLOT)) { + if (!need_bw_sch(ep, udev->speed, !!virt_dev->tt_info)) { /* * set @bpkts to 1 if it is LS or FS periodic endpoint, and its * device does not connected through an external HS hub @@ -723,7 +721,6 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, { struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd); struct xhci_hcd *xhci; - struct xhci_slot_ctx *slot_ctx; struct xhci_virt_device *virt_dev; struct mu3h_sch_bw_info *sch_array; struct mu3h_sch_bw_info *sch_bw; @@ -732,7 +729,6 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, xhci = hcd_to_xhci(hcd); virt_dev = xhci->devs[udev->slot_id]; - slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); sch_array = mtk->sch_array; xhci_dbg(xhci, "%s() type:%d, speed:%d, mpks:%d, dir:%d, ep:%p\n", @@ -740,7 +736,7 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, usb_endpoint_maxp(&ep->desc), usb_endpoint_dir_in(&ep->desc), ep); - if (!need_bw_sch(ep, udev->speed, slot_ctx->tt_info & TT_SLOT)) + if (!need_bw_sch(ep, udev->speed, !!virt_dev->tt_info)) return; bw_index = get_bw_index(xhci, udev, ep); -- 2.18.0