From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C32C3C432BE for ; Thu, 26 Aug 2021 11:56:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9411460E97 for ; Thu, 26 Aug 2021 11:56:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9411460E97 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3xUJjShD860CZwKMTMiAGOtbMXAd3oRCJ6PLgzoTqpM=; b=rBw7OBguM97Jc3 pl+Js+qQ0Uz6z9l1MxaS4rRfOfJh/0WUc7fM+bOFgZ6BIBZ8RqAL7/auk1FKlmH397trjMtPWmXDG TuP9KrAlz0mJNw2M06CR/Lg/loY2SgPaxGKqVl1WneQYKnBEASd/W03A2XceKEB74CvKmhKDaT5Sa nfXFKNa2P2uDlxbOZAocRAxN3NRlgTAiP7YIArggDRHR65o7jWmu8beSyAS2Pr5i9aVbjPXPW6cvN SmOOfKRm4QQEL3w3POlLghGBdVkuM/h7Chj4asQApPoCpXF6S1ghIuwSk3oEEUUVqjr8g+3ENozvG aKV+MP2ByoddkNKt33Fw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJDxf-009zDa-MB; Thu, 26 Aug 2021 11:54:23 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJDxZ-009zCE-K3 for linux-arm-kernel@lists.infradead.org; Thu, 26 Aug 2021 11:54:21 +0000 Received: by mail-pj1-x1032.google.com with SMTP id oa17so2047812pjb.1 for ; Thu, 26 Aug 2021 04:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GF9cA6HWm73PdcnhQrBWb0JMD23t4eWrYuwcNebBzhg=; b=BOLP6Ete/5M3jts/uWuAymRzOu8DrhtLuaCJjWI6HJPL7OVKD5Sswq0Ir/Ml8zxiWp sRpiHOy5vrltsG0dygRRhglM4AN+Tp8c5s0LpKJOFDYjOpRpq3jZK8SgY5u5aNdP+sUk kPoAzc+OBpyviSNC3b3vRX0ZXey/cvs089ptA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GF9cA6HWm73PdcnhQrBWb0JMD23t4eWrYuwcNebBzhg=; b=eKYR5LiUIKc/qQjj1LYFznlE4WIDqrLVVcqIip4rVZBe6Jm7DI4aZnHzNs7w9gjnTT JBhkvsFrwgb4RGfXCZCsByPhl88Zy1rv9mCjH4V1O+cvyv/gpnH9WNxrJ2arANtXqbAa nAS1etFX1nPu2CygHeLPX/UJ3h4Sv1dS84afUMEwGerebjxTAkzpA0E+HTVbTzfS4D7M lAUX7L/VQRPcerlpH16MjdCiVCOUF/2IlEmi2Fz/RiwNc9rH9T2ZGwoZJJs9Mc/JXbYe xH0tEl27NC448uTREP59zRA4IYtrqBi9Y/jviEux435e4fd8gbnAyxhvBp1qyM5nw3fl +kXg== X-Gm-Message-State: AOAM530U1LStUi47t+M/BFkhTxd4Pq+2ORIDLRHvt32JvpXQ5AHQugTC 8f7JBJI/UENfpa6UXIBc6Dig4xljoBwm8+a2JhAinQ== X-Google-Smtp-Source: ABdhPJyPJt6SUmiZLSQD+XbEIBZ8IKTak4j4QZ8Oj8fxfMRxk7v8EqBMuHWZ5SQ/bfQzG0hm7oZTmwF44/dS0Jgya64= X-Received: by 2002:a17:903:32ce:b0:138:7c09:1178 with SMTP id i14-20020a17090332ce00b001387c091178mr3215013plr.60.1629978855791; Thu, 26 Aug 2021 04:54:15 -0700 (PDT) MIME-Version: 1.0 References: <20210826025144.51992-1-chunfeng.yun@mediatek.com> <20210826025144.51992-3-chunfeng.yun@mediatek.com> In-Reply-To: <20210826025144.51992-3-chunfeng.yun@mediatek.com> From: Ikjoon Jang Date: Thu, 26 Aug 2021 19:54:04 +0800 Message-ID: Subject: Re: [PATCH next v2 3/6] usb: xhci-mtk: update fs bus bandwidth by bw_budget_table To: Chunfeng Yun Cc: Mathias Nyman , Greg Kroah-Hartman , Matthias Brugger , "open list:USB XHCI DRIVER" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , open list , Eddie Hung , Yaqii wu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210826_045417_717680_397E64D5 X-CRM114-Status: GOOD ( 24.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Chunfeng, On Thu, Aug 26, 2021 at 10:52 AM Chunfeng Yun wrote: > > Use @bw_budget_table[] to update fs bus bandwidth due to > not all microframes consume @bw_cost_per_microframe, see > setup_sch_info(). > > Signed-off-by: Chunfeng Yun > --- > v2: new patch, move from another series > --- > drivers/usb/host/xhci-mtk-sch.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > > diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c > index cffcaf4dfa9f..83abd28269ca 100644 > --- a/drivers/usb/host/xhci-mtk-sch.c > +++ b/drivers/usb/host/xhci-mtk-sch.c > @@ -458,8 +458,8 @@ static int check_fs_bus_bw(struct mu3h_sch_ep_info *sch_ep, int offset) > * Compared with hs bus, no matter what ep type, > * the hub will always delay one uframe to send data > */ > - for (j = 0; j < sch_ep->cs_count; j++) { > - tmp = tt->fs_bus_bw[base + j] + sch_ep->bw_cost_per_microframe; > + for (j = 0; j < sch_ep->num_budget_microframes; j++) { > + tmp = tt->fs_bus_bw[base + j] + sch_ep->bw_budget_table[j]; I'm worrying about this case with two endpoints, * EP1OUT: isochronous, maxpacket=192: bw_budget_table[] = { 188, 188, 0, ... } * EP2IN: interrupt, maxpacket=64: bw_budget_table[] = { 0, 0, 64, 64, ... } (Is this correct bw_budget_table contents for those eps?) I'm not sure if it's okay for those two endpoints to be allocated on the same u-frame slot. Can you please check if this is okay for xhci-mtk? (I feel like I already asked the same questions many times.) > if (tmp > FS_PAYLOAD_MAX) > return -ESCH_BW_OVERFLOW; > } > @@ -534,21 +534,18 @@ 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 i, j; > > num_esit = XHCI_MTK_MAX_ESIT / sch_ep->esit; > > - if (used) > - bw_updated = sch_ep->bw_cost_per_microframe; > - else > - bw_updated = -sch_ep->bw_cost_per_microframe; > - > for (i = 0; i < num_esit; i++) { > base = sch_ep->offset + i * sch_ep->esit; > > - for (j = 0; j < sch_ep->cs_count; j++) > - tt->fs_bus_bw[base + j] += bw_updated; > + for (j = 0; j < sch_ep->num_budget_microframes; j++) > + if (used) > + tt->fs_bus_bw[base + j] += sch_ep->bw_budget_table[j]; > + else > + tt->fs_bus_bw[base + j] -= sch_ep->bw_budget_table[j]; > } > > if (used) > -- > 2.18.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel