All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: David Miller <davem@davemloft.net>
Cc: f.fainelli@gmail.com, Netdev <netdev@vger.kernel.org>,
	Jeffrey Huang <huangjw@broadcom.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] bnxt_en: Fix potential race condition in bnxt_tx_enable()
Date: Mon, 18 Jul 2016 04:34:37 -0700	[thread overview]
Message-ID: <CACKFLikGpJ8d7jiVFz=KoqNtOpct7owi1=_9FkAR4pS8otAj2g@mail.gmail.com> (raw)
In-Reply-To: <20160715.232048.1780795244111833927.davem@davemloft.net>

On Fri, Jul 15, 2016 at 11:20 PM, David Miller <davem@davemloft.net> wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> Date: Fri, 15 Jul 2016 16:42:01 -0700
>
>> @@ -4599,7 +4599,9 @@ static void bnxt_tx_enable(struct bnxt *bp)
>>       for (i = 0; i < bp->tx_nr_rings; i++) {
>>               txr = &bp->tx_ring[i];
>>               txq = netdev_get_tx_queue(bp->dev, i);
>> +             __netif_tx_lock(txq, smp_processor_id());
>>               txr->dev_state = 0;
>> +             __netif_tx_unlock(txq);
>
> You're going to have to explain how this could possibly cause a
> problem, because I'm pretty sure it can't.
>
> Either the reader sees 0, or non-zero, in this value.
>
> And adding locking around this assignment does not change that at all.

Florian, I agree with David.  The lock is not needed.  The lock in
bnxt_tx_disable() is also unnecessary and should be removed.  Thanks.

  reply	other threads:[~2016-07-18 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-15 23:42 [PATCH net] bnxt_en: Fix potential race condition in bnxt_tx_enable() Florian Fainelli
2016-07-16  6:20 ` David Miller
2016-07-18 11:34   ` Michael Chan [this message]
2016-07-18 20:02 ` [PATCH net] bnxt_en: Remove locking around txr->dev_state Florian Fainelli
2016-07-18 20:06   ` Michael Chan
2016-07-20  2:22   ` David Miller

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='CACKFLikGpJ8d7jiVFz=KoqNtOpct7owi1=_9FkAR4pS8otAj2g@mail.gmail.com' \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=huangjw@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.