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: <ab774af1-1599-46ff-843e-6333a55a97a3@nxp.com>
Date: Fri, 12 Apr 2024 12:49:50 +0000
From: Horia Geanta <horia.geanta@....com>
To: Pankaj Gupta <pankaj.gupta@....com>, Gaurav Jain <gaurav.jain@....com>,
	Varun Sethi <V.Sethi@....com>, "herbert@...dor.apana.org.au"
	<herbert@...dor.apana.org.au>, "davem@...emloft.net" <davem@...emloft.net>,
	Iuliana Prodan <iuliana.prodan@....com>, "linux-crypto@...r.kernel.org"
	<linux-crypto@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, dl-linux-imx <linux-imx@....com>, Francesco
 Dolcini <francesco@...cini.it>
Subject: Re: [PATCH v2] caam: init-clk based on caam-page0-access

On 4/10/2024 11:00 AM, Pankaj Gupta wrote:
> CAAM clock initialization to be done based on, soc specific
> info stored in struct caam_imx_data:
> - caam-page0-access flag
> - num_clks
> 
[...]
> +static const struct caam_imx_data caam_imx8ulp_data = {
> +	.page0_access = false,
> +	.clks = NULL,
> +	.num_clks = 0,
> +};
Not needed, an empty static struct would do.

>  static const struct soc_device_attribute caam_imx_soc_table[] = {
>  	{ .soc_id = "i.MX6UL", .data = &caam_imx6ul_data },
>  	{ .soc_id = "i.MX6*",  .data = &caam_imx6_data },
>  	{ .soc_id = "i.MX7*",  .data = &caam_imx7_data },
>  	{ .soc_id = "i.MX8M*", .data = &caam_imx7_data },
> +	{ .soc_id = "i.MX8ULP", .data = &caam_imx8ulp_data },
>  	{ .soc_id = "VF*",     .data = &caam_vf610_data },
>  	{ .family = "Freescale i.MX" },
>  	{ /* sentinel */ }
As Francesco pointed out in v1, this change is not related.

Ideally, adding support for i.MX8ULP SoC should be done in a separate patch,
explaining a bit the particularities - similar to the commit message here:
https://github.com/nxp-imx/linux-imx/commit/d420f224ee02c164f6bdb3c8bbb5ec5827eaba37

> @@ -889,7 +902,15 @@ static int caam_probe(struct platform_device *pdev)
>  
>  		reg_access = !ctrlpriv->optee_en;
>  
> -		if (!imx_soc_match->data) {
> +		if (imx_soc_match->data) {
> +			imx_soc_data = imx_soc_match->data;
> +			reg_access = reg_access && imx_soc_data->page0_access;
> +			/*
> +			 * CAAM clocks cannot be controlled from kernel.
> +			 */
> +			if (!imx_soc_data->num_clks)
> +				goto iomap_ctrl;
> +		} else {
>  			dev_err(dev, "No clock data provided for i.MX SoC");
>  			return -EINVAL;
>  		}
if/else could be avoided, making code simpler:

	if (!imx_soc_match->data) {
		dev_err(dev, "No clock data provided for i.MX SoC");
		return -EINVAL;
	}

	imx_soc_data = imx_soc_match->data;
	reg_access = reg_access && imx_soc_data->page0_access;
	/* CAAM clocks cannot be controlled from kernel. */
	if (!imx_soc_data->num_clks)
		goto iomap_ctrl;

Regards,
Horia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ