mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jun Li <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/usbmisc_imx.c:745 imx7d_charger_data_contact_detect() error: double unlocked 'usbmisc->lock' (orig line 725)
Date: Wed, 12 Aug 2020 04:57:19 +0800	[thread overview]
Message-ID: <202008120417.3qTEAK3X%lkp@intel.com> (raw)

[-- 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 --]

                 reply	other threads:[~2020-08-11 20:58 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=202008120417.3qTEAK3X%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®