From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: Baochen Qiang <quic_bqiang@quicinc.com>,
Jeff Johnson <jjohnson@kernel.org>,
ath10k@lists.infradead.org, James Prestwood <prestwoj@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: athk10: Poll service ready completion by default to avoid warning `failed to receive service ready completion, polling..`?
Date: Tue, 29 Jul 2025 17:41:00 +0800 [thread overview]
Message-ID: <1b05e823-0698-4938-9ada-260214fc856b@oss.qualcomm.com> (raw)
In-Reply-To: <4e5a3a4d-9b6b-443b-b3c2-eac1b44e96e0@molgen.mpg.de>
On 7/28/2025 3:39 PM, Paul Menzel wrote:
>>>>> Additionally I have two questions regarding the code:
>>>>>
>>>>> 1. Is `WMI_SERVICE_READY_TIMEOUT_HZ` the right value to pass to
>>>>> `wait_for_completion_timeout(struct completion *done, unsigned long timeout)`?
>>>>>
>>>>> The macro is defined as:
>>>>>
>>>>> drivers/net/wireless/ath/ath10k/wmi.h:#define WMI_SERVICE_READY_TIMEOUT_HZ (5 *
>>>>> HZ)
>>>>>
>>>>> `timeout` is supposed to be in jiffies, and `CONFIG_HZ_250=y` on my system. I wonder how
>>>>> that amounts to five seconds on my system.
>>>>
>>>> HZ is defined as jiffies per second, so 5 * HZ equals 5 seconds.
>
> Sorry, I missed to comment here in my previous reply. HZ can be defined differently – like
Sorry for misleading - I was trying to say the HZ has a direct relationship with jiffies,
it equals jiffies-per-second in its value.
> 1000 HZ –, so the timeout would very, and then not match the actual timeout required by
> the hardware? `Documentation/scheduler/completion.rst` contains:
Not quite sure about what the 'timeout' actually mean here
- If you are referring it as the argument passed to wait_for_completion_timeout(): yes, of
course if could vary based on HZ value.
- But if you are talking about the actual max time wait_for_completion_timeout() will
block: the answer is NO.
>
>> Timeouts are preferably calculated with msecs_to_jiffies() or usecs_to_jiffies(),
>> to make the code largely HZ-invariant.
I am not quite understanding the 'HZ-invariant' here:
- Does it mean the actual max time blocked will vary if timeout argument is defined based
on HZ?
- Or it is saying the value of timeout argument itself could vary? But note the result of
msecs_to_jiffies() even varies on HZ as well.
prev parent reply other threads:[~2025-07-29 9:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <97a15967-5518-4731-a8ff-d43ff7f437b0@molgen.mpg.de>
[not found] ` <3cbe13e1-a820-4804-a28c-a57e2ee7a020@oss.qualcomm.com>
[not found] ` <8716a67c-6e33-4a35-8d96-33f81c07c8e0@molgen.mpg.de>
[not found] ` <1e797dea-d2e1-4947-8ef3-d2ac5ea0c156@oss.qualcomm.com>
2025-07-28 7:39 ` Paul Menzel
2025-07-28 8:50 ` Baochen Qiang
2025-07-28 12:48 ` Paul Menzel
2025-07-29 2:27 ` Baochen Qiang
2025-07-30 10:40 ` ath10k: ath10k_wmi_wait_for_service_ready() called twice during boot (was: athk10: Poll service ready completion by default to avoid warning `failed to receive service ready completion, polling..`?) Paul Menzel
2025-07-31 0:12 ` ath10k: ath10k_wmi_wait_for_service_ready() called twice during boot Baochen Qiang
2025-07-29 9:41 ` Baochen Qiang [this message]
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=1b05e823-0698-4938-9ada-260214fc856b@oss.qualcomm.com \
--to=baochen.qiang@oss.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pmenzel@molgen.mpg.de \
--cc=prestwoj@gmail.com \
--cc=quic_bqiang@quicinc.com \
--cc=vincent.guittot@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®