linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* On status handling in ath10k_htt_rx_tx_compl_ind()
@ 2023-09-14  5:15 Dmitry Antipov
  2023-09-14 15:38 ` Jeff Johnson
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Antipov @ 2023-09-14  5:15 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: Kalle Valo, ath10k, linux-wireless

In 'ath10k_htt_rx_tx_compl_ind()',

int status = MS(resp->data_tx_completion.flags, HTT_DATA_TX_STATUS);

actually is

int status = (((resp->data_tx_completion.flags) & 0x07) >> 0);

which can't be equal to HTT_DATA_TX_STATUS_DOWNLOAD_FAIL (128)
regardless of the 'data_tx_completion.flags' value. This is most
likely a weird (but I have no clue how serious it may be) bug.

Dmitry

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: On status handling in ath10k_htt_rx_tx_compl_ind()
  2023-09-14  5:15 On status handling in ath10k_htt_rx_tx_compl_ind() Dmitry Antipov
@ 2023-09-14 15:38 ` Jeff Johnson
  2023-09-14 16:07   ` [PATCH] wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL Dmitry Antipov
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Johnson @ 2023-09-14 15:38 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: Kalle Valo, ath10k, linux-wireless

On 9/13/2023 10:15 PM, Dmitry Antipov wrote:
> In 'ath10k_htt_rx_tx_compl_ind()',
> 
> int status = MS(resp->data_tx_completion.flags, HTT_DATA_TX_STATUS);
> 
> actually is
> 
> int status = (((resp->data_tx_completion.flags) & 0x07) >> 0);
> 
> which can't be equal to HTT_DATA_TX_STATUS_DOWNLOAD_FAIL (128)
> regardless of the 'data_tx_completion.flags' value. This is most
> likely a weird (but I have no clue how serious it may be) bug.
> 
> Dmitry

Looking at firmware code I don't see any reference to a "download fail" 
status so I don't think firmware would ever send such a status.

If you want to submit a patch, the correct fix is to remove all 
references to HTT_DATA_TX_STATUS_DOWNLOAD_FAIL.

/jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL
  2023-09-14 15:38 ` Jeff Johnson
@ 2023-09-14 16:07   ` Dmitry Antipov
  2023-09-14 16:21     ` Jeff Johnson
  2023-09-21  8:11     ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Antipov @ 2023-09-14 16:07 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Kalle Valo, linux-wireless, lvc-project, ath10k, Dmitry Antipov

According to Jeff, 'HTT_DATA_TX_STATUS_DOWNLOAD_FAIL' from
'enum htt_data_tx_status' is never actually used by the
firmware code and so may be dropped, with the related
adjustment to 'ath10k_htt_rx_tx_compl_ind()'.

Suggested-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>

Found by Linux Verification Center (linuxtesting.org) with SVACE.
---
 drivers/net/wireless/ath/ath10k/htt.h    | 3 +--
 drivers/net/wireless/ath/ath10k/htt_rx.c | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 7b24297146e7..c80470e8886a 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -880,8 +880,7 @@ enum htt_data_tx_status {
 	HTT_DATA_TX_STATUS_OK            = 0,
 	HTT_DATA_TX_STATUS_DISCARD       = 1,
 	HTT_DATA_TX_STATUS_NO_ACK        = 2,
-	HTT_DATA_TX_STATUS_POSTPONE      = 3, /* HL only */
-	HTT_DATA_TX_STATUS_DOWNLOAD_FAIL = 128
+	HTT_DATA_TX_STATUS_POSTPONE      = 3 /* HL only */
 };
 
 enum htt_data_tx_flags {
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 438b0caaceb7..b261d6371c0f 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2964,7 +2964,6 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
 		break;
 	case HTT_DATA_TX_STATUS_DISCARD:
 	case HTT_DATA_TX_STATUS_POSTPONE:
-	case HTT_DATA_TX_STATUS_DOWNLOAD_FAIL:
 		tx_done.status = HTT_TX_COMPL_STATE_DISCARD;
 		break;
 	default:
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL
  2023-09-14 16:07   ` [PATCH] wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL Dmitry Antipov
@ 2023-09-14 16:21     ` Jeff Johnson
  2023-09-21  8:11     ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Johnson @ 2023-09-14 16:21 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: Kalle Valo, linux-wireless, lvc-project, ath10k

On 9/14/2023 9:07 AM, Dmitry Antipov wrote:
> According to Jeff, 'HTT_DATA_TX_STATUS_DOWNLOAD_FAIL' from
> 'enum htt_data_tx_status' is never actually used by the
> firmware code and so may be dropped, with the related
> adjustment to 'ath10k_htt_rx_tx_compl_ind()'.
> 
> Suggested-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>

Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>

> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> ---
>   drivers/net/wireless/ath/ath10k/htt.h    | 3 +--
>   drivers/net/wireless/ath/ath10k/htt_rx.c | 1 -
>   2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
> index 7b24297146e7..c80470e8886a 100644
> --- a/drivers/net/wireless/ath/ath10k/htt.h
> +++ b/drivers/net/wireless/ath/ath10k/htt.h
> @@ -880,8 +880,7 @@ enum htt_data_tx_status {
>   	HTT_DATA_TX_STATUS_OK            = 0,
>   	HTT_DATA_TX_STATUS_DISCARD       = 1,
>   	HTT_DATA_TX_STATUS_NO_ACK        = 2,
> -	HTT_DATA_TX_STATUS_POSTPONE      = 3, /* HL only */
> -	HTT_DATA_TX_STATUS_DOWNLOAD_FAIL = 128
> +	HTT_DATA_TX_STATUS_POSTPONE      = 3 /* HL only */
>   };
>   
>   enum htt_data_tx_flags {
> diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
> index 438b0caaceb7..b261d6371c0f 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
> @@ -2964,7 +2964,6 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
>   		break;
>   	case HTT_DATA_TX_STATUS_DISCARD:
>   	case HTT_DATA_TX_STATUS_POSTPONE:
> -	case HTT_DATA_TX_STATUS_DOWNLOAD_FAIL:
>   		tx_done.status = HTT_TX_COMPL_STATE_DISCARD;
>   		break;
>   	default:


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL
  2023-09-14 16:07   ` [PATCH] wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL Dmitry Antipov
  2023-09-14 16:21     ` Jeff Johnson
@ 2023-09-21  8:11     ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2023-09-21  8:11 UTC (permalink / raw)
  To: Dmitry Antipov
  Cc: Jeff Johnson, linux-wireless, lvc-project, ath10k, Dmitry Antipov

Dmitry Antipov <dmantipov@yandex.ru> wrote:

> According to Jeff, 'HTT_DATA_TX_STATUS_DOWNLOAD_FAIL' from
> 'enum htt_data_tx_status' is never actually used by the
> firmware code and so may be dropped, with the related
> adjustment to 'ath10k_htt_rx_tx_compl_ind()'.
> 
> Suggested-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

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

30e7099a6dc9 wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230914160744.155903-1-dmantipov@yandex.ru/

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-21 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14  5:15 On status handling in ath10k_htt_rx_tx_compl_ind() Dmitry Antipov
2023-09-14 15:38 ` Jeff Johnson
2023-09-14 16:07   ` [PATCH] wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL Dmitry Antipov
2023-09-14 16:21     ` Jeff Johnson
2023-09-21  8:11     ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).