Re: [PATCH v3] x86/iosf: Make IOSF driver modular and usable by more drivers
From: David E. Box
Date: Wed May 07 2014 - 14:03:48 EST
On Wed, May 07, 2014 at 06:10:42PM +0100, One Thousand Gnomes wrote:
> On Wed, 07 May 2014 10:04:56 -0700
> "H. Peter Anvin" <hpa@xxxxxxxxx> wrote:
>
> > On 05/07/2014 09:48 AM, One Thousand Gnomes wrote:
> > > On Fri, 2 May 2014 10:36:39 -0700
> > >> +bool iosf_mbi_available(void)
> > >> +{
> > >> + return mbi_pdev;
> > >> +}
> > >> +EXPORT_SYMBOL(iosf_mbi_available);
> > >
> > > Probably worth a follow up patch that comments this so the assumption
> > > that iosf can never be unloaded or hot-unplugged is clear.
> > >
> >
> > When you say unloaded you mean the module or the hardware?
>
> Both. Currently the hardware isn't removable (but could be virtually
> removed by playing with unplugging) and the module can't be unloaded so
> the assumption is fine.
>
Actually it can be explictly unloaded with rmmod, something I left in while
testing use of the driver on non-iosf systems.
Speaking of non-iosf systems (Core/Xeon), having the iosf driver configured as
default m will cause it to be loaded on non-iosf systems by drivers that work
on both. Not a huge problem. I already tested that attempts to use the driver
result in proper warnings with ill affect to those systems. But it is a waste of
memory. I looked at doing a probe and unload in module_init but that would
cause these drivers, like RAPL for example, to fail due to the missing iosf
symbols, which the driver would still be looking for because default m means
that CONFIG_IOSF is always true so they aren't compiled out out in exchange for
the dummy ones.
Imo, this stems from not exposing the iosf in Kconfig. I understand the
reasoning but maybe there should be a separate Kconfig option that is exposed
indicating that the hardware is an x86 SOC. The iosf could have just depended on
that, avoiding this situation.
Dave Box
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/