Enable Wifi RFI interference mitigation feature support
Subsystems (10)
v8 cover Enable Wifi RFI interference mitigation feature support
Due to electrical and mechanical constraints in certain platform designs there may be likely interference of relatively high-powered harmonics of the (G-)DDR memory clocks with local radio module frequency bands used by Wifi 6/6e/7. To mitigate possible RFI interference producers can advertise the frequencies in use and consumers can use this information to avoid using these frequencies for sensitive features.
The whole patch set is based on Linux 6.5-rc5. With some brief introductions as below:
Patch1 - 2: Core functionality setup for WBRF feature support Patch3 - 4: Bring WBRF support to wifi subsystem. Patch5 - 9: Bring WBRF support to AMD graphics driver.
Evan Quan (9):
drivers core: Add support for Wifi band RF mitigations drivers core: add ACPI based WBRF mechanism introduced by AMD
cfg80211: expose nl80211_chan_width_to_mhz for wide sharing
wifi: mac80211: Add support for WBRF features
drm/amd/pm: update driver_if and ppsmc headers for coming wbrf feature drm/amd/pm: setup the framework to support Wifi RFI mitigation feature drm/amd/pm: add flood detection for wbrf events drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.0 drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.7
.../admin-guide/kernel-parameters.txt | 9 + drivers/acpi/Makefile | 2 + drivers/acpi/amd_wbrf.c | 294 ++++++++++++++ drivers/base/Kconfig | 20 + drivers/base/Makefile | 1 + drivers/base/wbrf.c | 367 ++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 17 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 213 ++++++++++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 33 ++ .../inc/pmfw_if/smu13_driver_if_v13_0_0.h | 14 +- .../inc/pmfw_if/smu13_driver_if_v13_0_7.h | 14 +- .../pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h | 3 +- .../pm/swsmu/inc/pmfw_if/smu_v13_0_7_ppsmc.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 3 + .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 9 + .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 60 +++ .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 59 +++ drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 3 + include/linux/acpi_amd_wbrf.h | 25 ++ include/linux/ieee80211.h | 1 + include/linux/wbrf.h | 47 +++ include/net/cfg80211.h | 8 + net/mac80211/Makefile | 2 + net/mac80211/chan.c | 9 + net/mac80211/ieee80211_i.h | 9 + net/mac80211/main.c | 2 + net/mac80211/wbrf.c | 103 +++++ net/wireless/chan.c | 3 +- 30 files changed, 1332 insertions(+), 6 deletions(-) create mode 100644 drivers/acpi/amd_wbrf.c create mode 100644 drivers/base/wbrf.c create mode 100644 include/linux/acpi_amd_wbrf.h create mode 100644 include/linux/wbrf.h create mode 100644 net/mac80211/wbrf.c
Signature · 1 line
2.34.1
PATCH v8 1/9 drivers core: Add support for Wifi band RF mitigations
Due to electrical and mechanical constraints in certain platform designs there may be likely interference of relatively high-powered harmonics of the (G-)DDR memory clocks with local radio module frequency bands used by Wifi 6/6e/7.
To mitigate this, AMD has introduced a mechanism that devices can use to notify active use of particular frequencies so that other devices can make relative internal adjustments as necessary to avoid this resonance.
In order for a device to support this, the expected flow for device driver or subsystems:
Drivers/subsystems contributing frequencies:
1) During probe, check wbrf_supported_producer to see if WBRF supported for the device.
2) If adding frequencies, then call wbrf_add_exclusion with the start and end ranges of the frequencies.
3) If removing frequencies, then call wbrf_remove_exclusion with start and end ranges of the frequencies.
Drivers/subsystems responding to frequencies:
1) During probe, check wbrf_supported_consumer to see if WBRF is supported for the device.
2) Call the wbrf_register_notifier to register for notifications of frequency changes from other devices.
3) Call the wbrf_retrieve_exclusions to retrieve the current exclusions range on receiving a notification and response correspondingly.
Meanwhile a kernel parameter wbrf with default setting as "auto" is introduced to specify what the policy is.
- With wbrf=on, the WBRF features will be enabled forcely.
- With wbrf=off, the WBRF features will be disabled forcely.
- With wbrf=auto, it will be up to the system to do proper checks to determine the WBRF features should be enabled or not.
--v4->v5:
- promote this to be a more generic solution with input argument taking struct device and provide better scalability to support non-ACPI scenarios(Andrew)
- update the APIs naming and some other minor fixes(Rafael)v6->v7:
- revised the struct wbrf_ranges_out to be naturally aligned(Andrew)
- revised some code comments(Andrew)
--- .../admin-guide/kernel-parameters.txt | 9 + drivers/base/Makefile | 1 + drivers/base/wbrf.c | 280 ++++++++++++++++++ include/linux/wbrf.h | 47 +++ 4 files changed, 337 insertions(+) create mode 100644 drivers/base/wbrf.c create mode 100644 include/linux/wbrf.h
Documentation/admin-guide/kernel-parameters.txt +9 -0
@@ -7152,3 +7152,12 @@ xmon commands. off xmon is disabled. + wbrf= [KNL] + Format: { on | auto | off } + Controls if WBRF features should be enabled or disabled + forcely. Default is auto. + on Force enable the WBRF features. + auto Up to the system to do proper checks to + determine the WBRF features should be enabled + or not. + off Force disable the WBRF features.
drivers/base/Makefile +1 -0
@@ -26,6 +26,7 @@ obj-$(CONFIG_GENERIC_MSI_IRQ) += platform-msi.o obj-$(CONFIG_GENERIC_ARCH_TOPOLOGY) += arch_topology.o obj-$(CONFIG_GENERIC_ARCH_NUMA) += arch_numa.o obj-$(CONFIG_ACPI) += physical_location.o +obj-y += wbrf.o obj-y += test/
drivers/base/wbrf.c new file +280 -0
280 lines not on this page · raw message
include/linux/wbrf.h new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v8 2/9 drivers core: add ACPI based WBRF mechanism introduced by AMD
In reply to Evan QuanAMD has introduced an ACPI based mechanism to support WBRF for some platforms with AMD dGPU + WLAN. This needs support from BIOS equipped with necessary AML implementations and dGPU firmwares.
For those systems without the ACPI mechanism and developing solutions, user can use/fall-back the generic WBRF solution for diagnosing potential interference issues.
And for the platform which does not equip with the necessary AMD ACPI implementations but with CONFIG_WBRF_AMD_ACPI built as 'y', it will fall back to generic WBRF solution if the wbrf is set as "on".
--v4->v5:
- promote this to be a more generic solution with input argument taking struct device and provide better scalability to support non-ACPI scenarios(Andrew)
- update the APIs naming and some other minor fixes(Rafael)v5->v6:
- make the code more readable and some other fixes(Andrew)v6->v8:
- drop CONFIG_WBRF_GENERIC(Mario)
- add wbrf kernel parameter for policy control(Mario)
--- drivers/acpi/Makefile | 2 + drivers/acpi/amd_wbrf.c | 294 ++++++++++++++++++++++++++++++++++ drivers/base/Kconfig | 20 +++ drivers/base/wbrf.c | 135 +++++++++++++--- include/linux/acpi_amd_wbrf.h | 25 +++ 5 files changed, 452 insertions(+), 24 deletions(-) create mode 100644 drivers/acpi/amd_wbrf.c create mode 100644 include/linux/acpi_amd_wbrf.h
drivers/acpi/Makefile +2 -0
@@ -133,3 +133,5 @@ obj-$(CONFIG_ARM64) += arm64/ obj-$(CONFIG_ACPI_VIOT) += viot.o obj-$(CONFIG_RISCV) += riscv/ + +obj-$(CONFIG_WBRF_AMD_ACPI) += amd_wbrf.o
drivers/acpi/amd_wbrf.c new file +294 -0
294 lines not on this page · raw message
drivers/base/Kconfig +20 -0
@@ -242,4 +242,24 @@ config FW_DEVLINK_SYNC_STATE_TIMEOUT command line option on every system/board your kernel is expected to work on. +menu "Wifi band RF mitigation mechanism" + +config WBRF_AMD_ACPI + bool "ACPI based mechanism introduced by AMD" + depends on ACPI + help + Wifi band RF mitigation mechanism allows multiple drivers from + different domains to notify the frequencies in use so that hardware + can be reconfigured to avoid harmonic conflicts. + + AMD has introduced an ACPI based mechanism to support WBRF for some + platforms with AMD dGPU and WLAN. This needs support from BIOS equipped + with necessary AML implementations and dGPU firmwares. + + Before enabling this ACPI based mechanism, it is suggested to confirm + with the hardware designer/provider first whether your platform + equipped with necessary BIOS and firmwares. + +endmenu + endmenu
drivers/base/wbrf.c +111 -24
211 lines not on this page · raw message
include/linux/acpi_amd_wbrf.h new file +25 -0
@@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Wifi Band Exclusion Interface (AMD ACPI Implementation) +* Copyright (C) 2023 Advanced Micro Devices +* +*/ + +#ifndef _ACPI_AMD_WBRF_H +#define _ACPI_AMD_WBRF_H + +#include <linux/wbrf.h> + +#if IS_ENABLED (CONFIG_WBRF_AMD_ACPI ) +bool acpi_amd_wbrf_supported_system (void ); +bool acpi_amd_wbrf_supported_consumer (struct device *dev); +bool acpi_amd_wbrf_supported_producer (struct device *dev); +int acpi_amd_wbrf_remove_exclusion (struct device *dev, +struct wbrf_ranges_in *in); +int acpi_amd_wbrf_add_exclusion (struct device *dev, +struct wbrf_ranges_in *in); +int acpi_amd_wbrf_retrieve_exclusions (struct device *dev, +struct wbrf_ranges_out *out); +#endif + +#endif /* _ACPI_AMD_WBRF_H */
Signature · 1 line
2.34.1
PATCH v8 3/9 cfg80211: expose nl80211_chan_width_to_mhz for wide sharing
In reply to Evan QuanThe newly added WBRF feature needs this interface for channel width calculation.
--- include/net/cfg80211.h | 8 ++++++++ net/wireless/chan.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)
include/net/cfg80211.h +8 -0
@@ -920,6 +920,14 @@ const struct cfg80211_chan_def * cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, const struct cfg80211_chan_def *chandef2); +/** +* nl80211_chan_width_to_mhz - get the channel width in Mhz +* @chan_width: the channel width from &enum nl80211_chan_width +* Return: channel width in Mhz if the chan_width from &enum nl80211_chan_width +* is valid. -1 otherwise. +*/ +int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width); +/** * cfg80211_chandef_valid - check if a channel definition is valid * @chandef: the channel definition to check
net/wireless/chan.c +2 -1
@@ -141,7 +141,7 @@ static bool cfg80211_edmg_chandef_valid(const struct cfg80211_chan_def *chandef)return true; } -static int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width) +int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width) {int mhz;
@@ -190,6 +190,7 @@ static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) }return mhz; } +EXPORT_SYMBOL (nl80211_chan_width_to_mhz);static int cfg80211_chandef_get_width (const struct cfg80211_chan_def *c) {
Signature · 1 line
2.34.1
PATCH v8 4/9 wifi: mac80211: Add support for WBRF features
In reply to Evan QuanTo support the WBRF mechanism, Wifi adapters utilized in the system must register the frequencies in use(or unregister those frequencies no longer used) via the dedicated calls. So that, other drivers responding to the frequencies can take proper actions to mitigate possible interference.
--v1->v2:
- place the new added member(wbrf_supported) in
ieee80211_local(Johannes)
- handle chandefs change scenario properly(Johannes)
- some minor fixes around code sharing and possible invalid input checks(Johannes)v2->v3:
- drop unnecessary input checks and intermediate APIs(Mario)
- Separate some mac80211 common code(Mario, Johannes)v3->v4:
- some minor fixes around return values(Johannes)
--- include/linux/ieee80211.h | 1 + net/mac80211/Makefile | 2 + net/mac80211/chan.c | 9 ++++ net/mac80211/ieee80211_i.h | 9 ++++ net/mac80211/main.c | 2 + net/mac80211/wbrf.c | 103 +++++++++++++++++++++++++++++++++++++ 6 files changed, 126 insertions(+) create mode 100644 net/mac80211/wbrf.c
include/linux/ieee80211.h +1 -0
@@ -4335,6 +4335,7 @@ static inline int ieee80211_get_tdls_action(struct sk_buff *skb, u32 hdr_size)/* convert frequencies */ #define MHZ_TO_KHZ (freq) ((freq) * 1000)#define KHZ_TO_MHZ (freq) ((freq) / 1000) +#define KHZ_TO_HZ (freq) ((freq) * 1000)#define PR_KHZ (f) KHZ_TO_MHZ(f), f % 1000#define KHZ_F "%d.%03d"
net/mac80211/Makefile +2 -0
@@ -65,4 +65,6 @@ rc80211_minstrel-$(CONFIG_MAC80211_DEBUGFS) += \ mac80211-$(CONFIG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y) +mac80211-y += wbrf.o + ccflags-y += -DDEBUG
net/mac80211/chan.c +9 -0
@@ -506,11 +506,16 @@ static void _ieee80211_change_chanctx(struct ieee80211_local *local,WARN_ON (!cfg80211_chandef_compatible (&ctx->conf.def, chandef)); +ieee80211_remove_wbrf (local, &ctx->conf.def); + ctx->conf.def = *chandef;/* check if min chanctx also changed */ changed =IEEE80211_CHANCTX_CHANGE_WIDTH |_ieee80211_recalc_chanctx_min_def (local, ctx, rsvd_for); + +ieee80211_add_wbrf (local, &ctx->conf.def); +drv_change_chanctx (local, ctx, changed);if (!local->use_chanctx) {
@@ -668,6 +673,8 @@ static int ieee80211_add_chanctx(struct ieee80211_local *local,lockdep_assert_held (&local->mtx);lockdep_assert_held (&local->chanctx_mtx); +ieee80211_add_wbrf (local, &ctx->conf.def); +if (!local->use_chanctx) local->hw.conf.radar_enabled = ctx->conf.radar_enabled;
@@ -748,6 +755,8 @@ static void ieee80211_del_chanctx(struct ieee80211_local *local, }ieee80211_recalc_idle (local); + +ieee80211_remove_wbrf (local, &ctx->conf.def); } static void ieee80211_free_chanctx(struct ieee80211_local *local,
net/mac80211/ieee80211_i.h +9 -0
@@ -1600,6 +1600,8 @@ struct ieee80211_local {/* extended capabilities provided by mac80211 */ u8 ext_capa[8 ]; + +bool wbrf_supported; }; static inline struct ieee80211_sub_if_data *
@@ -2638,4 +2640,11 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata,const struct ieee80211_eht_cap_elem *eht_cap_ie_elem, u8 eht_cap_len, struct link_sta_info *link_sta); + +void ieee80211_check_wbrf_support (struct ieee80211_local *local); +void ieee80211_add_wbrf (struct ieee80211_local *local, +struct cfg80211_chan_def *chandef); +void ieee80211_remove_wbrf (struct ieee80211_local *local, +struct cfg80211_chan_def *chandef); +#endif /* IEEE80211_I_H */
net/mac80211/main.c +2 -0
@@ -1396,6 +1396,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)debugfs_hw_add (local);rate_control_add_debugfs (local); +ieee80211_check_wbrf_support (local); +rtnl_lock ();wiphy_lock (hw->wiphy);
net/mac80211/wbrf.c new file +103 -0
103 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v8 5/9 drm/amd/pm: update driver_if and ppsmc headers for coming wbrf feature
In reply to Evan QuanAdd those data structures to support Wifi RFI mitigation feature.
--- .../pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h | 14 +++++++++++++- .../pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h | 14 +++++++++++++- .../amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h | 3 ++- .../amd/pm/swsmu/inc/pmfw_if/smu_v13_0_7_ppsmc.h | 3 ++- 4 files changed, 30 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h +13 -1
@@ -391,6 +391,17 @@ typedef struct {EccInfo_t EccInfo[24 ]; } EccInfoTable_t; +typedef struct { +uint16_t LowFreq; +uint16_t HighFreq; +}WifiOneBand_t ; + +typedef struct { +uint32_t WifiBandEntryNum; +WifiOneBand_t WifiBandEntry[11 ]; +uint32_t MmHubPadding[8 ]; +}WifiBandEntryTable_t ; +//D3HOT sequences typedef enum { BACO_SEQUENCE,
@@ -1615,7 +1626,8 @@ typedef struct {#define TABLE_I2C_COMMANDS 9#define TABLE_DRIVER_INFO 10#define TABLE_ECCINFO 11 -#define TABLE_COUNT 12 +#define TABLE_WIFIBAND 12 +#define TABLE_COUNT 13//IH Interupt ID #define IH_INTERRUPT_ID_TO_DRIVER 0xFE
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h +13 -1
@@ -392,6 +392,17 @@ typedef struct {EccInfo_t EccInfo[24 ]; } EccInfoTable_t; +typedef struct { +uint16_t LowFreq; +uint16_t HighFreq; +}WifiOneBand_t ; + +typedef struct { +uint32_t WifiBandEntryNum; +WifiOneBand_t WifiBandEntry[11 ]; +uint32_t MmHubPadding[8 ]; +}WifiBandEntryTable_t ; +//D3HOT sequences typedef enum { BACO_SEQUENCE,
@@ -1605,7 +1616,8 @@ typedef struct {#define TABLE_I2C_COMMANDS 9#define TABLE_DRIVER_INFO 10#define TABLE_ECCINFO 11 -#define TABLE_COUNT 12 +#define TABLE_WIFIBAND 12 +#define TABLE_COUNT 13//IH Interupt ID #define IH_INTERRUPT_ID_TO_DRIVER 0xFE
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h +2 -1
@@ -138,7 +138,8 @@#define PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel 0x4A#define PPSMC_MSG_SetPriorityDeltaGain 0x4B#define PPSMC_MSG_AllowIHHostInterrupt 0x4C -#define PPSMC_Message_Count 0x4D +#define PPSMC_MSG_EnableUCLKShadow 0x51 +#define PPSMC_Message_Count 0x52//Debug Dump Message #define DEBUGSMC_MSG_TestMessage 0x1
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_7_ppsmc.h +2 -1
@@ -134,6 +134,7 @@#define PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel 0x4A#define PPSMC_MSG_SetPriorityDeltaGain 0x4B#define PPSMC_MSG_AllowIHHostInterrupt 0x4C -#define PPSMC_Message_Count 0x4D +#define PPSMC_MSG_EnableUCLKShadow 0x51 +#define PPSMC_Message_Count 0x52#endif
Signature · 1 line
2.34.1
PATCH v8 6/9 drm/amd/pm: setup the framework to support Wifi RFI mitigation feature
In reply to Evan QuanWith WBRF feature supported, as a driver responding to the frequencies, amdgpu driver is able to do shadow pstate switching to mitigate possible interference(between its (G-)DDR memory clocks and local radio module frequency bands used by Wifi 6/6e/7).
--v1->v2:
- update the prompt for feature support(Lijo)
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 17 ++ drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 194 ++++++++++++++++++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 23 +++ drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 3 + 5 files changed, 239 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +2 -0
@@ -247,6 +247,8 @@ extern int amdgpu_sg_display;extern int amdgpu_user_partt_mode; +extern int amdgpu_wbrf; +#define AMDGPU_VM_MAX_NUM_CTX 4096#define AMDGPU_SG_THRESHOLD (256*1024*1024)#define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +17 -0
@@ -195,6 +195,7 @@ int amdgpu_use_xgmi_p2p = 1;int amdgpu_vcnfw_log;int amdgpu_sg_display =-1 ;/* auto */ int amdgpu_user_partt_mode =AMDGPU_AUTO_COMPUTE_PARTITION_MODE ; +int amdgpu_wbrf =-1 ;static void amdgpu_drv_delayed_reset_work_handler (struct work_struct *work);
@@ -981,6 +982,22 @@ module_param_named(user_partt_mode, amdgpu_user_partt_mode, uint, 0444);module_param (enforce_isolation, bool,0444 );MODULE_PARM_DESC (enforce_isolation,"enforce process isolation between graphics and compute . enforce_isolation = on" ); +/** +* DOC: wbrf (int) +* Enable Wifi RFI interference mitigation feature. +* Due to electrical and mechanical constraints there may be likely interference of +* relatively high-powered harmonics of the (G-)DDR memory clocks with local radio +* module frequency bands used by Wifi 6/6e/7. To mitigate the possible RFI interference, +* with this feature enabled, PMFW will use either “shadowed P-State” or “P-State” based +* on active list of frequencies in-use (to be avoided) as part of initial setting or +* P-state transition. However, there may be potential performance impact with this +* feature enabled. +* (0 = disabled, 1 = enabled, -1 = auto (default setting, will be enabled if supported)) +*/ +MODULE_PARM_DESC (wbrf, +"Enable Wifi RFI interference mitigation (0 = disabled, 1 = enabled, -1 = auto(default)" ); +module_param_named (wbrf, amdgpu_wbrf, int,0444 ); +/* These devices are not supported by amdgpu. * They are supported by the mach64, r128, radeon drivers */
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +194 -0
224 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +23 -0
@@ -22,6 +22,8 @@#ifndef __AMDGPU_SMU_H__#define __AMDGPU_SMU_H__ +#include <linux/wbrf.h> +#include "amdgpu.h" #include "kgd_pp_interface.h" #include "dm_pp_interface.h"
@@ -575,6 +577,10 @@ struct smu_contextu32 debug_resp_reg;struct delayed_work swctf_delayed_work; + +/* data structures for wbrf feature support */ +bool wbrf_supported; +struct notifier_block wbrf_notifier; };struct i2c_adapter ;
@@ -1356,6 +1362,23 @@ struct pptable_funcs {* @init_pptable_microcode: Prepare the pptable microcode to upload via PSP */ int (*init_pptable_microcode)(struct smu_context *smu); + +/** +* @is_asic_wbrf_supported: check whether PMFW supports the wbrf feature +*/ +bool (*is_asic_wbrf_supported)(struct smu_context *smu); + +/** +* @enable_uclk_shadow: Enable the uclk shadow feature on wbrf supported +*/ +int (*enable_uclk_shadow)(struct smu_context *smu, +bool enablement); + +/** +* @set_wbrf_exclusion_ranges: notify SMU the wifi bands occupied +*/ +int (*set_wbrf_exclusion_ranges)(struct smu_context *smu, +struct exclusion_range *exclusion_ranges); }; typedef enum {
drivers/gpu/drm/amd/pm/swsmu/smu_internal.h +3 -0
@@ -97,6 +97,9 @@#define smu_get_default_config_table_settings (smu, config_table) smu_ppt_funcs(get_default_config_table_settings, -EOPNOTSUPP, smu, config_table)#define smu_set_config_table (smu, config_table) smu_ppt_funcs(set_config_table, -EOPNOTSUPP, smu, config_table)#define smu_init_pptable_microcode (smu) smu_ppt_funcs(init_pptable_microcode, 0, smu) +#define smu_is_asic_wbrf_supported (smu) smu_ppt_funcs(is_asic_wbrf_supported, false, smu) +#define smu_enable_uclk_shadow (smu, enablement) smu_ppt_funcs(enable_uclk_shadow, 0, smu, enablement) +#define smu_set_wbrf_exclusion_ranges (smu, exclusion_ranges) smu_ppt_funcs(set_wbrf_exclusion_ranges, -EOPNOTSUPP, smu, exclusion_ranges)#endif #endif
Signature · 1 line
2.34.1
PATCH v8 7/9 drm/amd/pm: add flood detection for wbrf events
In reply to Evan QuanTo protect PMFW from being overloaded.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 31 +++++++++++++++---- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 7 +++++ 2 files changed, 32 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +25 -6
@@ -1318,7 +1318,8 @@ static int smu_wbrf_event_handler(struct notifier_block *nb,switch (action) {case WBRF_CHANGED : -smu_wbrf_handle_exclusion_ranges (smu); +schedule_delayed_work (&smu->wbrf_delayed_work, +msecs_to_jiffies (SMU_WBRF_EVENT_HANDLING_PACE ));break ;default :return NOTIFY_DONE ;
@@ -1327,6 +1328,21 @@ static int smu_wbrf_event_handler(struct notifier_block *nb,return NOTIFY_OK ; } +/** +* smu_wbrf_delayed_work_handler - callback on delayed work timer expired +* +* @work: struct work_struct pointer +* +* Flood is over and driver will consume the latest exclusion ranges. +*/ +static void smu_wbrf_delayed_work_handler (struct work_struct *work) +{ +struct smu_context *smu = + container_of(work, struct smu_context, wbrf_delayed_work.work); + +smu_wbrf_handle_exclusion_ranges (smu); +} +/** * smu_wbrf_support_check - check wbrf support *
@@ -1357,12 +1373,14 @@ static void smu_wbrf_support_check(struct smu_context *smu)*/ static int smu_wbrf_init (struct smu_context *smu) { -struct amdgpu_device *adev = smu->adev;int ret;if (!smu->wbrf_supported)return 0 ; +INIT_DELAYED_WORK (&smu->wbrf_delayed_work, + smu_wbrf_delayed_work_handler); + smu->wbrf_notifier.notifier_call = smu_wbrf_event_handler; ret =wbrf_register_notifier (&smu->wbrf_notifier);if (ret)
@@ -1373,11 +1391,10 @@ static int smu_wbrf_init(struct smu_context *smu)* before our driver loaded. To make sure our driver * is awared of those exclusion ranges. */ - ret =smu_wbrf_handle_exclusion_ranges (smu); -if (ret) -dev_err (adev->dev,"Failed to handle wbrf exclusion ranges\n" ); +schedule_delayed_work (&smu->wbrf_delayed_work, +msecs_to_jiffies (SMU_WBRF_EVENT_HANDLING_PACE )); -return ret; +return 0 ; }/**
@@ -1393,6 +1410,8 @@ static void smu_wbrf_fini(struct smu_context *smu)return ;wbrf_unregister_notifier (&smu->wbrf_notifier); + +cancel_delayed_work_sync (&smu->wbrf_delayed_work); }static int smu_smc_hw_setup (struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +7 -0
@@ -480,6 +480,12 @@ struct stb_context {#define WORKLOAD_POLICY_MAX 7 +/* +* Configure wbrf event handling pace as there can be only one +* event processed every SMU_WBRF_EVENT_HANDLING_PACE ms. +*/ +#define SMU_WBRF_EVENT_HANDLING_PACE 10 +struct smu_context {struct amdgpu_device *adev;
@@ -581,6 +587,7 @@ struct smu_context/* data structures for wbrf feature support */ bool wbrf_supported;struct notifier_block wbrf_notifier; +struct delayed_work wbrf_delayed_work; };struct i2c_adapter ;
Signature · 1 line
2.34.1
PATCH v8 8/9 drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.0
In reply to Evan QuanFulfill the SMU13.0.0 support for Wifi RFI mitigation feature.
--- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 3 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 3 + .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 9 +++ .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 60 +++++++++++++++++++ 5 files changed, 77 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +3 -0
@@ -325,6 +325,7 @@ enum smu_table_idSMU_TABLE_PACE ,SMU_TABLE_ECCINFO ,SMU_TABLE_COMBO_PPTABLE , +SMU_TABLE_WIFIBAND , SMU_TABLE_COUNT, };
@@ -1501,6 +1502,8 @@ enum smu_baco_seq { __dst_size); \ }) +#define HZ_IN_MHZ 1000000U +#if !defined(SWSMU_CODE_LAYER_L2 ) && !defined(SWSMU_CODE_LAYER_L3 ) && !defined(SWSMU_CODE_LAYER_L4 ) int smu_get_power_limit(void *handle, uint32_t *limit,
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +2 -1
@@ -245,7 +245,8 @@__SMU_DUMMY_MAP (AllowGpo), \__SMU_DUMMY_MAP (Mode2Reset), \__SMU_DUMMY_MAP (RequestI2cTransaction), \ -__SMU_DUMMY_MAP (GetMetricsTable), +__SMU_DUMMY_MAP (GetMetricsTable), \ +__SMU_DUMMY_MAP (EnableUCLKShadow), #undef __SMU_DUMMY_MAP#define __SMU_DUMMY_MAP (type) SMU_MSG_##type
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +3 -0
@@ -299,5 +299,8 @@ int smu_v13_0_update_pcie_parameters(struct smu_context *smu,uint32_t pcie_gen_cap, uint32_t pcie_width_cap); +int smu_v13_0_enable_uclk_shadow (struct smu_context *smu, +bool enablement); +#endif #endif
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +9 -0
@@ -2472,3 +2472,12 @@ int smu_v13_0_update_pcie_parameters(struct smu_context *smu,return 0 ; } + +int smu_v13_0_enable_uclk_shadow (struct smu_context *smu, +bool enablement) +{ +return smu_cmn_send_smc_msg_with_param (smu, + SMU_MSG_EnableUCLKShadow, + enablement, +NULL ); +}
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +60 -0
90 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v8 9/9 drm/amd/pm: enable Wifi RFI mitigation feature support for SMU13.0.7
In reply to Evan QuanFulfill the SMU13.0.7 support for Wifi RFI mitigation feature.
--- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +59 -0
@@ -126,6 +126,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_7_message_map[SMU_MSG_MAX_COUNT] =MSG_MAP (AllowGpo, PPSMC_MSG_SetGpoAllow,0 ),MSG_MAP (GetPptLimit, PPSMC_MSG_GetPptLimit,0 ),MSG_MAP (NotifyPowerSource, PPSMC_MSG_NotifyPowerSource,0 ), + MSG_MAP(EnableUCLKShadow, PPSMC_MSG_EnableUCLKShadow, 0), }; static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = {
@@ -207,6 +208,7 @@ static struct cmn2asic_mapping smu_v13_0_7_table_map[SMU_TABLE_COUNT] = { TAB_MAP(ACTIVITY_MONITOR_COEFF), [SMU_TABLE_COMBO_PPTABLE ] = {1 ,TABLE_COMBO_PPTABLE },TAB_MAP (OVERDRIVE ), + TAB_MAP(WIFIBAND), };static struct cmn2asic_mapping smu_v13_0_7_pwr_src_map[SMU_POWER_SOURCE_COUNT ] = {
@@ -497,6 +499,9 @@ static int smu_v13_0_7_tables_init(struct smu_context *smu) AMDGPU_GEM_DOMAIN_VRAM);SMU_TABLE_INIT (tables,SMU_TABLE_COMBO_PPTABLE ,MP0_MP1_DATA_REGION_SIZE_COMBOPPTABLE ,PAGE_SIZE ,AMDGPU_GEM_DOMAIN_VRAM ); +SMU_TABLE_INIT (tables,SMU_TABLE_WIFIBAND , +sizeof (WifiBandEntryTable_t),PAGE_SIZE , +AMDGPU_GEM_DOMAIN_VRAM ); smu_table->metrics_table =kzalloc (sizeof (SmuMetricsExternal_t),GFP_KERNEL );if (!smu_table->metrics_table)
@@ -2173,6 +2178,57 @@ static int smu_v13_0_7_set_df_cstate(struct smu_context *smu, NULL); } +static bool smu_v13_0_7_wbrf_support_check (struct smu_context *smu) +{ +return smu->smc_fw_version >0x00524600 ; +} + +static int smu_v13_0_7_set_wbrf_exclusion_ranges (struct smu_context *smu, +struct exclusion_range *exclusion_ranges) +{ +WifiBandEntryTable_t wifi_bands; +int valid_entries =0 ; +int ret, i; + +memset (&wifi_bands,0 ,sizeof (wifi_bands)); +for (i =0 ; i <ARRAY_SIZE (wifi_bands.WifiBandEntry); i++) { +if (!exclusion_ranges[i].start && + !exclusion_ranges[i].end) +break ; + +/* PMFW expects the inputs to be in Mhz unit */ + wifi_bands.WifiBandEntry[valid_entries].LowFreq = +DIV_ROUND_DOWN_ULL (exclusion_ranges[i].start,HZ_IN_MHZ ); + wifi_bands.WifiBandEntry[valid_entries++].HighFreq = +DIV_ROUND_UP_ULL (exclusion_ranges[i].end,HZ_IN_MHZ ); + } + wifi_bands.WifiBandEntryNum = valid_entries; + +/* +* Per confirm with PMFW team, WifiBandEntryNum = 0 is a valid setting. +* Considering the scenarios below: +* - At first the wifi device adds an exclusion range e.g. (2400,2500) to +* BIOS and our driver gets notified. We will set WifiBandEntryNum = 1 +* and pass the WifiBandEntry (2400, 2500) to PMFW. +* +* - Later the wifi device removes the wifiband list added above and +* our driver gets notified again. At this time, driver will set +* WifiBandEntryNum = 0 and pass an empty WifiBandEntry list to PMFW. +* - PMFW may still need to do some uclk shadow update(e.g. switching +* from shadow clock back to primary clock) on receiving this. +*/ + + ret =smu_cmn_update_table (smu, +SMU_TABLE_WIFIBAND , +0 , + (void *)(&wifi_bands), + true); +if (ret) +dev_err (smu->adev->dev,"Failed to set wifiband!" ); + +return ret; +} +static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { .get_allowed_feature_mask = smu_v13_0_7_get_allowed_feature_mask, .set_default_dpm_table = smu_v13_0_7_set_default_dpm_table,
@@ -2241,6 +2297,9 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { .set_mp1_state = smu_v13_0_7_set_mp1_state, .set_df_cstate = smu_v13_0_7_set_df_cstate, .gpo_control = smu_v13_0_gpo_control, + .is_asic_wbrf_supported = smu_v13_0_7_wbrf_support_check, + .enable_uclk_shadow = smu_v13_0_enable_uclk_shadow, + .set_wbrf_exclusion_ranges = smu_v13_0_7_set_wbrf_exclusion_ranges, };void smu_v13_0_7_set_ppt_funcs (struct smu_context *smu)
Signature · 1 line
2.34.1
Re: [PATCH V8 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing
In reply to Evan QuanQuoted 14 lines · Evan Quan
The newly added WBRF feature needs this interface for channel width calculation.
Signed-off-by Evan Quan <[email protected]>--- include/net/cfg80211.h | 8 ++++++++ net/wireless/chan.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)include/net/cfg80211.h +0
-0
include/net/cfg80211.h const struct cfg80211_chan_def * · line 927
Quoted 8 lines
include/net/cfg80211.h +5
-0@@ -920,6 +920,14 @@ const struct cfg80211_chan_def * cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, const struct cfg80211_chan_def *chandef2); +/** +* nl80211_chan_width_to_mhz - get the channel width in Mhz +* @chan_width: the channel width from &enum nl80211_chan_width +* Return: channel width in Mhz if the chan_width from &enum nl80211_chan_width +* is valid. -1 otherwise.
SI nit: s/Mhz/MHz/ in both places
Quoted 27 lines
include/net/cfg80211.h +3
-0+*/ +int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width); +/** * cfg80211_chandef_valid - check if a channel definition is valid * @chandef: the channel definition to check net/wireless/chan.c +2
-1@@ -141,7 +141,7 @@ static bool cfg80211_edmg_chandef_valid(const struct cfg80211_chan_def *chandef)return true; } -static int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width) +int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width) {int mhz;@@ -190,6 +190,7 @@ static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) }return mhz; } +EXPORT_SYMBOL (nl80211_chan_width_to_mhz);static int cfg80211_chandef_get_width (const struct cfg80211_chan_def *c) {
Randy Dunlap
reviewerRe: [PATCH V8 1/9] drivers core: Add support for Wifi band RF mitigations
In reply to Evan QuanDocumentation/admin-guide/kernel-parameters.txt line 7158
Quoted 12 lines · Evan Quan
Documentation/admin-guide/kernel-parameters.txt +4
-0@@ -7152,3 +7152,12 @@ xmon commands. off xmon is disabled. + wbrf= [KNL] + Format: { on | auto | off } + Controls if WBRF features should be enabled or disabled + forcely. Default is auto.
"forcely" is not a word. "forcedly" is a word, but it's not used very much AFAIK.
I would probably write "Controls if WBRF features should be forced on or off."
Quoted 5 lines
Documentation/admin-guide/kernel-parameters.txt +5
-0+ on Force enable the WBRF features. + auto Up to the system to do proper checks to + determine the WBRF features should be enabled + or not. + off Force disable the WBRF features.
Signature · 1 line
~Randy
Simon Horman
reviewerRe: [PATCH V8 6/9] drm/amd/pm: setup the framework to support Wifi RFI mitigation feature
In reply to Evan QuanQuoted 7 lines · Evan Quan
With WBRF feature supported, as a driver responding to the frequencies, amdgpu driver is able to do shadow pstate switching to mitigate possible interference(between its (G-)DDR memory clocks and local radio module frequency bands used by Wifi 6/6e/7).
Signed-off-by Evan Quan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>
...
Quoted 6 lines
+/**
+ *smu_wbrf_event_handler- handle notify events
+ *
+ * @nb: notifier block
+ * @action: event type
+ * @data: event data
Hi Evan,
a minor nit from my side: although it is documented here, smu_wbrf_event_handler has no @data parameter, while it does have an undocumented _arg parameter.
Quoted 20 lines
+ *
+ * Calls relevant amdgpu function in response to wbrf event
+ * notification from kernel.
+ */drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +16
-0+static int smu_wbrf_event_handler (struct notifier_block *nb, +unsigned long action,void *_arg) +{ + struct smu_context *smu = container_of(nb, struct smu_context, + wbrf_notifier); + +switch (action) { +case WBRF_CHANGED : +smu_wbrf_handle_exclusion_ranges (smu); +break ; +default : +return NOTIFY_DONE ; + }; + +return NOTIFY_OK ; +}
...
Simon Horman
reviewerRe: [PATCH V8 2/9] drivers core: add ACPI based WBRF mechanism introduced by AMD
In reply to Evan QuanQuoted 16 lines · Evan Quan
AMD has introduced an ACPI based mechanism to support WBRF for some platforms with AMD dGPU + WLAN. This needs support from BIOS equipped with necessary AML implementations and dGPU firmwares.
For those systems without the ACPI mechanism and developing solutions, user can use/fall-back the generic WBRF solution for diagnosing potential interference issues.
And for the platform which does not equip with the necessary AMD ACPI implementations but with
CONFIG_WBRF_AMD_ACPIbuilt as 'y', it will fall back to generic WBRF solution if thewbrfis set as "on".Co-developed-by Mario Limonciello <[email protected]>Signed-off-by Mario Limonciello <[email protected]>Co-developed-by Evan Quan <[email protected]>Signed-off-by Evan Quan <[email protected]>
...
Quoted 1 line
drivers/acpi/amd_wbrf.c +0
-0
...
Quoted 17 lines
drivers/acpi/amd_wbrf.c +17
-0+static bool check_acpi_wbrf (acpi_handle handle,u64 rev,u64 funcs) +{ +int i; +u64 mask =0 ; +union acpi_object *obj; + +if (funcs ==0 ) +return false; + + obj =acpi_evaluate_wbrf (handle, rev,0 ); +if (!obj) +return false; + +if (obj->type !=ACPI_TYPE_BUFFER ) +return false; + +/*
drivers/acpi/amd_wbrf.c line 232
Quoted 10 lines
drivers/acpi/amd_wbrf.c +10
-0+* Bit vector providing supported functions information. +* Each bit marks support for one specific function of the WBRF method. +*/ +for (i =0 ; i < obj->buffer.length && i <8 ; i++) + mask |= (((u64 )obj->buffer.pointer[i]) << (i *8 )); + +ACPI_FREE (obj); + +if ((mask &BIT (WBRF_ENABLED )) && + (mask & funcs) == funcs)
Hi Evan,
a minor nit from my side: the indentation of the line above seems odd.
if ((mask & BIT(WBRF_ENABLED)) && (mask & funcs) == funcs)
Quoted 4 lines
drivers/acpi/amd_wbrf.c +4
-0+return true; + +return false; +}
...
RE: [PATCH V8 2/9] drivers core: add ACPI based WBRF mechanism introduced by AMD
[AMD Official Use Only - General]
Quoted 76 lines
-----Original Message-----
From: Simon Horman <[email protected]>
Sent: Friday, August 11, 2023 5:38 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Limonciello, Mario <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Lazar, Lijo <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; amd- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH V8 2/9] drivers core: add ACPI based WBRF mechanism introduced by AMDQuoted 16 lines · Evan Quan
AMD has introduced an ACPI based mechanism to support WBRF for some platforms with AMD dGPU + WLAN. This needs support from BIOS equipped with necessary AML implementations and dGPU firmwares.
For those systems without the ACPI mechanism and developing solutions, user can use/fall-back the generic WBRF solution for diagnosing potential interference issues.
And for the platform which does not equip with the necessary AMD ACPI implementations but with
CONFIG_WBRF_AMD_ACPIbuilt as 'y', it will fall back to generic WBRF solution if thewbrfis set as "on".Co-developed-by Mario Limonciello <[email protected]>Signed-off-by Mario Limonciello <[email protected]>Co-developed-by Evan Quan <[email protected]>Signed-off-by Evan Quan <[email protected]>...
Quoted 1 line
drivers/acpi/amd_wbrf.c +0
-0...
Quoted 9 lines
drivers/acpi/amd_wbrf.c +9
-0+static bool check_acpi_wbrf (acpi_handle handle,u64 rev,u64 funcs) +{ +int i; +u64 mask =0 ; +union acpi_object *obj; + +if (funcs ==0 ) +return false; +drivers/acpi/amd_wbrf.c
Quoted 10 lines
drivers/acpi/amd_wbrf.c +10
-0+ obj =acpi_evaluate_wbrf (handle, rev,0 ); +if (!obj) +return false; + +if (obj->type !=ACPI_TYPE_BUFFER ) +return false; + +/* +* Bit vector providing supported functions information. +* Each bit marks support for one specific function of the WBRF method.
drivers/acpi/amd_wbrf.c line 232
Quoted 8 lines
drivers/acpi/amd_wbrf.c +8
-0+*/ +for (i =0 ; i < obj->buffer.length && i <8 ; i++) + mask |= (((u64 )obj->buffer.pointer[i]) << (i *8 )); + +ACPI_FREE (obj); + +if ((mask &BIT (WBRF_ENABLED )) && + (mask & funcs) == funcs)Hi Evan,
Quoted 1 line
a minor nit from my side: the indentation of the line above seems odd.
Thanks. Will update this.
Evan
Quoted 10 lines
if ((mask & BIT(WBRF_ENABLED)) && (mask & funcs) == funcs)Quoted 4 lines
drivers/acpi/amd_wbrf.c +4
-0+return true; + +return false; +}...
RE: [PATCH V8 6/9] drm/amd/pm: setup the framework to support Wifi RFI mitigation feature
In reply to Simon Horman[AMD Official Use Only - General]
Quoted 39 lines
-----Original Message-----
From: Simon Horman <[email protected]>
Sent: Friday, August 11, 2023 5:35 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Limonciello, Mario <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Lazar, Lijo <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; amd- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH V8 6/9] drm/amd/pm: setup the framework to support Wifi RFI mitigation featureQuoted 7 lines · Evan Quan
With WBRF feature supported, as a driver responding to the frequencies, amdgpu driver is able to do shadow pstate switching to mitigate possible interference(between its (G-)DDR memory clocks and local radio module frequency bands used by Wifi 6/6e/7).
Signed-off-by Evan Quan <[email protected]>Reviewed-by Mario Limonciello <[email protected]>...
Quoted 6 lines
+/**
+ *smu_wbrf_event_handler- handle notify events
+ *
+ * @nb: notifier block
+ * @action: event type
+ * @data: event data
Quoted 5 lines
Hi Evan,
a minor nit from my side: although it is documented here,
smu_wbrf_event_handlerhas no @data parameter, while it does have an undocumented_argparameter.
Thanks for pointing this out. I will fix this.
Evan
Quoted 23 lines
Quoted 21 lines
+ *
+ * Calls relevant amdgpu function in response to wbrf event
+ * notification from kernel.
+ */drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +16
-0+static int smu_wbrf_event_handler (struct notifier_block *nb, +unsigned long action,void *_arg) +{ + struct smu_context *smu = container_of(nb, struct smu_context, + wbrf_notifier); + +switch (action) { +case WBRF_CHANGED : +smu_wbrf_handle_exclusion_ranges (smu); +break ; +default : +return NOTIFY_DONE ; + }; + +return NOTIFY_OK ; +}...
RE: [PATCH V8 1/9] drivers core: Add support for Wifi band RF mitigations
In reply to Randy Dunlap[AMD Official Use Only - General]
Quoted 32 lines
-----Original Message-----
From: Randy Dunlap <[email protected]>
Sent: Thursday, August 10, 2023 11:41 PM
To: Quan, Evan <[email protected]>; [email protected]; [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Limonciello, Mario <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Lazar, Lijo <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; amd- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH V8 1/9] drivers core: Add support for Wifi band RF mitigationsQuoted 9 lines · Evan Quan
Documentation/admin-guide/kernel-parameters.txt +0
-0@@ -7152,3 +7152,12 @@ xmon commands. off xmon is disabled.
Quoted 8 lines
Documentation/admin-guide/kernel-parameters.txt
Quoted 3 lines
Documentation/admin-guide/kernel-parameters.txt +3
-0+ wbrf= [KNL] + Format: { on | auto | off } + Controls if WBRF features should be enabled ordisabled
Documentation/admin-guide/kernel-parameters.txt line 7158
Quoted 1 line
Documentation/admin-guide/kernel-parameters.txt +1
-0+ forcely. Default is auto."forcely" is not a word. "forcedly" is a word, but it's not used very much AFAIK. I would probably write "Controls if WBRF features should be forced on or off."
Yeah, that sounds better. Will update this as suggested.
Evan
Quoted 10 lines
Documentation/admin-guide/kernel-parameters.txt
Quoted 4 lines
Documentation/admin-guide/kernel-parameters.txt +3
-0+ on Force enable the WBRF features. + auto Up to the system to do proper checks to + determine the WBRF features should beenabled
Documentation/admin-guide/kernel-parameters.txt line 7163
Quoted 2 lines
Documentation/admin-guide/kernel-parameters.txt +2
-0+ or not. + off Force disable the WBRF features.--
~Randy
RE: [PATCH V8 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing
In reply to Jeff Johnson[AMD Official Use Only - General]
Quoted 39 lines
-----Original Message-----
From: Jeff Johnson <[email protected]>
Sent: Thursday, August 10, 2023 10:06 PM
To: Quan, Evan <[email protected]>; [email protected]; [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Limonciello, Mario <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Lazar, Lijo <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; amd- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH V8 3/9] cfg80211: exposenl80211_chan_width_to_mhzfor wide sharingQuoted 14 lines · Evan Quan
The newly added WBRF feature needs this interface for channel width calculation.
Signed-off-by Evan Quan <[email protected]>--- include/net/cfg80211.h | 8 ++++++++ net/wireless/chan.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)include/net/cfg80211.h index renamed from include/net/cfg80211.h +0
-0
7c7d03aa9d06..f50508e295db100644include/net/cfg80211.h const struct cfg80211_chan_def * · line 920
Quoted 1 line
include/net/cfg80211.h +0
-0@@ -920,6 +920,14 @@ const struct cfg80211_chan_def * cfg80211_chandef_compatible(const struct cfg80211_chan_def*chandef1,
Quoted 2 lines
include/net/cfg80211.h +0
-0const struct cfg80211_chan_def *chandef2);
Quoted 8 lines
include/net/cfg80211.h const struct cfg80211_chan_def * · line 927
Quoted 6 lines
include/net/cfg80211.h +6
-0+/** +* nl80211_chan_width_to_mhz - get the channel width in Mhz +* @chan_width: the channel width from &enum nl80211_chan_width +* Return: channel width in Mhz if the chan_width from &enum +nl80211_chan_width +* is valid. -1 otherwise. SI nit: s/Mhz/MHz/ in both places
Thanks, will update them accordingly.
Evan
Quoted 33 lines
include/net/cfg80211.h const struct cfg80211_chan_def * · line 930
Quoted 3 lines
include/net/cfg80211.h +2
-0+*/ +int nl80211_chan_width_to_mhz(enum nl80211_chan_width
chan_width);net/wireless/chan.c static bool cfg80211_edmg_chandef_valid(const
Quoted 9 lines
include/net/cfg80211.h +1
-0+/** * cfg80211_chandef_valid - check if a channel definition is valid * @chandef: the channel definition to check diff --git
a/net/wireless/chan.cb/net/wireless/chan.cindex0b7e81db383d..227db04eac42100644net/wireless/chan.c +0
-0@@ -141,7 +141,7 @@ static bool cfg80211_edmg_chandef_valid(conststruct
cfg80211_chan_def*chandef)net/wireless/chan.c static int nl80211_chan_width_to_mhz(enum
Quoted 10 lines
net/wireless/chan.c +1
-1return true; } -static int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width) +int nl80211_chan_width_to_mhz (enum nl80211_chan_width chan_width) {int mhz;@@ -190,6 +190,7 @@ static int nl80211_chan_width_to_mhz(enum
nl80211_chan_widthchan_width)net/wireless/chan.c static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width)
Quoted 6 lines
net/wireless/chan.c +1
-0}return mhz; } +EXPORT_SYMBOL (nl80211_chan_width_to_mhz); static int cfg80211_chandef_get_width(const struct cfg80211_chan_def*c)
Quoted 1 line
net/wireless/chan.c +0
-0{