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=-15.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,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham 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 1227FC433DB for ; Fri, 8 Jan 2021 06:12:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 6F036233FB for ; Fri, 8 Jan 2021 06:12:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F036233FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Iz596gq2NXX+PhGqUttPadUXANSiYu8+3gqp8S6EFM8=; b=B4RLghKUrWoj2PTrPLzFAe4e/ Ellg62ijXIVKDKzvJUEZMG6GnXV0eKMgZqF//Ymw4CZQEItO4IirGIxRe13zcPypgOq3ViNBeah/W PcN7hHs5Ddjn9QmyxjYffzfYipw9Smg/zn6PJCz5Cggl0HWfjhDgpVXmDV+/SmlsVPlRSI1TuC/86 PmNCcIXvohTbfGdMpDgJ1dkm4blpZiOSNBDWYHrya6OeT41KboSdfEjSjeID2WUYvGFLPMPnbGaQ1 7TBIx99JMubfOdBlabniAZrvZI9vfpFtJ0m+vMG8egI5XXX2bZPuoLO3Sl1uLKVl8RSVhCte3HHpI ukqMUyZdA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxl0L-00070v-RF; Fri, 08 Jan 2021 06:12:09 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxl0G-00070A-U0; Fri, 08 Jan 2021 06:12:06 +0000 X-UUID: 2524992b217e4fb0832aa6d98888427b-20210107 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=LDkX9dGv4KvdYnnhzQPG/2hc+NN7U1uTjI1C2TIOKEU=; b=e3oFH22iXVHk04QvgGDGtJing67Y3GCnTz7LpvDFRvhm2eM5b+nC2GCTP/9ZcEu1yOYhfJLWTV0fcnYYMQzjUVqF6AtuJVMxKj6jcvNW2RFTCOPesRCWe45JU7jARvPYfpwpmEoRGwAyYNX4q6ZVj9LXS9DSEgWwdIYd4turv8U=; X-UUID: 2524992b217e4fb0832aa6d98888427b-20210107 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1902843895; Thu, 07 Jan 2021 22:11:58 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 7 Jan 2021 22:11:56 -0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 8 Jan 2021 14:11:49 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 8 Jan 2021 14:11:48 +0800 Message-ID: <1610086308.24856.30.camel@mhfsdcap03> Subject: Re: [PATCH v5] usb: xhci-mtk: fix unreleased bandwidth data From: Chunfeng Yun To: Mathias Nyman Date: Fri, 8 Jan 2021 14:11:48 +0800 In-Reply-To: <2aea44f0-85e7-fd55-2c35-c1d994f20e03@linux.intel.com> References: <20201229142406.v5.1.Id0d31b5f3ddf5e734d2ab11161ac5821921b1e1e@changeid> <2aea44f0-85e7-fd55-2c35-c1d994f20e03@linux.intel.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 12678802E42F6808826D6958AF777C2230A087B39BF15A09308AD3209AE099362000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210108_011205_745245_4252476D X-CRM114-Status: GOOD ( 23.76 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhanyong Wang , Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Tianping Fang , linux-mediatek@lists.infradead.org, Matthias Brugger , Ikjoon Jang , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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 > > > > ... > > > > > 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 > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_2 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 267D3C433DB for ; Fri, 8 Jan 2021 06:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0369233FB for ; Fri, 8 Jan 2021 06:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726823AbhAHGMo (ORCPT ); Fri, 8 Jan 2021 01:12:44 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:16237 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725791AbhAHGMo (ORCPT ); Fri, 8 Jan 2021 01:12:44 -0500 X-UUID: a7d2ee42095b424f8da8284796bbd855-20210108 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=LDkX9dGv4KvdYnnhzQPG/2hc+NN7U1uTjI1C2TIOKEU=; b=e3oFH22iXVHk04QvgGDGtJing67Y3GCnTz7LpvDFRvhm2eM5b+nC2GCTP/9ZcEu1yOYhfJLWTV0fcnYYMQzjUVqF6AtuJVMxKj6jcvNW2RFTCOPesRCWe45JU7jARvPYfpwpmEoRGwAyYNX4q6ZVj9LXS9DSEgWwdIYd4turv8U=; X-UUID: a7d2ee42095b424f8da8284796bbd855-20210108 Received: from mtkcas32.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 1049624716; Fri, 08 Jan 2021 14:11:56 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 8 Jan 2021 14:11:49 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 8 Jan 2021 14:11:48 +0800 Message-ID: <1610086308.24856.30.camel@mhfsdcap03> Subject: Re: [PATCH v5] usb: xhci-mtk: fix unreleased bandwidth data From: Chunfeng Yun To: Mathias Nyman CC: Ikjoon Jang , , , Tianping Fang , Zhanyong Wang , Greg Kroah-Hartman , Mathias Nyman , Matthias Brugger , , Date: Fri, 8 Jan 2021 14:11:48 +0800 In-Reply-To: <2aea44f0-85e7-fd55-2c35-c1d994f20e03@linux.intel.com> References: <20201229142406.v5.1.Id0d31b5f3ddf5e734d2ab11161ac5821921b1e1e@changeid> <2aea44f0-85e7-fd55-2c35-c1d994f20e03@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 12678802E42F6808826D6958AF777C2230A087B39BF15A09308AD3209AE099362000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org T24gVGh1LCAyMDIxLTAxLTA3IGF0IDEzOjA5ICswMjAwLCBNYXRoaWFzIE55bWFuIHdyb3RlOg0K PiBPbiAyOS4xMi4yMDIwIDguMjQsIElram9vbiBKYW5nIHdy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2ltaWxhciBvdmVycmlkZXMgZm9yIC5hZGRfZW5kcG9pbnQgYW5kIC5kcm9wX2VuZHBv aW50IHNob3VsZCBwcm9iYWJseSBiZQ0KPiBkb25lIHNvIHRoYXQgd2UgY2FuIGdldCByaWQgb2Yg dGhlIHhoY2lfbXRrX2FkZC9kcm9wX2VwX3F1aXJrKCkgY2FsbHMgaW4geGhjaS5jIGFzIHdlbGwN CllvdSBtZWFuLCB3ZSBjYW4gZXhwb3J0IHhoY2lfYWRkL2Ryb3BfZW5kcG9pbnQoKT8NCg0KPiAN Cj4gVGhhbmtzDQo+IC1NYXRoaWFzDQo+IA0KDQo= 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=-15.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,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham 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 DDDD7C433E0 for ; Fri, 8 Jan 2021 06:15:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 82970233FB for ; Fri, 8 Jan 2021 06:15:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82970233FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1NwAZMRBq8Dr6Jk9F9rewWRv/fzareiP20o6SN0BO/8=; b=aZxxXiJG52QBMiwvo6Scc8sRa v6mc956bZazo/ETvlmf1yS9h/MvzIVl8WNkMMKTOcHMBuj4UiblTBfPRzuBNJaQuQkJ+6KqcaCHug lVfHOJ0tP0Pia6DPVHmAW/PhN6tqHWvUfqoSaHNt0wwBnlF0p4q7ytfkXRkP015t+cuGE6SWkYk2I 7fxZ5K+74uY0efc5zUrbiPYy+oSW4SuFepUpn3xON+xWbHoa2KOudggR2bJE4ER4vZXoNIgWUHuSm EwJ4zfFCTTnTQaRfjz2J+Dm37qOxbjomJjoydwpKJMC+LbF2bT2L3UyzzQ/PcFsxeor55t63qyVVy atBcqEpqQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxl0K-00070k-Ml; Fri, 08 Jan 2021 06:12:08 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxl0G-00070A-U0; Fri, 08 Jan 2021 06:12:06 +0000 X-UUID: 2524992b217e4fb0832aa6d98888427b-20210107 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=LDkX9dGv4KvdYnnhzQPG/2hc+NN7U1uTjI1C2TIOKEU=; b=e3oFH22iXVHk04QvgGDGtJing67Y3GCnTz7LpvDFRvhm2eM5b+nC2GCTP/9ZcEu1yOYhfJLWTV0fcnYYMQzjUVqF6AtuJVMxKj6jcvNW2RFTCOPesRCWe45JU7jARvPYfpwpmEoRGwAyYNX4q6ZVj9LXS9DSEgWwdIYd4turv8U=; X-UUID: 2524992b217e4fb0832aa6d98888427b-20210107 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1902843895; Thu, 07 Jan 2021 22:11:58 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 7 Jan 2021 22:11:56 -0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 8 Jan 2021 14:11:49 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 8 Jan 2021 14:11:48 +0800 Message-ID: <1610086308.24856.30.camel@mhfsdcap03> Subject: Re: [PATCH v5] usb: xhci-mtk: fix unreleased bandwidth data From: Chunfeng Yun To: Mathias Nyman Date: Fri, 8 Jan 2021 14:11:48 +0800 In-Reply-To: <2aea44f0-85e7-fd55-2c35-c1d994f20e03@linux.intel.com> References: <20201229142406.v5.1.Id0d31b5f3ddf5e734d2ab11161ac5821921b1e1e@changeid> <2aea44f0-85e7-fd55-2c35-c1d994f20e03@linux.intel.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 12678802E42F6808826D6958AF777C2230A087B39BF15A09308AD3209AE099362000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210108_011205_745245_4252476D X-CRM114-Status: GOOD ( 23.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhanyong Wang , Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Tianping Fang , linux-mediatek@lists.infradead.org, Matthias Brugger , Ikjoon Jang , linux-arm-kernel@lists.infradead.org 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 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 > > > > ... > > > > > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel