Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm...
[linux-block.git] / kernel / kexec.c
index b5e40f06976815e60b96dc8166c333a2562b3565..cb8e6e6f983c7900e9950ed2e0b719ff4a524f03 100644 (file)
@@ -93,13 +93,10 @@ static int do_kexec_load(unsigned long entry, unsigned long nr_segments,
 
        /*
         * Because we write directly to the reserved memory region when loading
-        * crash kernels we need a mutex here to prevent multiple crash kernels
-        * from attempting to load simultaneously, and to prevent a crash kernel
-        * from loading over the top of a in use crash kernel.
-        *
-        * KISS: always take the mutex.
+        * crash kernels we need a serialization here to prevent multiple crash
+        * kernels from attempting to load simultaneously.
         */
-       if (!mutex_trylock(&kexec_mutex))
+       if (!kexec_trylock())
                return -EBUSY;
 
        if (flags & KEXEC_ON_CRASH) {
@@ -165,7 +162,7 @@ out:
 
        kimage_free(image);
 out_unlock:
-       mutex_unlock(&kexec_mutex);
+       kexec_unlock();
        return ret;
 }