[xlnx:xlnx_rebase_v5.4 921/1683] drivers/usb/gadget/function/uvc_video.c:333:17: sparse: sparse: context imbalance in 'uvcg_video_pump' - unexpected unlock

kernel test robot lkp at intel.com
Wed Nov 4 02:49:22 EST 2020


tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head:   87d2d58e2137748748d96a630fd93eb0e2d81123
commit: f72d142ede2de067580bd13d63bd696d032c7a27 [921/1683] usb: gadget: uvc_video: unlock before submitting a request to ep
:::::: branch date: 25 hours ago
:::::: commit date: 7 months ago
config: parisc-randconfig-s032-20201030 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-56-gc09e8239-dirty
        # https://github.com/Xilinx/linux-xlnx/commit/f72d142ede2de067580bd13d63bd696d032c7a27
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx xlnx_rebase_v5.4
        git checkout f72d142ede2de067580bd13d63bd696d032c7a27
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=parisc 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/usb/gadget/function/uvc_video.c:333:17: sparse: sparse: context imbalance in 'uvcg_video_pump' - unexpected unlock

vim +/uvcg_video_pump +333 drivers/usb/gadget/function/uvc_video.c

cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  286  
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  287  /* --------------------------------------------------------------------------
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  288   * Video streaming
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  289   */
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  290  
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  291  /*
7ea95b110811fa8 drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09  292   * uvcg_video_pump - Pump video data into the USB requests
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  293   *
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  294   * This function fills the available USB requests (listed in req_free) with
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  295   * video data from the queued buffers.
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  296   */
3a83c16ef0e03e2 drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09  297  int uvcg_video_pump(struct uvc_video *video)
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  298  {
bd52b813a999e44 drivers/usb/gadget/function/uvc_video.c Michael Grzeschik     2014-08-08  299  	struct uvc_video_queue *queue = &video->queue;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  300  	struct usb_request *req;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  301  	struct uvc_buffer *buf;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  302  	unsigned long flags;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  303  	int ret;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  304  
7ea95b110811fa8 drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09  305  	/* FIXME TODO Race between uvcg_video_pump and requests completion
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  306  	 * handler ???
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  307  	 */
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  308  
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  309  	while (1) {
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  310  		/* Retrieve the first available USB request, protected by the
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  311  		 * request lock.
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  312  		 */
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  313  		spin_lock_irqsave(&video->req_lock, flags);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  314  		if (list_empty(&video->req_free)) {
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  315  			spin_unlock_irqrestore(&video->req_lock, flags);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  316  			return 0;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  317  		}
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  318  		req = list_first_entry(&video->req_free, struct usb_request,
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  319  					list);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  320  		list_del(&req->list);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  321  		spin_unlock_irqrestore(&video->req_lock, flags);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  322  
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  323  		/* Retrieve the first available video buffer and fill the
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  324  		 * request, protected by the video queue irqlock.
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  325  		 */
6dd5b021bd6c735 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart      2014-09-16  326  		spin_lock_irqsave(&queue->irqlock, flags);
6dd5b021bd6c735 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart      2014-09-16  327  		buf = uvcg_queue_head(queue);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  328  		if (buf == NULL) {
6dd5b021bd6c735 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart      2014-09-16  329  			spin_unlock_irqrestore(&queue->irqlock, flags);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  330  			break;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  331  		}
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  332  
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02 @333  		video->encode(req, video, buf);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  334  
f72d142ede2de06 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha  2020-01-23  335  		spin_unlock_irqrestore(&queue->irqlock, flags);
f72d142ede2de06 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha  2020-01-23  336  
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  337  		/* Queue the USB request */
9d1ff5dcb3cd339 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart      2018-08-10  338  		ret = uvcg_video_ep_queue(video, req);
6dd5b021bd6c735 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart      2014-09-16  339  		spin_unlock_irqrestore(&queue->irqlock, flags);
9d1ff5dcb3cd339 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart      2018-08-10  340  
9d1ff5dcb3cd339 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart      2018-08-10  341  		if (ret < 0) {
f72d142ede2de06 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha  2020-01-23  342  			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
f72d142ede2de06 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha  2020-01-23  343  			usb_ep_set_halt(video->ep);
7ea95b110811fa8 drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09  344  			uvcg_queue_cancel(queue, 0);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  345  			break;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  346  		}
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  347  	}
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  348  
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  349  	spin_lock_irqsave(&video->req_lock, flags);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  350  	list_add_tail(&req->list, &video->req_free);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  351  	spin_unlock_irqrestore(&video->req_lock, flags);
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  352  	return 0;
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  353  }
cdda479f15cd13f drivers/usb/gadget/uvc_video.c          Laurent Pinchart      2010-05-02  354  

:::::: The code at line 333 was first introduced by commit
:::::: cdda479f15cd13fa50a913ca85129c0437cc7b91 USB gadget: video class function driver

:::::: TO: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
:::::: CC: Greg Kroah-Hartman <gregkh at suse.de>

---
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: 30920 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20201104/974df63d/attachment-0001.gz>


More information about the linux-arm-kernel mailing list