[tty:tty-testing 15/46] drivers/tty/serial/xilinx_uartps.c:1398:3-9: preceding lock on line 1391 (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Please check whether an unlock is needed on line 1398.

julia

---------- Forwarded message ----------
Date: Tue, 18 Sep 2018 22:08:36 +0800
From: kbuild test robot <lkp@xxxxxxxxx>
To: kbuild@xxxxxx
Cc: Julia Lawall <julia.lawall@xxxxxxx>
Subject: [tty:tty-testing 15/46] drivers/tty/serial/xilinx_uartps.c:1398:3-9:
    preceding lock on line 1391

CC: kbuild-all@xxxxxx
CC: linux-serial@xxxxxxxxxxxxxxx
TO: Michal Simek <monstr@xxxxxxxxx>
CC: "Greg Kroah-Hartman" <gregkh@xxxxxxxxxxxxxxxxxxx>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
head:   43b22c8519b903a950be620d9cd095a63dbdbeed
commit: 2b790db7a6ce25e4575b6ac620c9efb00301bcbe [15/46] serial: uartps: Change uart ID port allocation
:::::: branch date: 29 minutes ago
:::::: commit date: 85 minutes ago

>> drivers/tty/serial/xilinx_uartps.c:1398:3-9: preceding lock on line 1391

# https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git/commit/?id=2b790db7a6ce25e4575b6ac620c9efb00301bcbe
git remote add tty https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
git remote update tty
git checkout 2b790db7a6ce25e4575b6ac620c9efb00301bcbe
vim +1398 drivers/tty/serial/xilinx_uartps.c

2b790db7 Michal Simek 2018-09-18  1386
2b790db7 Michal Simek 2018-09-18  1387  static int cdns_get_id(struct platform_device *pdev)
2b790db7 Michal Simek 2018-09-18  1388  {
2b790db7 Michal Simek 2018-09-18  1389  	int id, ret;
2b790db7 Michal Simek 2018-09-18  1390
2b790db7 Michal Simek 2018-09-18 @1391  	mutex_lock(&bitmap_lock);
2b790db7 Michal Simek 2018-09-18  1392
2b790db7 Michal Simek 2018-09-18  1393  	/* Alias list is stable that's why get alias bitmap only once */
2b790db7 Michal Simek 2018-09-18  1394  	if (!alias_bitmap_initialized) {
2b790db7 Michal Simek 2018-09-18  1395  		ret = of_alias_get_alias_list(cdns_uart_of_match, "serial",
2b790db7 Michal Simek 2018-09-18  1396  					      alias_bitmap, MAX_UART_INSTANCES);
2b790db7 Michal Simek 2018-09-18  1397  		if (ret)
2b790db7 Michal Simek 2018-09-18 @1398  			return ret;
2b790db7 Michal Simek 2018-09-18  1399
2b790db7 Michal Simek 2018-09-18  1400  		alias_bitmap_initialized++;
2b790db7 Michal Simek 2018-09-18  1401  	}
2b790db7 Michal Simek 2018-09-18  1402
2b790db7 Michal Simek 2018-09-18  1403  	/* Make sure that alias ID is not taken by instance without alias */
2b790db7 Michal Simek 2018-09-18  1404  	bitmap_or(bitmap, bitmap, alias_bitmap, MAX_UART_INSTANCES);
2b790db7 Michal Simek 2018-09-18  1405
2b790db7 Michal Simek 2018-09-18  1406  	dev_dbg(&pdev->dev, "Alias bitmap: %*pb\n",
2b790db7 Michal Simek 2018-09-18  1407  		MAX_UART_INSTANCES, bitmap);
2b790db7 Michal Simek 2018-09-18  1408
2b790db7 Michal Simek 2018-09-18  1409  	/* Look for a serialN alias */
2b790db7 Michal Simek 2018-09-18  1410  	id = of_alias_get_id(pdev->dev.of_node, "serial");
2b790db7 Michal Simek 2018-09-18  1411  	if (id < 0) {
2b790db7 Michal Simek 2018-09-18  1412  		dev_warn(&pdev->dev,
2b790db7 Michal Simek 2018-09-18  1413  			 "No serial alias passed. Using the first free id\n");
2b790db7 Michal Simek 2018-09-18  1414
2b790db7 Michal Simek 2018-09-18  1415  		/*
2b790db7 Michal Simek 2018-09-18  1416  		 * Start with id 0 and check if there is no serial0 alias
2b790db7 Michal Simek 2018-09-18  1417  		 * which points to device which is compatible with this driver.
2b790db7 Michal Simek 2018-09-18  1418  		 * If alias exists then try next free position.
2b790db7 Michal Simek 2018-09-18  1419  		 */
2b790db7 Michal Simek 2018-09-18  1420  		id = 0;
2b790db7 Michal Simek 2018-09-18  1421
2b790db7 Michal Simek 2018-09-18  1422  		for (;;) {
2b790db7 Michal Simek 2018-09-18  1423  			dev_info(&pdev->dev, "Checking id %d\n", id);
2b790db7 Michal Simek 2018-09-18  1424  			id = find_next_zero_bit(bitmap, MAX_UART_INSTANCES, id);
2b790db7 Michal Simek 2018-09-18  1425
2b790db7 Michal Simek 2018-09-18  1426  			/* No free empty instance */
2b790db7 Michal Simek 2018-09-18  1427  			if (id == MAX_UART_INSTANCES) {
2b790db7 Michal Simek 2018-09-18  1428  				dev_err(&pdev->dev, "No free ID\n");
2b790db7 Michal Simek 2018-09-18  1429  				mutex_unlock(&bitmap_lock);
2b790db7 Michal Simek 2018-09-18  1430  				return -EINVAL;
2b790db7 Michal Simek 2018-09-18  1431  			}
2b790db7 Michal Simek 2018-09-18  1432
2b790db7 Michal Simek 2018-09-18  1433  			dev_dbg(&pdev->dev, "The empty id is %d\n", id);
2b790db7 Michal Simek 2018-09-18  1434  			/* Check if ID is empty */
2b790db7 Michal Simek 2018-09-18  1435  			if (!test_and_set_bit(id, bitmap)) {
2b790db7 Michal Simek 2018-09-18  1436  				/* Break the loop if bit is taken */
2b790db7 Michal Simek 2018-09-18  1437  				dev_dbg(&pdev->dev,
2b790db7 Michal Simek 2018-09-18  1438  					"Selected ID %d allocation passed\n",
2b790db7 Michal Simek 2018-09-18  1439  					id);
2b790db7 Michal Simek 2018-09-18  1440  				break;
2b790db7 Michal Simek 2018-09-18  1441  			}
2b790db7 Michal Simek 2018-09-18  1442  			dev_dbg(&pdev->dev,
2b790db7 Michal Simek 2018-09-18  1443  				"Selected ID %d allocation failed\n", id);
2b790db7 Michal Simek 2018-09-18  1444  			/* if taking bit fails then try next one */
2b790db7 Michal Simek 2018-09-18  1445  			id++;
2b790db7 Michal Simek 2018-09-18  1446  		}
2b790db7 Michal Simek 2018-09-18  1447  	}
2b790db7 Michal Simek 2018-09-18  1448
2b790db7 Michal Simek 2018-09-18  1449  	mutex_unlock(&bitmap_lock);
2b790db7 Michal Simek 2018-09-18  1450
2b790db7 Michal Simek 2018-09-18  1451  	return id;
2b790db7 Michal Simek 2018-09-18  1452  }
2b790db7 Michal Simek 2018-09-18  1453

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux