[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4D5E44FB0200007800032A2F@vpn.id2.novell.com>
Date: Fri, 18 Feb 2011 09:07:55 +0000
From: "Jan Beulich" <JBeulich@...ell.com>
To: "Jesse Barnes" <jesse.barnes@...el.com>,
"Yinghai Lu" <yinghai@...nel.org>
Cc: <mingo@...e.hu>, <tglx@...utronix.de>, <arozansk@...hat.com>,
<mchehab@...hat.com>, "Michal Marek" <mmarek@...e.cz>,
<linux-kernel@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<hpa@...or.com>
Subject: Re: [PATCH, resend] x86/PCI: don't export a __devinit function
>>> On 17.02.11 at 18:21, Yinghai Lu <yinghai@...nel.org> wrote:
> On Thu, Feb 17, 2011 at 8:08 AM, Jan Beulich <JBeulich@...ell.com> wrote:
>> Exporting a __devinit function (pcibios_scan_specific_bus()) isn't
>> correct. (Michal, any reason why modpost only warns about exported
>> __init functions?) Short of being able to think of a better solution,
>> and short of making the whole call tree (reaching into the arch-
>> independent part of the PCI subsystem) non-__devinit, export the
>> symbol only when HOTPLUG is enabled (which is always the case for non-
>> expert configurations), use section mismatch avoidance annotations for
>> that case (knowing that __devinit functions will not be discarded),
>> and mark the symbol __devinit only in the !HOTPLUG case.
>>
>> Consequently, EDAC_I7CORE (consuming the export) then has to depend on
>> HOTPLUG. A fundamental question of course if whether this driver has
>> to use that function in the first place (i.e. whether it wouldn't be
>> better to just remove the export) - the problem it tries to address
>> happens on other systems too, but the PCI bus the devices in question
>> live on isn't necessarily bus 255. For the affected system I have, the
>> alternative approach is to set pcibios_last_bus from __pci_mmcfg_init()
>> based on the highest bus number on segment 0 being covered by MCFG.
>>
>> Signed-off-by: Jan Beulich <jbeulich@...ell.com>
>> Cc: Mauro Carvalho Chehab <mchehab@...hat.com>
>> Cc: Aristeu Sergio <arozansk@...hat.com>
>> Cc: Michal Marek <mmarek@...e.cz>
>>
>> ---
>> arch/x86/pci/legacy.c | 21 ++++++++++++++++++---
>> drivers/edac/Kconfig | 2 +-
>> 2 files changed, 19 insertions(+), 4 deletions(-)
>>
>> --- 2.6.38-rc5/arch/x86/pci/legacy.c
>> +++ 2.6.38-rc5-x86-pci-section-conflict/arch/x86/pci/legacy.c
>> @@ -36,7 +36,23 @@ int __init pci_legacy_init(void)
>> return 0;
>> }
>>
>> -void __devinit pcibios_scan_specific_bus(int busn)
>> +#ifdef CONFIG_HOTPLUG
>> +static void __ref
>> +#else
>> +static inline void
>> +#endif
>> +_pci_scan_bus_on_node(int busno, int node)
>> +{
>> + pci_scan_bus_on_node(busno, &pci_root_ops, node);
>> +}
>> +
>> +#ifdef CONFIG_HOTPLUG
>> +EXPORT_SYMBOL_GPL(pcibios_scan_specific_bus);
>> +void
>> +#else
>> +void __devinit
>> +#endif
>
> anyway to avoid or reduce those #ifdef?
Yes, they look ugly, but no, I have no better idea (other than
creating single-use abstractions that wouldn't look any better).
Jan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists