linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc ZYNGIER <mzyngier@freesurf.fr>
To: torvalds@transmeta.com
Cc: Andrew Morton <andrewm@uow.edu.au>,
	linux-kernel@vger.kernel.org, linux-irda@pasta.cs.UiT.No
Subject: [PATCH] [IrDA+SMP] Lockup in handle_IRQ_event
Date: 04 Jan 2001 15:13:08 +0100	[thread overview]
Message-ID: <wrpvgrviex7.fsf_-_@hina.wild-wind.fr.eu.org> (raw)
In-Reply-To: <wrpzoh89t1c.fsf@hina.wild-wind.fr.eu.org> <3A53B356.32353C01@uow.edu.au> <wrpsnmz63kv.fsf@hina.wild-wind.fr.eu.org> <3A547911.C5320C69@uow.edu.au>
In-Reply-To: Andrew Morton's message of "Fri, 05 Jan 2001 00:22:25 +1100"

Hi Linus,

Please find enclosed a patch against 2.4.0-prerelease that :

- Fixes a lockup in handle_IRQ_event when using IrDA on an SMP
machine. It changes spin_lock_irqsave/spin_unlock_irq pairs to
spin_lock_irqsave/spin_unlock_irqrestore, which seems to be the
logical thing to do.

- Removes 2 unused functions that are broken on SPARC (hashbin_unlock
does a restore_flags when save_flags is done in hashbin_lock, which
messes register windows).

With this patch, IrDA is rock solid on my x86 SMP box (at least with
my usage patern...). It was crashing immediatly before (NMI watchdog).

A previous version of this patch has been reviewed by Andrew Morton,
who said it looked ok.

Thanks for applying it to your tree.

	M.

--- linux/net/irda/irqueue.c.prerelease	Thu Jan  4 10:21:13 2001
+++ linux/net/irda/irqueue.c	Thu Jan  4 14:30:35 2001
@@ -8,6 +8,8 @@
  * Created at:    Tue Jun  9 13:29:31 1998
  * Modified at:   Sun Dec 12 13:48:22 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
+ * Modified at:   Thu Jan  4 14:29:10 CET 2001
+ * Modified by:   Marc Zyngier <mzyngier@freesurf.fr>
  * 
  *     Copyright (C) 1998-1999, Aage Kvalnes <aage@cs.uit.no>
  *     Copyright (C) 1998, Dag Brattli, 
@@ -142,69 +144,6 @@
 }
 
 /*
- * Function hashbin_lock (hashbin, hashv, name)
- *
- *    Lock the hashbin
- *
- */
-void hashbin_lock(hashbin_t* hashbin, __u32 hashv, char* name, 
-		  unsigned long flags)
-{
-	int bin;
-	
-	IRDA_DEBUG(0, "hashbin_lock\n");
-
-	ASSERT(hashbin != NULL, return;);
-	ASSERT(hashbin->magic == HB_MAGIC, return;);
-
-	/*
-	 * Locate hashbin
-	 */
-	if (name)
-		hashv = hash(name);
-	bin = GET_HASHBIN(hashv);
-	
-	/* Synchronize */
-	if ( hashbin->hb_type & HB_GLOBAL )
-		spin_lock_irqsave(&hashbin->hb_mutex[ bin], flags);
-	else {
-		save_flags(flags);
-		cli();
-	}
-}
-
-/*
- * Function hashbin_unlock (hashbin, hashv, name)
- *
- *    Unlock the hashbin
- *
- */
-void hashbin_unlock(hashbin_t* hashbin, __u32 hashv, char* name, 
-		    unsigned long flags)
-{
-	int bin;
-
-	IRDA_DEBUG(0, "hashbin_unlock()\n");
-
-	ASSERT(hashbin != NULL, return;);
-	ASSERT(hashbin->magic == HB_MAGIC, return;);
-	
-	/*
-	 * Locate hashbin
-	 */
-	if (name )
-		hashv = hash(name);
-	bin = GET_HASHBIN(hashv);
-	
-	/* Release lock */
-	if ( hashbin->hb_type & HB_GLOBAL)
-		spin_unlock_irq( &hashbin->hb_mutex[ bin]);
-	else if (hashbin->hb_type & HB_LOCAL) {
-		restore_flags( flags);
-	}
-}
-
-/*
  * Function hashbin_insert (hashbin, entry, name)
  *
  *    Insert an entry into the hashbin
@@ -258,7 +197,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 +266,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 +375,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 +450,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 14:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-03 22:20 [IrDA+SMP] Lockup in handle_IRQ_event Marc ZYNGIER
2001-01-03 23:18 ` Andrew Morton
2001-01-04  9:58   ` Marc ZYNGIER
2001-01-04 13:22     ` Andrew Morton
2001-01-04 14:13       ` Marc ZYNGIER [this message]
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=wrpvgrviex7.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 \
    --cc=torvalds@transmeta.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).