linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Ikjoon Jang <ikjn@chromium.org>,
	<linux-mediatek@lists.infradead.org>, <linux-usb@vger.kernel.org>,
	Tianping Fang <tianping.fang@mediatek.com>,
	Zhanyong Wang <zhanyong.wang@mediatek.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5] usb: xhci-mtk: fix unreleased bandwidth data
Date: Fri, 8 Jan 2021 14:11:48 +0800	[thread overview]
Message-ID: <1610086308.24856.30.camel@mhfsdcap03> (raw)
In-Reply-To: <2aea44f0-85e7-fd55-2c35-c1d994f20e03@linux.intel.com>

On Thu, 2021-01-07 at 13:09 +0200, Mathias Nyman wrote:
> On 29.12.2020 8.24, 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.
> > 
> > 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 <ikjn@chromium.org>
> > 
> 
> ...
> 
> > 
> > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> > index d4a8d0efbbc4..e1fcd3cf723f 100644
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> > @@ -2882,6 +2882,12 @@ static int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
> >  	xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev);
> >  	virt_dev = xhci->devs[udev->slot_id];
> >  
> > +	if (xhci->quirks & XHCI_MTK_HOST) {
> > +		ret = xhci_mtk_check_bandwidth(hcd, udev);
> > +		if (ret < 0)
> > +			return ret;
> > +	}
> > +
> 
> Just noticed that XHCI_MTK_HOST quirk is only set in xhci-mtk.c.
> xhci-mtk.c calls xhci_init_driver(..., xhci_mtk_overrides) with a .reset override function.
> 
> why not add override functions for .check_bandwidth and .reset_bandwidth to xhci_mtk_overrides instead?
> 
> Another patch to add similar overrides for .add_endpoint and .drop_endpoint should probably be
> done so that we can get rid of the xhci_mtk_add/drop_ep_quirk() calls in xhci.c as well
You mean, we can export xhci_add/drop_endpoint()?

> 
> Thanks
> -Mathias
> 


  parent reply	other threads:[~2021-01-08  6:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29  6:24 [PATCH v5] usb: xhci-mtk: fix unreleased bandwidth data Ikjoon Jang
2021-01-07 11:09 ` Mathias Nyman
2021-01-08  2:56   ` Ikjoon Jang
2021-01-08  6:11   ` Chunfeng Yun [this message]
2021-01-08 14:46     ` Mathias Nyman
2021-01-12  5:48       ` Ikjoon Jang
2021-01-14  2:23         ` Chunfeng Yun
2021-01-14  8:29         ` Chunfeng Yun
2021-01-15  2:51           ` Ikjoon Jang
2021-01-19  2:33             ` Chunfeng Yun
2021-01-08  6:34 ` Chunfeng Yun
2021-01-08 10:50   ` Ikjoon Jang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1610086308.24856.30.camel@mhfsdcap03 \
    --to=chunfeng.yun@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ikjn@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mathias.nyman@linux.intel.com \
    --cc=matthias.bgg@gmail.com \
    --cc=tianping.fang@mediatek.com \
    --cc=zhanyong.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).