mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@yandex-team.ru>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>,
	Vinod Koul <vinod.koul@intel.com>,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	David Whipple <whipple@securedatainnovations.ch>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [REGRESSION][BISECTED] 3.10.26: net_dma: mark broken (b69ec589136c)
Date: Wed, 29 Jan 2014 16:41:32 +0400	[thread overview]
Message-ID: <20140129124132.GA3180@stfomichev-desktop> (raw)
In-Reply-To: <CAPcyv4gNdKqRYGfjNY0GyOysN-3WrTVRGbo-+6Jdb2ukFGPX9w@mail.gmail.com>

> I wonder if we are simply racing the initialization of the completion
> vs when it is triggered by dma.
We have wmb() in the ioat2_tx_submit_unlock (before submitting work to dma,
but after init_completion), shouldn't it make race between interrupt handler
and our waiting thread impossible?

I also believe I traced x->done in the do_wait_for_common
before and after 'timeout = action(timeout);' and it was as expected:
0 - before and 1 - after.

> I also think we need to be waiting
> for in-flight tasklet runs when stopping the channel.
Yes, I also thought that's the reason of the race, because tasklet is in
the queue, but it is disabled (on my weird trace I don't see the interrupt,
so I abandoned this idea).
But it seems to be possible only when we issue dma, wait_for_completion_timeout
waits and times out, we do cleanup (tasklet_disable), we get interrupt and
do tasklet_schedule. But (again) I don't see timeout and
interrupt on my trace (could it be corrupted?).

Despite all this theory, the patch below (which just replaces tasklet_disable
with tasklet_kill in the cleanup routines) seems to be working (did about
40 reboots and didn't see the issue).

I think replacing tasklet_disable with tasklet_kill is reasonable anyway, so
should I send the patch rebased on 3.13 with comments or you'll take care
and merge it into mainline and stable yourself?

---
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index 17a2393b3e25..6c62f4de02c0 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -379,7 +379,7 @@ static void ioat1_dma_free_chan_resources(struct dma_chan *c)
 	if (ioat->desccount == 0)
 		return;
 
-	tasklet_disable(&chan->cleanup_task);
+	tasklet_kill(&chan->cleanup_task);
 	del_timer_sync(&chan->timer);
 	ioat1_cleanup(ioat);
 
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index b925e1b1d139..268e93d1af2d 100644
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -809,7 +809,7 @@ void ioat2_free_chan_resources(struct dma_chan *c)
 	if (!ioat->ring)
 		return;
 
-	tasklet_disable(&chan->cleanup_task);
+	tasklet_kill(&chan->cleanup_task);
 	del_timer_sync(&chan->timer);
 	device->cleanup_fn((unsigned long) c);
 	device->reset_hw(chan);
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index acb86507828a..94a5f04e114e 100644

  reply	other threads:[~2014-01-29 12:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27 17:31 Stanislav Fomichev
2014-01-29  9:13 ` Dan Williams
2014-01-29 12:41   ` Stanislav Fomichev [this message]
2014-01-29 20:33     ` Dan Williams

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=20140129124132.GA3180@stfomichev-desktop \
    --to=stfomichev@yandex-team.ru \
    --cc=alexander.h.duyck@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    --cc=whipple@securedatainnovations.ch \
    /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

all inboxes | Powered by JetHome®