Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp208082pxb; Fri, 8 Jan 2021 02:52:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1QR6YoPWFlNQhrHSrden8NShhmhYD7Sf5nqP8vsuCK89wTXq8nKz7DXbQEJErN28sktTN X-Received: by 2002:aa7:da03:: with SMTP id r3mr4775699eds.155.1610103171936; Fri, 08 Jan 2021 02:52:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610103171; cv=none; d=google.com; s=arc-20160816; b=gkqqMGLF5xcfsXp6+vrGpgJWlxaaldglVH3Bfd7nZF7kqfeRyoelQwZs5rxe13AR0m z4OPiwtK/lLqQn0Hgzi0eyXvhBEzkV31MCc5EWldSgE6Y+mv2m0wGNlftBgGuoEjLCeH GFaRkvFp1ZAu/0UB9GD5QtotZYPo4hIdJm3Xn/U8jVwFdijpVgMa1u8Y2pWDKHLAZsp+ yftvPAGDb/OVEjQ69KtwPe+yP/mYgOqHhJocTxC2cw3Clgkh+FvdoEHXlnrUsOyLoteH +J0wvlZON/tZuBoU+HgMDHyV9a6lpC45yWr7DyYSfQpNfZ3o406bhpjzOLGMgcPJ2suI Ttcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hUYexvGQkq4ls/OimwsO5Jd0RZqGFOW3s7MoFq9zFTo=; b=fBmyuUASYSYmqrPjEC7viUePiA19UqrPHucdD7Zi4gF88nEDDPmTfUpGdf1z+XMbYa f6cQlYUJTGsFXMASOl+uWLI7ldzhJtJA2vCs/X4UNv+f1NxkAxpAXNBnztTuSkstIbxI 6BtrKIORy+XSZH0OajD68C9G9JpUdN+E0BC5zOxoQQXuhV7bRFsQZnUUkR9hjFJ0c43u jBPJvX/pSdk6FOS4D7qqmcGIE0J7glIyLQ4UFeFf1pXNstqJ+0DdPjREjzA2BAiP6VgC zJ8YrIXUmPXDYbcngxuc8x3v8J7epZTz0Mb/dzq2s3cVKa26rp/YbV7HjnaCU+4XOwkR XdcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YJkyuQWX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si3439211edt.265.2021.01.08.02.52.28; Fri, 08 Jan 2021 02:52:51 -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; dkim=pass header.i=@chromium.org header.s=google header.b=YJkyuQWX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727630AbhAHKvV (ORCPT + 99 others); Fri, 8 Jan 2021 05:51:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726752AbhAHKvV (ORCPT ); Fri, 8 Jan 2021 05:51:21 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39E5AC0612F5 for ; Fri, 8 Jan 2021 02:50:41 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id i5so7459406pgo.1 for ; Fri, 08 Jan 2021 02:50:41 -0800 (PST) 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=hUYexvGQkq4ls/OimwsO5Jd0RZqGFOW3s7MoFq9zFTo=; b=YJkyuQWXhbFLgxwObjUfAmF83zKljdj7aMi/D0QeB/d+QLVbsGCvwyase5VS/GWSpg Es1unRr4cp3Fvy24ZBffOLz0Lfh11nBkmofiM2flPrgjewamfaSpMXKulclYD2Pltylo jrH2DnIwA96hZC5n+910xx3mFFG4aCgPnl1+Q= 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=hUYexvGQkq4ls/OimwsO5Jd0RZqGFOW3s7MoFq9zFTo=; b=ac8o1aZlTK+zWGmvYo4Il22CCPsJ6GPnYBWnP8DF5TFpU3gW9Hn68hHihWziNsjA0R ranzAOdB33dX1dnGLHCrK4Mc17qyd+9h9Fpo40B+1tkdlO0eP8eJz51MyZVzSfGgkh+d Yi/QXabcapcb/ElfOxp+ztCilFelFg6ni55hSgCaqp/q/r87FSWSl/djIrofXqnSLh9B czRN4FWLmP0LOIfNa14Pu3vjVEZzazXzN8O+dsd7RsYV8TAx4cO+vSx8lS6+9HDkA8lH 7sCxMbtF5Dk4Cz86MM0unFMoFxBtMFfrZPVHTNogigNsPKUA72QlwVzAue2dhvgy94Px qhiw== X-Gm-Message-State: AOAM533CEmwHYjAIK9vPeNRRN1FQsaGuce9L7QPtbf44pcemr+yOMLca xV5JRXu7hi6GT/TUG+9BFlIO3A4zCJqnpFcUh4GorA== X-Received: by 2002:aa7:8813:0:b029:19d:cd3b:6f89 with SMTP id c19-20020aa788130000b029019dcd3b6f89mr3048408pfo.42.1610103039797; Fri, 08 Jan 2021 02:50:39 -0800 (PST) MIME-Version: 1.0 References: <20201229142406.v5.1.Id0d31b5f3ddf5e734d2ab11161ac5821921b1e1e@changeid> <1610087648.24856.41.camel@mhfsdcap03> In-Reply-To: <1610087648.24856.41.camel@mhfsdcap03> From: Ikjoon Jang Date: Fri, 8 Jan 2021 18:50:29 +0800 Message-ID: Subject: Re: [PATCH v5] usb: xhci-mtk: fix unreleased bandwidth data To: Chunfeng Yun Cc: "moderated list:ARM/Mediatek SoC support" , linux-usb@vger.kernel.org, Tianping Fang , Zhanyong Wang , Greg Kroah-Hartman , Mathias Nyman , Matthias Brugger , "moderated list:ARM/Mediatek SoC support" , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 8, 2021 at 2:34 PM Chunfeng Yun wrote: > > On Tue, 2020-12-29 at 14:24 +0800, Ikjoon Jang wrote: > > xhci-mtk has hooks on add_endpoint() and drop_endpoint() from xhci > > to handle its own sw bandwidth managements and stores bandwidth data > > into internal table every time add_endpoint() is called, > > so when bandwidth allocation fails at one endpoint, all earlier > > allocation from the same interface could still remain at the table. > If failed to add an endpoint, will cause failure of its interface > config, then the other endpoints in the same interface will be dropped > later? you mean some endpoints in an interface may fail but without > affecting its function? Yes, drop_endpoint() is called for a failed interface when set_interface() fails to switch alt settings, but set_configuration() does not call drop_endpoint(). TT data seems to remain allocated until a device gets removed. > > > > > This patch adds two more hooks from check_bandwidth() and > > reset_bandwidth(), and make mtk-xhci to releases all failed endpoints > > from reset_bandwidth(). > > > > Fixes: 08e469de87a2 ("usb: xhci-mtk: supports bandwidth scheduling with multi-TT") > > Signed-off-by: Ikjoon Jang >