diff mbox

[03/21] ath10k: Support setting debug mask from driver code.

Message ID 1462835475-11079-4-git-send-email-greearb@candelatech.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Ben Greear May 9, 2016, 11:10 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

Might want to turn off verbose debug as soon as you
see a firmware crash, for instance.  Helps keep dmesg
output from over-running the stuff you care about.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 5 +++++
 drivers/net/wireless/ath/ath10k/debug.h | 1 +
 2 files changed, 6 insertions(+)

Comments

Michal Kazior May 11, 2016, 10:40 a.m. UTC | #1
On 10 May 2016 at 01:10,  <greearb@candelatech.com> wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> Might want to turn off verbose debug as soon as you
> see a firmware crash, for instance.  Helps keep dmesg
> output from over-running the stuff you care about.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>  drivers/net/wireless/ath/ath10k/debug.c | 5 +++++
>  drivers/net/wireless/ath/ath10k/debug.h | 1 +
>  2 files changed, 6 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
> index e251155..a689bf1 100644
> --- a/drivers/net/wireless/ath/ath10k/debug.c
> +++ b/drivers/net/wireless/ath/ath10k/debug.c
> @@ -194,6 +194,11 @@ void ath10k_print_driver_info(struct ath10k *ar)
>  }
>  EXPORT_SYMBOL(ath10k_print_driver_info);
>
> +void ath10k_set_debug_mask(unsigned int v) {

The { should be on new line.


> +       ath10k_debug_mask = v;
> +}
> +EXPORT_SYMBOL(ath10k_set_debug_mask);

I didn't see any uses of this in your patchset (it's commented out in
21/21) and I'm not fully convinced it's a good idea to override
debug_mask like that. Once I set a debug_mask I expect it to stay
unchanged. What if I do want to trace what happens after fw crash?

Wouldn't it be better to have a knob to tell ath10k whether hw
recovery should be automatic or manual?


Micha?
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ben Greear May 11, 2016, 3:10 p.m. UTC | #2
On 05/11/2016 03:40 AM, Michal Kazior wrote:
> On 10 May 2016 at 01:10,  <greearb@candelatech.com> wrote:
>> From: Ben Greear <greearb@candelatech.com>
>>
>> Might want to turn off verbose debug as soon as you
>> see a firmware crash, for instance.  Helps keep dmesg
>> output from over-running the stuff you care about.
>>
>> Signed-off-by: Ben Greear <greearb@candelatech.com>
>> ---
>>   drivers/net/wireless/ath/ath10k/debug.c | 5 +++++
>>   drivers/net/wireless/ath/ath10k/debug.h | 1 +
>>   2 files changed, 6 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
>> index e251155..a689bf1 100644
>> --- a/drivers/net/wireless/ath/ath10k/debug.c
>> +++ b/drivers/net/wireless/ath/ath10k/debug.c
>> @@ -194,6 +194,11 @@ void ath10k_print_driver_info(struct ath10k *ar)
>>   }
>>   EXPORT_SYMBOL(ath10k_print_driver_info);
>>
>> +void ath10k_set_debug_mask(unsigned int v) {
>
> The { should be on new line.
>
>
>> +       ath10k_debug_mask = v;
>> +}
>> +EXPORT_SYMBOL(ath10k_set_debug_mask);
>
> I didn't see any uses of this in your patchset (it's commented out in
> 21/21) and I'm not fully convinced it's a good idea to override
> debug_mask like that. Once I set a debug_mask I expect it to stay
> unchanged. What if I do want to trace what happens after fw crash?
>
> Wouldn't it be better to have a knob to tell ath10k whether hw
> recovery should be automatic or manual?

Hmm, I have a later patch that allows twiddling this through debugfs,
that is what I meant to add to this series.  I'll find that one and squash
it into this one.

Thanks,
Ben
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index e251155..a689bf1 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -194,6 +194,11 @@  void ath10k_print_driver_info(struct ath10k *ar)
 }
 EXPORT_SYMBOL(ath10k_print_driver_info);
 
+void ath10k_set_debug_mask(unsigned int v) {
+	ath10k_debug_mask = v;
+}
+EXPORT_SYMBOL(ath10k_set_debug_mask);
+
 void ath10k_err(struct ath10k *ar, const char *fmt, ...)
 {
 	struct va_format vaf = {
diff --git a/drivers/net/wireless/ath/ath10k/debug.h b/drivers/net/wireless/ath/ath10k/debug.h
index 75c89e3..a5c9aae 100644
--- a/drivers/net/wireless/ath/ath10k/debug.h
+++ b/drivers/net/wireless/ath/ath10k/debug.h
@@ -69,6 +69,7 @@  void ath10k_debug_print_hwfw_info(struct ath10k *ar);
 void ath10k_debug_print_board_info(struct ath10k *ar);
 void ath10k_debug_print_boot_info(struct ath10k *ar);
 void ath10k_print_driver_info(struct ath10k *ar);
+void ath10k_set_debug_mask(unsigned int v);
 
 #ifdef CONFIG_ATH10K_DEBUGFS
 int ath10k_debug_start(struct ath10k *ar);