All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>,
	<ath11k@lists.infradead.org>,  <linux-wireless@vger.kernel.org>,
	Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
Subject: Re: [PATCHv5] wifi: ath11k: skip status ring entry processing
Date: Tue, 30 Apr 2024 16:48:50 +0300	[thread overview]
Message-ID: <87cyq7ota5.fsf@kernel.org> (raw)
In-Reply-To: <35f114c4-1ff7-4a4b-aadf-ed147f19e170@quicinc.com> (Jeff Johnson's message of "Mon, 29 Apr 2024 11:12:49 -0700")

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 4/29/2024 12:36 AM, Tamizh Chelvam Raja wrote:
>
>> From: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
>> 
>> If STATUS_BUFFER_DONE is not set for a monitor status ring entry,
>> we don't process the status ring until STATUS_BUFFER_DONE set
>> for that status ring entry.
>> 
>> During LMAC reset it may happen that hardware will not write
>> STATUS_BUFFER_DONE tlv in status buffer, in that case we end up
>> waiting for STATUS_BUFFER_DONE leading to backpressure on monitor
>> status ring.
>> 
>> To fix the issue, when HP(Head Pointer) + 1 entry is peeked and if DMA
>> is not done and if HP + 2 entry's DMA done is set,
>> replenish HP + 1 entry and start processing in next interrupt.
>> If HP + 2 entry's DMA done is not set, poll onto HP + 1 entry DMA
>> done to be set.
>> 
>> Also, during monitor attach HP points to the end of the ring and
>> TP(Tail Pointer) points to the start of the ring.
>> Using ath11k_hal_srng_src_peek() may result in processing invalid buffer
>> for the very first interrupt. Since, HW starts writing buffer from TP.
>> 
>> To avoid this issue call ath11k_hal_srng_src_next_peek() instead of
>> calling ath11k_hal_srng_src_peek().
>> 
>> Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
>> 
>> Signed-off-by: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
>> Co-developed-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
>> Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
>
> however note...
>
>> +
>> +				/* If done status is missing:
>> +				 * 1. As per MAC team's suggestion,
>> +				 *    when HP + 1 entry is peeked and if DMA
>> +				 *    is not done and if HP + 2 entry's DMA done
>> +				 *    is set. skip HP + 1 entry and
>> +				 *    start processing in next interrupt.
>> +				 * 2. If HP + 2 entry's DMA done is not set,
>> +				 *    poll onto HP + 1 entry DMA done to be set.
>> +				 *    Check status for same buffer for next time
>> +				 *    dp_rx_mon_status_srng_process
>> +				 */
>> +
>> + reap_status = ath11k_dp_rx_mon_handle_status_buf_done(ab, srng,
>> + rx_ring);
>
> ath11k-check reports:
>
> drivers/net/wireless/ath/ath11k/dp_rx.c:3116: line length of 95 exceeds 90 columns
> drivers/net/wireless/ath/ath11k/dp_rx.c:3117: line length of 95 exceeds 90 columns

Tamizh, please ALWAYS run ath11k-check. We are wasting time for trivial
stuff like this.

> Kalle, in this case we may want to make an exception since I don't think there
> is a clean way to fix this other than refactoring.

The new function name looked quite long so I shortened it to
ath11k_dp_rx_mon_buf_done() and the warning is now gone. Does that look
reasonable name?

Also I removed one unrelated change and removed unnecessary else. Please
check my changes:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=6e88d559268779107715008c51e006f7a5f62045

But now I noticed that the warning message needs some work:

ath11k_warn(ab, "mon status DONE not set %lx, buf_id %d\n",
	    FIELD_GET(HAL_TLV_HDR_TAG, tlv->tl),
	    buf_id);

Please use understandable warning and error messages in plain english.
Any suggestions? I can edit the commit in the pending branch.

> FWIW I'd like to see this function refactored to avoid the excessive
> indentation, but that should be a separate exercise.

Indeed, the indentation in this function is getting close to the limit.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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


  reply	other threads:[~2024-04-30 13:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  7:36 [PATCHv5] wifi: ath11k: skip status ring entry processing Tamizh Chelvam Raja
2024-04-29 18:12 ` Jeff Johnson
2024-04-30 13:48   ` Kalle Valo [this message]
2024-04-30 14:44     ` Tamizh Chelvam Raja
2024-04-30 15:14     ` Jeff Johnson
2024-05-03 13:11       ` Kalle Valo
2024-05-03 14:55         ` Jeff Johnson
2024-05-07 10:00 ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cyq7ota5.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath11k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_jjohnson@quicinc.com \
    --cc=quic_tamizhr@quicinc.com \
    --cc=quic_vnaralas@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.