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: <CAAOTY_-7ES_tdO4p7aSeVO3x+=0kzWVtCAve-EV_Mrj=WGEmGg@mail.gmail.com>
Date:   Sat, 30 May 2020 19:08:31 +0800
From:   Chun-Kuang Hu <chunkuang.hu@...nel.org>
To:     Yong Wu <yong.wu@...iatek.com>
Cc:     Matthias Brugger <matthias.bgg@...il.com>,
        Joerg Roedel <joro@...tes.org>,
        Rob Herring <robh+dt@...nel.org>,
        Will Deacon <will.deacon@....com>, youlin.pei@...iatek.com,
        Nicolas Boichat <drinkcat@...omium.org>,
        Evan Green <evgreen@...omium.org>, eizan@...omium.org,
        Matthias Kaehlcke <mka@...omium.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        CK Hu <ck.hu@...iatek.com>, devicetree@...r.kernel.org,
        cui.zhang@...iatek.com, Tomasz Figa <tfiga@...gle.com>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>, ming-fan.chen@...iatek.com,
        anan.sun@...iatek.com, acourbot@...omium.org,
        srv_heupstream <srv_heupstream@...iatek.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        chao.hao@...iatek.com, iommu@...ts.linux-foundation.org,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH v4 11/17] drm/mediatek: Get rid of mtk_smi_larb_get/put

Hi, Yong:

Yong Wu <yong.wu@...iatek.com> 於 2020年5月30日 週六 下午4:27寫道:
>
> MediaTek IOMMU has already added the device_link between the consumer
> and smi-larb device. If the drm device call the pm_runtime_get_sync,
> the smi-larb's pm_runtime_get_sync also be called automatically.
>

Acked-by: Chun-Kuang Hu <chunkuang.hu@...nel.org>

> CC: CK Hu <ck.hu@...iatek.com>
> CC: Philipp Zabel <p.zabel@...gutronix.de>
> Signed-off-by: Yong Wu <yong.wu@...iatek.com>
> Reviewed-by: Evan Green <evgreen@...omium.org>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c     |  9 ---------
>  drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 21 ---------------------
>  drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h |  1 -
>  3 files changed, 31 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index c9bc844..d4c4078 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -8,7 +8,6 @@
>  #include <linux/soc/mediatek/mtk-cmdq.h>
>
>  #include <asm/barrier.h>
> -#include <soc/mediatek/smi.h>
>
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_plane_helper.h>
> @@ -532,12 +531,6 @@ static void mtk_drm_crtc_atomic_enable(struct drm_crtc *crtc,
>
>         DRM_DEBUG_DRIVER("%s %d\n", __func__, crtc->base.id);
>
> -       ret = mtk_smi_larb_get(comp->larb_dev);
> -       if (ret) {
> -               DRM_ERROR("Failed to get larb: %d\n", ret);
> -               return;
> -       }
> -
>         ret = pm_runtime_get_sync(comp->dev);
>         if (ret < 0)
>                 DRM_DEV_ERROR(comp->dev, "Failed to enable power domain: %d\n",
> @@ -545,7 +538,6 @@ static void mtk_drm_crtc_atomic_enable(struct drm_crtc *crtc,
>
>         ret = mtk_crtc_ddp_hw_init(mtk_crtc);
>         if (ret) {
> -               mtk_smi_larb_put(comp->larb_dev);
>                 pm_runtime_put(comp->dev);
>                 return;
>         }
> @@ -582,7 +574,6 @@ static void mtk_drm_crtc_atomic_disable(struct drm_crtc *crtc,
>
>         drm_crtc_vblank_off(crtc);
>         mtk_crtc_ddp_hw_fini(mtk_crtc);
> -       mtk_smi_larb_put(comp->larb_dev);
>         ret = pm_runtime_put(comp->dev);
>         if (ret < 0)
>                 DRM_DEV_ERROR(comp->dev, "Failed to disable power domain: %d\n",
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> index 593027a..a6e7f3a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> @@ -432,8 +432,6 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node,
>                       const struct mtk_ddp_comp_funcs *funcs)
>  {
>         enum mtk_ddp_comp_type type;
> -       struct device_node *larb_node;
> -       struct platform_device *larb_pdev;
>  #if IS_REACHABLE(CONFIG_MTK_CMDQ)
>         struct resource res;
>         struct cmdq_client_reg cmdq_reg;
> @@ -468,31 +466,12 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node,
>         if (IS_ERR(comp->clk))
>                 return PTR_ERR(comp->clk);
>
> -       /* Only DMA capable components need the LARB property */
> -       comp->larb_dev = NULL;
>         if (type != MTK_DISP_OVL &&
>             type != MTK_DISP_OVL_2L &&
>             type != MTK_DISP_RDMA &&
>             type != MTK_DISP_WDMA)
>                 return 0;
>
> -       larb_node = of_parse_phandle(node, "mediatek,larb", 0);
> -       if (!larb_node) {
> -               dev_err(dev,
> -                       "Missing mediadek,larb phandle in %pOF node\n", node);
> -               return -EINVAL;
> -       }
> -
> -       larb_pdev = of_find_device_by_node(larb_node);
> -       if (!larb_pdev) {
> -               dev_warn(dev, "Waiting for larb device %pOF\n", larb_node);
> -               of_node_put(larb_node);
> -               return -EPROBE_DEFER;
> -       }
> -       of_node_put(larb_node);
> -
> -       comp->larb_dev = &larb_pdev->dev;
> -
>         comp->dev = dev;
>
>  #if IS_REACHABLE(CONFIG_MTK_CMDQ)
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
> index 4c063e0..11c7120 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
> @@ -98,7 +98,6 @@ struct mtk_ddp_comp {
>         struct clk *clk;
>         void __iomem *regs;
>         int irq;
> -       struct device *larb_dev;
>         struct device *dev;
>         enum mtk_ddp_comp_id id;
>         const struct mtk_ddp_comp_funcs *funcs;
> --
> 1.9.1
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ