Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen don't reinitialize mutexes/cv on resume



details:   https://anonhg.NetBSD.org/src/rev/5c84cb2b05e8
branches:  trunk
changeset: 932656:5c84cb2b05e8
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed May 13 13:19:38 2020 +0000

description:
don't reinitialize mutexes/cv on resume

part of PR port-xen/55207

diffstat:

 sys/arch/xen/xen/evtchn.c          |  22 +++++++++++-----------
 sys/arch/xen/xenbus/xenbus_comms.c |  14 ++++++++++----
 sys/arch/xen/xenbus/xenbus_comms.h |  10 +++++-----
 sys/arch/xen/xenbus/xenbus_probe.c |   6 +++---
 4 files changed, 29 insertions(+), 23 deletions(-)

diffs (146 lines):

diff -r 1f48be086994 -r 5c84cb2b05e8 sys/arch/xen/xen/evtchn.c
--- a/sys/arch/xen/xen/evtchn.c Wed May 13 11:41:35 2020 +0000
+++ b/sys/arch/xen/xen/evtchn.c Wed May 13 13:19:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evtchn.c,v 1.94 2020/05/07 19:48:57 bouyer Exp $       */
+/*     $NetBSD: evtchn.c,v 1.95 2020/05/13 13:19:38 jdolecek Exp $     */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.94 2020/05/07 19:48:57 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.95 2020/05/13 13:19:38 jdolecek Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -254,6 +254,13 @@
 events_init(void)
 {
        mutex_init(&evtchn_lock, MUTEX_DEFAULT, IPL_NONE);
+
+       (void)events_resume();
+}
+
+bool
+events_resume(void)
+{
 #ifdef XENPV
        debug_port = bind_virq_to_evtch(VIRQ_DEBUG);
 
@@ -271,6 +278,8 @@
        hypervisor_unmask_event(debug_port);
 #endif /* XENPV */
        x86_enable_intr();              /* at long last... */
+
+       return true;
 }
 
 bool
@@ -294,15 +303,6 @@
        return true;
 }
 
-bool
-events_resume (void)
-{
-       events_init();
-
-       return true;
-}
-
-
 unsigned int
 evtchn_do_event(int evtch, struct intrframe *regs)
 {
diff -r 1f48be086994 -r 5c84cb2b05e8 sys/arch/xen/xenbus/xenbus_comms.c
--- a/sys/arch/xen/xenbus/xenbus_comms.c        Wed May 13 11:41:35 2020 +0000
+++ b/sys/arch/xen/xenbus/xenbus_comms.c        Wed May 13 13:19:38 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_comms.c,v 1.23 2020/05/06 16:50:13 bouyer Exp $ */
+/* $NetBSD: xenbus_comms.c,v 1.24 2020/05/13 13:19:38 jdolecek Exp $ */
 /******************************************************************************
  * xenbus_comms.c
  *
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.23 2020/05/06 16:50:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.24 2020/05/13 13:19:38 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/null.h> 
@@ -219,11 +219,17 @@
 int
 xb_init_comms(device_t dev)
 {
-       int evtchn;
-
        mutex_init(&xenstore_lock, MUTEX_DEFAULT, IPL_TTY);
        cv_init(&xenstore_cv, "xsio");
 
+       return xb_resume_comms(dev);
+}
+
+int
+xb_resume_comms(device_t dev)
+{
+       int evtchn;
+
        evtchn = xen_start_info.store_evtchn;
 
        ih = xen_intr_establish_xname(-1, &xen_pic, evtchn, IST_LEVEL, IPL_TTY,
diff -r 1f48be086994 -r 5c84cb2b05e8 sys/arch/xen/xenbus/xenbus_comms.h
--- a/sys/arch/xen/xenbus/xenbus_comms.h        Wed May 13 11:41:35 2020 +0000
+++ b/sys/arch/xen/xenbus/xenbus_comms.h        Wed May 13 13:19:38 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_comms.h,v 1.7 2020/05/06 16:50:13 bouyer Exp $ */
+/* $NetBSD: xenbus_comms.h,v 1.8 2020/05/13 13:19:38 jdolecek Exp $ */
 /*
  * Private include for xenbus communications.
  * 
@@ -30,10 +30,10 @@
 #define _XENBUS_COMMS_H
 
 void xenbus_kernfs_init(void);
-int xs_init(device_t dev);
-int xb_init_comms(device_t dev);
-void xb_suspend_comms(device_t dev);
-void xb_resume_comms(device_t dev);
+int xs_init(device_t);
+int xb_init_comms(device_t);
+void xb_suspend_comms(device_t);
+int xb_resume_comms(device_t);
 
 void xb_xenstored_make_ready(void);
 
diff -r 1f48be086994 -r 5c84cb2b05e8 sys/arch/xen/xenbus/xenbus_probe.c
--- a/sys/arch/xen/xenbus/xenbus_probe.c        Wed May 13 11:41:35 2020 +0000
+++ b/sys/arch/xen/xenbus/xenbus_probe.c        Wed May 13 13:19:38 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.52 2020/05/06 16:50:13 bouyer Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.53 2020/05/13 13:19:38 jdolecek Exp $ */
 /******************************************************************************
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.52 2020/05/06 16:50:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.53 2020/05/13 13:19:38 jdolecek Exp $");
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -131,7 +131,7 @@
 static bool
 xenbus_resume(device_t dev, const pmf_qual_t *qual)
 {
-       xb_init_comms(dev);
+       xb_resume_comms(dev);
        xs_resume();
 
        return true;



Home | Main Index | Thread Index | Old Index