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: <29a2111d-024b-4d9e-27ef-e3399509ff32@samsung.com>
Date:   Mon, 13 Sep 2021 12:30:27 +0200
From:   Andrzej Hajda <a.hajda@...sung.com>
To:     Maxime Ripard <maxime@...no.tech>, Sam Ravnborg <sam@...nborg.org>,
        Daniel Vetter <daniel.vetter@...el.com>,
        David Airlie <airlied@...ux.ie>,
        Jonas Karlman <jonas@...boo.se>,
        Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Neil Armstrong <narmstrong@...libre.com>,
        Robert Foss <robert.foss@...aro.org>,
        Jernej Skrabec <jernej.skrabec@...il.com>
Cc:     Sean Paul <sean@...rly.run>, freedreno@...ts.freedesktop.org,
        Kyungmin Park <kyungmin.park@...sung.com>,
        linux-kernel@...r.kernel.org,
        Xinliang Liu <xinliang.liu@...aro.org>,
        Seung-Woo Kim <sw0312.kim@...sung.com>,
        Tian Tao <tiantao6@...ilicon.com>,
        Inki Dae <inki.dae@...sung.com>,
        linux-samsung-soc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        Rob Clark <robdclark@...il.com>,
        dri-devel@...ts.freedesktop.org,
        John Stultz <john.stultz@...aro.org>,
        Chen Feng <puck.chen@...ilicon.com>,
        Xinwei Kong <kong.kongxinwei@...ilicon.com>,
        Joonyoung Shim <jy0922.shim@...sung.com>
Subject: Re: [PATCH v4 24/24] drm/exynos: dsi: Adjust probe order


W dniu 10.09.2021 o 12:12, Maxime Ripard pisze:
> Without proper care and an agreement between how DSI hosts and devices
> drivers register their MIPI-DSI entities and potential components, we can
> end up in a situation where the drivers can never probe.
>
> Most drivers were taking evasive maneuvers to try to workaround this,
> but not all of them were following the same conventions, resulting in
> various incompatibilities between DSI hosts and devices.
>
> Now that we have a sequence agreed upon and documented, let's convert
> exynos to it.
>
> Signed-off-by: Maxime Ripard <maxime@...no.tech>

This patch should be dropped, as it will probably break the driver.

Exynos is already compatible with the pattern 
register-bus-then-get-sink, but it adds/removes panel/bridge 
dynamically, so it creates drm_device without waiting for downstream sink.


Regards

Andrzej


> ---
>   drivers/gpu/drm/exynos/exynos_drm_dsi.c | 19 ++++++++++++-------
>   1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> index e39fac889edc..dfda2b259c44 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> @@ -1529,6 +1529,7 @@ static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = {
>   
>   MODULE_DEVICE_TABLE(of, exynos_dsi_of_match);
>   
> +static const struct component_ops exynos_dsi_component_ops;
>   static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
>   				  struct mipi_dsi_device *device)
>   {
> @@ -1536,6 +1537,7 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
>   	struct drm_encoder *encoder = &dsi->encoder;
>   	struct drm_device *drm = encoder->dev;
>   	struct drm_bridge *out_bridge;
> +	struct device *dev = host->dev;
>   
>   	out_bridge  = of_drm_find_bridge(device->dev.of_node);
>   	if (out_bridge) {
> @@ -1585,7 +1587,7 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
>   	if (drm->mode_config.poll_enabled)
>   		drm_kms_helper_hotplug_event(drm);
>   
> -	return 0;
> +	return component_add(dev, &exynos_dsi_component_ops);
>   }
>   
>   static int exynos_dsi_host_detach(struct mipi_dsi_host *host,
> @@ -1593,6 +1595,9 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host,
>   {
>   	struct exynos_dsi *dsi = host_to_dsi(host);
>   	struct drm_device *drm = dsi->encoder.dev;
> +	struct device *dev = host->dev;
> +
> +	component_del(dev, &exynos_dsi_component_ops);
>   
>   	if (dsi->panel) {
>   		mutex_lock(&drm->mode_config.mutex);
> @@ -1716,7 +1721,7 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
>   		of_node_put(in_bridge_node);
>   	}
>   
> -	return mipi_dsi_host_register(&dsi->dsi_host);
> +	return 0;
>   }
>   
>   static void exynos_dsi_unbind(struct device *dev, struct device *master,
> @@ -1726,8 +1731,6 @@ static void exynos_dsi_unbind(struct device *dev, struct device *master,
>   	struct drm_encoder *encoder = &dsi->encoder;
>   
>   	exynos_dsi_disable(encoder);
> -
> -	mipi_dsi_host_unregister(&dsi->dsi_host);
>   }
>   
>   static const struct component_ops exynos_dsi_component_ops = {
> @@ -1821,7 +1824,7 @@ static int exynos_dsi_probe(struct platform_device *pdev)
>   
>   	pm_runtime_enable(dev);
>   
> -	ret = component_add(dev, &exynos_dsi_component_ops);
> +	ret = mipi_dsi_host_register(&dsi->dsi_host);
>   	if (ret)
>   		goto err_disable_runtime;
>   
> @@ -1835,10 +1838,12 @@ static int exynos_dsi_probe(struct platform_device *pdev)
>   
>   static int exynos_dsi_remove(struct platform_device *pdev)
>   {
> +	struct exynos_dsi *dsi = platform_get_drvdata(pdev);
> +
> +	mipi_dsi_host_unregister(&dsi->dsi_host);
> +
>   	pm_runtime_disable(&pdev->dev);
>   
> -	component_del(&pdev->dev, &exynos_dsi_component_ops);
> -
>   	return 0;
>   }
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ