From: CK Hu <ck.hu@mediatek.com>
To: Hsin-Yi Wang <hsinyi@chromium.org>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>
Cc: David Airlie <airlied@linux.ie>, <linux-kernel@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<linux-mediatek@lists.infradead.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] drm/mediatek: ensure bridge disable happends before suspend
Date: Mon, 4 Jul 2022 17:16:27 +0800 [thread overview]
Message-ID: <870cac7815d0f2ec9cfe4a18b19c141723fcd178.camel@mediatek.com> (raw)
In-Reply-To: <20220629190545.478113-1-hsinyi@chromium.org>
Hi, Hsin-yi:
On Thu, 2022-06-30 at 03:05 +0800, Hsin-Yi Wang wrote:
> Make sure bridge_disable will be called before suspend by calling
> drm_mode_config_helper_suspend() in .prepare callback.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> ---
> The issue is found if suspend is called via VT2 in several MTK SoC
> (eg.
> MT8173, MT8183, MT8186) chromebook boards with eDP bridge:
> bridge disable is called through mtk-drm's suspend, and it needs to
> be
> called before bridge pm runtime suspend.
> So we move the hook to .prepare() and .complete().
> ---
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 13a1bbe7ead7f..a42812e490007 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -828,8 +828,7 @@ static int mtk_drm_remove(struct platform_device
> *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> -static int mtk_drm_sys_suspend(struct device *dev)
> +static int mtk_drm_sys_prepare(struct device *dev)
> {
> struct mtk_drm_private *private = dev_get_drvdata(dev);
> struct drm_device *drm = private->drm;
> @@ -840,20 +839,21 @@ static int mtk_drm_sys_suspend(struct device
> *dev)
> return ret;
> }
>
> -static int mtk_drm_sys_resume(struct device *dev)
> +static void mtk_drm_sys_complete(struct device *dev)
> {
> struct mtk_drm_private *private = dev_get_drvdata(dev);
> struct drm_device *drm = private->drm;
> int ret;
>
> ret = drm_mode_config_helper_resume(drm);
> -
> - return ret;
> + if (ret)
> + dev_err(dev, "Failed to resume\n");
> }
> -#endif
>
> -static SIMPLE_DEV_PM_OPS(mtk_drm_pm_ops, mtk_drm_sys_suspend,
> - mtk_drm_sys_resume);
> +static const struct dev_pm_ops mtk_drm_pm_ops = {
> + .prepare = mtk_drm_sys_prepare,
> + .complete = mtk_drm_sys_complete,
> +};
>
> static struct platform_driver mtk_drm_platform_driver = {
> .probe = mtk_drm_probe,
next prev parent reply other threads:[~2022-07-04 10:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 19:05 [PATCH] drm/mediatek: ensure bridge disable happends before suspend Hsin-Yi Wang
2022-07-04 9:16 ` CK Hu [this message]
2022-07-04 11:44 ` AngeloGioacchino Del Regno
2022-07-04 13:51 ` Chun-Kuang Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=870cac7815d0f2ec9cfe4a18b19c141723fcd178.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=airlied@linux.ie \
--cc=chunkuang.hu@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hsinyi@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox