mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/usb/chipidea/usbmisc_imx.c:745 imx7d_charger_data_contact_detect() error: double unlocked 'usbmisc->lock' (orig line 725)
@ 2020-08-11 20:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-08-11 20:57 UTC (permalink / raw)
  To: Jun Li; +Cc: kbuild-all, linux-kernel, Peter Chen

[-- Attachment #1: Type: text/plain, Size: 2336 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   00e4db51259a5f936fec1424b884f029479d3981
commit: 746f316b753a83e366bfc5f936cbf0d72d1c2d1d usb: chipidea: introduce imx7d USB charger detection
date:   3 months ago
config: h8300-randconfig-m031-20200811 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0

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

smatch warnings:
drivers/usb/chipidea/usbmisc_imx.c:745 imx7d_charger_data_contact_detect() error: double unlocked 'usbmisc->lock' (orig line 725)

vim +745 drivers/usb/chipidea/usbmisc_imx.c

   712	
   713	static int imx7d_charger_data_contact_detect(struct imx_usbmisc_data *data)
   714	{
   715		struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev);
   716		unsigned long flags;
   717		u32 val;
   718		int i, data_pin_contact_count = 0;
   719	
   720		/* Enable Data Contact Detect (DCD) per the USB BC 1.2 */
   721		spin_lock_irqsave(&usbmisc->lock, flags);
   722		val = readl(usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
   723		writel(val | MX7D_USB_OTG_PHY_CFG2_CHRG_DCDENB,
   724				usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
 > 725		spin_unlock_irqrestore(&usbmisc->lock, flags);
   726	
   727		for (i = 0; i < 100; i = i + 1) {
   728			val = readl(usbmisc->base + MX7D_USB_OTG_PHY_STATUS);
   729			if (!(val & MX7D_USB_OTG_PHY_STATUS_LINE_STATE0)) {
   730				if (data_pin_contact_count++ > 5)
   731					/* Data pin makes contact */
   732					break;
   733				usleep_range(5000, 10000);
   734			} else {
   735				data_pin_contact_count = 0;
   736				usleep_range(5000, 6000);
   737			}
   738		}
   739	
   740		/* Disable DCD after finished data contact check */
   741		spin_lock_irqsave(&usbmisc->lock, flags);
   742		val = readl(usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
   743		writel(val & ~MX7D_USB_OTG_PHY_CFG2_CHRG_DCDENB,
   744				usbmisc->base + MX7D_USB_OTG_PHY_CFG2);
 > 745		spin_unlock_irqrestore(&usbmisc->lock, flags);
   746	
   747		if (i == 100) {
   748			dev_err(data->dev,
   749				"VBUS is coming from a dedicated power supply.\n");
   750			return -ENXIO;
   751		}
   752	
   753		return 0;
   754	}
   755	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23507 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-11 20:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 20:57 drivers/usb/chipidea/usbmisc_imx.c:745 imx7d_charger_data_contact_detect() error: double unlocked 'usbmisc->lock' (orig line 725) kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®