drm/edid/firmware: Add built-in edid/1280x720.bin firmware
[platform/kernel/linux-starfive.git] / kernel / umh.c
index 8506315..fbf872c 100644 (file)
@@ -438,21 +438,27 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
        if (wait == UMH_NO_WAIT)        /* task has freed sub_info */
                goto unlock;
 
-       if (wait & UMH_KILLABLE)
-               state |= TASK_KILLABLE;
-
        if (wait & UMH_FREEZABLE)
                state |= TASK_FREEZABLE;
 
-       retval = wait_for_completion_state(&done, state);
-       if (!retval)
-               goto wait_done;
-
        if (wait & UMH_KILLABLE) {
+               retval = wait_for_completion_state(&done, state | TASK_KILLABLE);
+               if (!retval)
+                       goto wait_done;
+
                /* umh_complete() will see NULL and free sub_info */
                if (xchg(&sub_info->complete, NULL))
                        goto unlock;
+
+               /*
+                * fallthrough; in case of -ERESTARTSYS now do uninterruptible
+                * wait_for_completion_state(). Since umh_complete() shall call
+                * complete() in a moment if xchg() above returned NULL, this
+                * uninterruptible wait_for_completion_state() will not block
+                * SIGKILL'ed processes for long.
+                */
        }
+       wait_for_completion_state(&done, state);
 
 wait_done:
        retval = sub_info->retval;