From a7487c73e8af157db8b1f75d4f521dcc9a5a1380 Mon Sep 17 00:00:00 2001 From: Albert Cano Date: Wed, 8 Aug 2018 09:04:34 +0100 Subject: [PATCH] [9610] wlbt: Add kernel param. to dynamically enable/disable smapper We would like to have the option to dynamically enable/disable smapper on a running kernels to be able to profile the functionality. SMAPPER is initialized on WLAN init, therefore the enable/disable will only take effect when WLAN is turning on Change-Id: I11116087f22eb961e047e81beda19b7a328fe202 SCSC-Bug-Id: SSB-42641 Signed-off-by: Albert Cano --- drivers/net/wireless/scsc/hip4.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/scsc/hip4.c b/drivers/net/wireless/scsc/hip4.c index 2d166100556e..8ff2a46ba034 100755 --- a/drivers/net/wireless/scsc/hip4.c +++ b/drivers/net/wireless/scsc/hip4.c @@ -38,6 +38,13 @@ static int hip4_qos_med_tput_in_mbps = 150; module_param(hip4_qos_med_tput_in_mbps, int, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(hip4_qos_med_tput_in_mbps, "throughput (in Mbps) to apply Median PM QoS"); +#ifdef CONFIG_SCSC_SMAPPER +static bool hip4_smapper_enable = true; +module_param(hip4_smapper_enable, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(hip4_smapper_enable, "enable HIP4 SMAPPER. (default: Y)"); +static bool hip4_smapper_is_enabled; +#endif + static ktime_t intr_received; static ktime_t bh_init; static ktime_t bh_end; @@ -1632,7 +1639,10 @@ int hip4_init(struct slsi_hip4 *hip) #ifdef CONFIG_SCSC_SMAPPER /* Init SMAPPER */ - hip4_smapper_init(sdev, hip); + if (hip4_smapper_enable) { + hip4_smapper_init(sdev, hip); + hip4_smapper_is_enabled = true; + } #endif /* setup for PM QoS */ @@ -1931,7 +1941,10 @@ void hip4_deinit(struct slsi_hip4 *hip) #ifdef CONFIG_SCSC_SMAPPER /* Init SMAPPER */ - hip4_smapper_deinit(sdev, hip); + if (hip4_smapper_is_enabled) { + hip4_smapper_is_enabled = false; + hip4_smapper_deinit(sdev, hip); + } #endif wake_lock_destroy(&hip->hip_priv->hip4_wake_lock); -- 2.20.1