Merge tag 'char-misc-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
[sfrench/cifs-2.6.git] / drivers / hv / hv.c
index 11273cd384d6dd75d135e2faea1b115dfdf19a4d..632d25674e7feef8e8db91820ab22a63d6c80de9 100644 (file)
@@ -33,9 +33,7 @@
 #include "hyperv_vmbus.h"
 
 /* The one and only */
-struct hv_context hv_context = {
-       .synic_initialized      = false,
-};
+struct hv_context hv_context;
 
 /*
  * If false, we're using the old mechanism for stimer0 interrupts
@@ -326,8 +324,6 @@ int hv_synic_init(unsigned int cpu)
 
        hv_set_synic_state(sctrl.as_uint64);
 
-       hv_context.synic_initialized = true;
-
        /*
         * Register the per-cpu clockevent source.
         */
@@ -373,7 +369,8 @@ int hv_synic_cleanup(unsigned int cpu)
        bool channel_found = false;
        unsigned long flags;
 
-       if (!hv_context.synic_initialized)
+       hv_get_synic_state(sctrl.as_uint64);
+       if (sctrl.enable != 1)
                return -EFAULT;
 
        /*
@@ -435,7 +432,6 @@ int hv_synic_cleanup(unsigned int cpu)
        hv_set_siefp(siefp.as_uint64);
 
        /* Disable the global synic bit */
-       hv_get_synic_state(sctrl.as_uint64);
        sctrl.enable = 0;
        hv_set_synic_state(sctrl.as_uint64);