[PATCH V5 1/9] drivers core: Add support for Wifi band RF mitigations

Quan, Evan Evan.Quan at amd.com
Tue Jul 4 03:30:53 UTC 2023


[AMD Official Use Only - General]

> -----Original Message-----
> From: Andrew Lunn <andrew at lunn.ch>
> Sent: Saturday, July 1, 2023 8:20 AM
> To: Quan, Evan <Evan.Quan at amd.com>
> Cc: rafael at kernel.org; lenb at kernel.org; Deucher, Alexander
> <Alexander.Deucher at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>; Pan, Xinhui <Xinhui.Pan at amd.com>;
> airlied at gmail.com; daniel at ffwll.ch; johannes at sipsolutions.net;
> davem at davemloft.net; edumazet at google.com; kuba at kernel.org;
> pabeni at redhat.com; Limonciello, Mario <Mario.Limonciello at amd.com>;
> mdaenzer at redhat.com; maarten.lankhorst at linux.intel.com;
> tzimmermann at suse.de; hdegoede at redhat.com; jingyuwang_vip at 163.com;
> Lazar, Lijo <Lijo.Lazar at amd.com>; jim.cromie at gmail.com;
> bellosilicio at gmail.com; andrealmeid at igalia.com; trix at redhat.com;
> jsg at jsg.id.au; arnd at arndb.de; linux-kernel at vger.kernel.org; linux-
> acpi at vger.kernel.org; amd-gfx at lists.freedesktop.org; dri-
> devel at lists.freedesktop.org; linux-wireless at vger.kernel.org;
> netdev at vger.kernel.org
> Subject: Re: [PATCH V5 1/9] drivers core: Add support for Wifi band RF
> mitigations
>
> > Drivers/subsystems contributing frequencies:
> >
> > 1) During probe, check `wbrf_supported_producer` to see if WBRF
> supported
> >    for the device.
>
> What is the purpose of this stage? Why would it not be supported for this
> device?
This is needed for wbrf support via ACPI mechanism. If BIOS(AML code) does not support the wbrf adding/removing for some device,
it should speak that out so that the device can be aware of that.
>
> > +#ifdef CONFIG_WBRF
> > +bool wbrf_supported_producer(struct device *dev); int
> > +wbrf_add_exclusion(struct device *adev,
> > +                  struct wbrf_ranges_in *in);
> > +int wbrf_remove_exclusion(struct device *dev,
> > +                     struct wbrf_ranges_in *in);
> > +int wbrf_retrieve_exclusions(struct device *dev,
> > +                        struct wbrf_ranges_out *out); bool
> > +wbrf_supported_consumer(struct device *dev);
> > +
> > +int wbrf_register_notifier(struct notifier_block *nb); int
> > +wbrf_unregister_notifier(struct notifier_block *nb); #else static
> > +inline bool wbrf_supported_producer(struct device *dev) { return
> > +false; } static inline int wbrf_add_exclusion(struct device *adev,
> > +                                struct wbrf_ranges_in *in) { return -
> ENODEV; } static inline
> > +int wbrf_remove_exclusion(struct device *dev,
> > +                                   struct wbrf_ranges_in *in) { return -
> ENODEV; }
>
> The normal aim of stubs is that so long as it is not expected to be fatal if the
> functionality is missing, the caller should not care if it is missing. So i would
> expect these to return 0, indicating everything worked as expected.
Sure, that makes sense.
>
> > +static inline int wbrf_retrieve_exclusions(struct device *dev,
> > +                                      struct wbrf_ranges_out *out)
> { return -ENODEV; }
>
> This is more complex. Ideally you want to return an empty set, so there is
> nothing to do. So i think the stub probably wants to do a memset and then
> return 0.
Right, will update it accordingly.
>
> > +static inline bool wbrf_supported_consumer(struct device *dev) {
> > +return false; } static inline int wbrf_register_notifier(struct
> > +notifier_block *nb) { return -ENODEV; } static inline int
> > +wbrf_unregister_notifier(struct notifier_block *nb) { return -ENODEV;
> > +}
>
> And these can just return 0.
Will update it.

Evan
>
>     Andrew


More information about the dri-devel mailing list