All of lore.kernel.org
 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-07-10 13:49 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-07-10 13:49 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Li Jun <jun.li@nxp.com>
CC: Peter Chen <peter.chen@nxp.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   42f82040ee66db13525dc6f14b8559890b2f4c1c
commit: 05559f10ed797b79f7fa47313682c48919a2b111 usb: chipidea: add role switch class support
date:   11 months ago
:::::: branch date: 12 hours ago
:::::: commit date: 11 months ago
config: h8300-randconfig-m031-20200710 (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>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers//usb/chipidea/core.c:657 ci_usb_role_switch_set() error: double unlocked 'ci->lock' (orig line 638)

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=05559f10ed797b79f7fa47313682c48919a2b111
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 05559f10ed797b79f7fa47313682c48919a2b111
vim +657 drivers//usb/chipidea/core.c

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

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

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

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

only message in thread, other threads:[~2020-07-10 13:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-10 13:49 drivers//usb/chipidea/core.c:657 ci_usb_role_switch_set() error: double unlocked 'ci->lock' (orig line 638) kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.