Hi Udipto, kernel test robot noticed the following build warnings: [auto build test WARNING on usb/usb-testing] [also build test WARNING on usb/usb-next usb/usb-linus driver-core/driver-core-testing driver-core/driver-core-next driver-core/driver-core-linus westeri-thunderbolt/next linus/master v6.3-rc7 next-20230418] [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#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Udipto-Goswami/usb-dwc3-debugfs-Prevent-any-register-access-when-devices/20230418-202039 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing patch link: https://lore.kernel.org/r/20230418121835.17550-1-quic_ugoswami%40quicinc.com patch subject: [PATCH v5] usb: dwc3: debugfs: Prevent any register access when devices config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20230419/202304191354.gk7ee6Gf-lkp@xxxxxxxxx/config) compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Reported-by: Dan Carpenter <error27@xxxxxxxxx> | Link: https://lore.kernel.org/r/202304191354.gk7ee6Gf-lkp@xxxxxxxxx/ smatch warnings: drivers/usb/dwc3/debugfs.c:338 dwc3_lsp_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:409 dwc3_mode_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:485 dwc3_testmode_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:555 dwc3_testmode_write() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:586 dwc3_link_state_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:649 dwc3_link_state_write() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:702 dwc3_tx_fifo_size_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:732 dwc3_rx_fifo_size_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:761 dwc3_tx_request_queue_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:784 dwc3_rx_request_queue_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:807 dwc3_rx_info_queue_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:830 dwc3_descriptor_fetch_queue_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:853 dwc3_event_queue_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:911 dwc3_trb_ring_show() warn: pm_runtime_get_sync() also returns 1 on success drivers/usb/dwc3/debugfs.c:960 dwc3_ep_info_register_show() warn: pm_runtime_get_sync() also returns 1 on success vim +338 drivers/usb/dwc3/debugfs.c 62ba09d6bb6330 Thinh Nguyen 2018-11-07 329 static int dwc3_lsp_show(struct seq_file *s, void *unused) 62ba09d6bb6330 Thinh Nguyen 2018-11-07 330 { 62ba09d6bb6330 Thinh Nguyen 2018-11-07 331 struct dwc3 *dwc = s->private; 62ba09d6bb6330 Thinh Nguyen 2018-11-07 332 unsigned int current_mode; 62ba09d6bb6330 Thinh Nguyen 2018-11-07 333 unsigned long flags; 62ba09d6bb6330 Thinh Nguyen 2018-11-07 334 u32 reg; 86f75fd9ae2609 Udipto Goswami 2023-04-18 335 int ret; 86f75fd9ae2609 Udipto Goswami 2023-04-18 336 86f75fd9ae2609 Udipto Goswami 2023-04-18 337 ret = pm_runtime_get_sync(dwc->dev); 86f75fd9ae2609 Udipto Goswami 2023-04-18 @338 if (!ret || ret < 0) { 86f75fd9ae2609 Udipto Goswami 2023-04-18 339 pm_runtime_put(dwc->dev); 86f75fd9ae2609 Udipto Goswami 2023-04-18 340 return 0; I don't know what's going on here, but Smatch doesn't like it. :P 86f75fd9ae2609 Udipto Goswami 2023-04-18 341 } 62ba09d6bb6330 Thinh Nguyen 2018-11-07 342 62ba09d6bb6330 Thinh Nguyen 2018-11-07 343 spin_lock_irqsave(&dwc->lock, flags); 62ba09d6bb6330 Thinh Nguyen 2018-11-07 344 reg = dwc3_readl(dwc->regs, DWC3_GSTS); 62ba09d6bb6330 Thinh Nguyen 2018-11-07 345 current_mode = DWC3_GSTS_CURMOD(reg); 62ba09d6bb6330 Thinh Nguyen 2018-11-07 346 62ba09d6bb6330 Thinh Nguyen 2018-11-07 347 switch (current_mode) { 62ba09d6bb6330 Thinh Nguyen 2018-11-07 348 case DWC3_GSTS_CURMOD_HOST: 62ba09d6bb6330 Thinh Nguyen 2018-11-07 349 dwc3_host_lsp(s); 62ba09d6bb6330 Thinh Nguyen 2018-11-07 350 break; 62ba09d6bb6330 Thinh Nguyen 2018-11-07 351 case DWC3_GSTS_CURMOD_DEVICE: 62ba09d6bb6330 Thinh Nguyen 2018-11-07 352 dwc3_gadget_lsp(s); 62ba09d6bb6330 Thinh Nguyen 2018-11-07 353 break; 62ba09d6bb6330 Thinh Nguyen 2018-11-07 354 default: 62ba09d6bb6330 Thinh Nguyen 2018-11-07 355 seq_puts(s, "Mode is unknown, no LSP register printed\n"); 62ba09d6bb6330 Thinh Nguyen 2018-11-07 356 break; 62ba09d6bb6330 Thinh Nguyen 2018-11-07 357 } 62ba09d6bb6330 Thinh Nguyen 2018-11-07 358 spin_unlock_irqrestore(&dwc->lock, flags); 86f75fd9ae2609 Udipto Goswami 2023-04-18 359 pm_runtime_put(dwc->dev); 62ba09d6bb6330 Thinh Nguyen 2018-11-07 360 62ba09d6bb6330 Thinh Nguyen 2018-11-07 361 return 0; 62ba09d6bb6330 Thinh Nguyen 2018-11-07 362 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests