Author: royger
Date: Fri Jul 29 16:35:58 2016
New Revision: 303491
URL: https://svnweb.freebsd.org/changeset/base/303491

Log:
  Revert r291022: x86/intr: allow mutex recursion in intr_remove_handler
  
  This was only needed for Xen, and a better way to deal with this issue has
  been found, so this commit can be reverted.
  
  Sponsored by:         Citrix Systems R&D
  MFC after:            5 days
  Reviewed by:          kib
  Differential revision:        https://reviews.freebsd.org/D7363

Modified:
  head/sys/x86/x86/intr_machdep.c

Modified: head/sys/x86/x86/intr_machdep.c
==============================================================================
--- head/sys/x86/x86/intr_machdep.c     Fri Jul 29 16:34:54 2016        
(r303490)
+++ head/sys/x86/x86/intr_machdep.c     Fri Jul 29 16:35:58 2016        
(r303491)
@@ -197,28 +197,19 @@ int
 intr_remove_handler(void *cookie)
 {
        struct intsrc *isrc;
-       int error, mtx_owned;
+       int error;
 
        isrc = intr_handler_source(cookie);
        error = intr_event_remove_handler(cookie);
        if (error == 0) {
-               /*
-                * Recursion is needed here so PICs can remove interrupts
-                * while resuming. It was previously not possible due to
-                * intr_resume holding the intr_table_lock and
-                * intr_remove_handler recursing on it.
-                */
-               mtx_owned = mtx_owned(&intr_table_lock);
-               if (mtx_owned == 0)
-                       mtx_lock(&intr_table_lock);
+               mtx_lock(&intr_table_lock);
                isrc->is_handlers--;
                if (isrc->is_handlers == 0) {
                        isrc->is_pic->pic_disable_source(isrc, PIC_NO_EOI);
                        isrc->is_pic->pic_disable_intr(isrc);
                }
                intrcnt_updatename(isrc);
-               if (mtx_owned == 0)
-                       mtx_unlock(&intr_table_lock);
+               mtx_unlock(&intr_table_lock);
        }
        return (error);
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to