summaryrefslogtreecommitdiff
path: root/drivers/gpu/imx
diff options
context:
space:
mode:
authorXianzhong <xianzhong.li@nxp.com>2018-07-10 21:44:44 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commitd7cc2d795c313f194ade31609a5e2b29c8c5f8e7 (patch)
tree9fe8649574db281fe8b49952fe7318f773530665 /drivers/gpu/imx
parent5d3cf9cddcc2b6ab2d4b46b53b03677f105b021e (diff)
MGS-4061 gpu: imx: dpu-blit: fix kernel panic in pm test
resume will increase unlock counter, max allowed value is 15. suspend need decrease unlock counter to avoid overflow panic. Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Diffstat (limited to 'drivers/gpu/imx')
-rw-r--r--drivers/gpu/imx/dpu-blit/dpu-blit-registers.h2
-rw-r--r--drivers/gpu/imx/dpu-blit/dpu-blit.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/imx/dpu-blit/dpu-blit-registers.h b/drivers/gpu/imx/dpu-blit/dpu-blit-registers.h
index d4c28d18eb6a..3d86b272e281 100644
--- a/drivers/gpu/imx/dpu-blit/dpu-blit-registers.h
+++ b/drivers/gpu/imx/dpu-blit/dpu-blit-registers.h
@@ -250,9 +250,11 @@
#define CMDSEQ_HIF ((uint32_t)(0x400))
#define CMDSEQ_LOCKUNLOCKHIF ((uint32_t)(0x500))
+#define CMDSEQ_LOCKUNLOCKHIF_LOCKUNLOCKHIF__LOCK_KEY 0x5651F763U
#define CMDSEQ_LOCKUNLOCKHIF_LOCKUNLOCKHIF__UNLOCK_KEY 0x691DB936U
#define CMDSEQ_LOCKUNLOCK ((uint32_t)(0x580))
+#define CMDSEQ_LOCKUNLOCK_LOCKUNLOCK__LOCK_KEY 0x5651F763U
#define CMDSEQ_LOCKUNLOCK_LOCKUNLOCK__UNLOCK_KEY 0x691DB936U
#define CMDSEQ_BUFFERADDRESS ((uint32_t)(0x588))
diff --git a/drivers/gpu/imx/dpu-blit/dpu-blit.c b/drivers/gpu/imx/dpu-blit/dpu-blit.c
index 620d53217719..bb747d411111 100644
--- a/drivers/gpu/imx/dpu-blit/dpu-blit.c
+++ b/drivers/gpu/imx/dpu-blit/dpu-blit.c
@@ -422,6 +422,12 @@ EXPORT_SYMBOL_GPL(dpu_bliteng_init);
void dpu_bliteng_fini(struct dpu_bliteng *dpu_bliteng)
{
+ /* LockUnlock and LockUnlockHIF */
+ dpu_be_write(dpu_bliteng, CMDSEQ_LOCKUNLOCKHIF_LOCKUNLOCKHIF__LOCK_KEY,
+ CMDSEQ_LOCKUNLOCKHIF);
+ dpu_be_write(dpu_bliteng, CMDSEQ_LOCKUNLOCK_LOCKUNLOCK__LOCK_KEY,
+ CMDSEQ_LOCKUNLOCK);
+
kfree(dpu_bliteng->cmd_list);
if (dpu_bliteng->buffer_addr_virt)