drivers/misc/mei/hw-me.c:995:1-7: preceding lock on line 958

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Simon Richter <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2f1baf1fc8929e6c48370be543ad028ac7ad4131
commit: 25f9b0d351552f63ac3f72e6c655bc8f9994f7d2 misc/mei: Allow building Intel ME interface on non-x86
date:   7 months ago
:::::: branch date: 34 hours ago
:::::: commit date: 7 months ago
config: powerpc-randconfig-r053-20260812 (https://download.01.org/0day-ci/archive/20260815/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 12df34b8469b8095359de8c249cb1b2753fadeea)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: 25f9b0d35155 ("misc/mei: Allow building Intel ME interface on non-x86")
| Reported-by: kernel test robot <[email protected]>
| Reported-by: Julia Lawall <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

cocci warnings: (new ones prefixed by >>)
>> drivers/misc/mei/hw-me.c:995:1-7: preceding lock on line 958
   drivers/misc/mei/hw-me.c:815:2-8: preceding lock on line 804
   drivers/misc/mei/hw-me.c:832:1-7: preceding lock on line 804

vim +995 drivers/misc/mei/hw-me.c

859ef2ffbfa785 Alexander Usyskin 2015-08-02  924  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  925  /**
859ef2ffbfa785 Alexander Usyskin 2015-08-02  926   * mei_me_d0i3_enter_sync - perform d0i3 entry procedure
859ef2ffbfa785 Alexander Usyskin 2015-08-02  927   *
859ef2ffbfa785 Alexander Usyskin 2015-08-02  928   * @dev: the device structure
859ef2ffbfa785 Alexander Usyskin 2015-08-02  929   *
859ef2ffbfa785 Alexander Usyskin 2015-08-02  930   * Return: 0 on success an error code otherwise
859ef2ffbfa785 Alexander Usyskin 2015-08-02  931   */
859ef2ffbfa785 Alexander Usyskin 2015-08-02  932  static int mei_me_d0i3_enter_sync(struct mei_device *dev)
859ef2ffbfa785 Alexander Usyskin 2015-08-02  933  {
859ef2ffbfa785 Alexander Usyskin 2015-08-02  934  	struct mei_me_hw *hw = to_me_hw(dev);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  935  	int ret;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  936  	u32 reg;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  937  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  938  	reg = mei_me_d0i3c_read(dev);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  939  	if (reg & H_D0I3C_I3) {
859ef2ffbfa785 Alexander Usyskin 2015-08-02  940  		/* we are in d0i3, nothing to do */
7704e6be4ed283 Alexander Usyskin 2025-08-26  941  		dev_dbg(&dev->dev, "d0i3 set not needed\n");
859ef2ffbfa785 Alexander Usyskin 2015-08-02  942  		ret = 0;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  943  		goto on;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  944  	}
859ef2ffbfa785 Alexander Usyskin 2015-08-02  945  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  946  	/* PGI entry procedure */
859ef2ffbfa785 Alexander Usyskin 2015-08-02  947  	dev->pg_event = MEI_PG_EVENT_WAIT;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  948  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  949  	ret = mei_hbm_pg(dev, MEI_PG_ISOLATION_ENTRY_REQ_CMD);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  950  	if (ret)
859ef2ffbfa785 Alexander Usyskin 2015-08-02  951  		/* FIXME: should we reset here? */
859ef2ffbfa785 Alexander Usyskin 2015-08-02  952  		goto out;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  953  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  954  	mutex_unlock(&dev->device_lock);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  955  	wait_event_timeout(dev->wait_pg,
95953618519632 Alexander Usyskin 2022-09-08  956  		dev->pg_event == MEI_PG_EVENT_RECEIVED,
95953618519632 Alexander Usyskin 2022-09-08  957  		dev->timeouts.pgi);
859ef2ffbfa785 Alexander Usyskin 2015-08-02 @958  	mutex_lock(&dev->device_lock);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  959  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  960  	if (dev->pg_event != MEI_PG_EVENT_RECEIVED) {
859ef2ffbfa785 Alexander Usyskin 2015-08-02  961  		ret = -ETIME;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  962  		goto out;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  963  	}
859ef2ffbfa785 Alexander Usyskin 2015-08-02  964  	/* end PGI entry procedure */
859ef2ffbfa785 Alexander Usyskin 2015-08-02  965  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  966  	dev->pg_event = MEI_PG_EVENT_INTR_WAIT;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  967  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  968  	reg = mei_me_d0i3_set(dev, true);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  969  	if (!(reg & H_D0I3C_CIP)) {
7704e6be4ed283 Alexander Usyskin 2025-08-26  970  		dev_dbg(&dev->dev, "d0i3 enter wait not needed\n");
859ef2ffbfa785 Alexander Usyskin 2015-08-02  971  		ret = 0;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  972  		goto on;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  973  	}
859ef2ffbfa785 Alexander Usyskin 2015-08-02  974  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  975  	mutex_unlock(&dev->device_lock);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  976  	wait_event_timeout(dev->wait_pg,
95953618519632 Alexander Usyskin 2022-09-08  977  		dev->pg_event == MEI_PG_EVENT_INTR_RECEIVED,
95953618519632 Alexander Usyskin 2022-09-08  978  		dev->timeouts.d0i3);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  979  	mutex_lock(&dev->device_lock);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  980  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  981  	if (dev->pg_event != MEI_PG_EVENT_INTR_RECEIVED) {
859ef2ffbfa785 Alexander Usyskin 2015-08-02  982  		reg = mei_me_d0i3c_read(dev);
859ef2ffbfa785 Alexander Usyskin 2015-08-02  983  		if (!(reg & H_D0I3C_I3)) {
859ef2ffbfa785 Alexander Usyskin 2015-08-02  984  			ret = -ETIME;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  985  			goto out;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  986  		}
859ef2ffbfa785 Alexander Usyskin 2015-08-02  987  	}
859ef2ffbfa785 Alexander Usyskin 2015-08-02  988  
859ef2ffbfa785 Alexander Usyskin 2015-08-02  989  	ret = 0;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  990  on:
859ef2ffbfa785 Alexander Usyskin 2015-08-02  991  	hw->pg_state = MEI_PG_ON;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  992  out:
859ef2ffbfa785 Alexander Usyskin 2015-08-02  993  	dev->pg_event = MEI_PG_EVENT_IDLE;
7704e6be4ed283 Alexander Usyskin 2025-08-26  994  	dev_dbg(&dev->dev, "d0i3 enter ret = %d\n", ret);
859ef2ffbfa785 Alexander Usyskin 2015-08-02 @995  	return ret;
859ef2ffbfa785 Alexander Usyskin 2015-08-02  996  }
859ef2ffbfa785 Alexander Usyskin 2015-08-02  997  

:::::: The code at line 995 was first introduced by commit
:::::: 859ef2ffbfa785d273567467088cc8743f80b5bd mei: me: d0i3: add d0i3 enter/exit state machine

:::::: TO: Alexander Usyskin <[email protected]>
:::::: CC: Greg Kroah-Hartman <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.