All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kip Macy <kip.macy@gmail.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: XenFreeBSD lockup fix
Date: Fri, 22 Apr 2005 15:22:14 -0700	[thread overview]
Message-ID: <b1fa29170504221522387fbb5c@mail.gmail.com> (raw)

Old bug.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/04/22 15:19:02-07:00 kmacy@curly.lab.netapp.com 
#   Fix lockup in evtchn_do_upcall
#   Signed-off-by: Kip Macy <kmacy@fsmware.com>
# 
# freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
#   2005/04/22 15:18:57-07:00 kmacy@curly.lab.netapp.com +6 -1
#   Work around potential recursive locking in event channel handler
# 
diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/e
vtchn.c
--- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c 2005-04-21
15:24:19 -07:00
+++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c 2005-04-21
15:24:19 -07:00
@@ -54,7 +54,7 @@
 {
     unsigned long  l1, l2;
     unsigned int   l1i, l2i, port;
-    int            irq;
+    int            irq, owned;
     unsigned long  flags;
     shared_info_t *s = HYPERVISOR_shared_info;
     vcpu_info_t   *vcpu_info = &s->vcpu_data[smp_processor_id()];
@@ -78,12 +78,17 @@
                 l2 &= ~(1 << l2i);
             
                 port = (l1i << 5) + l2i;
+               if ((owned = mtx_owned(&sched_lock)) != 0)
+                        mtx_unlock_spin_flags(&sched_lock, MTX_QUIET);
                 if ( (irq = evtchn_to_irq[port]) != -1 ) {
                    struct intsrc *isrc = intr_lookup_source(irq);
                    intr_execute_handlers(isrc, frame);
                } else {
                     evtchn_device_upcall(port);
                }
+               if (owned)
+                   mtx_lock_spin_flags(&sched_lock, MTX_QUIET);
+
             }
         }
     }

                 reply	other threads:[~2005-04-22 22:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=b1fa29170504221522387fbb5c@mail.gmail.com \
    --to=kip.macy@gmail.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.