public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] raw1394 : Fix hang on unload
@ 2005-02-06 19:41 Parag Warudkar
  2005-02-07 10:19 ` hugang
  0 siblings, 1 reply; 4+ messages in thread
From: Parag Warudkar @ 2005-02-06 19:41 UTC (permalink / raw)
  To: akpm, linux-kernel, linux1394-devel, Jody McIntyre

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

I was seeing rmmod getting stuck consistently in D state while removing
raw1394. Looking at raw1394.c:cleanup_raw1394 - the order of doing
things seemed incorrect to me after comparing other places in raw1394.c
which do the same thing but with a different order.

bash          R  running task       0  4319   3884                3900
(NOTLB)
rmmod         D 0000008428792a16     0  4490   3900
(NOTLB)
ffff81001cff9dd8 0000000000000082 0000000000000000 0000000100000000
       0000007400000000 ffff8100211c9070 000000000000097b
ffff81002c8a2800
       ffffffff80397c97 ffff81002b6f9360
Call Trace:<ffffffff80379d25>{__down+421}
<ffffffff80133510>{default_wake_function+0}
       <ffffffff8037cd8c>{__down_failed+53}
<ffffffff801c0e40>{generic_delete_inode+0}
       <ffffffff8029e540>{.text.lock.driver+5}
<ffffffff885a8260>{:raw1394:cleanup_raw1394+16}
       <ffffffff8015eb31>{sys_delete_module+497}
<ffffffff8021a692>{__up_write+514}
       <ffffffff80183efb>{sys_munmap+107} <ffffffff8010ecda>{system_call
+126}

Attached patch fixes the rmmod raw1394 hang. Tested.

Parag

[-- Attachment #2: raw1394.c.patch --]
[-- Type: text/x-patch, Size: 460 bytes --]

--- drivers/ieee1394/raw1394.c.orig	2005-02-06 14:34:58.000000000 -0500
+++ drivers/ieee1394/raw1394.c	2005-02-06 14:36:18.000000000 -0500
@@ -2758,10 +2758,10 @@
 
 static void __exit cleanup_raw1394(void)
 {
-	hpsb_unregister_protocol(&raw1394_driver);
 	cdev_del(&raw1394_cdev);
         devfs_remove(RAW1394_DEVICE_NAME);
         hpsb_unregister_highlevel(&raw1394_highlevel);
+	hpsb_unregister_protocol(&raw1394_driver);
 }
 
 module_init(init_raw1394);

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

* Re: [PATCH] raw1394 : Fix hang on unload
  2005-02-06 19:41 [PATCH] raw1394 : Fix hang on unload Parag Warudkar
@ 2005-02-07 10:19 ` hugang
  2005-02-08 14:24   ` J.A. Magallon
  0 siblings, 1 reply; 4+ messages in thread
From: hugang @ 2005-02-07 10:19 UTC (permalink / raw)
  To: Parag Warudkar; +Cc: akpm, linux-kernel, linux1394-devel, Jody McIntyre

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

On Sun, Feb 06, 2005 at 02:41:15PM -0500, Parag Warudkar wrote:
> I was seeing rmmod getting stuck consistently in D state while removing
> raw1394. Looking at raw1394.c:cleanup_raw1394 - the order of doing
> things seemed incorrect to me after comparing other places in raw1394.c
> which do the same thing but with a different order.
> 
> bash          R  running task       0  4319   3884                3900
> (NOTLB)
> rmmod         D 0000008428792a16     0  4490   3900
> (NOTLB)
> ffff81001cff9dd8 0000000000000082 0000000000000000 0000000100000000
>        0000007400000000 ffff8100211c9070 000000000000097b
> ffff81002c8a2800
>        ffffffff80397c97 ffff81002b6f9360
> Call Trace:<ffffffff80379d25>{__down+421}
> <ffffffff80133510>{default_wake_function+0}
>        <ffffffff8037cd8c>{__down_failed+53}
> <ffffffff801c0e40>{generic_delete_inode+0}
>        <ffffffff8029e540>{.text.lock.driver+5}
> <ffffffff885a8260>{:raw1394:cleanup_raw1394+16}
>        <ffffffff8015eb31>{sys_delete_module+497}
> <ffffffff8021a692>{__up_write+514}
>        <ffffffff80183efb>{sys_munmap+107} <ffffffff8010ecda>{system_call
> +126}
> 
> Attached patch fixes the rmmod raw1394 hang. Tested.

I think sbp2 also need do this, attached patch will fix sbp2 rmmod
hang, But not tested.

-- 
Hu Gang       .-.
              /v\
             // \\ 
Linux User  /(   )\  [204016]
GPG Key ID   ^^-^^   http://soulinfo.com/~hugang/hugang.asc

[-- Attachment #2: fix_sbp2_hang --]
[-- Type: text/plain, Size: 454 bytes --]

--- 2.6.10-mm1-axg-swap_mem/drivers/ieee1394/sbp2.c~hang	2005-02-07 18:17:12.000000000 +0800
+++ 2.6.10-mm1-axg-swap_mem/drivers/ieee1394/sbp2.c	2005-02-07 18:17:22.000000000 +0800
@@ -2845,9 +2845,9 @@ static void __exit sbp2_module_exit(void
 {
 	SBP2_DEBUG("sbp2_module_exit");
 
-	hpsb_unregister_protocol(&sbp2_driver);
-
 	hpsb_unregister_highlevel(&sbp2_highlevel);
+
+	hpsb_unregister_protocol(&sbp2_driver);
 }
 
 module_init(sbp2_module_init);

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

* Re: [PATCH] raw1394 : Fix hang on unload
  2005-02-07 10:19 ` hugang
@ 2005-02-08 14:24   ` J.A. Magallon
  2005-02-08 16:40     ` Parag Warudkar
  0 siblings, 1 reply; 4+ messages in thread
From: J.A. Magallon @ 2005-02-08 14:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux1394-devel

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


On 2005.02.07, hugang@soulinfo.com wrote:
> On Sun, Feb 06, 2005 at 02:41:15PM -0500, Parag Warudkar wrote:
> > I was seeing rmmod getting stuck consistently in D state while removing
> > raw1394. Looking at raw1394.c:cleanup_raw1394 - the order of doing
> > things seemed incorrect to me after comparing other places in raw1394.c
> > which do the same thing but with a different order.
> > 
> > bash          R  running task       0  4319   3884                3900
> > (NOTLB)
> > rmmod         D 0000008428792a16     0  4490   3900
> > (NOTLB)
> > ffff81001cff9dd8 0000000000000082 0000000000000000 0000000100000000
> >        0000007400000000 ffff8100211c9070 000000000000097b
> > ffff81002c8a2800
> >        ffffffff80397c97 ffff81002b6f9360
> > Call Trace:<ffffffff80379d25>{__down+421}
> > <ffffffff80133510>{default_wake_function+0}
> >        <ffffffff8037cd8c>{__down_failed+53}
> > <ffffffff801c0e40>{generic_delete_inode+0}
> >        <ffffffff8029e540>{.text.lock.driver+5}
> > <ffffffff885a8260>{:raw1394:cleanup_raw1394+16}
> >        <ffffffff8015eb31>{sys_delete_module+497}
> > <ffffffff8021a692>{__up_write+514}
> >        <ffffffff80183efb>{sys_munmap+107} <ffffffff8010ecda>{system_call
> > +126}
> > 
> > Attached patch fixes the rmmod raw1394 hang. Tested.
> 
> I think sbp2 also need do this, attached patch will fix sbp2 rmmod
> hang, But not tested.
> 

It happens the same for me with eth1394. Reversing the order of those
calls allows unloading of the module; as they are now, rmmod just hangs
forever...

I looked also at other 1394 drivers and all have the calls in 'bad' order.
Sure this ordering has to be reversed or it is correct and is triggering
other hidden bug ?

TIA

--
J.A. Magallon <jamagallon()able!es>     \               Software is like sex:
werewolf!able!es                         \         It's better when it's free
Mandrakelinux release 10.2 (Cooker) for i586
Linux 2.6.10-jam8 (gcc 3.4.3 (Mandrakelinux 10.2 3.4.3-3mdk)) #1


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] raw1394 : Fix hang on unload
  2005-02-08 14:24   ` J.A. Magallon
@ 2005-02-08 16:40     ` Parag Warudkar
  0 siblings, 0 replies; 4+ messages in thread
From: Parag Warudkar @ 2005-02-08 16:40 UTC (permalink / raw)
  To: J.A. Magallon; +Cc: linux-kernel, linux1394-devel

> I looked also at other 1394 drivers and all have the calls in 'bad' order.
> Sure this ordering has to be reversed or it is correct and is triggering
> other hidden bug ?
> 
Quite possibly it's triggering (or is triggered by) some other bug. 
There is also a possibility that raw1394.c might be doing something
wrong and gets away with it with the changed ordering. Because dv1394.c
does it the "seemingly-bad" way and I haven't got rmmod to hang while
removing it.

Can anyone answer this - in what  cases will generic_delete_inode hang
on __down_failed -> default_wake_function -> __down?

Thanks

Parag


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

end of thread, other threads:[~2005-02-08 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-06 19:41 [PATCH] raw1394 : Fix hang on unload Parag Warudkar
2005-02-07 10:19 ` hugang
2005-02-08 14:24   ` J.A. Magallon
2005-02-08 16:40     ` Parag Warudkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox