[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230428102651.01215795@hermes.local>
Date: Fri, 28 Apr 2023 10:26:51 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Manish Chopra <manishc@...vell.com>
Cc: <kuba@...nel.org>, <netdev@...r.kernel.org>, <aelior@...vell.com>,
<palok@...vell.com>, Sudarsana Kalluru <skalluru@...vell.com>,
"David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH v3 net] qed/qede: Fix scheduling while atomic
On Fri, 28 Apr 2023 09:13:37 -0700
Manish Chopra <manishc@...vell.com> wrote:
> - usleep_range(1000, 2000);
> +
> + if (is_atomic)
> + udelay(QED_BAR_ACQUIRE_TIMEOUT_UDELAY);
> + else
> + usleep_range(QED_BAR_ACQUIRE_TIMEOUT_USLEEP,
> + QED_BAR_ACQUIRE_TIMEOUT_USLEEP * 2);
> }
This is a variant of the conditional locking which is an ugly design pattern.
It makes static checking tools break and
a source of more bugs.
Better to fix the infrastructure or caller to not spin, or have two different
functions.
Powered by blists - more mailing lists