Skip to contentSkip to conversation

drivers/thermal/mmp3_thermal.c:65:3-9: preceding lock on line 59 (fwd)

PATCH New Julia Lawall 1 participant 1 message Jun 2, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 drivers/thermal/mmp3_thermal.c:65:3-9: preceding lock on line 59 (fwd)

Hello,

Please check whether there should be ab unlock before line 65.

The indenttion of the code looks strange. The indentation of the done label is certainly incorrect. It should be in the leftmost column.

julia

---------- Forwarded message ----------
Date: Tue, 2 Jun 2020 10:39:48 +0800
From: kbuild test robot <[email protected]>
To: kbuild(a)lists.01.org
Cc: lkp(a)intel.com, Julia Lawall <[email protected]>
Subject: [lkundrak-linux-mmp:lr/mmp3-thermal-v1 2/2]
drivers/thermal/mmp3_thermal.c:65:3-9: preceding lock on line 59

CC: kbuild-all(a)lists.01.org
TO: "Lubomir, Rintel," <[email protected]>

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux-mmp.git lr/mmp3-thermal-v1
head:   17256e30675ba9df02daa0722a6f1d35996322fe
commit: 17256e30675ba9df02daa0722a6f1d35996322fe [2/2] thermal driver

:::::: branch date: 6 weeks ago
:::::: commit date: 6 weeks ago
config: arm-randconfig-c003-20200602 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate

coccinelle warnings: (new ones prefixed by >>)

Quoted 1 line
Quoted 1 line

drivers/thermal/mmp3_thermal.c:65:3-9: preceding lock on line 59

# https://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux-mmp.git/commit/?id=17256e30675ba9df02daa0722a6f1d35996322fe
git remote add lkundrak-linux-mmp git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux-mmp.git
git remote update lkundrak-linux-mmp
git checkout 17256e30675ba9df02daa0722a6f1d35996322fe
vim +65 drivers/thermal/mmp3_thermal.c

17256e30675ba9 Lubomir Rintel 2019-08-12   52
17256e30675ba9 Lubomir Rintel 2019-08-12   53  static unsigned long read_temperature_sensor(struct mmp3_thermal *priv, int range, int index)
17256e30675ba9 Lubomir Rintel 2019-08-12   54  {
17256e30675ba9 Lubomir Rintel 2019-08-12   55  	int i, j, gray;
17256e30675ba9 Lubomir Rintel 2019-08-12   56  	unsigned long temp;
17256e30675ba9 Lubomir Rintel 2019-08-12   57  	u32 val;
17256e30675ba9 Lubomir Rintel 2019-08-12   58
17256e30675ba9 Lubomir Rintel 2019-08-12  @59  	mutex_lock(&mmp3_thermal_sensor_mutex);
17256e30675ba9 Lubomir Rintel 2019-08-12   60
17256e30675ba9 Lubomir Rintel 2019-08-12   61  	val = readl(priv->regs + index);
17256e30675ba9 Lubomir Rintel 2019-08-12   62
17256e30675ba9 Lubomir Rintel 2019-08-12   63  	if (val & TEMP_EN_WDOG) {
17256e30675ba9 Lubomir Rintel 2019-08-12   64  		if ((range == HIRANGE) == ((val & TEMP_LOWRANGE) == 0))
17256e30675ba9 Lubomir Rintel 2019-08-12  @65  			return 0;
17256e30675ba9 Lubomir Rintel 2019-08-12   66  	}
17256e30675ba9 Lubomir Rintel 2019-08-12   67
17256e30675ba9 Lubomir Rintel 2019-08-12   68  	if (range == HIRANGE) {
17256e30675ba9 Lubomir Rintel 2019-08-12   69  		val &= ~TEMP_LOWRANGE;
17256e30675ba9 Lubomir Rintel 2019-08-12   70  	} else {
17256e30675ba9 Lubomir Rintel 2019-08-12   71  		val |= TEMP_LOWRANGE;
17256e30675ba9 Lubomir Rintel 2019-08-12   72  	}
17256e30675ba9 Lubomir Rintel 2019-08-12   73
17256e30675ba9 Lubomir Rintel 2019-08-12   74  	val &= ~TEMP_START;
17256e30675ba9 Lubomir Rintel 2019-08-12   75  	writel(val, priv->regs + index);
17256e30675ba9 Lubomir Rintel 2019-08-12   76  	usleep_range(300, 1000);
17256e30675ba9 Lubomir Rintel 2019-08-12   77
17256e30675ba9 Lubomir Rintel 2019-08-12   78  	for (i = 0; i < 10; i++) {
17256e30675ba9 Lubomir Rintel 2019-08-12   79  		writel(val | TEMP_START, priv->regs + index);
17256e30675ba9 Lubomir Rintel 2019-08-12   80  		for (j = 0; j < 10; j++) {
17256e30675ba9 Lubomir Rintel 2019-08-12   81  			usleep_range(300, 1000);
17256e30675ba9 Lubomir Rintel 2019-08-12   82  			if (readl(priv->regs + index) & TEMP_STATUS)
17256e30675ba9 Lubomir Rintel 2019-08-12   83  				goto done;
17256e30675ba9 Lubomir Rintel 2019-08-12   84  		}
17256e30675ba9 Lubomir Rintel 2019-08-12   85  		usleep_range(300, 1000);
17256e30675ba9 Lubomir Rintel 2019-08-12   86  		writel(val, priv->regs + index);
17256e30675ba9 Lubomir Rintel 2019-08-12   87  	}
17256e30675ba9 Lubomir Rintel 2019-08-12   88      done:
17256e30675ba9 Lubomir Rintel 2019-08-12   89
17256e30675ba9 Lubomir Rintel 2019-08-12   90  	if (i == 10) {
17256e30675ba9 Lubomir Rintel 2019-08-12   91  		printk(KERN_ERR "mmp3_thermal: timeout reading sensor %d, range %d\n",
17256e30675ba9 Lubomir Rintel 2019-08-12   92  			index, range);
17256e30675ba9 Lubomir Rintel 2019-08-12   93  		writel(val, priv->regs + index);
17256e30675ba9 Lubomir Rintel 2019-08-12   94  		temp = 0;  // filtering may fix this
17256e30675ba9 Lubomir Rintel 2019-08-12   95  	} else {
17256e30675ba9 Lubomir Rintel 2019-08-12   96  		gray = readl(priv->regs + index) & TEMP_TEMP_VALUE_MASK;
17256e30675ba9 Lubomir Rintel 2019-08-12   97  		temp = gray_to_temp[range][gray];
17256e30675ba9 Lubomir Rintel 2019-08-12   98  	}
17256e30675ba9 Lubomir Rintel 2019-08-12   99
17256e30675ba9 Lubomir Rintel 2019-08-12  100  	mutex_unlock(&mmp3_thermal_sensor_mutex);
17256e30675ba9 Lubomir Rintel 2019-08-12  101
17256e30675ba9 Lubomir Rintel 2019-08-12  102  	return temp;	// return value is tenths, C
17256e30675ba9 Lubomir Rintel 2019-08-12  103  }
17256e30675ba9 Lubomir Rintel 2019-08-12  104

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