From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH v4 1/4] PCI: Introduce pci_dev_for_each_resource()
Date: Sat, 11 Mar 2023 21:42:48 +0800 [thread overview]
Message-ID: <202303112149.xD47qKOY-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20230310171416.23356-2-andriy.shevchenko@linux.intel.com>
References: <20230310171416.23356-2-andriy.shevchenko@linux.intel.com>
TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
TO: "Mickaël Salaün" <mic@digikod.net>
TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
TO: Mika Westerberg <mika.westerberg@linux.intel.com>
TO: "Krzysztof Wilczyński" <kw@linux.com>
TO: Michael Ellerman <mpe@ellerman.id.au>
TO: Randy Dunlap <rdunlap@infradead.org>
TO: Arnd Bergmann <arnd@arndb.de>
TO: Bjorn Helgaas <helgaas@kernel.org>
TO: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
TO: Niklas Schnelle <schnelle@linux.ibm.com>
TO: "Pali Rohár" <pali@kernel.org>
TO: "Maciej W. Rozycki" <macro@orcam.me.uk>
TO: Juergen Gross <jgross@suse.com>
TO: Dominik Brodowski <linux@dominikbrodowski.net>
TO: linux-kernel@vger.kernel.org
TO: linux-alpha@vger.kernel.org
TO: linux-arm-kernel@lists.infradead.org
TO: linux-mips@vger.kernel.org
TO: linuxppc-dev@lists.ozlabs.org
TO: linux-sh@vger.kernel.org
TO: sparclinux@vger.kernel.org
TO: linux-pci@vger.kernel.org
TO: xen-devel@lists.xenproject.org
TO: linux-acpi@vger.kernel.org
CC: Miguel Ojeda <ojeda@kernel.org>
CC: Richard Henderson <richard.henderson@linaro.org>
CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
CC: Matt Turner <mattst88@gmail.com>
CC: Russell King <linux@armlinux.org.uk>
CC: Andrew Lunn <andrew@lunn.ch>
Hi Andy,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pci/next]
[also build test WARNING on pci/for-linus powerpc/next powerpc/fixes linus/master v6.3-rc1 next-20230310]
[cannot apply to soc/for-next davem-sparc/master]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/PCI-Introduce-pci_dev_for_each_resource/20230311-011642
base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
patch link: https://lore.kernel.org/r/20230310171416.23356-2-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v4 1/4] PCI: Introduce pci_dev_for_each_resource()
:::::: branch date: 20 hours ago
:::::: commit date: 20 hours ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20230311/202303112149.xD47qKOY-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202303112149.xD47qKOY-lkp@intel.com/
smatch warnings:
drivers/pnp/quirks.c:248 quirk_system_pci_resources() warn: was && intended here instead of ||?
vim +248 drivers/pnp/quirks.c
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 228
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 229 static void quirk_system_pci_resources(struct pnp_dev *dev)
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 230 {
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 231 struct pci_dev *pdev = NULL;
059b4a086017fb Mika Westerberg 2023-03-10 232 struct resource *res, *r;
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 233 int i, j;
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 234
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 235 /*
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 236 * Some BIOSes have PNP motherboard devices with resources that
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 237 * partially overlap PCI BARs. The PNP system driver claims these
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 238 * motherboard resources, which prevents the normal PCI driver from
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 239 * requesting them later.
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 240 *
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 241 * This patch disables the PNP resources that conflict with PCI BARs
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 242 * so they won't be claimed by the PNP system driver.
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 243 */
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 244 for_each_pci_dev(pdev) {
059b4a086017fb Mika Westerberg 2023-03-10 245 pci_dev_for_each_resource(pdev, r, i) {
059b4a086017fb Mika Westerberg 2023-03-10 246 unsigned long type = resource_type(r);
999ed65ad12e37 Rene Herman 2008-07-25 247
059b4a086017fb Mika Westerberg 2023-03-10 @248 if (type != IORESOURCE_IO || type != IORESOURCE_MEM ||
059b4a086017fb Mika Westerberg 2023-03-10 249 resource_size(r) == 0)
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 250 continue;
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 251
059b4a086017fb Mika Westerberg 2023-03-10 252 if (r->flags & IORESOURCE_UNSET)
f7834c092c4299 Bjorn Helgaas 2015-03-03 253 continue;
f7834c092c4299 Bjorn Helgaas 2015-03-03 254
95ab3669f78306 Bjorn Helgaas 2008-04-28 255 for (j = 0;
999ed65ad12e37 Rene Herman 2008-07-25 256 (res = pnp_get_resource(dev, type, j)); j++) {
aee3ad815dd291 Bjorn Helgaas 2008-06-27 257 if (res->start == 0 && res->end == 0)
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 258 continue;
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 259
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 260 /*
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 261 * If the PNP region doesn't overlap the PCI
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 262 * region at all, there's no problem.
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 263 */
059b4a086017fb Mika Westerberg 2023-03-10 264 if (!resource_overlaps(res, r))
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 265 continue;
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 266
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 267 /*
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 268 * If the PNP region completely encloses (or is
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 269 * at least as large as) the PCI region, that's
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 270 * also OK. For example, this happens when the
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 271 * PNP device describes a bridge with PCI
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 272 * behind it.
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 273 */
059b4a086017fb Mika Westerberg 2023-03-10 274 if (res->start <= r->start && res->end >= r->end)
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 275 continue;
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 276
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 277 /*
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 278 * Otherwise, the PNP region overlaps *part* of
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 279 * the PCI region, and that might prevent a PCI
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 280 * driver from requesting its resources.
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 281 */
c7dabef8a2c59e Bjorn Helgaas 2009-10-27 282 dev_warn(&dev->dev,
059b4a086017fb Mika Westerberg 2023-03-10 283 "disabling %pR because it overlaps %s BAR %d %pR\n",
059b4a086017fb Mika Westerberg 2023-03-10 284 res, pci_name(pdev), i, r);
4b34fe156455d2 Bjorn Helgaas 2008-06-02 285 res->flags |= IORESOURCE_DISABLED;
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 286 }
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 287 }
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 288 }
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 289 }
0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 290
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next reply other threads:[~2023-03-11 13:42 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-11 13:42 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-03-10 17:14 [PATCH v4 0/4] PCI: Add pci_dev_for_each_resource() helper and update users Andy Shevchenko
2023-03-10 17:14 ` [PATCH v4 1/4] PCI: Introduce pci_dev_for_each_resource() Andy Shevchenko
2023-03-10 17:14 ` Andy Shevchenko
2023-03-10 17:14 ` Andy Shevchenko
2023-03-10 17:14 ` Andy Shevchenko
2023-03-10 21:51 ` kernel test robot
2023-03-10 21:51 ` kernel test robot
2023-03-10 21:51 ` kernel test robot
2023-03-10 21:51 ` kernel test robot
2023-03-10 22:15 ` Keith Busch
2023-03-10 22:15 ` Keith Busch
2023-03-10 22:15 ` Keith Busch
2023-03-10 22:15 ` Keith Busch
2023-03-14 18:39 ` Andy Shevchenko
2023-03-14 18:39 ` Andy Shevchenko
2023-03-14 18:39 ` Andy Shevchenko
2023-03-14 18:39 ` Andy Shevchenko
2023-03-11 13:54 ` Dan Carpenter
2023-03-11 13:54 ` Dan Carpenter
2023-03-11 13:54 ` Dan Carpenter
2023-03-11 13:54 ` Dan Carpenter
2023-03-14 18:43 ` Andy Shevchenko
2023-03-14 18:43 ` Andy Shevchenko
2023-03-14 18:43 ` Andy Shevchenko
2023-03-14 18:43 ` Andy Shevchenko
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=202303112149.xD47qKOY-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/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.