Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1179399pxj; Fri, 18 Jun 2021 01:03:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2MctNuC3SfR3nW5pC5DQFxHFPFHzQUd0RWHVz6uzE93fw2kmwFIEaTVsbL4ohj2Zn6ECZ X-Received: by 2002:a17:906:6d97:: with SMTP id h23mr9647262ejt.467.1624003438323; Fri, 18 Jun 2021 01:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624003438; cv=none; d=google.com; s=arc-20160816; b=rEqgg41Sp+sYeeY0CDxJqHmCcUKg96JZdUwNgjPwHNAz70+lYPVF1cvSQtz0ZuzN53 zVDNDRsISTrnNgEkb7Uw1CND0Tdm/u6pERlxSr7H96IcmpvGymzTiHQxM9LDU3rbz+p+ 6J96RZBoa0ZYsqvQJSLsNQlZW+/CT21ysaoxz4a95DUL6240tRXyMHgYVGDvDqHDqzIu Hbhk5Ox1+M1cq8WkdjxZxfM4AnT0WmyBwNUEtcw3wpqcpIN9vB0FqwqP4TA12z/fWykO jc8tLXNpxzQQDroOxWjU0HVvuNXOaG+AOPSqSk0+FKeJ77kyGdqgkqlROwxM3pkMXuJb i4pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=NIj3SQd7uoRTr9xxwJQWfM2PDyos4BizKENStgzg1OU=; b=QelodoXu9eN6NXzQ9a3tgwCMauBxo5Oxhup/CWc+7YQbG1a/LKfeRW/AfVK2mIBFhq fqHtec25jXflibzzGyW5OcsY7qhwZYeQtGDmKcXAoFncbE8tS7grUcfa13g60p7TqrID K27kA6ojsbQ2NhLg8ASW56ob40TaK/EhqjHDPi/lb4nhyX3f3KA3BVWiBOFl6vMJkDg7 VERK9aqDNuPWY8w4bkDd9Dwmgh9Ku7HF2WAuqYyfc/qxhMgIiC1eUJMo4e8+rWowvf2C TiwwU5fYgf4xJsE87AFSidVXV4rmBYJtl+RnBkz0xqB5mgO/Hw7n69TXSiwLG1mp1/Q3 WORw== 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 j23si2161083eje.21.2021.06.18.01.03.35; Fri, 18 Jun 2021 01:03:58 -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 S232586AbhFRFsa (ORCPT + 99 others); Fri, 18 Jun 2021 01:48:30 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:23494 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229671AbhFRFs3 (ORCPT ); Fri, 18 Jun 2021 01:48:29 -0400 X-UUID: d2b6d1d52d5949d7b46b2a66002cf363-20210618 X-UUID: d2b6d1d52d5949d7b46b2a66002cf363-20210618 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1020669437; Fri, 18 Jun 2021 13:46:17 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 18 Jun 2021 13:46:07 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 18 Jun 2021 13:46:06 +0800 From: Chunfeng Yun To: Mathias Nyman CC: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , , , , , Ikjoon Jang , Tianping Fang Subject: [PATCH v2] usb: xhci-mtk: allow multiple Start-Split in a microframe Date: Fri, 18 Jun 2021 13:46:05 +0800 Message-ID: <1623995165-25759-1-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 02BB984D341FF26AAEC4515F05D01F59A1311868CC49A7C74FF13F345B3278832000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch is used to relax bandwidth schedule by allowing multiple Start-Split in the same microframe. Signed-off-by: Chunfeng Yun --- v2: fix build warning unused-but-set-variable --- drivers/usb/host/xhci-mtk-sch.c | 18 ------------------ drivers/usb/host/xhci-mtk.h | 2 -- 2 files changed, 20 deletions(-) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index c07411d9b16f..cffcaf4dfa9f 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -470,11 +470,9 @@ static int check_fs_bus_bw(struct mu3h_sch_ep_info *sch_ep, int offset) static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset) { - struct mu3h_sch_tt *tt = sch_ep->sch_tt; u32 extra_cs_count; u32 start_ss, last_ss; u32 start_cs, last_cs; - int i; if (!sch_ep->sch_tt) return 0; @@ -491,10 +489,6 @@ static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset) if (!(start_ss == 7 || last_ss < 6)) return -ESCH_SS_Y6; - for (i = 0; i < sch_ep->cs_count; i++) - if (test_bit(offset + i, tt->ss_bit_map)) - return -ESCH_SS_OVERLAP; - } else { u32 cs_count = DIV_ROUND_UP(sch_ep->maxpkt, FS_PAYLOAD_MAX); @@ -521,9 +515,6 @@ static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset) if (cs_count > 7) cs_count = 7; /* HW limit */ - if (test_bit(offset, tt->ss_bit_map)) - return -ESCH_SS_OVERLAP; - sch_ep->cs_count = cs_count; /* one for ss, the other for idle */ sch_ep->num_budget_microframes = cs_count + 2; @@ -544,11 +535,9 @@ static void update_sch_tt(struct mu3h_sch_ep_info *sch_ep, bool used) struct mu3h_sch_tt *tt = sch_ep->sch_tt; u32 base, num_esit; int bw_updated; - int bits; int i, j; num_esit = XHCI_MTK_MAX_ESIT / sch_ep->esit; - bits = (sch_ep->ep_type == ISOC_OUT_EP) ? sch_ep->cs_count : 1; if (used) bw_updated = sch_ep->bw_cost_per_microframe; @@ -558,13 +547,6 @@ static void update_sch_tt(struct mu3h_sch_ep_info *sch_ep, bool used) for (i = 0; i < num_esit; i++) { base = sch_ep->offset + i * sch_ep->esit; - for (j = 0; j < bits; j++) { - if (used) - set_bit(base + j, tt->ss_bit_map); - else - clear_bit(base + j, tt->ss_bit_map); - } - for (j = 0; j < sch_ep->cs_count; j++) tt->fs_bus_bw[base + j] += bw_updated; } diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h index cd3a37bb73e6..390cb5a86082 100644 --- a/drivers/usb/host/xhci-mtk.h +++ b/drivers/usb/host/xhci-mtk.h @@ -24,12 +24,10 @@ #define XHCI_MTK_MAX_ESIT 64 /** - * @ss_bit_map: used to avoid start split microframes overlay * @fs_bus_bw: array to keep track of bandwidth already used for FS * @ep_list: Endpoints using this TT */ struct mu3h_sch_tt { - DECLARE_BITMAP(ss_bit_map, XHCI_MTK_MAX_ESIT); u32 fs_bus_bw[XHCI_MTK_MAX_ESIT]; struct list_head ep_list; }; -- 2.18.0