From: Julia Lawall <julia.lawall@inria.fr>
To: Michal Simek <monstr@monstr.eu>
Cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org
Subject: [xlnx:master 227/273] drivers/tty/serial/xilinx_uartps.c:1467:3-9: preceding lock on line 1460 (fwd)
Date: Thu, 25 Feb 2021 22:32:28 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.22.394.2102252231440.2855@hadrien> (raw)
[-- Attachment #1: Type: text/plain, Size: 6080 bytes --]
Please check whether a mutex_unlock is needed on line 1467.
julia
---------- Forwarded message ----------
Date: Fri, 26 Feb 2021 03:17:23 +0800
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Cc: lkp@intel.com, Julia Lawall <julia.lawall@lip6.fr>
Subject: [xlnx:master 227/273] drivers/tty/serial/xilinx_uartps.c:1467:3-9:
preceding lock on line 1460
CC: kbuild-all@lists.01.org
CC: linux-arm-kernel@lists.infradead.org
TO: Michal Simek <monstr@monstr.eu>
tree: https://github.com/Xilinx/linux-xlnx master
head: f45363ddde384526dafc2b2490763f24c5030e8d
commit: e75553bc99db8983cdfc8c629a5ca741d9897053 [227/273] serial: uartps: Change uart ID port allocation
:::::: branch date: 9 days ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-c002-20210225 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/tty/serial/xilinx_uartps.c:1467:3-9: preceding lock on line 1460
vim +1467 drivers/tty/serial/xilinx_uartps.c
e75553bc99db89 Michal Simek 2018-09-20 1455
e75553bc99db89 Michal Simek 2018-09-20 1456 static int cdns_get_id(struct platform_device *pdev)
e75553bc99db89 Michal Simek 2018-09-20 1457 {
e75553bc99db89 Michal Simek 2018-09-20 1458 int id, ret;
e75553bc99db89 Michal Simek 2018-09-20 1459
e75553bc99db89 Michal Simek 2018-09-20 @1460 mutex_lock(&bitmap_lock);
e75553bc99db89 Michal Simek 2018-09-20 1461
e75553bc99db89 Michal Simek 2018-09-20 1462 /* Alias list is stable that's why get alias bitmap only once */
e75553bc99db89 Michal Simek 2018-09-20 1463 if (!alias_bitmap_initialized) {
e75553bc99db89 Michal Simek 2018-09-20 1464 ret = of_alias_get_alias_list(cdns_uart_of_match, "serial",
e75553bc99db89 Michal Simek 2018-09-20 1465 alias_bitmap, CDNS_UART_NR_PORTS);
e75553bc99db89 Michal Simek 2018-09-20 1466 if (ret)
e75553bc99db89 Michal Simek 2018-09-20 @1467 return ret;
e75553bc99db89 Michal Simek 2018-09-20 1468
e75553bc99db89 Michal Simek 2018-09-20 1469 alias_bitmap_initialized++;
e75553bc99db89 Michal Simek 2018-09-20 1470 }
e75553bc99db89 Michal Simek 2018-09-20 1471
e75553bc99db89 Michal Simek 2018-09-20 1472 /* Make sure that alias ID is not taken by instance without alias */
e75553bc99db89 Michal Simek 2018-09-20 1473 bitmap_or(bitmap, bitmap, alias_bitmap, CDNS_UART_NR_PORTS);
e75553bc99db89 Michal Simek 2018-09-20 1474
e75553bc99db89 Michal Simek 2018-09-20 1475 dev_dbg(&pdev->dev, "Alias bitmap: %*pb\n",
e75553bc99db89 Michal Simek 2018-09-20 1476 CDNS_UART_NR_PORTS, bitmap);
e75553bc99db89 Michal Simek 2018-09-20 1477
e75553bc99db89 Michal Simek 2018-09-20 1478 /* Look for a serialN alias */
e75553bc99db89 Michal Simek 2018-09-20 1479 id = of_alias_get_id(pdev->dev.of_node, "serial");
e75553bc99db89 Michal Simek 2018-09-20 1480 if (id < 0) {
e75553bc99db89 Michal Simek 2018-09-20 1481 dev_warn(&pdev->dev,
e75553bc99db89 Michal Simek 2018-09-20 1482 "No serial alias passed. Using the first free id\n");
e75553bc99db89 Michal Simek 2018-09-20 1483
e75553bc99db89 Michal Simek 2018-09-20 1484 /*
e75553bc99db89 Michal Simek 2018-09-20 1485 * Start with id 0 and check if there is no serial0 alias
e75553bc99db89 Michal Simek 2018-09-20 1486 * which points to device which is compatible with this driver.
e75553bc99db89 Michal Simek 2018-09-20 1487 * If alias exists then try next free position.
e75553bc99db89 Michal Simek 2018-09-20 1488 */
e75553bc99db89 Michal Simek 2018-09-20 1489 id = 0;
e75553bc99db89 Michal Simek 2018-09-20 1490
e75553bc99db89 Michal Simek 2018-09-20 1491 for (;;) {
e75553bc99db89 Michal Simek 2018-09-20 1492 dev_info(&pdev->dev, "Checking id %d\n", id);
e75553bc99db89 Michal Simek 2018-09-20 1493 id = find_next_zero_bit(bitmap, CDNS_UART_NR_PORTS, id);
e75553bc99db89 Michal Simek 2018-09-20 1494
e75553bc99db89 Michal Simek 2018-09-20 1495 /* No free empty instance */
e75553bc99db89 Michal Simek 2018-09-20 1496 if (id == CDNS_UART_NR_PORTS) {
e75553bc99db89 Michal Simek 2018-09-20 1497 dev_err(&pdev->dev, "No free ID\n");
e75553bc99db89 Michal Simek 2018-09-20 1498 mutex_unlock(&bitmap_lock);
e75553bc99db89 Michal Simek 2018-09-20 1499 return -EINVAL;
e75553bc99db89 Michal Simek 2018-09-20 1500 }
e75553bc99db89 Michal Simek 2018-09-20 1501
e75553bc99db89 Michal Simek 2018-09-20 1502 dev_dbg(&pdev->dev, "The empty id is %d\n", id);
e75553bc99db89 Michal Simek 2018-09-20 1503 /* Check if ID is empty */
e75553bc99db89 Michal Simek 2018-09-20 1504 if (!test_and_set_bit(id, bitmap)) {
e75553bc99db89 Michal Simek 2018-09-20 1505 /* Break the loop if bit is taken */
e75553bc99db89 Michal Simek 2018-09-20 1506 dev_dbg(&pdev->dev,
e75553bc99db89 Michal Simek 2018-09-20 1507 "Selected ID %d allocation passed\n",
e75553bc99db89 Michal Simek 2018-09-20 1508 id);
e75553bc99db89 Michal Simek 2018-09-20 1509 break;
e75553bc99db89 Michal Simek 2018-09-20 1510 }
e75553bc99db89 Michal Simek 2018-09-20 1511 dev_dbg(&pdev->dev,
e75553bc99db89 Michal Simek 2018-09-20 1512 "Selected ID %d allocation failed\n", id);
e75553bc99db89 Michal Simek 2018-09-20 1513 /* if taking bit fails then try next one */
e75553bc99db89 Michal Simek 2018-09-20 1514 id++;
e75553bc99db89 Michal Simek 2018-09-20 1515 }
e75553bc99db89 Michal Simek 2018-09-20 1516 }
e75553bc99db89 Michal Simek 2018-09-20 1517
e75553bc99db89 Michal Simek 2018-09-20 1518 mutex_unlock(&bitmap_lock);
e75553bc99db89 Michal Simek 2018-09-20 1519
e75553bc99db89 Michal Simek 2018-09-20 1520 return id;
e75553bc99db89 Michal Simek 2018-09-20 1521 }
e75553bc99db89 Michal Simek 2018-09-20 1522
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: Type: application/gzip, Size: 25913 bytes --]
[-- Attachment #3: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
reply other threads:[~2021-02-25 21:34 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=alpine.DEB.2.22.394.2102252231440.2855@hadrien \
--to=julia.lawall@inria.fr \
--cc=kbuild-all@lists.01.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=monstr@monstr.eu \
/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