RE: [PATCH v2 3/3] platform/x86: dell-smbios: Link all dell-smbios-* modules together

From: Mario.Limonciello
Date: Tue Feb 27 2018 - 13:03:38 EST


> -----Original Message-----
> From: Andy Shevchenko [mailto:andy.shevchenko@xxxxxxxxx]
> Sent: Tuesday, February 27, 2018 12:02 PM
> To: Limonciello, Mario <Mario_Limonciello@xxxxxxxx>
> Cc: Darren Hart <dvhart@xxxxxxxxxxxxx>; Pali RohÃr <pali.rohar@xxxxxxxxx>;
> LKML <linux-kernel@xxxxxxxxxxxxxxx>; Platform Driver <platform-driver-
> x86@xxxxxxxxxxxxxxx>
> Subject: Re: [PATCH v2 3/3] platform/x86: dell-smbios: Link all dell-smbios-*
> modules together
>
> On Tue, Feb 27, 2018 at 7:47 PM, Mario Limonciello
> <mario.limonciello@xxxxxxxx> wrote:
> > Some race conditions were raised due to dell-smbios and its backends
> > not being ready by the time that a consumer would call one of the
> > exported methods.
> >
> > To avoid this problem, guarantee that all initialization has been
> > done by linking them all together and running init for them all.
> >
> > As part of this change the Kconfig needs to be adjusted so that
> > CONFIG_DELL_SMBIOS_SMM and CONFIG_DELL_SMBIOS_WMI are boolean
> > rather than modules.
> >
> > CONFIG_DELL_SMBIOS is a visually selectable option again and both
> > CONFIG_DELL_SMBIOS_WMI and CONFIG_DELL_SMBIOS_SMM are optional.
>
> > changes from v1:
> > * Move #ifdefs into dell-smbios.h and use static inline functions
>
> > --- a/drivers/platform/x86/dell-smbios-smm.c
> > +++ b/drivers/platform/x86/dell-smbios-smm.c
>
> > +#ifdef CONFIG_DELL_SMBIOS_SMM
>
> Hmm... It's still here.
>
> Hint: in Makefile you need something like
>
> obj-$(CONFIG_DELL_SMBIOS_SMM) += dell-smbios-smm.o

Thanks makes sense. Will adjust again.

>
> > +#endif /* CONFIG_DELL_SMBIOS_SMM */
>
> > --- a/drivers/platform/x86/dell-smbios-wmi.c
> > +++ b/drivers/platform/x86/dell-smbios-wmi.c
>
> > +#ifdef CONFIG_DELL_SMBIOS_WMI
>
> Ditto.
>
> > +#endif /* CONFIG_DELL_SMBIOS_WMI */
>
>
> > +#ifdef CONFIG_DELL_SMBIOS_WMI
> > +int init_dell_smbios_wmi(void);
> > +void exit_dell_smbios_wmi(void);
> > +#else /* CONFIG_DELL_SMBIOS_WMI */
> > +static inline int init_dell_smbios_wmi(void)
> > +{
> > + return -ENODEV;
> > +}
>
> > +static inline void exit_dell_smbios_wmi(void)
> > +{}
>
> One line, please.
>
> > +#endif /* CONFIG_DELL_SMBIOS_WMI */
> > +
> > +#ifdef CONFIG_DELL_SMBIOS_SMM
> > +int init_dell_smbios_smm(void);
> > +void exit_dell_smbios_smm(void);
> > +#else /* CONFIG_DELL_SMBIOS_SMM */
> > +static inline int init_dell_smbios_smm(void)
> > +{
> > + return -ENODEV;
> > +}
>
> > +static inline void exit_dell_smbios_smm(void)
> > +{}
>
> Ditto.
>
> > +#endif /* CONFIG_DELL_SMBIOS_SMM */
>
> --
> With Best Regards,
> Andy Shevchenko