]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/locking/mutex.c
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[karo-tx-linux.git] / kernel / locking / mutex.c
index dadbf88c22c48cea044aac4e34fda9deec78636a..454195194d4a133f2d600d0d3659b2ee5306b7ad 100644 (file)
@@ -378,8 +378,14 @@ done:
         * reschedule now, before we try-lock the mutex. This avoids getting
         * scheduled out right after we obtained the mutex.
         */
-       if (need_resched())
+       if (need_resched()) {
+               /*
+                * We _should_ have TASK_RUNNING here, but just in case
+                * we do not, make it so, otherwise we might get stuck.
+                */
+               __set_current_state(TASK_RUNNING);
                schedule_preempt_disabled();
+       }
 
        return false;
 }