MLK-19989 drivers: mxc: hdp-cec: make the hdp-cec kernel thread freezeable
authorJason Liu <jason.hui.liu@nxp.com>
Thu, 25 Oct 2018 02:32:08 +0000 (10:32 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
the hdp-cec kernel thread should be freezeable during system suspend phase,
othwerwise, it will cause issues(hang) since it will still try to access
some resources such as clocks which are off during system suspend process.

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Cc: Sandor Yu <sandor.yu@nxp.com>
Cc: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Acked-by: Sandor Yu <sandor.yu@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/mxc/hdp-cec/imx-hdp-cec.c

index e1aea1f..068ae8e 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/version.h>
 #include <linux/workqueue.h>
 #include <linux/kthread.h>
+#include <linux/freezer.h>
 #include <media/cec.h>
 #include <soc/imx8/soc.h>
 
@@ -173,8 +174,10 @@ static int cec_poll_worker(void *_cec)
        int num_rx_msgs, i;
        int sts;
 
+       set_freezable();
+
        for (;;) {
-               if (kthread_should_stop())
+               if (kthread_freezable_should_stop(NULL))
                        break;
 
                /* Check TX State */