From: Stephen Hemminger <stephen@networkplumber.org>
To: Manish Chopra <manishc@marvell.com>
Cc: <kuba@kernel.org>, <netdev@vger.kernel.org>, <aelior@marvell.com>,
<palok@marvell.com>, Sudarsana Kalluru <skalluru@marvell.com>,
"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH v3 net] qed/qede: Fix scheduling while atomic
Date: Fri, 28 Apr 2023 10:26:51 -0700 [thread overview]
Message-ID: <20230428102651.01215795@hermes.local> (raw)
In-Reply-To: <20230428161337.8485-1-manishc@marvell.com>
On Fri, 28 Apr 2023 09:13:37 -0700
Manish Chopra <manishc@marvell.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.
next prev parent reply other threads:[~2023-04-28 17:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 16:13 [PATCH v3 net] qed/qede: Fix scheduling while atomic Manish Chopra
2023-04-28 17:26 ` Stephen Hemminger [this message]
2023-05-03 3:03 ` Jakub Kicinski
2023-05-17 20:10 ` [EXT] " Manish Chopra
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=20230428102651.01215795@hermes.local \
--to=stephen@networkplumber.org \
--cc=aelior@marvell.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=palok@marvell.com \
--cc=skalluru@marvell.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 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).