mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc ZYNGIER <mzyngier@freesurf.fr>
To: Andrew Morton <andrewm@uow.edu.au>
Cc: linux-kernel@vger.kernel.org, linux-irda@pasta.cs.UiT.No
Subject: Re: [IrDA+SMP] Lockup in handle_IRQ_event
Date: 04 Jan 2001 10:58:56 +0100	[thread overview]
Message-ID: <wrpsnmz63kv.fsf@hina.wild-wind.fr.eu.org> (raw)
In-Reply-To: <wrpzoh89t1c.fsf@hina.wild-wind.fr.eu.org> <3A53B356.32353C01@uow.edu.au>
In-Reply-To: Andrew Morton's message of "Thu, 04 Jan 2001 10:18:46 +1100"

>>>>> "AM" == Andrew Morton <andrewm@uow.edu.au> writes:

Hi Andrew,

AM> Try this:

AM> --- linux-2.4.0-prerelease/net/irda/irqueue.c	Tue Nov 21 20:11:22 2000
AM> +++ linux-akpm/net/irda/irqueue.c	Thu Jan  4 10:14:10 2001
AM> @@ -436,7 +436,7 @@
 
AM>  	/* Release lock */
AM>  	if ( hashbin->hb_type & HB_GLOBAL) {
AM> -		spin_unlock_irq( &hashbin->hb_mutex[ bin]);
AM> +		spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags);
 
AM>  	} else if ( hashbin->hb_type & HB_LOCAL) {
AM>  		restore_flags( flags);


Ok, that wasn't enough, but you pointed me to the right
direction. With your patch, the machine survived a few more seconds,
that crashed with a slightly different path :

>>EIP; c010a5e5 <handle_IRQ_event+21/78>   <=====
Trace; c010a7f6 <do_IRQ+a6/f4>
Trace; c0108fbc <ret_from_intr+0/20>
Trace; d0830018 <[irda]irlmp_unregister_client+20/54>
Trace; d0835f01 <[irda]hashbin_insert+bd/c4>
Trace; d082f863 <[irda]irlmp_disconnect_request+7b/98>
Trace; d0837299 <[irda]irttp_disconnect_request+f1/f8>
Trace; d0878d58 <[ircomm]ircomm_ttp_disconnect_request+14/18>
Trace; d0878767 <[ircomm]ircomm_state_conn+83/b8>
Trace; d08787c0 <[ircomm]ircomm_do_event+24/2c>
Trace; d0878467 <[ircomm]ircomm_disconnect_request+17/20>
Trace; d0838438 <[irda]__irias_delete_attrib+0/30>
Trace; d087d2eb <[ircomm-tty]ircomm_tty_state_ready+47/a4>
Trace; d087d36c <[ircomm-tty]ircomm_tty_do_event+24/2c>
Trace; d087c92a <[ircomm-tty]ircomm_tty_detach_cable+72/a8>
Trace; d087bfac <[ircomm-tty]ircomm_tty_shutdown+88/b8>
Trace; d087b8fa <[ircomm-tty]ircomm_tty_close+c2/16c>
Trace; c017e960 <release_dev+244/514>
Trace; c017efc9 <tty_release+2d/68>
Trace; c0132af1 <fput+39/e8>
Trace; c0131aa2 <filp_close+b2/bc>
Trace; c01184fb <put_files_struct+4f/b8>
Trace; c0118cd3 <do_exit+127/274>
Trace; c0118e4a <sys_exit+e/10>
Trace; c0108efb <system_call+33/38>
Code;  c010a5e5 <handle_IRQ_event+21/78>

hashbin_insert was guilty this time. So, using your patch as a
guideline, I changed all spin_lock_irqsave/spin_unlock_irq pairs to
spin_lock_irqsave/spin_unlock_irqrestore. Which seems to make sense
anyway !

Using this patch, the machine is solid, and I've been able to play
with my phone as much as I wanted to (well... while the battery
lasted, anyway... ;-).

Here's the patch (which of course includes yours). If it's proved to
be correct, it would be a good idea to summit it to Linus while
prerelease is still open to fixes.

Thanks a lot for your help.

	M.

--- linux/net/irda/irqueue.c.prerelease	Thu Jan  4 10:21:13 2001
+++ linux/net/irda/irqueue.c	Thu Jan  4 10:24:39 2001
@@ -198,7 +198,7 @@
 	
 	/* Release lock */
 	if ( hashbin->hb_type & HB_GLOBAL)
-		spin_unlock_irq( &hashbin->hb_mutex[ bin]);
+		spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags);
 	else if (hashbin->hb_type & HB_LOCAL) {
 		restore_flags( flags);
 	}
@@ -258,7 +258,7 @@
 	/* Release lock */
 	if ( hashbin->hb_type & HB_GLOBAL) {
 
-		spin_unlock_irq( &hashbin->hb_mutex[ bin]);
+		spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags);
 
 	} else if ( hashbin->hb_type & HB_LOCAL) {
 		restore_flags( flags);
@@ -327,7 +327,7 @@
 	
 	/* Release lock */
 	if ( hashbin->hb_type & HB_GLOBAL) {
-		spin_unlock_irq( &hashbin->hb_mutex[ bin]);
+		spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags);
 
 	} else if ( hashbin->hb_type & HB_LOCAL) {
 		restore_flags( flags);
@@ -436,7 +436,7 @@
 
 	/* Release lock */
 	if ( hashbin->hb_type & HB_GLOBAL) {
-		spin_unlock_irq( &hashbin->hb_mutex[ bin]);
+		spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags);
 
 	} else if ( hashbin->hb_type & HB_LOCAL) {
 		restore_flags( flags);
@@ -511,7 +511,7 @@
 
 	/* Release lock */
 	if ( hashbin->hb_type & HB_GLOBAL) {
-		spin_unlock_irq( &hashbin->hb_mutex[ bin]);
+		spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags);
 
 	} else if ( hashbin->hb_type & HB_LOCAL) {
 		restore_flags( flags);

-- 
Places change, faces change. Life is so very strange.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-04 13:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-03 22:20 Marc ZYNGIER
2001-01-03 23:18 ` Andrew Morton
2001-01-04  9:58   ` Marc ZYNGIER [this message]
2001-01-04 13:22     ` Andrew Morton
2001-01-04 14:13       ` [PATCH] " Marc ZYNGIER
2001-01-04 10:51   ` [Linux-IrDA]Re: " Florian Lohoff
2001-01-04 12:04     ` Anton Blanchard
2001-01-04 12:06     ` Keith Owens

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=wrpsnmz63kv.fsf@hina.wild-wind.fr.eu.org \
    --to=mzyngier@freesurf.fr \
    --cc=andrewm@uow.edu.au \
    --cc=linux-irda@pasta.cs.UiT.No \
    --cc=linux-kernel@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 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®