mbox series

[v2,0/4] CMDQ refinement of Mediatek DRM driver

Message ID 20210808234733.14782-1-chunkuang.hu@kernel.org (mailing list archive)
Headers show
Series CMDQ refinement of Mediatek DRM driver | expand

Message

Chun-Kuang Hu Aug. 8, 2021, 11:47 p.m. UTC
These refinements include using standard mailbox callback interface,
timeout detection, and a fixed cmdq_handle.

Changes in v2:
1. Define mtk_drm_cmdq_pkt_create() and mtk_drm_cmdq_pkt_destroy()
   when CONFIG_MTK_CMDQ is reachable.

Chun-Kuang Hu (4):
  drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
  drm/mediatek: Remove struct cmdq_client
  drm/mediatek: Detect CMDQ execution timeout
  drm/mediatek: Add cmdq_handle in mtk_crtc

 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 110 ++++++++++++++++++++----
 1 file changed, 91 insertions(+), 19 deletions(-)

Comments

Chun-Kuang Hu Aug. 12, 2021, 12:13 a.m. UTC | #1
Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2021年8月9日 週一 上午7:47寫道:
>
> These refinements include using standard mailbox callback interface,
> timeout detection, and a fixed cmdq_handle.

For this series, applied to mediatek-drm-next [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> Changes in v2:
> 1. Define mtk_drm_cmdq_pkt_create() and mtk_drm_cmdq_pkt_destroy()
>    when CONFIG_MTK_CMDQ is reachable.
>
> Chun-Kuang Hu (4):
>   drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
>   drm/mediatek: Remove struct cmdq_client
>   drm/mediatek: Detect CMDQ execution timeout
>   drm/mediatek: Add cmdq_handle in mtk_crtc
>
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 110 ++++++++++++++++++++----
>  1 file changed, 91 insertions(+), 19 deletions(-)
>
> --
> 2.25.1
>
Enric Balletbo Serra Sept. 21, 2021, 8:33 a.m. UTC | #2
Hi Chun-Kuang,

Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dj., 12 d’ag.
2021 a les 2:13:

> Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2021年8月9日 週一 上午7:47寫道:
> >
> > These refinements include using standard mailbox callback interface,
> > timeout detection, and a fixed cmdq_handle.
>
> For this series, applied to mediatek-drm-next [1].
>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
>
>
These patches seem to break the display on the Acer Chromebook R 13
(MT8173) in the current mainline. After running a bisection it pointed me
to the following commit

commit f4be17cd5b14dd73545b0e014a63ebe9ab5ef837
Author: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Date:   Sun Jul 4 15:36:48 2021 +0800

    drm/mediatek: Remove struct cmdq_client

Reverting this patch alone is not trivial, so I ended up reverting the full
series, and I can confirm that reverting the full series makes the display
work again.

Unfortunately, after the merge window, different things broke for this
device, and I didn't finish isolating them, and it is not clear to me yet
whether the logs I'm getting are useful for this specific issue or not.
Basically with this series merged the kernel seems to be stuck, and the
display is not working. Latest message is

[   12.329173] mtk-iommu 10205000.iommu: Partial TLB flush timed out,
falling back to full flush

Without the series, the kernel goes far and display works, however there
are other issues affecting the cros-ec, but I think that's another issue.

I'll try to dig a bit more, but, meanwhile, if you have any idea please let
me know.

Thanks,
 Enric



> Regards,
> Chun-Kuang.
>
> >
> > Changes in v2:
> > 1. Define mtk_drm_cmdq_pkt_create() and mtk_drm_cmdq_pkt_destroy()
> >    when CONFIG_MTK_CMDQ is reachable.
> >
> > Chun-Kuang Hu (4):
> >   drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
> >   drm/mediatek: Remove struct cmdq_client
> >   drm/mediatek: Detect CMDQ execution timeout
> >   drm/mediatek: Add cmdq_handle in mtk_crtc
> >
> >  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 110 ++++++++++++++++++++----
> >  1 file changed, 91 insertions(+), 19 deletions(-)
> >
> > --
> > 2.25.1
> >
>
Enric Balletbo Serra Sept. 21, 2021, 8:36 a.m. UTC | #3
Hi Chun-Kuang,

(again without html format, sorry for the noise)

Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dj., 12
d’ag. 2021 a les 2:13:
>
> Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2021年8月9日 週一 上午7:47寫道:
> >
> > These refinements include using standard mailbox callback interface,
> > timeout detection, and a fixed cmdq_handle.
>
> For this series, applied to mediatek-drm-next [1].
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
>

These patches seem to break the display on the Acer Chromebook R 13
(MT8173) in the current mainline. After running a bisection it pointed
me to the following commit

commit f4be17cd5b14dd73545b0e014a63ebe9ab5ef837
Author: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Date:   Sun Jul 4 15:36:48 2021 +0800

    drm/mediatek: Remove struct cmdq_client

Reverting this patch alone is not trivial, so I ended up reverting the
full series, and I can confirm that reverting the full series makes
the display work again.

Unfortunately, after the merge window, different things broke for this
device, and I didn't finish isolating them, and it is not clear to me
yet whether the logs I'm getting are useful for this specific issue or
not. Basically with this series merged the kernel seems to be stuck,
and the display is not working. Latest message is

[   12.329173] mtk-iommu 10205000.iommu: Partial TLB flush timed out,
falling back to full flush

Without the series, the kernel goes far and display works, however
there are other issues affecting the cros-ec, but I think that's
another issue.

I'll try to dig a bit more, but, meanwhile, if you have any idea
please let me know.

Thanks,
 Enric


> Regards,
> Chun-Kuang.
>
> >
> > Changes in v2:
> > 1. Define mtk_drm_cmdq_pkt_create() and mtk_drm_cmdq_pkt_destroy()
> >    when CONFIG_MTK_CMDQ is reachable.
> >
> > Chun-Kuang Hu (4):
> >   drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
> >   drm/mediatek: Remove struct cmdq_client
> >   drm/mediatek: Detect CMDQ execution timeout
> >   drm/mediatek: Add cmdq_handle in mtk_crtc
> >
> >  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 110 ++++++++++++++++++++----
> >  1 file changed, 91 insertions(+), 19 deletions(-)
> >
> > --
> > 2.25.1
> >
Chun-Kuang Hu Sept. 21, 2021, 1:14 p.m. UTC | #4
Hi, Enric:

Enric Balletbo Serra <eballetbo@gmail.com> 於 2021年9月21日 週二 下午4:36寫道:
>
> Hi Chun-Kuang,
>
> (again without html format, sorry for the noise)
>
> Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dj., 12
> d’ag. 2021 a les 2:13:
> >
> > Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2021年8月9日 週一 上午7:47寫道:
> > >
> > > These refinements include using standard mailbox callback interface,
> > > timeout detection, and a fixed cmdq_handle.
> >
> > For this series, applied to mediatek-drm-next [1].
> >
> > [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
> >
>
> These patches seem to break the display on the Acer Chromebook R 13
> (MT8173) in the current mainline. After running a bisection it pointed
> me to the following commit
>
> commit f4be17cd5b14dd73545b0e014a63ebe9ab5ef837
> Author: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> Date:   Sun Jul 4 15:36:48 2021 +0800
>
>     drm/mediatek: Remove struct cmdq_client
>
> Reverting this patch alone is not trivial, so I ended up reverting the
> full series, and I can confirm that reverting the full series makes
> the display work again.

I think you could not just revert "drm/mediatek: Remove struct
cmdq_client", you should also revert the patches after it, such as

"drm/mediatek: Clear pending flag when cmdq packet is done"
"drm/mediatek: Add cmdq_handle in mtk_crtc"
"drm/mediatek: Detect CMDQ execution timeout"

If "drm/mediatek: Remove struct cmdq_client" is the patch cause
display abnormal, I think you could compare code w/ and w/o this
patch. Focus on the value accuracy, such as cmdq_cl and cmdq_chan. And
focus on the flow accuracy, such as mtk_drm_crtc_update_config() and
ddp_cmdq_cb(). If this could not find the problem, I think the latest
way is to break this patch into small patches, changes little in each
small patches and we could finally find out the problem.

Regards,
Chun-Kuang.

>
> Unfortunately, after the merge window, different things broke for this
> device, and I didn't finish isolating them, and it is not clear to me
> yet whether the logs I'm getting are useful for this specific issue or
> not. Basically with this series merged the kernel seems to be stuck,
> and the display is not working. Latest message is
>
> [   12.329173] mtk-iommu 10205000.iommu: Partial TLB flush timed out,
> falling back to full flush
>
> Without the series, the kernel goes far and display works, however
> there are other issues affecting the cros-ec, but I think that's
> another issue.
>
> I'll try to dig a bit more, but, meanwhile, if you have any idea
> please let me know.
>
> Thanks,
>  Enric
>
>
> > Regards,
> > Chun-Kuang.
> >
> > >
> > > Changes in v2:
> > > 1. Define mtk_drm_cmdq_pkt_create() and mtk_drm_cmdq_pkt_destroy()
> > >    when CONFIG_MTK_CMDQ is reachable.
> > >
> > > Chun-Kuang Hu (4):
> > >   drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
> > >   drm/mediatek: Remove struct cmdq_client
> > >   drm/mediatek: Detect CMDQ execution timeout
> > >   drm/mediatek: Add cmdq_handle in mtk_crtc
> > >
> > >  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 110 ++++++++++++++++++++----
> > >  1 file changed, 91 insertions(+), 19 deletions(-)
> > >
> > > --
> > > 2.25.1
> > >
Enric Balletbo Serra Sept. 23, 2021, 4:36 p.m. UTC | #5
Hi Chun-Kuang,

Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dt., 21 de
set. 2021 a les 15:15:
>
> Hi, Enric:
>
> Enric Balletbo Serra <eballetbo@gmail.com> 於 2021年9月21日 週二 下午4:36寫道:
> >
> > Hi Chun-Kuang,
> >
> > (again without html format, sorry for the noise)
> >
> > Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dj., 12
> > d’ag. 2021 a les 2:13:
> > >
> > > Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2021年8月9日 週一 上午7:47寫道:
> > > >
> > > > These refinements include using standard mailbox callback interface,
> > > > timeout detection, and a fixed cmdq_handle.
> > >
> > > For this series, applied to mediatek-drm-next [1].
> > >
> > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
> > >
> >
> > These patches seem to break the display on the Acer Chromebook R 13
> > (MT8173) in the current mainline. After running a bisection it pointed
> > me to the following commit
> >
> > commit f4be17cd5b14dd73545b0e014a63ebe9ab5ef837
> > Author: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> > Date:   Sun Jul 4 15:36:48 2021 +0800
> >
> >     drm/mediatek: Remove struct cmdq_client
> >
> > Reverting this patch alone is not trivial, so I ended up reverting the
> > full series, and I can confirm that reverting the full series makes
> > the display work again.
>
> I think you could not just revert "drm/mediatek: Remove struct
> cmdq_client", you should also revert the patches after it, such as
>
> "drm/mediatek: Clear pending flag when cmdq packet is done"
> "drm/mediatek: Add cmdq_handle in mtk_crtc"
> "drm/mediatek: Detect CMDQ execution timeout"
>

Yes, in fact I reverted:

9efb16c2fdd6 drm/mediatek: Clear pending flag when cmdq packet is done
bc9241be73d9 drm/mediatek: Add cmdq_handle in mtk_crtc
8cdcb3653424 drm/mediatek: Detect CMDQ execution timeout
f4be17cd5b14 drm/mediatek: Remove struct cmdq_client
c1ec54b7b5af drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb

Without these patches 5.15-rc2 works again on my platform.

The commit 'c1ec54b7b5af drm/mediatek: Use mailbox rx_callback instead
of cmdq_task_cb' alone introduces lots of warnings in the kernel

WARNING: CPU: 0 PID: 0 at drivers/mailbox/mtk-cmdq-mailbox.c:198
cmdq_task_exec_done+0xb8/0xe0

I think is just a leftover or the mentioned warning, but that confused
me a bit doing the bisection. Then, after commit 'f4be17cd5b14
drm/mediatek: Remove struct cmdq_client' my system simply gets stuck.
For now I don't see any obvious mistake but will dig further.

Can I ask you in which platform did you test? And if you can double
check if your platform is broken too in current mainline?

Thanks,
  Enric

> If "drm/mediatek: Remove struct cmdq_client" is the patch cause
> display abnormal, I think you could compare code w/ and w/o this
> patch. Focus on the value accuracy, such as cmdq_cl and cmdq_chan. And
> focus on the flow accuracy, such as mtk_drm_crtc_update_config() and
> ddp_cmdq_cb(). If this could not find the problem, I think the latest
> way is to break this patch into small patches, changes little in each
> small patches and we could finally find out the problem.
>
> Regards,
> Chun-Kuang.
>
> >
> > Unfortunately, after the merge window, different things broke for this
> > device, and I didn't finish isolating them, and it is not clear to me
> > yet whether the logs I'm getting are useful for this specific issue or
> > not. Basically with this series merged the kernel seems to be stuck,
> > and the display is not working. Latest message is
> >
> > [   12.329173] mtk-iommu 10205000.iommu: Partial TLB flush timed out,
> > falling back to full flush
> >
> > Without the series, the kernel goes far and display works, however
> > there are other issues affecting the cros-ec, but I think that's
> > another issue.
> >
> > I'll try to dig a bit more, but, meanwhile, if you have any idea
> > please let me know.
> >
> > Thanks,
> >  Enric
> >
> >
> > > Regards,
> > > Chun-Kuang.
> > >
> > > >
> > > > Changes in v2:
> > > > 1. Define mtk_drm_cmdq_pkt_create() and mtk_drm_cmdq_pkt_destroy()
> > > >    when CONFIG_MTK_CMDQ is reachable.
> > > >
> > > > Chun-Kuang Hu (4):
> > > >   drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
> > > >   drm/mediatek: Remove struct cmdq_client
> > > >   drm/mediatek: Detect CMDQ execution timeout
> > > >   drm/mediatek: Add cmdq_handle in mtk_crtc
> > > >
> > > >  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 110 ++++++++++++++++++++----
> > > >  1 file changed, 91 insertions(+), 19 deletions(-)
> > > >
> > > > --
> > > > 2.25.1
> > > >
Chun-Kuang Hu Sept. 23, 2021, 11:43 p.m. UTC | #6
Hi, Enric:

Enric Balletbo Serra <eballetbo@gmail.com> 於 2021年9月24日 週五 上午12:36寫道:
>
> Hi Chun-Kuang,
>
> Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dt., 21 de
> set. 2021 a les 15:15:
> >
> > Hi, Enric:
> >
> > Enric Balletbo Serra <eballetbo@gmail.com> 於 2021年9月21日 週二 下午4:36寫道:
> > >
> > > Hi Chun-Kuang,
> > >
> > > (again without html format, sorry for the noise)
> > >
> > > Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dj., 12
> > > d’ag. 2021 a les 2:13:
> > > >
> > > > Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2021年8月9日 週一 上午7:47寫道:
> > > > >
> > > > > These refinements include using standard mailbox callback interface,
> > > > > timeout detection, and a fixed cmdq_handle.
> > > >
> > > > For this series, applied to mediatek-drm-next [1].
> > > >
> > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
> > > >
> > >
> > > These patches seem to break the display on the Acer Chromebook R 13
> > > (MT8173) in the current mainline. After running a bisection it pointed
> > > me to the following commit
> > >
> > > commit f4be17cd5b14dd73545b0e014a63ebe9ab5ef837
> > > Author: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> > > Date:   Sun Jul 4 15:36:48 2021 +0800
> > >
> > >     drm/mediatek: Remove struct cmdq_client
> > >
> > > Reverting this patch alone is not trivial, so I ended up reverting the
> > > full series, and I can confirm that reverting the full series makes
> > > the display work again.
> >
> > I think you could not just revert "drm/mediatek: Remove struct
> > cmdq_client", you should also revert the patches after it, such as
> >
> > "drm/mediatek: Clear pending flag when cmdq packet is done"
> > "drm/mediatek: Add cmdq_handle in mtk_crtc"
> > "drm/mediatek: Detect CMDQ execution timeout"
> >
>
> Yes, in fact I reverted:
>
> 9efb16c2fdd6 drm/mediatek: Clear pending flag when cmdq packet is done
> bc9241be73d9 drm/mediatek: Add cmdq_handle in mtk_crtc
> 8cdcb3653424 drm/mediatek: Detect CMDQ execution timeout
> f4be17cd5b14 drm/mediatek: Remove struct cmdq_client
> c1ec54b7b5af drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
>
> Without these patches 5.15-rc2 works again on my platform.
>
> The commit 'c1ec54b7b5af drm/mediatek: Use mailbox rx_callback instead
> of cmdq_task_cb' alone introduces lots of warnings in the kernel
>
> WARNING: CPU: 0 PID: 0 at drivers/mailbox/mtk-cmdq-mailbox.c:198
> cmdq_task_exec_done+0xb8/0xe0

I think the WARN_ON in cmdq driver should be remove because that
warning show that cmdq_task_cb is not used but I that is what I want.

>
> I think is just a leftover or the mentioned warning, but that confused
> me a bit doing the bisection. Then, after commit 'f4be17cd5b14
> drm/mediatek: Remove struct cmdq_client' my system simply gets stuck.
> For now I don't see any obvious mistake but will dig further.
>
> Can I ask you in which platform did you test? And if you can double
> check if your platform is broken too in current mainline?

I've no environment to test code now. I apply this series because I
assume Yongqiang has test his patch "Clear pending flag when cmdq
packet is done".  Before I setup the environment (this may take a long
time), I would find others to fix this problem.
According to your information, "c1ec54b7b5af drm/mediatek: Use mailbox
rx_callback instead of cmdq_task_cb" would cause many warning but
display still work, right? If so, I think we should focus on
"f4be17cd5b14 drm/mediatek: Remove struct cmdq_client".

Regards,
Chun-Kuang.

>
> Thanks,
>   Enric
>
> > If "drm/mediatek: Remove struct cmdq_client" is the patch cause
> > display abnormal, I think you could compare code w/ and w/o this
> > patch. Focus on the value accuracy, such as cmdq_cl and cmdq_chan. And
> > focus on the flow accuracy, such as mtk_drm_crtc_update_config() and
> > ddp_cmdq_cb(). If this could not find the problem, I think the latest
> > way is to break this patch into small patches, changes little in each
> > small patches and we could finally find out the problem.
> >
> > Regards,
> > Chun-Kuang.
> >
> > >
> > > Unfortunately, after the merge window, different things broke for this
> > > device, and I didn't finish isolating them, and it is not clear to me
> > > yet whether the logs I'm getting are useful for this specific issue or
> > > not. Basically with this series merged the kernel seems to be stuck,
> > > and the display is not working. Latest message is
> > >
> > > [   12.329173] mtk-iommu 10205000.iommu: Partial TLB flush timed out,
> > > falling back to full flush
> > >
> > > Without the series, the kernel goes far and display works, however
> > > there are other issues affecting the cros-ec, but I think that's
> > > another issue.
> > >
> > > I'll try to dig a bit more, but, meanwhile, if you have any idea
> > > please let me know.
> > >
> > > Thanks,
> > >  Enric
> > >
> > >
> > > > Regards,
> > > > Chun-Kuang.
> > > >
> > > > >
> > > > > Changes in v2:
> > > > > 1. Define mtk_drm_cmdq_pkt_create() and mtk_drm_cmdq_pkt_destroy()
> > > > >    when CONFIG_MTK_CMDQ is reachable.
> > > > >
> > > > > Chun-Kuang Hu (4):
> > > > >   drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
> > > > >   drm/mediatek: Remove struct cmdq_client
> > > > >   drm/mediatek: Detect CMDQ execution timeout
> > > > >   drm/mediatek: Add cmdq_handle in mtk_crtc
> > > > >
> > > > >  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 110 ++++++++++++++++++++----
> > > > >  1 file changed, 91 insertions(+), 19 deletions(-)
> > > > >
> > > > > --
> > > > > 2.25.1
> > > > >
Chun-Kuang Hu Sept. 29, 2021, 2:25 p.m. UTC | #7
+Jason:

Hi, Enric:

Please test Jason's series [1], [2]. Does these series fixes your problem?

[1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=554759
[2] https://patchwork.kernel.org/project/linux-mediatek/list/?series=554767

Regards,
Chun-Kuang.

Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2021年9月24日 週五 上午7:43寫道:
>
> Hi, Enric:
>
> Enric Balletbo Serra <eballetbo@gmail.com> 於 2021年9月24日 週五 上午12:36寫道:
> >
> > Hi Chun-Kuang,
> >
> > Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dt., 21 de
> > set. 2021 a les 15:15:
> > >
> > > Hi, Enric:
> > >
> > > Enric Balletbo Serra <eballetbo@gmail.com> 於 2021年9月21日 週二 下午4:36寫道:
> > > >
> > > > Hi Chun-Kuang,
> > > >
> > > > (again without html format, sorry for the noise)
> > > >
> > > > Missatge de Chun-Kuang Hu <chunkuang.hu@kernel.org> del dia dj., 12
> > > > d’ag. 2021 a les 2:13:
> > > > >
> > > > > Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2021年8月9日 週一 上午7:47寫道:
> > > > > >
> > > > > > These refinements include using standard mailbox callback interface,
> > > > > > timeout detection, and a fixed cmdq_handle.
> > > > >
> > > > > For this series, applied to mediatek-drm-next [1].
> > > > >
> > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
> > > > >
> > > >
> > > > These patches seem to break the display on the Acer Chromebook R 13
> > > > (MT8173) in the current mainline. After running a bisection it pointed
> > > > me to the following commit
> > > >
> > > > commit f4be17cd5b14dd73545b0e014a63ebe9ab5ef837
> > > > Author: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> > > > Date:   Sun Jul 4 15:36:48 2021 +0800
> > > >
> > > >     drm/mediatek: Remove struct cmdq_client
> > > >
> > > > Reverting this patch alone is not trivial, so I ended up reverting the
> > > > full series, and I can confirm that reverting the full series makes
> > > > the display work again.
> > >
> > > I think you could not just revert "drm/mediatek: Remove struct
> > > cmdq_client", you should also revert the patches after it, such as
> > >
> > > "drm/mediatek: Clear pending flag when cmdq packet is done"
> > > "drm/mediatek: Add cmdq_handle in mtk_crtc"
> > > "drm/mediatek: Detect CMDQ execution timeout"
> > >
> >
> > Yes, in fact I reverted:
> >
> > 9efb16c2fdd6 drm/mediatek: Clear pending flag when cmdq packet is done
> > bc9241be73d9 drm/mediatek: Add cmdq_handle in mtk_crtc
> > 8cdcb3653424 drm/mediatek: Detect CMDQ execution timeout
> > f4be17cd5b14 drm/mediatek: Remove struct cmdq_client
> > c1ec54b7b5af drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
> >
> > Without these patches 5.15-rc2 works again on my platform.
> >
> > The commit 'c1ec54b7b5af drm/mediatek: Use mailbox rx_callback instead
> > of cmdq_task_cb' alone introduces lots of warnings in the kernel
> >
> > WARNING: CPU: 0 PID: 0 at drivers/mailbox/mtk-cmdq-mailbox.c:198
> > cmdq_task_exec_done+0xb8/0xe0
>
> I think the WARN_ON in cmdq driver should be remove because that
> warning show that cmdq_task_cb is not used but I that is what I want.
>
> >
> > I think is just a leftover or the mentioned warning, but that confused
> > me a bit doing the bisection. Then, after commit 'f4be17cd5b14
> > drm/mediatek: Remove struct cmdq_client' my system simply gets stuck.
> > For now I don't see any obvious mistake but will dig further.
> >
> > Can I ask you in which platform did you test? And if you can double
> > check if your platform is broken too in current mainline?
>
> I've no environment to test code now. I apply this series because I
> assume Yongqiang has test his patch "Clear pending flag when cmdq
> packet is done".  Before I setup the environment (this may take a long
> time), I would find others to fix this problem.
> According to your information, "c1ec54b7b5af drm/mediatek: Use mailbox
> rx_callback instead of cmdq_task_cb" would cause many warning but
> display still work, right? If so, I think we should focus on
> "f4be17cd5b14 drm/mediatek: Remove struct cmdq_client".
>
> Regards,
> Chun-Kuang.
>
> >
> > Thanks,
> >   Enric
> >
> > > If "drm/mediatek: Remove struct cmdq_client" is the patch cause
> > > display abnormal, I think you could compare code w/ and w/o this
> > > patch. Focus on the value accuracy, such as cmdq_cl and cmdq_chan. And
> > > focus on the flow accuracy, such as mtk_drm_crtc_update_config() and
> > > ddp_cmdq_cb(). If this could not find the problem, I think the latest
> > > way is to break this patch into small patches, changes little in each
> > > small patches and we could finally find out the problem.
> > >
> > > Regards,
> > > Chun-Kuang.
> > >
> > > >
> > > > Unfortunately, after the merge window, different things broke for this
> > > > device, and I didn't finish isolating them, and it is not clear to me
> > > > yet whether the logs I'm getting are useful for this specific issue or
> > > > not. Basically with this series merged the kernel seems to be stuck,
> > > > and the display is not working. Latest message is
> > > >
> > > > [   12.329173] mtk-iommu 10205000.iommu: Partial TLB flush timed out,
> > > > falling back to full flush
> > > >
> > > > Without the series, the kernel goes far and display works, however
> > > > there are other issues affecting the cros-ec, but I think that's
> > > > another issue.
> > > >
> > > > I'll try to dig a bit more, but, meanwhile, if you have any idea
> > > > please let me know.
> > > >
> > > > Thanks,
> > > >  Enric
> > > >
> > > >
> > > > > Regards,
> > > > > Chun-Kuang.
> > > > >
> > > > > >
> > > > > > Changes in v2:
> > > > > > 1. Define mtk_drm_cmdq_pkt_create() and mtk_drm_cmdq_pkt_destroy()
> > > > > >    when CONFIG_MTK_CMDQ is reachable.
> > > > > >
> > > > > > Chun-Kuang Hu (4):
> > > > > >   drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb
> > > > > >   drm/mediatek: Remove struct cmdq_client
> > > > > >   drm/mediatek: Detect CMDQ execution timeout
> > > > > >   drm/mediatek: Add cmdq_handle in mtk_crtc
> > > > > >
> > > > > >  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 110 ++++++++++++++++++++----
> > > > > >  1 file changed, 91 insertions(+), 19 deletions(-)
> > > > > >
> > > > > > --
> > > > > > 2.25.1
> > > > > >