diff mbox series

[1/8] wil6210: dump Rx status message on errors

Message ID 20191218135947.5903-2-merez@codeaurora.org (mailing list archive)
State Accepted
Commit 7be3c2331d506a61da78cfe426a037a3c7de7c71
Delegated to: Kalle Valo
Headers show
Series wil6210 patches | expand

Commit Message

Maya Erez Dec. 18, 2019, 1:59 p.m. UTC
From: Ahmad Masri <amasri@codeaurora.org>

Dump all the Rx status message on different errors to allow more
visibility of the case.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
 drivers/net/wireless/ath/wil6210/txrx_edma.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Kalle Valo Dec. 18, 2019, 2:07 p.m. UTC | #1
Maya Erez <merez@codeaurora.org> writes:

> From: Ahmad Masri <amasri@codeaurora.org>
>
> Dump all the Rx status message on different errors to allow more
> visibility of the case.
>
> Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
> Signed-off-by: Maya Erez <merez@codeaurora.org>
> ---
>  drivers/net/wireless/ath/wil6210/txrx_edma.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c
> index 02548d40253c..6a1671c3a2be 100644
> --- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
> +++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
> @@ -903,6 +903,11 @@ static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
>  	if (unlikely(!wil_val_in_range(buff_id, 1, wil->rx_buff_mgmt.size))) {
>  		wil_err(wil, "Corrupt buff_id=%d, sring->swhead=%d\n",
>  			buff_id, sring->swhead);
> +		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
> +			       (void *)msg, wil->use_compressed_rx_status ?

Isn't the cast unnecessary? Please avoid casting as much as possible.

> @@ -963,6 +968,11 @@ static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
>  
>  	if (unlikely(dmalen > sz)) {
>  		wil_err(wil, "Rx size too large: %d bytes!\n", dmalen);
> +		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
> +			       (void *)msg, wil->use_compressed_rx_status ?

Same here.
Kalle Valo Dec. 18, 2019, 2:31 p.m. UTC | #2
Kalle Valo <kvalo@codeaurora.org> writes:

> Maya Erez <merez@codeaurora.org> writes:
>
>> From: Ahmad Masri <amasri@codeaurora.org>
>>
>> Dump all the Rx status message on different errors to allow more
>> visibility of the case.
>>
>> Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
>> Signed-off-by: Maya Erez <merez@codeaurora.org>
>> ---
>>  drivers/net/wireless/ath/wil6210/txrx_edma.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c
>> index 02548d40253c..6a1671c3a2be 100644
>> --- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
>> +++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
>> @@ -903,6 +903,11 @@ static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
>>  	if (unlikely(!wil_val_in_range(buff_id, 1, wil->rx_buff_mgmt.size))) {
>>  		wil_err(wil, "Corrupt buff_id=%d, sring->swhead=%d\n",
>>  			buff_id, sring->swhead);
>> +		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
>> +			       (void *)msg, wil->use_compressed_rx_status ?
>
> Isn't the cast unnecessary? Please avoid casting as much as possible.
>
>> @@ -963,6 +968,11 @@ static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
>>  
>>  	if (unlikely(dmalen > sz)) {
>>  		wil_err(wil, "Rx size too large: %d bytes!\n", dmalen);
>> +		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
>> +			       (void *)msg, wil->use_compressed_rx_status ?
>
> Same here.

I fixed these in the pending branch, please double check:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=51d652cdee36051bdb83809adb91951f41c7a456
Maya Erez Dec. 18, 2019, 3 p.m. UTC | #3
On 2019-12-18 16:31, Kalle Valo wrote:
> Kalle Valo <kvalo@codeaurora.org> writes:
> 
>> Maya Erez <merez@codeaurora.org> writes:
>> 
>>> From: Ahmad Masri <amasri@codeaurora.org>
>>> 
>>> Dump all the Rx status message on different errors to allow more
>>> visibility of the case.
>>> 
>>> Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
>>> Signed-off-by: Maya Erez <merez@codeaurora.org>
>>> ---
>>>  drivers/net/wireless/ath/wil6210/txrx_edma.c | 10 ++++++++++
>>>  1 file changed, 10 insertions(+)
>>> 
>>> diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c 
>>> b/drivers/net/wireless/ath/wil6210/txrx_edma.c
>>> index 02548d40253c..6a1671c3a2be 100644
>>> --- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
>>> +++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
>>> @@ -903,6 +903,11 @@ static struct sk_buff 
>>> *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
>>>  	if (unlikely(!wil_val_in_range(buff_id, 1, 
>>> wil->rx_buff_mgmt.size))) {
>>>  		wil_err(wil, "Corrupt buff_id=%d, sring->swhead=%d\n",
>>>  			buff_id, sring->swhead);
>>> +		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
>>> +			       (void *)msg, wil->use_compressed_rx_status ?
>> 
>> Isn't the cast unnecessary? Please avoid casting as much as possible.
>> 
>>> @@ -963,6 +968,11 @@ static struct sk_buff 
>>> *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
>>> 
>>>  	if (unlikely(dmalen > sz)) {
>>>  		wil_err(wil, "Rx size too large: %d bytes!\n", dmalen);
>>> +		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
>>> +			       (void *)msg, wil->use_compressed_rx_status ?
>> 
>> Same here.
> 
> I fixed these in the pending branch, please double check:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=51d652cdee36051bdb83809adb91951f41c7a456

Thanks for fixing it. The fix looks good.
Kalle Valo Dec. 19, 2019, 4:17 p.m. UTC | #4
Maya Erez <merez@codeaurora.org> wrote:

> Dump all the Rx status message on different errors to allow more
> visibility of the case.
> 
> Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
> Signed-off-by: Maya Erez <merez@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

8 patches applied to ath-next branch of ath.git, thanks.

7be3c2331d50 wil6210: dump Rx status message on errors
d3214d428066 wil6210: minimize the time that mem_lock is held
c715b38473c8 wil6210: take mem_lock for writing in crash dump collection
5c5d88a29dd4 wil6210: add verification for cid upper bound
c99d5f8d6178 wil6210: reduce ucode_debug memory region
18beb61d848d wil6210: fix MID valid bits in Rx status message
5e5f069c30cc wil6210: support set_multicast_to_unicast cfg80211 operation
4315a74a482f wil6210: add support for set_cqm_rssi_config
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c
index 02548d40253c..6a1671c3a2be 100644
--- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
+++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
@@ -903,6 +903,11 @@  static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
 	if (unlikely(!wil_val_in_range(buff_id, 1, wil->rx_buff_mgmt.size))) {
 		wil_err(wil, "Corrupt buff_id=%d, sring->swhead=%d\n",
 			buff_id, sring->swhead);
+		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
+			       (void *)msg, wil->use_compressed_rx_status ?
+			       sizeof(struct wil_rx_status_compressed) :
+			       sizeof(struct wil_rx_status_extended), false);
+
 		wil_rx_status_reset_buff_id(sring);
 		wil_sring_advance_swhead(sring);
 		sring->invalid_buff_id_cnt++;
@@ -963,6 +968,11 @@  static struct sk_buff *wil_sring_reap_rx_edma(struct wil6210_priv *wil,
 
 	if (unlikely(dmalen > sz)) {
 		wil_err(wil, "Rx size too large: %d bytes!\n", dmalen);
+		print_hex_dump(KERN_ERR, "RxS ", DUMP_PREFIX_OFFSET, 16, 1,
+			       (void *)msg, wil->use_compressed_rx_status ?
+			       sizeof(struct wil_rx_status_compressed) :
+			       sizeof(struct wil_rx_status_extended), false);
+
 		stats->rx_large_frame++;
 		rxdata->skipping = true;
 	}