Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen move xen_intr_disestablish() call in xbd_xe...



details:   https://anonhg.NetBSD.org/src/rev/73d297aec5bb
branches:  trunk
changeset: 932607:73d297aec5bb
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue May 12 09:54:02 2020 +0000

description:
move xen_intr_disestablish() call in xbd_xenbus_suspend() so it's executed
without holding the xbd mutex, to avoid LOCKDEBUG assertion on suspend

while here only disestablish the intr if it was established

part of PR port-xen/55207

diffstat:

 sys/arch/xen/xen/xbd_xenbus.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r d70902751e16 -r 73d297aec5bb sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c     Tue May 12 09:48:44 2020 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c     Tue May 12 09:54:02 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.125 2020/05/07 19:25:57 maxv Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.126 2020/05/12 09:54:02 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.125 2020/05/07 19:25:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.126 2020/05/12 09:54:02 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -436,7 +436,10 @@
        }
 
        hypervisor_mask_event(sc->sc_evtchn);
-       xen_intr_disestablish(sc->sc_ih);
+       if (sc->sc_ih != NULL) {
+               xen_intr_disestablish(sc->sc_ih);
+               sc->sc_ih = NULL;
+       }
 
        mutex_enter(&sc->sc_lock);
        while (xengnt_status(sc->sc_ring_gntref))
@@ -488,10 +491,14 @@
 
        hypervisor_mask_event(sc->sc_evtchn);
        sc->sc_backend_status = BLKIF_STATE_SUSPENDED;
-       xen_intr_disestablish(sc->sc_ih);
 
        mutex_exit(&sc->sc_lock);
 
+       if (sc->sc_ih != NULL) {
+               xen_intr_disestablish(sc->sc_ih);
+               sc->sc_ih = NULL;
+       }
+
        xenbus_device_suspend(sc->sc_xbusd);
        aprint_verbose_dev(dev, "removed event channel %d\n", sc->sc_evtchn);
 



Home | Main Index | Thread Index | Old Index