lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202208050012.uDlpcTiD-lkp@intel.com>
Date:   Fri, 5 Aug 2022 10:35:44 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Randy Dunlap <rdunlap@...radead.org>,
        Kevin Cernekee <cernekee@...il.com>,
        Felipe Balbi <felipe.balbi@...rosoft.com>,
        linux-usb@...r.kernel.org
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Subject: drivers/usb/gadget/udc/bcm63xx_udc.c:1861 bcm63xx_udc_stop() warn:
 sleeping in atomic context

[ This patch just enabled the build-bot to test more code, so it gets
  blamed for the new warnings even though it didn't introduce them.

  The actual bug in a USB driver, so I've added linux-usb to the CC
  list. -dan ]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b44f2fd87919b5ae6e1756d4c7ba2cbba22238e1
commit: 5eeaafc8d69373c095e461bdb39e5c9b62228ac5 mips: BCM63XX: ensure that CPU_SUPPORTS_32BIT_KERNEL is set
config: mips-randconfig-m041-20220804 (https://download.01.org/0day-ci/archive/20220805/202208050012.uDlpcTiD-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

New smatch warnings:
drivers/usb/gadget/udc/bcm63xx_udc.c:1861 bcm63xx_udc_stop() warn: sleeping in atomic context

vim +1861 drivers/usb/gadget/udc/bcm63xx_udc.c

22835b807e7ca9 drivers/usb/gadget/udc/bcm63xx_udc.c Felipe Balbi       2014-10-17  1846  static int bcm63xx_udc_stop(struct usb_gadget *gadget)
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1847  {
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1848  	struct bcm63xx_udc *udc = gadget_to_udc(gadget);
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1849  	unsigned long flags;
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1850  
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1851  	spin_lock_irqsave(&udc->lock, flags);
                                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1852  
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1853  	udc->driver = NULL;
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1854  
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1855  	/*
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1856  	 * If we switch the PHY too abruptly after dropping D+, the host
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1857  	 * will often complain:
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1858  	 *
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1859  	 *     hub 1-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1860  	 */
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25 @1861  	msleep(100);
                                                                                                ^^^^^^^^^^^^
You can't sleep when you're holding a spinlock.

613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1862  
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1863  	bcm63xx_select_phy_mode(udc, false);
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1864  	set_clocks(udc, false);
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1865  
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1866  	spin_unlock_irqrestore(&udc->lock, flags);
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1867  
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1868  	return 0;
613065e53cb191 drivers/usb/gadget/bcm63xx_udc.c     Kevin Cernekee     2012-08-25  1869  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ