lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <701804230d4de3dacf7028c60afbc73f4f7167fa.camel@mediatek.com>
Date:   Thu, 28 Sep 2023 02:32:07 +0000
From:   CK Hu (胡俊光) <ck.hu@...iatek.com>
To:     Shawn Sung (宋孝謙) 
        <Shawn.Sung@...iatek.com>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        "angelogioacchino.delregno@...labora.com" 
        <angelogioacchino.delregno@...labora.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        Singo Chang (張興國) 
        <Singo.Chang@...iatek.com>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        Jason-JH Lin (林睿祥) 
        <Jason-JH.Lin@...iatek.com>,
        Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
        "daniel@...ll.ch" <daniel@...ll.ch>,
        "p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
        "conor+dt@...nel.org" <conor+dt@...nel.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        Project_Global_Chrome_Upstream_Group 
        <Project_Global_Chrome_Upstream_Group@...iatek.com>,
        "airlied@...il.com" <airlied@...il.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "nfraprado@...labora.com" <nfraprado@...labora.com>
Subject: Re: [RESEND PATCH v6 16/20] drm/mediatek: Make sure the power-on
 sequence of LARB and RDMA

Hi, Hsiao-chien:

On Mon, 2023-09-11 at 15:42 +0800, Hsiao Chien Sung wrote:
> Since LARBs (Local ARBiter) have to be powered on before its users,
> to ensure the power-on sequence, we created a device link between
> RDMA and its LARB, and when pm_runtime_get_sync is called in RDMA,
> system will guarantee the LARB is powered on before the RDMA.

OVL is one of LARB user, but OVL have no device link with LARB, but it
works for years. If all DMA component need device link with LARB, add
to all of them not only mdp_rdma.

Regards,
CK

> 
> Signed-off-by: Hsiao Chien Sung <shawn.sung@...iatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> index c3adaeefd551..fce6fbb534b1 100644
> --- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
> @@ -244,10 +244,23 @@ size_t mtk_mdp_rdma_get_num_formats(struct
> device *dev)
> 
>  int mtk_mdp_rdma_clk_enable(struct device *dev)
>  {
> +	int ret;
>  	struct mtk_mdp_rdma *rdma = dev_get_drvdata(dev);
> 
> -	clk_prepare_enable(rdma->clk);
> -	return 0;
> +	/*
> +	 * Since LARBs (Local ARBiter) have to be powered on before its
> users,
> +	 * to ensure the power-on sequence, we created a device link
> between
> +	 * RDMA and its LARB, and when pm_runtime_get_sync is called in
> RDMA,
> +	 * system will make sure the LARB is powered on before the RDMA
> +	 */
> +	ret = pm_runtime_get_sync(dev);
> +
> +	if (ret < 0)
> +		dev_err(dev, "pm_runtime_get_sync failed: %d\n", ret);
> +	else
> +		ret = clk_prepare_enable(rdma->clk);
> +
> +	return ret;
>  }
> 
>  void mtk_mdp_rdma_clk_disable(struct device *dev)
> @@ -255,6 +268,9 @@ void mtk_mdp_rdma_clk_disable(struct device *dev)
>  	struct mtk_mdp_rdma *rdma = dev_get_drvdata(dev);
> 
>  	clk_disable_unprepare(rdma->clk);
> +
> +	/* Same reason as when enabling clock, turn the LARB off */
> +	pm_runtime_put(dev);
>  }
> 
>  static int mtk_mdp_rdma_bind(struct device *dev, struct device
> *master,
> --
> 2.18.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ