lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 06/17] net: ipa: Add timeout for ipa_cmd_pipeline_clear_wait
From
Date
On 9/19/21 10:08 PM, Sireesh Kodali wrote:
> From: Vladimir Lypak <vladimir.lypak@gmail.com>
>
> Sometimes the pipeline clear fails, and when it does, having a hang in
> kernel is ugly. The timeout gives us a nice error message. Note that
> this shouldn't actually hang, ever. It only hangs if there is a mistake
> in the config, and the timeout is only useful when debugging.
>
> Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>
> Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>

This is actually an item on my to-do list. All of the waits
for GSI completions should have timeouts. The only reason it
hasn't been implemented already is that I would like to be sure
all paths that could have a timeout actually have a reasonable
recovery.

I'd say an error message after a timeout is better than a hung
task panic, but if this does time out, I'm not sure the state
of the hardware is well-defined.

-Alex

> ---
> drivers/net/ipa/ipa_cmd.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c
> index 3db9e94e484f..0bdbc331fa78 100644
> --- a/drivers/net/ipa/ipa_cmd.c
> +++ b/drivers/net/ipa/ipa_cmd.c
> @@ -658,7 +658,10 @@ u32 ipa_cmd_pipeline_clear_count(void)
>
> void ipa_cmd_pipeline_clear_wait(struct ipa *ipa)
> {
> - wait_for_completion(&ipa->completion);
> + unsigned long timeout_jiffies = msecs_to_jiffies(1000);
> +
> + if (!wait_for_completion_timeout(&ipa->completion, timeout_jiffies))
> + dev_err(&ipa->pdev->dev, "%s time out\n", __func__);
> }
>
> void ipa_cmd_pipeline_clear(struct ipa *ipa)
>

\
 
 \ /
  Last update: 2021-10-14 00:30    [W:0.276 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site