Re: [PATCH v13 2/5] PCI: Assume control of portdrv-related features only when portdrv enabled
From: Kuppuswamy Sathyanarayanan
Date: Mon Sep 21 2026 - 14:59:46 EST
Hi,
On 9/19/2026 11:17 PM, Lukas Wunner wrote:
> On Sat, Sep 19, 2026 at 09:26:52AM -0700, Kuppuswamy Sathyanarayanan wrote:
>> +++ b/drivers/pci/probe.c
>> @@ -668,12 +668,14 @@ static void pci_init_host_bridge(struct pci_host_bridge *bridge)
>> * may implement its own AER handling and use _OSC to prevent the
>> * OS from interfering.
>> */
>> +#ifdef CONFIG_PCIEPORTBUS
>> bridge->native_aer = 1;
>> bridge->native_pcie_hotplug = 1;
>> - bridge->native_shpc_hotplug = 1;
>> bridge->native_pme = 1;
>> - bridge->native_ltr = 1;
>> bridge->native_dpc = 1;
>> +#endif
>> + bridge->native_ltr = 1;
>> + bridge->native_shpc_hotplug = 1;
>> bridge->domain_nr = PCI_DOMAIN_NR_NOT_SET;
>
> How about (e.g.)
>
> bridge->native_pcie_hotplug = IS_ENABLED(CONFIG_PCIEPORTBUS);
>
> instead of using #ifdef? That's the preferred style according to
> section 21 of Documentation/process/coding-style.rst
Good point, will fix in v14. I will use a local variable for it so the
fields keep their current order and the diff stays small:
bool port_services = IS_ENABLED(CONFIG_PCIEPORTBUS);
bridge->native_aer = port_services;
bridge->native_pcie_hotplug = port_services;
bridge->native_shpc_hotplug = 1;
bridge->native_pme = port_services;
bridge->native_ltr = 1;
bridge->native_dpc = port_services;
>
>> bridge->native_cxl_error = 1;
>
> Hm, this one depends on CONFIG_PCIEAER I believe.
> (But Terry Bowman is the expert.)
I don't think it does. The only consumer is cxl_event_config() in
drivers/cxl/pci.c. CXL_PCI doesn't depend on PCIEAER.
Terry, please correct me if I'm wrong.
>
> Thanks,
>
> Lukas
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer