i386/73224: Lock order reversal in ntoskrnl_timercall()

Frank Mayhar frank at exit.com
Fri Oct 29 17:20:33 PDT 2004


The following reply was made to PR i386/73224; it has been noted by GNATS.

From: Frank Mayhar <frank at exit.com>
To: freebsd-gnats-submit at FreeBSD.org
Cc:  
Subject: Re: i386/73224: Lock order reversal in ntoskrnl_timercall()
Date: Fri, 29 Oct 2004 17:12:29 -0700 (PDT)

 It appears that there is another LOR just like this one in if_ndis.c in
 the ndis_timer() function.  Patch is below, I've been running for a short
 time with the two patches without obvious incident other than the preexisting
 panic that I've been trying to track down...
 
 Index: sys/compat/ndis/subr_ntoskrnl.c
 ===================================================================
 RCS file: /cvs/repos/src/sys/compat/ndis/subr_ntoskrnl.c,v
 retrieving revision 1.43.2.1
 diff -u -r1.43.2.1 subr_ntoskrnl.c
 --- sys/compat/ndis/subr_ntoskrnl.c     13 Oct 2004 19:23:33 -0000      1.43.2.1
 +++ sys/compat/ndis/subr_ntoskrnl.c     30 Oct 2004 00:10:30 -0000
 @@ -1616,8 +1616,6 @@
         ktimer                  *timer;
         struct timeval          tv;
  
 -       mtx_unlock(&Giant);
 -
         timer = arg;
  
         timer->k_header.dh_inserted = FALSE;
 @@ -1644,8 +1642,6 @@
  
         ntoskrnl_wakeup(&timer->k_header);
  
 -       mtx_lock(&Giant);
 -
         return;
  }
  
 Index: sys/dev/if_ndis/if_ndis.c
 ===================================================================
 RCS file: /cvs/repos/src/sys/dev/if_ndis/if_ndis.c,v
 retrieving revision 1.69.2.2
 diff -u -r1.69.2.2 if_ndis.c
 --- sys/dev/if_ndis/if_ndis.c   23 Oct 2004 18:56:39 -0000      1.69.2.2
 +++ sys/dev/if_ndis/if_ndis.c   30 Oct 2004 00:10:30 -0000
 @@ -1061,16 +1061,12 @@
  {
         struct ndis_softc       *sc;
  
 -       mtx_unlock(&Giant);
 -
         sc = xsc;
  
         ndis_sched(ndis_ticktask, sc, NDIS_TASKQUEUE);
         sc->ndis_stat_ch = timeout(ndis_tick, sc, hz *
             sc->ndis_block.nmb_checkforhangsecs);
  
 -       mtx_lock(&Giant);
 -
         return;
  }
 
 -- 
 Frank Mayhar frank at exit.com	http://www.exit.com/
 Exit Consulting                 http://www.gpsclock.com/
                                 http://www.exit.com/blog/frank/


More information about the freebsd-i386 mailing list