usb: xhci-mtk: fix ISOC error when interval is zero
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Thu, 20 Sep 2018 16:13:32 +0000 (19:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2019 08:53:07 +0000 (09:53 +0100)
[ Upstream commit 87173acc0d8f0987bda8827da35fff67f52ad15d ]

If the interval equal zero, needn't round up to power of two
for the number of packets in each ESIT, so fix it.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/xhci-mtk-sch.c

index 73f763c4f5f591a2c19053083dedf7b6aa252f31..144674913c78850647408d5da0224662f18734c7 100644 (file)
@@ -122,7 +122,9 @@ static void setup_sch_info(struct usb_device *udev,
                }
 
                if (ep_type == ISOC_IN_EP || ep_type == ISOC_OUT_EP) {
-                       if (esit_pkts <= sch_ep->esit)
+                       if (sch_ep->esit == 1)
+                               sch_ep->pkts = esit_pkts;
+                       else if (esit_pkts <= sch_ep->esit)
                                sch_ep->pkts = 1;
                        else
                                sch_ep->pkts = roundup_pow_of_two(esit_pkts)