0127-usb-xhci-mtk-use-ports-count-from-xhci-in-xhci_mtk_s.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From f97aa71fe34135e7fc8da6231e61ee06f79d739d Mon Sep 17 00:00:00 2001
  2. From: Chunfeng Yun <[email protected]>
  3. Date: Fri, 13 Oct 2017 16:26:34 +0800
  4. Subject: [PATCH 127/224] usb: xhci-mtk: use ports count from xhci in
  5. xhci_mtk_sch_init()
  6. Make use of ports count from xhci but not from ippc in
  7. xhci_mtk_sch_init()
  8. Signed-off-by: Chunfeng Yun <[email protected]>
  9. Acked-by: Mathias Nyman <[email protected]>
  10. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  11. ---
  12. drivers/usb/host/xhci-mtk-sch.c | 3 ++-
  13. drivers/usb/host/xhci-mtk.c | 3 ---
  14. 2 files changed, 2 insertions(+), 4 deletions(-)
  15. --- a/drivers/usb/host/xhci-mtk-sch.c
  16. +++ b/drivers/usb/host/xhci-mtk-sch.c
  17. @@ -287,12 +287,13 @@ static bool need_bw_sch(struct usb_host_
  18. int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk)
  19. {
  20. + struct xhci_hcd *xhci = hcd_to_xhci(mtk->hcd);
  21. struct mu3h_sch_bw_info *sch_array;
  22. int num_usb_bus;
  23. int i;
  24. /* ss IN and OUT are separated */
  25. - num_usb_bus = mtk->num_u3_ports * 2 + mtk->num_u2_ports;
  26. + num_usb_bus = xhci->num_usb3_ports * 2 + xhci->num_usb2_ports;
  27. sch_array = kcalloc(num_usb_bus, sizeof(*sch_array), GFP_KERNEL);
  28. if (sch_array == NULL)
  29. --- a/drivers/usb/host/xhci-mtk.c
  30. +++ b/drivers/usb/host/xhci-mtk.c
  31. @@ -492,7 +492,6 @@ static void xhci_mtk_quirks(struct devic
  32. /* called during probe() after chip reset completes */
  33. static int xhci_mtk_setup(struct usb_hcd *hcd)
  34. {
  35. - struct xhci_hcd *xhci = hcd_to_xhci(hcd);
  36. struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd);
  37. int ret;
  38. @@ -507,8 +506,6 @@ static int xhci_mtk_setup(struct usb_hcd
  39. return ret;
  40. if (usb_hcd_is_primary_hcd(hcd)) {
  41. - mtk->num_u3_ports = xhci->num_usb3_ports;
  42. - mtk->num_u2_ports = xhci->num_usb2_ports;
  43. ret = xhci_mtk_sch_init(mtk);
  44. if (ret)
  45. return ret;