lkml.org 
[lkml]   [2018]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 3/3] platform/x86: dell-smbios: Link all dell-smbios-* modules together
Date
> -----Original Message-----
> From: Andy Shevchenko [mailto:andy.shevchenko@gmail.com]
> Sent: Tuesday, February 27, 2018 10:09 AM
> To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> Cc: Darren Hart <dvhart@infradead.org>; Pali Rohár <pali.rohar@gmail.com>;
> LKML <linux-kernel@vger.kernel.org>; Platform Driver <platform-driver-
> x86@vger.kernel.org>
> Subject: Re: [PATCH 3/3] platform/x86: dell-smbios: Link all dell-smbios-* modules
> together
>
> On Tue, Feb 27, 2018 at 5:56 PM, Mario Limonciello
> <mario.limonciello@dell.com> 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.
>
>
> > --- a/drivers/platform/x86/dell-smbios-smm.c
> > +++ b/drivers/platform/x86/dell-smbios-smm.c
>
> > +#ifdef CONFIG_DELL_SMBIOS_SMM
>
> > +#else /* CONFIG_DELL_SMBIOS_SMM */
> > +int init_dell_smbios_smm(void)
> > +{
> > + return -ENODEV;
> > +}
>
> > +void exit_dell_smbios_smm(void)
> > +{}
> > +#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
>
> > +#else /* CONFIG_DELL_SMBIOS_WMI */
> > +int init_dell_smbios_wmi(void)
> > +{
> > + return -ENODEV;
> > +}
> > +
> > +void exit_dell_smbios_wmi(void)
> > +{}
> > +#endif /* CONFIG_DELL_SMBIOS_WMI */
>
> It's rather strange to see above in *.c and not in *.h where it's
> usually supposed to be...

Thanks that was my original thought too, but I was following
the style that I had seen in drivers/input/mouse which is
used for psmouse/synaptics.
Eg: https://github.com/torvalds/linux/blob/master/drivers/input/mouse/synaptics.c#L1692

>
> > --- a/drivers/platform/x86/dell-smbios.h
> > +++ b/drivers/platform/x86/dell-smbios.h
> > @@ -75,4 +75,10 @@ int dell_laptop_register_notifier(struct notifier_block
> *nb);
> > int dell_laptop_unregister_notifier(struct notifier_block *nb);
> > void dell_laptop_call_notifier(unsigned long action, void *data);
> >
> > +/* for the supported backends */
> > +int init_dell_smbios_wmi(void);
> > +void exit_dell_smbios_wmi(void);
> > +int init_dell_smbios_smm(void);
> > +void exit_dell_smbios_smm(void);
> > +
>
> ...here...

So do you mean you would rather see inline functions in header
file for the #else case then?


\
 
 \ /
  Last update: 2018-02-27 17:13    [W:0.085 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site