diff mbox

[v7,3/8] ath10k: save firmware debug log messages

Message ID 20140819082300.16842.40769.stgit@potku.adurom.net (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Kalle Valo Aug. 19, 2014, 8:23 a.m. UTC
From: Ben Greear <greearb@candelatech.com>

They may be dumped through the firmware dump debugfs
file.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c |   10 ++++++++++
 1 file changed, 10 insertions(+)


--
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

Comments

Michal Kazior Aug. 19, 2014, 9:39 a.m. UTC | #1
On 19 August 2014 10:23, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> They may be dumped through the firmware dump debugfs
> file.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath10k/wmi.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> index 23acbadeb8fa..eafc565240f1 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -1290,6 +1290,16 @@ static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
>
>         trace_ath10k_wmi_dbglog(skb->data, skb->len);
>
> +       spin_lock_bh(&ar->data_lock);
> +
> +       /* First 4 bytes are a messages-dropped-due-to-overflow counter,
> +        * and should not be recorded in the dbglog buffer, so we skip
> +        * them.
> +        */
> +       ath10k_debug_dbglog_add(ar, skb->data + 4, skb->len - 4);
> +
> +       spin_unlock_bh(&ar->data_lock);
> +
>         return 0;
>  }
>
>
> --
> 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
--
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
Michal Kazior Aug. 19, 2014, 9:44 a.m. UTC | #2
On 19 August 2014 11:39, Michal Kazior <michal.kazior@tieto.com> wrote:

I miss-clicked, sorry for the noise.


> On 19 August 2014 10:23, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> From: Ben Greear <greearb@candelatech.com>
>>
>> They may be dumped through the firmware dump debugfs
>> file.
>>
>> Signed-off-by: Ben Greear <greearb@candelatech.com>
>> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
>> ---
>>  drivers/net/wireless/ath/ath10k/wmi.c |   10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
>> index 23acbadeb8fa..eafc565240f1 100644
>> --- a/drivers/net/wireless/ath/ath10k/wmi.c
>> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
>> @@ -1290,6 +1290,16 @@ static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
>>
>>         trace_ath10k_wmi_dbglog(skb->data, skb->len);
>>
>> +       spin_lock_bh(&ar->data_lock);
>> +
>> +       /* First 4 bytes are a messages-dropped-due-to-overflow counter,
>> +        * and should not be recorded in the dbglog buffer, so we skip
>> +        * them.
>> +        */
>> +       ath10k_debug_dbglog_add(ar, skb->data + 4, skb->len - 4);

Can't we just:

struct wmi_dbg_msg {
  __le32 num_dropped_due_to_overflow;
  u8 payload[0]; // is this an array of u8 or __le32 actually?
};


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 Aug. 19, 2014, 3:16 p.m. UTC | #3
>>> +       spin_lock_bh(&ar->data_lock);
>>> +
>>> +       /* First 4 bytes are a messages-dropped-due-to-overflow counter,
>>> +        * and should not be recorded in the dbglog buffer, so we skip
>>> +        * them.
>>> +        */
>>> +       ath10k_debug_dbglog_add(ar, skb->data + 4, skb->len - 4);
>
> Can't we just:
>
> struct wmi_dbg_msg {
>    __le32 num_dropped_due_to_overflow;
>    u8 payload[0]; // is this an array of u8 or __le32 actually?
> };

When I wrote this, I was more paranoid about exposing
any possible details of firmware.  It is an array of 32-bit ints in firmware,
and it decodes as ints instead of bytes, so probably u32 payload instead of u8.

Thanks,
Ben
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 23acbadeb8fa..eafc565240f1 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1290,6 +1290,16 @@  static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
 
 	trace_ath10k_wmi_dbglog(skb->data, skb->len);
 
+	spin_lock_bh(&ar->data_lock);
+
+	/* First 4 bytes are a messages-dropped-due-to-overflow counter,
+	 * and should not be recorded in the dbglog buffer, so we skip
+	 * them.
+	 */
+	ath10k_debug_dbglog_add(ar, skb->data + 4, skb->len - 4);
+
+	spin_unlock_bh(&ar->data_lock);
+
 	return 0;
 }