]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/firmware/psci_checker.c
watchdog: sama5d4: fix timeout-sec usage
[mirror_ubuntu-bionic-kernel.git] / drivers / firmware / psci_checker.c
index f3f4f810e5df39b82a68e71305541b391393dbad..36967bcc24e7f903976562e18c87fdced80aea17 100644 (file)
@@ -353,16 +353,16 @@ static int suspend_test_thread(void *arg)
        for (;;) {
                /* Needs to be set first to avoid missing a wakeup. */
                set_current_state(TASK_INTERRUPTIBLE);
-               if (kthread_should_stop()) {
-                       __set_current_state(TASK_RUNNING);
+               if (kthread_should_park())
                        break;
-               }
                schedule();
        }
 
        pr_info("CPU %d suspend test results: success %d, shallow states %d, errors %d\n",
                cpu, nb_suspend, nb_shallow_sleep, nb_err);
 
+       kthread_parkme();
+
        return nb_err;
 }
 
@@ -427,8 +427,10 @@ static int suspend_tests(void)
 
 
        /* Stop and destroy all threads, get return status. */
-       for (i = 0; i < nb_threads; ++i)
+       for (i = 0; i < nb_threads; ++i) {
+               err += kthread_park(threads[i]);
                err += kthread_stop(threads[i]);
+       }
  out:
        cpuidle_resume_and_unlock();
        kfree(threads);