Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Justin He <Justin.He@arm.com>
Cc: Prabhakar Kushwaha <prabhakar.pkin@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Ariel Elior <aelior@marvell.com>,
	"GR-everest-linux-l2@marvell.com"
	<GR-everest-linux-l2@marvell.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	nd <nd@arm.com>, Shai Malin <malin1024@gmail.com>,
	Shai Malin <smalin@marvell.com>,
	Prabhakar Kushwaha <pkushwaha@marvell.com>
Subject: Re: [PATCH] qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()
Date: Tue, 20 Jul 2021 11:05:56 +0200	[thread overview]
Message-ID: <20210720110556.24cf7f8e@cakuba> (raw)
In-Reply-To: <AM6PR08MB4376CD003BF58F85E0121F39F7E29@AM6PR08MB4376.eurprd08.prod.outlook.com>

On Tue, 20 Jul 2021 02:02:26 +0000, Justin He wrote:
> > > For instance:
> > > _qed_mcp_cmd_and_union()
> > >   In while loop
> > >     spin_lock_bh()
> > >     qed_mcp_has_pending_cmd() (assume false), will break the loop  
> > 
> > I agree till here.
> >   
> > >   if (cnt >= max_retries) {
> > > ...
> > >     return -EAGAIN; <-- here returns -EAGAIN without invoking bh unlock
> > >   }
> > >  
> > 
> > Because of break, cnt has not been increased.
> >    - cnt is still less than max_retries.
> >   - if (cnt >= max_retries) will not be *true*, leading to spin_unlock_bh().
> > Hence pairing completed.  
> 
> Sorry, indeed. Let me check other possibilities.
> @David S. Miller Sorry for the inconvenience, could you please revert it
> in netdev tree?

Please submit a revert patch with the conclusions from the discussion
included in the commit message.

  reply	other threads:[~2021-07-20  9:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  8:08 Jia He
2021-07-15 19:50 ` patchwork-bot+netdevbpf
2021-07-15 23:42   ` Justin He
2021-07-19 10:35 ` Prabhakar Kushwaha
2021-07-19 13:16   ` Justin He
2021-07-19 14:50     ` Prabhakar Kushwaha
2021-07-20  2:02       ` Justin He
2021-07-20  9:05         ` Jakub Kicinski [this message]
2021-07-20  9:28           ` Justin He

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=20210720110556.24cf7f8e@cakuba \
    --to=kuba@kernel.org \
    --cc=GR-everest-linux-l2@marvell.com \
    --cc=Justin.He@arm.com \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malin1024@gmail.com \
    --cc=nd@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pkushwaha@marvell.com \
    --cc=prabhakar.pkin@gmail.com \
    --cc=smalin@marvell.com \
    --subject='Re: [PATCH] qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()' \
    /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

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).