diff mbox series

usb: xhci-mtk: fix the failure of bandwidth allocation

Message ID 1594348182-431-1-git-send-email-chunfeng.yun@mediatek.com (mailing list archive)
State Mainlined
Commit 5ce1a24dd98c00a57a8fa13660648abf7e08e3ef
Headers show
Series usb: xhci-mtk: fix the failure of bandwidth allocation | expand

Commit Message

Chunfeng Yun (云春峰) July 10, 2020, 2:29 a.m. UTC
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(+)

Comments

Nicolas Boichat July 10, 2020, 3:14 a.m. UTC | #1
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
Chunfeng Yun (云春峰) July 10, 2020, 5:58 a.m. UTC | #2
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
diff mbox series

Patch

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;
 }