MLK-18826: drm: imx: dcss: fix hang when dumping registers
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Thu, 19 Jul 2018 11:07:14 +0000 (14:07 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
If DCSS is suspended, the clocks are disabled. Dumping the registers,
with the following command:

cat /sys/kernel/debug/imx-dcss/dump_registers

will hang the system, because of DTG.

This patch makes sure clocks are enabled before dumping the registers
and will immediately release them afterwards.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/imx/dcss/dcss-common.c

index 4b3a667..2c05d9a 100644 (file)
@@ -448,6 +448,10 @@ static int dcss_trace_dump_open(struct inode *inode, struct file *file)
 
 static int dcss_dump_regs_show(struct seq_file *s, void *data)
 {
+       struct dcss_soc *dcss = s->private;
+
+       pm_runtime_get_sync(dcss->dev);
+
        dcss_blkctl_dump_regs(s, s->private);
        dcss_dtrc_dump_regs(s, s->private);
        dcss_dpr_dump_regs(s, s->private);
@@ -459,6 +463,8 @@ static int dcss_dump_regs_show(struct seq_file *s, void *data)
        dcss_hdr10_dump_regs(s, s->private);
        dcss_ctxld_dump_regs(s, s->private);
 
+       pm_runtime_put_sync(dcss->dev);
+
        return 0;
 }