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: <h47tqpveo7iitrz2luqifb7fidrhfv4o4rsivvb7bacbhj4qcg@xmamgxyfk3qr>
Date: Wed, 17 Apr 2024 13:20:07 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Herman van Hazendonk <github.com@...rie.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	"Rafael J. Wysocki" <rafael@...nel.org>, dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org, 
	Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH] component: Support masters with no subcomponents

On Wed, Apr 17, 2024 at 11:12:09AM +0200, Herman van Hazendonk wrote:
> This happens in the MSM DRM driver when it is used
> without any subcomponents, which is a special corner
> case.
> 
> If the MDP4 is used with nothing but the LVDS display,
> we get this problem that no components are found since
> the LVDS is part of the MDP4 itself.
> 
> We cannot use a NULL match, so create a dummy match
> with no components for this case so the driver will
> still probe nicely without adding a secondary
> complicated probe() path to the MSM DRM driver.
> 
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Herman van Hazendonk <github.com@...rie.org>
> ---
> This happens in the MSM DRM driver when it is used
> without any subcomponents, which is a special corner
> case.
> 
> If the MDP4 is used with nothing but the LVDS display,
> we get this problem that no components are found since
> the LVDS is part of the MDP4 itself.
> 
> We cannot use a NULL match, so create a dummy match
> with no components for this case so the driver will
> still probe nicely without adding a secondary
> complicated probe() path to the MSM DRM driver.
> ---
>  drivers/base/component.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/base/component.c b/drivers/base/component.c
> index 741497324d78..bb79e7a77bb0 100644
> --- a/drivers/base/component.c
> +++ b/drivers/base/component.c
> @@ -497,6 +497,10 @@ static void free_aggregate_device(struct aggregate_device *adev)
>  	kfree(adev);
>  }
>  
> +static struct component_match dummy_match = {
> +	.num = 0,
> +};

I think it's better to handle this in the MDP4 driver code.

Also note that LVDS / LCDC support should be fixed anyway. The DT needs
to pass LCDC clock (which it doesn't). apq8064 uses DSI2 clock after
reparenting it onto the LVDS clock generated by MDP4. Previous
generations should have a separate LCDC clock coming from MMCC.

> +
>  /**
>   * component_master_add_with_match - register an aggregate driver
>   * @parent: parent device of the aggregate driver
> @@ -516,6 +520,9 @@ int component_master_add_with_match(struct device *parent,
>  	struct aggregate_device *adev;
>  	int ret;
>  
> +	if (!match)
> +		match = &dummy_match;
> +
>  	/* Reallocate the match array for its true size */
>  	ret = component_match_realloc(match, match->num);
>  	if (ret)
> 
> ---
> base-commit: 96fca68c4fbf77a8185eb10f7557e23352732ea2
> change-id: 20240417-component-dummy-a9aae5ac7234
> 
> Best regards,
> -- 
> Herman van Hazendonk <github.com@...rie.org>
> 

-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ