[PATCH] usb: xhci-mtk: fix unreleased bandwidth data

kernel test robot lkp at intel.com
Wed Dec 2 10:34:24 EST 2020


Hi Ikjoon,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v5.10-rc6 next-20201201]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ikjoon-Jang/usb-xhci-mtk-fix-unreleased-bandwidth-data/20201130-134136
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: nios2-randconfig-r021-20201202 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/324226ecfa4a9c871325f040e886589fbbff2262
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ikjoon-Jang/usb-xhci-mtk-fix-unreleased-bandwidth-data/20201130-134136
        git checkout 324226ecfa4a9c871325f040e886589fbbff2262
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   drivers/usb/host/xhci-mtk-sch.c: In function 'xhci_mtk_add_ep_quirk':
>> drivers/usb/host/xhci-mtk-sch.c:606:27: warning: variable 'sch_array' set but not used [-Wunused-but-set-variable]
     606 |  struct mu3h_sch_bw_info *sch_array;
         |                           ^~~~~~~~~

vim +/sch_array +606 drivers/usb/host/xhci-mtk-sch.c

0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  596  
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  597  int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  598  		struct usb_host_endpoint *ep)
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  599  {
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  600  	struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd);
324226ecfa4a9c8 Ikjoon Jang  2020-11-30  601  	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  602  	struct xhci_ep_ctx *ep_ctx;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  603  	struct xhci_slot_ctx *slot_ctx;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  604  	struct xhci_virt_device *virt_dev;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  605  	struct mu3h_sch_ep_info *sch_ep;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24 @606  	struct mu3h_sch_bw_info *sch_array;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  607  	unsigned int ep_index;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  608  
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  609  	virt_dev = xhci->devs[udev->slot_id];
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  610  	ep_index = xhci_get_endpoint_index(&ep->desc);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  611  	slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  612  	ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  613  	sch_array = mtk->sch_array;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  614  
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  615  	xhci_dbg(xhci, "%s() type:%d, speed:%d, mpkt:%d, dir:%d, ep:%p\n",
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  616  		__func__, usb_endpoint_type(&ep->desc), udev->speed,
734d3ddd81902d8 Felipe Balbi 2016-09-28  617  		usb_endpoint_maxp(&ep->desc),
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  618  		usb_endpoint_dir_in(&ep->desc), ep);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  619  
b765a16a11fad6b Chunfeng Yun 2016-01-26  620  	if (!need_bw_sch(ep, udev->speed, slot_ctx->tt_info & TT_SLOT)) {
b765a16a11fad6b Chunfeng Yun 2016-01-26  621  		/*
b765a16a11fad6b Chunfeng Yun 2016-01-26  622  		 * set @bpkts to 1 if it is LS or FS periodic endpoint, and its
b765a16a11fad6b Chunfeng Yun 2016-01-26  623  		 * device does not connected through an external HS hub
b765a16a11fad6b Chunfeng Yun 2016-01-26  624  		 */
b765a16a11fad6b Chunfeng Yun 2016-01-26  625  		if (usb_endpoint_xfer_int(&ep->desc)
b765a16a11fad6b Chunfeng Yun 2016-01-26  626  			|| usb_endpoint_xfer_isoc(&ep->desc))
b765a16a11fad6b Chunfeng Yun 2016-01-26  627  			ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(1));
b765a16a11fad6b Chunfeng Yun 2016-01-26  628  
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  629  		return 0;
b765a16a11fad6b Chunfeng Yun 2016-01-26  630  	}
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  631  
95b516c18621d16 Chunfeng Yun 2018-09-20  632  	sch_ep = create_sch_ep(udev, ep, ep_ctx);
324226ecfa4a9c8 Ikjoon Jang  2020-11-30  633  
95b516c18621d16 Chunfeng Yun 2018-09-20  634  	if (IS_ERR_OR_NULL(sch_ep))
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  635  		return -ENOMEM;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  636  
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  637  	setup_sch_info(udev, ep_ctx, sch_ep);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  638  
324226ecfa4a9c8 Ikjoon Jang  2020-11-30  639  	list_add_tail(&sch_ep->endpoint, &mtk->bw_ep_list_new);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  640  
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  641  	ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(sch_ep->pkts)
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  642  		| EP_BCSCOUNT(sch_ep->cs_count) | EP_BBM(sch_ep->burst_mode));
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  643  	ep_ctx->reserved[1] |= cpu_to_le32(EP_BOFFSET(sch_ep->offset)
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  644  		| EP_BREPEAT(sch_ep->repeat));
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  645  
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  646  	xhci_dbg(xhci, " PKTS:%x, CSCOUNT:%x, BM:%x, OFFSET:%x, REPEAT:%x\n",
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  647  			sch_ep->pkts, sch_ep->cs_count, sch_ep->burst_mode,
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  648  			sch_ep->offset, sch_ep->repeat);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  649  
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  650  	return 0;
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  651  }
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  652  EXPORT_SYMBOL_GPL(xhci_mtk_add_ep_quirk);
0cbd4b34cda9dfd Chunfeng Yun 2015-11-24  653  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 26463 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20201202/131f90c5/attachment-0001.gz>


More information about the Linux-mediatek mailing list