tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 68b0fb4e955465eef28bed1f5a252c4e6c636a36 commit: c3f7d9b46a5caf93fd52e6fabc7a2d27cba66c6f [2490/2490] lan78xx: Fix race conditions in suspend/resume handling config: x86_64-randconfig-161-20241127 (https://download.01.org/0day-ci/archive/20241128/202411280257.12S1bi0F-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202411280257.12S1bi0F-lkp@intel.com/
smatch warnings: drivers/net/usb/lan78xx.c:4518 lan78xx_resume() warn: inconsistent indenting
vim +4518 drivers/net/usb/lan78xx.c
4491 4492 static int lan78xx_resume(struct usb_interface *intf) 4493 { 4494 struct lan78xx_net *dev = usb_get_intfdata(intf); 4495 bool dev_open; 4496 int ret; 4497 4498 mutex_lock(&dev->dev_mutex); 4499 4500 netif_dbg(dev, ifup, dev->net, "resuming device"); 4501 4502 dev_open = test_bit(EVENT_DEV_OPEN, &dev->flags); 4503 4504 if (dev_open) { 4505 bool pipe_halted = false; 4506 4507 ret = lan78xx_flush_tx_fifo(dev); 4508 if (ret < 0) 4509 goto out; 4510 4511 if (dev->urb_intr) { 4512 int ret = usb_submit_urb(dev->urb_intr, GFP_KERNEL); 4513 4514 if (ret < 0) { 4515 if (ret == -ENODEV) 4516 netif_device_detach(dev->net); 4517
4518 netdev_warn(dev->net, "Failed to submit intr URB");
4519 } 4520 } 4521 4522 spin_lock_irq(&dev->txq.lock); 4523 4524 if (netif_device_present(dev->net)) { 4525 pipe_halted = lan78xx_submit_deferred_urbs(dev); 4526 4527 if (pipe_halted) 4528 lan78xx_defer_kevent(dev, EVENT_TX_HALT); 4529 } 4530 4531 clear_bit(EVENT_DEV_ASLEEP, &dev->flags); 4532 4533 spin_unlock_irq(&dev->txq.lock); 4534 4535 if (!pipe_halted && 4536 netif_device_present(dev->net) && 4537 (skb_queue_len(&dev->txq) < dev->tx_qlen)) 4538 netif_start_queue(dev->net); 4539 4540 ret = lan78xx_start_tx_path(dev); 4541 if (ret < 0) 4542 goto out; 4543 4544 tasklet_schedule(&dev->bh); 4545 4546 if (!timer_pending(&dev->stat_monitor)) { 4547 dev->delta = 1; 4548 mod_timer(&dev->stat_monitor, 4549 jiffies + STAT_UPDATE_TIMER); 4550 } 4551 4552 } else { 4553 clear_bit(EVENT_DEV_ASLEEP, &dev->flags); 4554 } 4555 4556 ret = lan78xx_write_reg(dev, WUCSR2, 0); 4557 if (ret < 0) 4558 goto out; 4559 ret = lan78xx_write_reg(dev, WUCSR, 0); 4560 if (ret < 0) 4561 goto out; 4562 ret = lan78xx_write_reg(dev, WK_SRC, 0xFFF1FF1FUL); 4563 if (ret < 0) 4564 goto out; 4565 4566 ret = lan78xx_write_reg(dev, WUCSR2, WUCSR2_NS_RCD_ | 4567 WUCSR2_ARP_RCD_ | 4568 WUCSR2_IPV6_TCPSYN_RCD_ | 4569 WUCSR2_IPV4_TCPSYN_RCD_); 4570 if (ret < 0) 4571 goto out; 4572 4573 ret = lan78xx_write_reg(dev, WUCSR, WUCSR_EEE_TX_WAKE_ | 4574 WUCSR_EEE_RX_WAKE_ | 4575 WUCSR_PFDA_FR_ | 4576 WUCSR_RFE_WAKE_FR_ | 4577 WUCSR_WUFR_ | 4578 WUCSR_MPR_ | 4579 WUCSR_BCST_FR_); 4580 if (ret < 0) 4581 goto out; 4582 4583 ret = 0; 4584 out: 4585 mutex_unlock(&dev->dev_mutex); 4586 4587 return ret; 4588 } 4589