linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: xhci-mtk: fix the failure of bandwidth allocation
@ 2020-07-10  2:29 Chunfeng Yun
  2020-07-10  3:14 ` Nicolas Boichat
  0 siblings, 1 reply; 3+ messages in thread
From: Chunfeng Yun @ 2020-07-10  2:29 UTC (permalink / raw)
  To: Mathias Nyman
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, stable,
	Chunfeng Yun, linux-mediatek, Matthias Brugger, linux-arm-kernel

The wMaxPacketSize field of endpoint descriptor may be zero
as default value in alternate interface, and they are not
actually selected when start stream, so skip them when try to
allocate bandwidth.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/host/xhci-mtk-sch.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c
index fea5555..45c54d56 100644
--- a/drivers/usb/host/xhci-mtk-sch.c
+++ b/drivers/usb/host/xhci-mtk-sch.c
@@ -557,6 +557,10 @@ static bool need_bw_sch(struct usb_host_endpoint *ep,
 	if (is_fs_or_ls(speed) && !has_tt)
 		return false;
 
+	/* skip endpoint with zero maxpkt */
+	if (usb_endpoint_maxp(&ep->desc) == 0)
+		return false;
+
 	return true;
 }
 
-- 
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: xhci-mtk: fix the failure of bandwidth allocation
  2020-07-10  2:29 [PATCH] usb: xhci-mtk: fix the failure of bandwidth allocation Chunfeng Yun
@ 2020-07-10  3:14 ` Nicolas Boichat
  2020-07-10  5:58   ` Chunfeng Yun
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Boichat @ 2020-07-10  3:14 UTC (permalink / raw)
  To: Chunfeng Yun
  Cc: Mathias Nyman, Greg Kroah-Hartman, linux-usb, lkml, stable,
	moderated list:ARM/Mediatek SoC support, Matthias Brugger,
	Ikjoon Jang, linux-arm Mailing List

On Fri, Jul 10, 2020 at 10:30 AM Chunfeng Yun <chunfeng.yun@mediatek.com> wrote:
>
> The wMaxPacketSize field of endpoint descriptor may be zero
> as default value in alternate interface, and they are not
> actually selected when start stream, so skip them when try to
> allocate bandwidth.
>
> Cc: stable <stable@vger.kernel.org>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Add this?
Fixes: 0cbd4b34cda9dfd ("xhci: mediatek: support MTK xHCI host controller")

> ---
>  drivers/usb/host/xhci-mtk-sch.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c
> index fea5555..45c54d56 100644
> --- a/drivers/usb/host/xhci-mtk-sch.c
> +++ b/drivers/usb/host/xhci-mtk-sch.c
> @@ -557,6 +557,10 @@ static bool need_bw_sch(struct usb_host_endpoint *ep,
>         if (is_fs_or_ls(speed) && !has_tt)
>                 return false;
>
> +       /* skip endpoint with zero maxpkt */
> +       if (usb_endpoint_maxp(&ep->desc) == 0)
> +               return false;
> +
>         return true;
>  }
>
> --
> 1.9.1
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: xhci-mtk: fix the failure of bandwidth allocation
  2020-07-10  3:14 ` Nicolas Boichat
@ 2020-07-10  5:58   ` Chunfeng Yun
  0 siblings, 0 replies; 3+ messages in thread
From: Chunfeng Yun @ 2020-07-10  5:58 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Mathias Nyman, Greg Kroah-Hartman, linux-usb, lkml, stable,
	moderated list:ARM/Mediatek SoC support, Matthias Brugger,
	Ikjoon Jang, linux-arm Mailing List

On Fri, 2020-07-10 at 11:14 +0800, Nicolas Boichat wrote:
> On Fri, Jul 10, 2020 at 10:30 AM Chunfeng Yun <chunfeng.yun@mediatek.com> wrote:
> >
> > The wMaxPacketSize field of endpoint descriptor may be zero
> > as default value in alternate interface, and they are not
> > actually selected when start stream, so skip them when try to
> > allocate bandwidth.
> >
> > Cc: stable <stable@vger.kernel.org>
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> 
> Add this?
> Fixes: 0cbd4b34cda9dfd ("xhci: mediatek: support MTK xHCI host controller")
Ok, thanks

> 
> > ---
> >  drivers/usb/host/xhci-mtk-sch.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c
> > index fea5555..45c54d56 100644
> > --- a/drivers/usb/host/xhci-mtk-sch.c
> > +++ b/drivers/usb/host/xhci-mtk-sch.c
> > @@ -557,6 +557,10 @@ static bool need_bw_sch(struct usb_host_endpoint *ep,
> >         if (is_fs_or_ls(speed) && !has_tt)
> >                 return false;
> >
> > +       /* skip endpoint with zero maxpkt */
> > +       if (usb_endpoint_maxp(&ep->desc) == 0)
> > +               return false;
> > +
> >         return true;
> >  }
> >
> > --
> > 1.9.1
> > _______________________________________________
> > Linux-mediatek mailing list
> > Linux-mediatek@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-mediatek

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-10  6:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10  2:29 [PATCH] usb: xhci-mtk: fix the failure of bandwidth allocation Chunfeng Yun
2020-07-10  3:14 ` Nicolas Boichat
2020-07-10  5:58   ` Chunfeng Yun

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).