From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers//usb/chipidea/core.c:657 ci_usb_role_switch_set() error: double unlocked 'ci->lock' (orig line 638)
Date: Fri, 10 Jul 2020 21:49:01 +0800 [thread overview]
Message-ID: <202007102157.jS657eNI%lkp@intel.com> (raw)
[-- 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 --]
reply other threads:[~2020-07-10 13:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202007102157.jS657eNI%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.