From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 1/2] spi: Add the SPI daisy chain support.
Date: Thu, 16 Jul 2020 07:05:45 +0800 [thread overview]
Message-ID: <202007160646.7qQ4B702%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 10127 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200703141246.17281-1-adrian.fiergolski@fastree3d.com>
References: <20200703141246.17281-1-adrian.fiergolski@fastree3d.com>
TO: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
CC: geert(a)linux-m68k.org
CC: lukas(a)wunner.de
CC: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
CC: Mark Brown <broonie@kernel.org>
CC: Rob Herring <robh+dt@kernel.org>
CC: linux-spi(a)vger.kernel.org
CC: devicetree(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
Hi Adrian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on spi/for-next]
[also build test WARNING on v5.8-rc5 next-20200715]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Adrian-Fiergolski/spi-Add-the-SPI-daisy-chain-support/20200703-221615
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
:::::: branch date: 12 days ago
:::::: commit date: 12 days ago
config: i386-randconfig-c001-20200715 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 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/spi/spi.c:648:1-7: preceding lock on line 603
# https://github.com/0day-ci/linux/commit/34bc72e614ee4d07d46404d78d1e38369274b2cd
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 34bc72e614ee4d07d46404d78d1e38369274b2cd
vim +648 drivers/spi/spi.c
b6fb8d3a1f156c5 Mika Westerberg 2014-01-09 566
dc87c98e8f635a7 Grant Likely 2008-05-15 567 /**
dc87c98e8f635a7 Grant Likely 2008-05-15 568 * spi_add_device - Add spi_device allocated with spi_alloc_device
dc87c98e8f635a7 Grant Likely 2008-05-15 569 * @spi: spi_device to register
dc87c98e8f635a7 Grant Likely 2008-05-15 570 *
dc87c98e8f635a7 Grant Likely 2008-05-15 571 * Companion function to spi_alloc_device. Devices allocated with
dc87c98e8f635a7 Grant Likely 2008-05-15 572 * spi_alloc_device can be added onto the spi bus with this function.
dc87c98e8f635a7 Grant Likely 2008-05-15 573 *
97d56dc68268968 Javier Martinez Canillas 2015-10-22 574 * Return: 0 on success; negative errno on failure
dc87c98e8f635a7 Grant Likely 2008-05-15 575 */
dc87c98e8f635a7 Grant Likely 2008-05-15 576 int spi_add_device(struct spi_device *spi)
dc87c98e8f635a7 Grant Likely 2008-05-15 577 {
e48880e02e7e7ea David Brownell 2008-08-15 578 static DEFINE_MUTEX(spi_add_lock);
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 579 struct spi_controller *ctlr = spi->controller;
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 580 struct device *dev = ctlr->dev.parent;
dc87c98e8f635a7 Grant Likely 2008-05-15 581 int status;
dc87c98e8f635a7 Grant Likely 2008-05-15 582
dc87c98e8f635a7 Grant Likely 2008-05-15 583 /* Chipselects are numbered 0..max; validate. */
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 584 if (spi->chip_select >= ctlr->num_chipselect) {
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 585 dev_err(dev, "cs%d >= max %d\n", spi->chip_select,
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 586 ctlr->num_chipselect);
dc87c98e8f635a7 Grant Likely 2008-05-15 587 return -EINVAL;
dc87c98e8f635a7 Grant Likely 2008-05-15 588 }
dc87c98e8f635a7 Grant Likely 2008-05-15 589
dc87c98e8f635a7 Grant Likely 2008-05-15 590 /* Set the bus ID string */
e13ac47bec20797 Jarkko Nikula 2013-11-14 591 spi_dev_set_name(spi);
e48880e02e7e7ea David Brownell 2008-08-15 592
e48880e02e7e7ea David Brownell 2008-08-15 593 /* We need to make sure there's no other device with this
e48880e02e7e7ea David Brownell 2008-08-15 594 * chipselect **BEFORE** we call setup(), else we'll trash
e48880e02e7e7ea David Brownell 2008-08-15 595 * its configuration. Lock against concurrent add() calls.
e48880e02e7e7ea David Brownell 2008-08-15 596 */
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 597 #ifdef CONFIG_SPI_DAISY_CHAIN
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 598 /* Do not lock the controller when registering the daisy_chain driver
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 599 * as the last one wouldn't be able to register its subnodes
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 600 */
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 601 if (strcmp((const char *)spi->dev.of_node->name, "daisy_chain") == 0)
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 602 #endif
e48880e02e7e7ea David Brownell 2008-08-15 @603 mutex_lock(&spi_add_lock);
e48880e02e7e7ea David Brownell 2008-08-15 604
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 605 #ifdef CONFIG_SPI_DAISY_CHAIN
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 606 if (spi->daisy_chain_devs == NULL) {
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 607 #endif
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 608 status = bus_for_each_dev(&spi_bus_type, NULL, spi,
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 609 spi_dev_check);
b6fb8d3a1f156c5 Mika Westerberg 2014-01-09 610 if (status) {
e48880e02e7e7ea David Brownell 2008-08-15 611 dev_err(dev, "chipselect %d already in use\n",
e48880e02e7e7ea David Brownell 2008-08-15 612 spi->chip_select);
e48880e02e7e7ea David Brownell 2008-08-15 613 goto done;
e48880e02e7e7ea David Brownell 2008-08-15 614 }
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 615 #ifdef CONFIG_SPI_DAISY_CHAIN
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 616 }
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 617 #endif
f3186dd876697e6 Linus Walleij 2019-01-07 618 /* Descriptors take precedence */
f3186dd876697e6 Linus Walleij 2019-01-07 619 if (ctlr->cs_gpiods)
f3186dd876697e6 Linus Walleij 2019-01-07 620 spi->cs_gpiod = ctlr->cs_gpiods[spi->chip_select];
f3186dd876697e6 Linus Walleij 2019-01-07 621 else if (ctlr->cs_gpios)
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 622 spi->cs_gpio = ctlr->cs_gpios[spi->chip_select];
743179849015dc7 Jean-Christophe PLAGNIOL-VILLARD 2012-11-15 623
e48880e02e7e7ea David Brownell 2008-08-15 624 /* Drivers may modify this initial i/o setup, but will
e48880e02e7e7ea David Brownell 2008-08-15 625 * normally rely on the device being setup. Devices
e48880e02e7e7ea David Brownell 2008-08-15 626 * using SPI_CS_HIGH can't coexist well otherwise...
e48880e02e7e7ea David Brownell 2008-08-15 627 */
7d0771970c51e73 David Brownell 2009-06-17 628 status = spi_setup(spi);
dc87c98e8f635a7 Grant Likely 2008-05-15 629 if (status < 0) {
eb288a1f45e2aa9 Linus Walleij 2010-10-21 630 dev_err(dev, "can't setup %s, status %d\n",
eb288a1f45e2aa9 Linus Walleij 2010-10-21 631 dev_name(&spi->dev), status);
e48880e02e7e7ea David Brownell 2008-08-15 632 goto done;
dc87c98e8f635a7 Grant Likely 2008-05-15 633 }
dc87c98e8f635a7 Grant Likely 2008-05-15 634
e48880e02e7e7ea David Brownell 2008-08-15 635 /* Device may be bound to an active driver when this returns */
dc87c98e8f635a7 Grant Likely 2008-05-15 636 status = device_add(&spi->dev);
e48880e02e7e7ea David Brownell 2008-08-15 637 if (status < 0)
eb288a1f45e2aa9 Linus Walleij 2010-10-21 638 dev_err(dev, "can't add %s, status %d\n",
eb288a1f45e2aa9 Linus Walleij 2010-10-21 639 dev_name(&spi->dev), status);
e48880e02e7e7ea David Brownell 2008-08-15 640 else
35f74fcab1228be Kay Sievers 2009-01-06 641 dev_dbg(dev, "registered child %s\n", dev_name(&spi->dev));
e48880e02e7e7ea David Brownell 2008-08-15 642
e48880e02e7e7ea David Brownell 2008-08-15 643 done:
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 644 #ifdef CONFIG_SPI_DAISY_CHAIN
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 645 if (strcmp((const char *)spi->dev.of_node->name, "daisy_chain") == 0)
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 646 #endif
e48880e02e7e7ea David Brownell 2008-08-15 647 mutex_unlock(&spi_add_lock);
e48880e02e7e7ea David Brownell 2008-08-15 @648 return status;
dc87c98e8f635a7 Grant Likely 2008-05-15 649 }
dc87c98e8f635a7 Grant Likely 2008-05-15 650 EXPORT_SYMBOL_GPL(spi_add_device);
8ae12a0d85987dc David Brownell 2006-01-08 651
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39207 bytes --]
next reply other threads:[~2020-07-15 23:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 23:05 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-03 14:12 [PATCH 1/2] spi: Add the SPI daisy chain support Adrian Fiergolski
2020-07-03 22:32 ` kernel test robot
2020-07-03 22:32 ` kernel test robot
2020-07-04 0:18 ` kernel test robot
2020-07-04 0:18 ` kernel test robot
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=202007160646.7qQ4B702%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.