CC: [email protected] CC: [email protected] TO: "Anurag, Kumar, Vulisha," <[email protected]> CC: Michal Simek <[email protected]> CC: Piyush Mehta <[email protected]>
tree: https://github.com/Xilinx/linux-xlnx master head: 3e983e4f0dfe5024dd0b4fedd5e46363f1dc9240 commit: 75684e8cb49926c7d118d4b7648cd2bdbaf6404b [9614/10031] usb: gadget: uvc_video: unlock before submitting a request to ep :::::: branch date: 2 days ago :::::: commit date: 4 months ago config: arm-randconfig-s032-20200603 (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.1-244-g0ee050a8-dirty git checkout 75684e8cb49926c7d118d4b7648cd2bdbaf6404b # save the attached .config to linux build tree make W=1 C=1 ARCH=arm CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> 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 # https://github.com/Xilinx/linux-xlnx/commit/75684e8cb49926c7d118d4b7648cd2bdbaf6404b git remote add xlnx https://github.com/Xilinx/linux-xlnx git remote update xlnx git checkout 75684e8cb49926c7d118d4b7648cd2bdbaf6404b vim +/uvcg_video_pump +333 drivers/usb/gadget/function/uvc_video.c cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 286 cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 287 /* -------------------------------------------------------------------------- cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 288 * Video streaming cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 289 */ cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 290 cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 291 /* 7ea95b110811fa drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09 292 * uvcg_video_pump - Pump video data into the USB requests cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 293 * cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 294 * This function fills the available USB requests (listed in req_free) with cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 295 * video data from the queued buffers. cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 296 */ 3a83c16ef0e03e drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09 297 int uvcg_video_pump(struct uvc_video *video) cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 298 { bd52b813a999e4 drivers/usb/gadget/function/uvc_video.c Michael Grzeschik 2014-08-08 299 struct uvc_video_queue *queue = &video->queue; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 300 struct usb_request *req; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 301 struct uvc_buffer *buf; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 302 unsigned long flags; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 303 int ret; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 304 7ea95b110811fa drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09 305 /* FIXME TODO Race between uvcg_video_pump and requests completion cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 306 * handler ??? cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 307 */ cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 308 cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 309 while (1) { cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 310 /* Retrieve the first available USB request, protected by the cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 311 * request lock. cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 312 */ cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 313 spin_lock_irqsave(&video->req_lock, flags); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 314 if (list_empty(&video->req_free)) { cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 315 spin_unlock_irqrestore(&video->req_lock, flags); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 316 return 0; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 317 } cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 318 req = list_first_entry(&video->req_free, struct usb_request, cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 319 list); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 320 list_del(&req->list); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 321 spin_unlock_irqrestore(&video->req_lock, flags); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 322 cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 323 /* Retrieve the first available video buffer and fill the cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 324 * request, protected by the video queue irqlock. cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 325 */ 6dd5b021bd6c73 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2014-09-16 326 spin_lock_irqsave(&queue->irqlock, flags); 6dd5b021bd6c73 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2014-09-16 327 buf = uvcg_queue_head(queue); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 328 if (buf == NULL) { 6dd5b021bd6c73 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2014-09-16 329 spin_unlock_irqrestore(&queue->irqlock, flags); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 330 break; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 331 } cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 332 cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 @333 video->encode(req, video, buf); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 334 75684e8cb49926 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha 2020-01-23 335 spin_unlock_irqrestore(&queue->irqlock, flags); 75684e8cb49926 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha 2020-01-23 336 cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 337 /* Queue the USB request */ 9d1ff5dcb3cd33 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2018-08-10 338 ret = uvcg_video_ep_queue(video, req); 6dd5b021bd6c73 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2014-09-16 339 spin_unlock_irqrestore(&queue->irqlock, flags); 9d1ff5dcb3cd33 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2018-08-10 340 9d1ff5dcb3cd33 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2018-08-10 341 if (ret < 0) { 75684e8cb49926 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha 2020-01-23 342 printk(KERN_INFO "Failed to queue request (%d)\n", ret); 75684e8cb49926 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha 2020-01-23 343 usb_ep_set_halt(video->ep); 7ea95b110811fa drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09 344 uvcg_queue_cancel(queue, 0); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 345 break; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 346 } cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 347 } cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 348 cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 349 spin_lock_irqsave(&video->req_lock, flags); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 350 list_add_tail(&req->list, &video->req_free); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 351 spin_unlock_irqrestore(&video->req_lock, flags); cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 352 return 0; cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 353 } cdda479f15cd13 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 <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
