2018-02-27 14:05:42

by Ramon Fried

[permalink] [raw]
Subject: [PATCH v3] wcn36xx: reduce verbosity of drivers messages

Whenever the WLAN interface is started the FW
version and caps are printed.
The caps now will be displayed only in debug mode.
Firmware version will be displayed only once on first
startup of the interface.

Change-Id: I4db6ea7f384fe15eebe4c3ddb1d1ccab00094332
Signed-off-by: Ramon Fried <[email protected]>
---
v2: print the firwmare version as info but only
onetime.
v3: change the static variable to a struct variable.

drivers/net/wireless/ath/wcn36xx/main.c | 3 ++-
drivers/net/wireless/ath/wcn36xx/smd.c | 18 ++++++++++--------
drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 ++
3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index ab5be6d2c691..bfe9062bfa52 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -261,7 +261,7 @@ static void wcn36xx_feat_caps_info(struct wcn36xx *wcn)

for (i = 0; i < MAX_FEATURE_SUPPORTED; i++) {
if (get_feat_caps(wcn->fw_feat_caps, i))
- wcn36xx_info("FW Cap %s\n", wcn36xx_get_cap_name(i));
+ wcn36xx_dbg(WCN36XX_DBG_MAC, "FW Cap %s\n", wcn36xx_get_cap_name(i));
}
}

@@ -1283,6 +1283,7 @@ static int wcn36xx_probe(struct platform_device *pdev)
wcn = hw->priv;
wcn->hw = hw;
wcn->dev = &pdev->dev;
+ wcn->first_boot = true;
mutex_init(&wcn->conf_mutex);
mutex_init(&wcn->hal_mutex);
mutex_init(&wcn->scan_lock);
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 2a4871ca9c72..1a5b4d57c0ac 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -409,15 +409,17 @@ static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len)
wcn->fw_minor = rsp->start_rsp_params.version.minor;
wcn->fw_major = rsp->start_rsp_params.version.major;

- wcn36xx_info("firmware WLAN version '%s' and CRM version '%s'\n",
- wcn->wlan_version, wcn->crm_version);
-
- wcn36xx_info("firmware API %u.%u.%u.%u, %u stations, %u bssids\n",
- wcn->fw_major, wcn->fw_minor,
- wcn->fw_version, wcn->fw_revision,
- rsp->start_rsp_params.stations,
- rsp->start_rsp_params.bssids);
+ if (wcn->first_boot) {
+ wcn->first_boot = false;
+ wcn36xx_info("firmware WLAN version '%s' and CRM version '%s'\n",
+ wcn->wlan_version, wcn->crm_version);

+ wcn36xx_info("firmware API %u.%u.%u.%u, %u stations, %u bssids\n",
+ wcn->fw_major, wcn->fw_minor,
+ wcn->fw_version, wcn->fw_revision,
+ rsp->start_rsp_params.stations,
+ rsp->start_rsp_params.bssids);
+ }
return 0;
}

diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index 81017e6703b4..5854adf43f3a 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -192,6 +192,8 @@ struct wcn36xx {
u8 crm_version[WCN36XX_HAL_VERSION_LENGTH + 1];
u8 wlan_version[WCN36XX_HAL_VERSION_LENGTH + 1];

+ bool first_boot;
+
/* IRQs */
int tx_irq;
int rx_irq;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


2018-03-26 15:11:52

by Kalle Valo

[permalink] [raw]
Subject: Re: [v3] wcn36xx: reduce verbosity of drivers messages

Ramon Fried <[email protected]> wrote:

> Whenever the WLAN interface is started the FW
> version and caps are printed.
> The caps now will be displayed only in debug mode.
> Firmware version will be displayed only once on first
> startup of the interface.
>
> Change-Id: I4db6ea7f384fe15eebe4c3ddb1d1ccab00094332
> Signed-off-by: Ramon Fried <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

6b8a127bf66d wcn36xx: reduce verbosity of drivers messages

--
https://patchwork.kernel.org/patch/10245303/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2018-03-26 15:05:10

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v3] wcn36xx: reduce verbosity of drivers messages

Ramon Fried <[email protected]> writes:

> Kind reminder. Is the patch ok ?

First of all, please don't top most as it makes using patchwork
annoying. I wish it would detect these top posts somehow.

And for checking the state of patch I have a written instructions to the
wiki:

https://wireless.wiki.kernel.org/doku.php?id=en/developers/documentation/submittingpatches#checking_state_of_patches_from_patchwork

And the actual answer: I'm lagging behind with ath.git patches but
should catch up soon.

--
Kalle Valo

2018-03-26 12:29:35

by Ramon Fried

[permalink] [raw]
Subject: Re: [PATCH v3] wcn36xx: reduce verbosity of drivers messages

Hi Kalle.

Kind reminder. Is the patch ok ?

Thanks,

Ramon


On 2/27/2018 4:05 PM, Ramon Fried wrote:
> Whenever the WLAN interface is started the FW
> version and caps are printed.
> The caps now will be displayed only in debug mode.
> Firmware version will be displayed only once on first
> startup of the interface.
>
> Change-Id: I4db6ea7f384fe15eebe4c3ddb1d1ccab00094332
> Signed-off-by: Ramon Fried <[email protected]>
> ---
> v2: print the firwmare version as info but only
> onetime.
> v3: change the static variable to a struct variable.
>
> drivers/net/wireless/ath/wcn36xx/main.c | 3 ++-
> drivers/net/wireless/ath/wcn36xx/smd.c | 18 ++++++++++--------
> drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 ++
> 3 files changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
> index ab5be6d2c691..bfe9062bfa52 100644
> --- a/drivers/net/wireless/ath/wcn36xx/main.c
> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
> @@ -261,7 +261,7 @@ static void wcn36xx_feat_caps_info(struct wcn36xx *wcn)
>
> for (i = 0; i < MAX_FEATURE_SUPPORTED; i++) {
> if (get_feat_caps(wcn->fw_feat_caps, i))
> - wcn36xx_info("FW Cap %s\n", wcn36xx_get_cap_name(i));
> + wcn36xx_dbg(WCN36XX_DBG_MAC, "FW Cap %s\n", wcn36xx_get_cap_name(i));
> }
> }
>
> @@ -1283,6 +1283,7 @@ static int wcn36xx_probe(struct platform_device *pdev)
> wcn = hw->priv;
> wcn->hw = hw;
> wcn->dev = &pdev->dev;
> + wcn->first_boot = true;
> mutex_init(&wcn->conf_mutex);
> mutex_init(&wcn->hal_mutex);
> mutex_init(&wcn->scan_lock);
> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> index 2a4871ca9c72..1a5b4d57c0ac 100644
> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
> @@ -409,15 +409,17 @@ static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len)
> wcn->fw_minor = rsp->start_rsp_params.version.minor;
> wcn->fw_major = rsp->start_rsp_params.version.major;
>
> - wcn36xx_info("firmware WLAN version '%s' and CRM version '%s'\n",
> - wcn->wlan_version, wcn->crm_version);
> -
> - wcn36xx_info("firmware API %u.%u.%u.%u, %u stations, %u bssids\n",
> - wcn->fw_major, wcn->fw_minor,
> - wcn->fw_version, wcn->fw_revision,
> - rsp->start_rsp_params.stations,
> - rsp->start_rsp_params.bssids);
> + if (wcn->first_boot) {
> + wcn->first_boot = false;
> + wcn36xx_info("firmware WLAN version '%s' and CRM version '%s'\n",
> + wcn->wlan_version, wcn->crm_version);
>
> + wcn36xx_info("firmware API %u.%u.%u.%u, %u stations, %u bssids\n",
> + wcn->fw_major, wcn->fw_minor,
> + wcn->fw_version, wcn->fw_revision,
> + rsp->start_rsp_params.stations,
> + rsp->start_rsp_params.bssids);
> + }
> return 0;
> }
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
> index 81017e6703b4..5854adf43f3a 100644
> --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
> +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
> @@ -192,6 +192,8 @@ struct wcn36xx {
> u8 crm_version[WCN36XX_HAL_VERSION_LENGTH + 1];
> u8 wlan_version[WCN36XX_HAL_VERSION_LENGTH + 1];
>
> + bool first_boot;
> +
> /* IRQs */
> int tx_irq;
> int rx_irq;