All of lore.kernel.org
 help / color / mirror / Atom feed
* [pci:pci/hotplug 34/35] drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'?
@ 2018-07-19 23:53 kbuild test robot
  2018-07-20  8:18 ` Lukas Wunner
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2018-07-19 23:53 UTC (permalink / raw)
  To: Lukas Wunner; +Cc: kbuild-all, linux-pci, Bjorn Helgaas

[-- Attachment #1: Type: text/plain, Size: 2856 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/hotplug
head:   9bb3bb1b6688cf16691f98a422aaa47a0f38507f
commit: 50b623f07b02fc48e4d7d3e8b5a302abf40b3a7a [34/35] PCI: Whitelist native hotplug ports for runtime D3
config: powerpc-walnut_defconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 50b623f07b02fc48e4d7d3e8b5a302abf40b3a7a
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   drivers/pci/pci.c: In function 'pci_bridge_d3_possible':
>> drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'? [-Werror=implicit-function-declaration]
      if (bridge->is_hotplug_bridge && !pciehp_is_native(bridge))
                                        ^~~~~~~~~~~~~~~~
                                        pcie_ports_native
   cc1: some warnings being treated as errors

vim +2311 drivers/pci/pci.c

  2287	
  2288	/**
  2289	 * pci_bridge_d3_possible - Is it possible to put the bridge into D3
  2290	 * @bridge: Bridge to check
  2291	 *
  2292	 * This function checks if it is possible to move the bridge to D3.
  2293	 * Currently we only allow D3 for recent enough PCIe ports.
  2294	 */
  2295	bool pci_bridge_d3_possible(struct pci_dev *bridge)
  2296	{
  2297		if (!pci_is_pcie(bridge))
  2298			return false;
  2299	
  2300		switch (pci_pcie_type(bridge)) {
  2301		case PCI_EXP_TYPE_ROOT_PORT:
  2302		case PCI_EXP_TYPE_UPSTREAM:
  2303		case PCI_EXP_TYPE_DOWNSTREAM:
  2304			if (pci_bridge_d3_disable)
  2305				return false;
  2306	
  2307			/*
  2308			 * Hotplug ports handled by firmware in System Management Mode
  2309			 * may not be put into D3 by the OS (Thunderbolt on non-Macs).
  2310			 */
> 2311			if (bridge->is_hotplug_bridge && !pciehp_is_native(bridge))
  2312				return false;
  2313	
  2314			if (pci_bridge_d3_force)
  2315				return true;
  2316	
  2317			/*
  2318			 * Hotplug ports handled natively by the OS were not validated
  2319			 * by vendors for runtime D3 at least until 2018 because there
  2320			 * was no OS support.
  2321			 */
  2322			if (bridge->is_hotplug_bridge)
  2323				return false;
  2324	
  2325			/*
  2326			 * It should be safe to put PCIe ports from 2015 or newer
  2327			 * to D3.
  2328			 */
  2329			if (dmi_get_bios_year() >= 2015)
  2330				return true;
  2331			break;
  2332		}
  2333	
  2334		return false;
  2335	}
  2336	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 11555 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pci:pci/hotplug 34/35] drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'?
  2018-07-19 23:53 [pci:pci/hotplug 34/35] drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'? kbuild test robot
@ 2018-07-20  8:18 ` Lukas Wunner
  2018-07-23  6:39   ` Mika Westerberg
  2018-07-23 22:07   ` Bjorn Helgaas
  0 siblings, 2 replies; 4+ messages in thread
From: Lukas Wunner @ 2018-07-20  8:18 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, Mika Westerberg

On Fri, Jul 20, 2018 at 07:53:33AM +0800, kbuild test robot wrote:
> commit: 50b623f07b02fc48e4d7d3e8b5a302abf40b3a7a [34/35] PCI: Whitelist native hotplug ports for runtime D3
> 
>    drivers/pci/pci.c: In function 'pci_bridge_d3_possible':
> >> drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'? [-Werror=implicit-function-declaration]
>       if (bridge->is_hotplug_bridge && !pciehp_is_native(bridge))
>                                         ^~~~~~~~~~~~~~~~
>                                         pcie_ports_native
>    cc1: some warnings being treated as errors

Hm, there is a conflict on the pci/hotplug branch wherein commit
"PCI: hotplug: Implement hotplug_is_native() only when CONFIG_ACPI=y"
removes the pciehp_is_native() declaration for the CONFIG_ACPI=n
case (because there was previously only one caller of that function
and that caller depended on CONFIG_ACPI=y), but the succeeding commit
"PCI: Whitelist native hotplug ports for runtime D3" now adds another
caller of that function which also exists in the CONFIG_ACPI=n case.

Can the former commit be amended to leave the pciehp_is_native()
declaration in place for CONFIG_ACPI=n?

I'm wondering if we should be checking hotplug_is_native() instead of
pciehp_is_native() in pci_bridge_d3_possible().  There appears to be
an ordering issue if we do that because shpchp_is_native() checks
bridge->shpc_managed, but that is only set to true by shpc_probe().
Now the problem is, the shpc pci_driver is registered with module_init().
If shpc is built-in, that becomes a device_initcall().

And pci_bridge_d3_possible() is called from pcie_portdrv_probe(),
and portdrv is also registered with a device_initcall().

Thus, if hotplug_is_native() is called from pci_bridge_d3_possible(),
it's result in the shpc case depends on the link order if shpc is
built-in.  If shpc is a module, it will always return false for the
shpc case.

I'm sorry, I'm pretty clueless about shpc and whether or not portdrv
should activate runtime PM whether an shpc port is controlled by
the firmware.

Thanks,

Lukas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pci:pci/hotplug 34/35] drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'?
  2018-07-20  8:18 ` Lukas Wunner
@ 2018-07-23  6:39   ` Mika Westerberg
  2018-07-23 22:07   ` Bjorn Helgaas
  1 sibling, 0 replies; 4+ messages in thread
From: Mika Westerberg @ 2018-07-23  6:39 UTC (permalink / raw)
  To: Lukas Wunner; +Cc: Bjorn Helgaas, linux-pci

On Fri, Jul 20, 2018 at 10:18:41AM +0200, Lukas Wunner wrote:
> I'm wondering if we should be checking hotplug_is_native() instead of
> pciehp_is_native() in pci_bridge_d3_possible().  There appears to be
> an ordering issue if we do that because shpchp_is_native() checks
> bridge->shpc_managed, but that is only set to true by shpc_probe().
> Now the problem is, the shpc pci_driver is registered with module_init().
> If shpc is built-in, that becomes a device_initcall().
> 
> And pci_bridge_d3_possible() is called from pcie_portdrv_probe(),
> and portdrv is also registered with a device_initcall().
> 
> Thus, if hotplug_is_native() is called from pci_bridge_d3_possible(),
> it's result in the shpc case depends on the link order if shpc is
> built-in.  If shpc is a module, it will always return false for the
> shpc case.
> 
> I'm sorry, I'm pretty clueless about shpc and whether or not portdrv
> should activate runtime PM whether an shpc port is controlled by
> the firmware.

We only enable D3 for PCIe ports in pci_bridge_d3_possible(). We don't
do it for conventional PCI so I think calling pciehp_is_native() there
is the right thing to do.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pci:pci/hotplug 34/35] drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'?
  2018-07-20  8:18 ` Lukas Wunner
  2018-07-23  6:39   ` Mika Westerberg
@ 2018-07-23 22:07   ` Bjorn Helgaas
  1 sibling, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2018-07-23 22:07 UTC (permalink / raw)
  To: Lukas Wunner; +Cc: linux-pci, Mika Westerberg

On Fri, Jul 20, 2018 at 10:18:41AM +0200, Lukas Wunner wrote:
> On Fri, Jul 20, 2018 at 07:53:33AM +0800, kbuild test robot wrote:
> > commit: 50b623f07b02fc48e4d7d3e8b5a302abf40b3a7a [34/35] PCI: Whitelist native hotplug ports for runtime D3
> > 
> >    drivers/pci/pci.c: In function 'pci_bridge_d3_possible':
> > >> drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'? [-Werror=implicit-function-declaration]
> >       if (bridge->is_hotplug_bridge && !pciehp_is_native(bridge))
> >                                         ^~~~~~~~~~~~~~~~
> >                                         pcie_ports_native
> >    cc1: some warnings being treated as errors
> 
> Hm, there is a conflict on the pci/hotplug branch wherein commit
> "PCI: hotplug: Implement hotplug_is_native() only when CONFIG_ACPI=y"
> removes the pciehp_is_native() declaration for the CONFIG_ACPI=n
> case (because there was previously only one caller of that function
> and that caller depended on CONFIG_ACPI=y), but the succeeding commit
> "PCI: Whitelist native hotplug ports for runtime D3" now adds another
> caller of that function which also exists in the CONFIG_ACPI=n case.
> 
> Can the former commit be amended to leave the pciehp_is_native()
> declaration in place for CONFIG_ACPI=n?

I dropped the following commits for now:

  PCI: shpchp: Inline shpchp_is_native()
  PCI: hotplug: Implement hotplug_is_native() only when CONFIG_ACPI=y

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-23 23:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19 23:53 [pci:pci/hotplug 34/35] drivers/pci/pci.c:2311:37: error: implicit declaration of function 'pciehp_is_native'; did you mean 'pcie_ports_native'? kbuild test robot
2018-07-20  8:18 ` Lukas Wunner
2018-07-23  6:39   ` Mika Westerberg
2018-07-23 22:07   ` Bjorn Helgaas

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.