mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dmaengine: Fix oops on dmatest module unload.
@ 2009-02-10  9:31 Thierry Reding
  2009-02-12 11:48 ` Atsushi Nemoto
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2009-02-10  9:31 UTC (permalink / raw)
  To: Haavard Skinnemoen; +Cc: linux-kernel

This patch fixes an oops that happens when the dmatest module is unloaded. The
dma_release_channel() function is called on channels that have already been
cleaned up (and therefore freed) with dmatest_cleanup_channel().

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

---
 drivers/dma/dmatest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 732fa1e..d12219c 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -433,10 +433,10 @@ static void __exit dmatest_exit(void)
 
 	list_for_each_entry_safe(dtc, _dtc, &dmatest_channels, node) {
 		list_del(&dtc->node);
+		dma_release_channel(dtc->chan);
 		dmatest_cleanup_channel(dtc);
 		pr_debug("dmatest: dropped channel %s\n",
 			 dma_chan_name(dtc->chan));
-		dma_release_channel(dtc->chan);
 	}
 }
 module_exit(dmatest_exit);
-- 
tg: (8e49215..) adx/dma (depends on: adx/master)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: Fix oops on dmatest module unload.
  2009-02-10  9:31 [PATCH] dmaengine: Fix oops on dmatest module unload Thierry Reding
@ 2009-02-12 11:48 ` Atsushi Nemoto
  2009-02-12 12:30   ` [PATCH v2] " Thierry Reding
  0 siblings, 1 reply; 6+ messages in thread
From: Atsushi Nemoto @ 2009-02-12 11:48 UTC (permalink / raw)
  To: thierry.reding; +Cc: haavard.skinnemoen, linux-kernel, dan.j.williams

On Tue, 10 Feb 2009 10:31:03 +0100, Thierry Reding <thierry.reding@avionic-design.de> wrote:
> This patch fixes an oops that happens when the dmatest module is unloaded. The
> dma_release_channel() function is called on channels that have already been
> cleaned up (and therefore freed) with dmatest_cleanup_channel().
...
> @@ -433,10 +433,10 @@ static void __exit dmatest_exit(void)
>  
>  	list_for_each_entry_safe(dtc, _dtc, &dmatest_channels, node) {
>  		list_del(&dtc->node);
> +		dma_release_channel(dtc->chan);
>  		dmatest_cleanup_channel(dtc);
>  		pr_debug("dmatest: dropped channel %s\n",
>  			 dma_chan_name(dtc->chan));
> -		dma_release_channel(dtc->chan);
>  	}
>  }

Good catch!  Please move pr_debug() too.

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] dmaengine: Fix oops on dmatest module unload.
  2009-02-12 11:48 ` Atsushi Nemoto
@ 2009-02-12 12:30   ` Thierry Reding
  2009-02-13  0:12     ` Dan Williams
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2009-02-12 12:30 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: haavard.skinnemoen, linux-kernel, dan.j.williams

This patch fixes an oops that happens when the dmatest module is unloaded. The
dma_release_channel() function is called on channels that have already been
cleaned up (and therefore freed) with dmatest_cleanup_channel().

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

---
 drivers/dma/dmatest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 732fa1e..0fb053e 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -433,10 +433,10 @@ static void __exit dmatest_exit(void)
 
 	list_for_each_entry_safe(dtc, _dtc, &dmatest_channels, node) {
 		list_del(&dtc->node);
-		dmatest_cleanup_channel(dtc);
 		pr_debug("dmatest: dropped channel %s\n",
 			 dma_chan_name(dtc->chan));
 		dma_release_channel(dtc->chan);
+		dmatest_cleanup_channel(dtc);
 	}
 }
 module_exit(dmatest_exit);
-- 
tg: (8e49215..) adx/dma (depends on: adx/master)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] dmaengine: Fix oops on dmatest module unload.
  2009-02-12 12:30   ` [PATCH v2] " Thierry Reding
@ 2009-02-13  0:12     ` Dan Williams
  2009-03-04 23:03       ` Dan Williams
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Williams @ 2009-02-13  0:12 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Atsushi Nemoto, haavard.skinnemoen, linux-kernel

On Thu, Feb 12, 2009 at 5:30 AM, Thierry Reding
<thierry.reding@avionic-design.de> wrote:
> This patch fixes an oops that happens when the dmatest module is unloaded. The
> dma_release_channel() function is called on channels that have already been
> cleaned up (and therefore freed) with dmatest_cleanup_channel().
>
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

Thanks, applied with Atsushi's ack.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] dmaengine: Fix oops on dmatest module unload.
  2009-02-13  0:12     ` Dan Williams
@ 2009-03-04 23:03       ` Dan Williams
  2009-03-06 11:13         ` Atsushi Nemoto
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Williams @ 2009-03-04 23:03 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Atsushi Nemoto, haavard.skinnemoen, linux-kernel

On Thu, Feb 12, 2009 at 5:12 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Thu, Feb 12, 2009 at 5:30 AM, Thierry Reding
> <thierry.reding@avionic-design.de> wrote:
>> This patch fixes an oops that happens when the dmatest module is unloaded. The
>> dma_release_channel() function is called on channels that have already been
>> cleaned up (and therefore freed) with dmatest_cleanup_channel().
>>
>> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
>
> Thanks, applied with Atsushi's ack.
>

...and now it is unapplied :-).  The problem with this patch is that
it releases the channel before dmatest is done with it.  'Cleanup'
followed by 'release' is the right order, just need to save ->chan
before it gets freed.

--
Dan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] dmaengine: Fix oops on dmatest module unload.
  2009-03-04 23:03       ` Dan Williams
@ 2009-03-06 11:13         ` Atsushi Nemoto
  0 siblings, 0 replies; 6+ messages in thread
From: Atsushi Nemoto @ 2009-03-06 11:13 UTC (permalink / raw)
  To: dan.j.williams; +Cc: thierry.reding, haavard.skinnemoen, linux-kernel

On Wed, 4 Mar 2009 16:03:47 -0700, Dan Williams <dan.j.williams@intel.com> wrote:
> ...and now it is unapplied :-).  The problem with this patch is that
> it releases the channel before dmatest is done with it.  'Cleanup'
> followed by 'release' is the right order, just need to save ->chan
> before it gets freed.

Oh that's right.  I tested your fix in async_tx tree and it works
fine.  Thanks!

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-06 11:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-10  9:31 [PATCH] dmaengine: Fix oops on dmatest module unload Thierry Reding
2009-02-12 11:48 ` Atsushi Nemoto
2009-02-12 12:30   ` [PATCH v2] " Thierry Reding
2009-02-13  0:12     ` Dan Williams
2009-03-04 23:03       ` Dan Williams
2009-03-06 11:13         ` Atsushi Nemoto

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®