Re: [PATCH] PCI: Consider alignment of hot-added bridges when distributing available resources

From: kbuild test robot
Date: Mon Feb 04 2019 - 06:10:05 EST

Hi Nicholas,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on pci/next]
[also build test WARNING on v5.0-rc4 next-20190204]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

base: next
config: i386-randconfig-x007-201905 (attached as .config)
compiler: gcc-8 (Debian 8.2.0-14) 8.2.0
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

In file included from include/linux/printk.h:331,
from include/linux/kernel.h:14,
from drivers//pci/setup-bus.c:18:
drivers//pci/setup-bus.c: In function 'extend_bridge_window':
>> drivers//pci/setup-bus.c:1831:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
pci_dbg(bridge, "bridge window %pR extended by 0x%016llx\n", res,
include/linux/dynamic_debug.h:135:39: note: in definition of macro 'dynamic_dev_dbg'
__dynamic_dev_dbg(&descriptor, dev, fmt, \
include/linux/device.h:1473:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
include/linux/pci.h:2362:36: note: in expansion of macro 'dev_dbg'
#define pci_dbg(pdev, fmt, arg...) dev_dbg(&(pdev)->dev, fmt, ##arg)
drivers//pci/setup-bus.c:1831:2: note: in expansion of macro 'pci_dbg'
pci_dbg(bridge, "bridge window %pR extended by 0x%016llx\n", res,

vim +1831 drivers//pci/setup-bus.c

1817 static void extend_bridge_window(struct pci_dev *bridge, struct resource *res,
1818 struct list_head *add_list, resource_size_t available)
1819 {
1820 struct pci_dev_resource *dev_res;
1822 if (res->parent)
1823 return;
1825 /*
1826 * Hot-adding multiple Thunderbolt devices in SL0 might result in
1827 * multiple devices being enumerated together. This can break the
1828 * resource allocation if the resource sizes are specified with
1829 * add_size instead of simply changing the resource size.
1830 */
> 1831 pci_dbg(bridge, "bridge window %pR extended by 0x%016llx\n", res,
1832 available - resource_size(res));
1833 res->end = res->start + available - 1;
1835 /*
1836 * If a list entry exists, we need to remove any additional size
1837 * requested because that could interfere with the alignment and
1838 * sizing done when distributing resources, causing resources to
1839 * fail to allocate later on.
1840 */
1841 dev_res = res_to_dev_res(add_list, res);
1842 if (!dev_res)
1843 return;
1845 dev_res->add_size = 0;
1846 }

0-DAY kernel test infrastructure Open Source Technology Center Intel Corporation

Attachment: .config.gz
Description: application/gzip