From 2e3ed3ae67a9deef3fc640068e92932e3d985aaf Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Sun, 19 Jun 2022 20:48:31 +0800 Subject: [PATCH] wireless/bcm43xxx: prefer HPWORK if bcmf task has higher priority than HPWORK Use high priority queue if the bcmf daemon task has a higher priority than HPWORK, which will bring better performance especially on devices that focus on real-time of network. Signed-off-by: chao.an --- drivers/wireless/ieee80211/bcm43xxx/Kconfig | 1 + drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/wireless/ieee80211/bcm43xxx/Kconfig b/drivers/wireless/ieee80211/bcm43xxx/Kconfig index a5a48d7be0..8ad71116bb 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/Kconfig +++ b/drivers/wireless/ieee80211/bcm43xxx/Kconfig @@ -120,6 +120,7 @@ config IEEE80211_BROADCOM_FULLMAC_SDIO config IEEE80211_BROADCOM_SCHED_PRIORITY int "Broadcom BCMF daemon thread schedule priority" + default SCHED_HPWORKPRIORITY if SCHED_HPWORK default 255 ---help--- This parameter should be set the bcmf daemon thread diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c index 825502514e..e0fa3031c3 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c @@ -68,13 +68,17 @@ /* The low priority work queue is preferred. If it is not enabled, LPWORK * will be the same as HPWORK. * - * NOTE: However, the network should NEVER run on the high priority work - * queue! That queue is intended only to service short back end interrupt - * processing that never suspends. Suspending the high priority work queue - * may bring the system to its knees! + * Use high priority queue if the bcmf daemon task has a higher priority + * than HPWORK, which will bring better performance especially on devices + * that focus on real-time of network. */ -#define BCMFWORK LPWORK +#if defined(CONFIG_SCHED_HPWORK) && \ + (CONFIG_IEEE80211_BROADCOM_SCHED_PRIORITY >= CONFIG_SCHED_HPWORKPRIORITY) +# define BCMFWORK HPWORK +#else +# define BCMFWORK LPWORK +#endif /* CONFIG_IEEE80211_BROADCOM_NINTERFACES determines the number of physical * interfaces that will be supported.