From: kernel test robot <lkp@intel.com>
To: Li Jun <jun.li@nxp.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Peter Chen <peter.chen@nxp.com>
Subject: drivers/usb/chipidea/core.c:657 ci_usb_role_switch_set() error: double unlocked 'ci->lock' (orig line 638)
Date: Fri, 7 Aug 2020 18:00:02 +0800 [thread overview]
Message-ID: <202008071801.Xh6tOFOH%lkp@intel.com> (raw)
[-- 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 --]
next reply other threads:[~2020-08-07 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-07 10:00 kernel test robot [this message]
2020-08-08 2:44 ` Jun Li
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=202008071801.Xh6tOFOH%lkp@intel.com \
--to=lkp@intel.com \
--cc=jun.li@nxp.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.chen@nxp.com \
/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 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®