mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/usb/chipidea/core.c:657 ci_usb_role_switch_set() error: double unlocked 'ci->lock' (orig line 638)
@ 2020-08-07 10:00 kernel test robot
  2020-08-08  2:44 ` Jun Li
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-08-07 10:00 UTC (permalink / raw)
  To: Li Jun; +Cc: kbuild-all, linux-kernel, Peter Chen

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   86cfccb66937dd6cbf26ed619958b9e587e6a115
commit: 05559f10ed797b79f7fa47313682c48919a2b111 usb: chipidea: add role switch class support
date:   12 months ago
config: parisc-randconfig-m031-20200807 (attached as .config)
compiler: hppa-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/core.c:657 ci_usb_role_switch_set() error: double unlocked 'ci->lock' (orig line 638)

vim +657 drivers/usb/chipidea/core.c

   615	
   616	static int ci_usb_role_switch_set(struct device *dev, enum usb_role role)
   617	{
   618		struct ci_hdrc *ci = dev_get_drvdata(dev);
   619		struct ci_hdrc_cable *cable = NULL;
   620		enum usb_role current_role = ci_role_to_usb_role(ci);
   621		unsigned long flags;
   622	
   623		if (current_role == role)
   624			return 0;
   625	
   626		pm_runtime_get_sync(ci->dev);
   627		/* Stop current role */
   628		spin_lock_irqsave(&ci->lock, flags);
   629		if (current_role == USB_ROLE_DEVICE)
   630			cable = &ci->platdata->vbus_extcon;
   631		else if (current_role == USB_ROLE_HOST)
   632			cable = &ci->platdata->id_extcon;
   633	
   634		if (cable) {
   635			cable->changed = true;
   636			cable->connected = false;
   637			ci_irq(ci->irq, ci);
 > 638			spin_unlock_irqrestore(&ci->lock, flags);
   639			if (ci->wq && role != USB_ROLE_NONE)
   640				flush_workqueue(ci->wq);
   641			spin_lock_irqsave(&ci->lock, flags);
   642		}
   643	
   644		cable = NULL;
   645	
   646		/* Start target role */
   647		if (role == USB_ROLE_DEVICE)
   648			cable = &ci->platdata->vbus_extcon;
   649		else if (role == USB_ROLE_HOST)
   650			cable = &ci->platdata->id_extcon;
   651	
   652		if (cable) {
   653			cable->changed = true;
   654			cable->connected = true;
   655			ci_irq(ci->irq, ci);
   656		}
 > 657		spin_unlock_irqrestore(&ci->lock, flags);
   658		pm_runtime_put_sync(ci->dev);
   659	
   660		return 0;
   661	}
   662	

---
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: 25209 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-08  2:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07 10:00 drivers/usb/chipidea/core.c:657 ci_usb_role_switch_set() error: double unlocked 'ci->lock' (orig line 638) kernel test robot
2020-08-08  2:44 ` Jun Li

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®