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]
Date:   Tue, 05 Oct 2021 11:34:07 +0200
From:   Philipp Zabel <p.zabel@...gutronix.de>
To:     Paweł Anikiel <pan@...ihalf.com>,
        miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
        robh+dt@...nel.org, arnd@...db.de, olof@...om.net, soc@...nel.org,
        dinguyen@...nel.org
Cc:     linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        tn@...ihalf.com, ka@...ihalf.com, jam@...ihalf.com
Subject: Re: [PATCH 3/3] reset: socfpga: add empty driver allowing consumers
 to probe

Hi Paweł,

On Mon, 2021-09-20 at 14:41 +0200, Paweł Anikiel wrote:
> The early reset driver doesn't ever probe, which causes consuming
> devices to be unable to probe. Add an empty driver to set this device
> as available, allowing consumers to probe.
> 
> Signed-off-by: Paweł Anikiel <pan@...ihalf.com>
> ---
>  drivers/reset/reset-socfpga.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c
> index 2a72f861f798..8c6492e5693c 100644
> --- a/drivers/reset/reset-socfpga.c
> +++ b/drivers/reset/reset-socfpga.c
> @@ -92,3 +92,29 @@ void __init socfpga_reset_init(void)
>  	for_each_matching_node(np, socfpga_early_reset_dt_ids)
>  		a10_reset_init(np);
>  }
> +
> +/*
> + * The early driver is problematic, because it doesn't register
> + * itself as a driver. This causes certain device links to prevent
> + * consumer devices from probing. The hacky solution is to register
> + * an empty driver, whose only job is to attach itself to the reset
> + * manager and call probe.
> + */
> +static const struct of_device_id socfpga_reset_dt_ids[] = {
> +	{ .compatible = "altr,rst-mgr", },
> +	{ /* sentinel */ },
> +};
> +
> +static int reset_simple_probe(struct platform_device *pdev)
> +{
> +	return 0;
> +}
> +
> +static struct platform_driver reset_socfpga_driver = {
> +	.probe	= reset_simple_probe,
> +	.driver = {
> +		.name		= "socfpga-reset",
> +		.of_match_table	= socfpga_reset_dt_ids,
> +	},
> +};
> +builtin_platform_driver(reset_socfpga_driver);

If we can just let devlink delay all consumers until the empty driver is
probed, does the reset controller have to be registered early at all?

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ