netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: Vladimir Davydov <vdavydov@parallels.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
	e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, devel@openvz.org,
	Tushar Dave <tushar.n.dave@intel.com>,
	Patrick McHardy <kaber@trash.net>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 2/2] e1000: fix possible reset_task running after adapter down
Date: Fri, 22 Nov 2013 15:14:01 -0800	[thread overview]
Message-ID: <1385162041.2219.29.camel@jtkirshe-mobl> (raw)
In-Reply-To: <a0339f72560eeee5cad54c9363a5b5f196b83933.1385107870.git.vdavydov@parallels.com>

[-- Attachment #1: Type: text/plain, Size: 1208 bytes --]

On Fri, 2013-11-22 at 12:20 +0400, Vladimir Davydov wrote:
> On e1000_down(), we should ensure every asynchronous work is canceled
> before proceeding. Since the watchdog_task can schedule other works
> apart from itself, it should be stopped first, but currently it is
> stopped after the reset_task. This can result in the following race
> leading to the reset_task running after the module unload:
> 
> e1000_down_and_stop():                  e1000_watchdog():
> ----------------------                  -----------------
> 
> cancel_work_sync(reset_task)
>                                         schedule_work(reset_task)
> cancel_delayed_work_sync(watchdog_task)
> 
> The patch moves cancel_delayed_work_sync(watchdog_task) at the
> beginning
> of e1000_down_and_stop() thus ensuring the race is impossible.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
> Cc: Tushar Dave <tushar.n.dave@intel.com>
> Cc: Patrick McHardy <kaber@trash.net>
> Cc: David S. Miller <davem@davemloft.net>
> ---
>  drivers/net/ethernet/intel/e1000/e1000_main.c |   15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)

I have applied your patch to my queue, thanks!

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-11-22 23:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22  8:20 [PATCH 1/2] e1000: fix lockdep warning in e1000_reset_task Vladimir Davydov
2013-11-22  8:20 ` [PATCH 2/2] e1000: fix possible reset_task running after adapter down Vladimir Davydov
2013-11-22 23:14   ` Jeff Kirsher [this message]
2013-11-22 23:13 ` [PATCH 1/2] e1000: fix lockdep warning in e1000_reset_task Jeff Kirsher

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=1385162041.2219.29.camel@jtkirshe-mobl \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=devel@openvz.org \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=jesse.brandeburg@intel.com \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tushar.n.dave@intel.com \
    --cc=vdavydov@parallels.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).