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: <400023013d9b53b0f4647909387d844f1a959d09.camel@suse.de>
Date:   Fri, 05 Jun 2020 14:49:25 +0200
From:   Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To:     Maxime Ripard <maxime@...no.tech>
Cc:     Tim Gover <tim.gover@...pberrypi.com>,
        Dave Stevenson <dave.stevenson@...pberrypi.com>,
        linux-kernel@...r.kernel.org,
        bcm-kernel-feedback-list@...adcom.com,
        linux-rpi-kernel@...ts.infradead.org,
        Phil Elwell <phil@...pberrypi.com>,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 22/25] clk: bcm: rpi: Give firmware clocks a name

On Wed, 2020-05-27 at 17:45 +0200, Maxime Ripard wrote:
> We've registered the firmware clocks using their ID as name, but it's much
> more convenient to register them using their proper name. Since the
> firmware doesn't provide it, we have to duplicate it.
> 
> Signed-off-by: Maxime Ripard <maxime@...no.tech>
> ---
>  drivers/clk/bcm/clk-raspberrypi.c | 25 ++++++++++++++++++++++---
>  1 file changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-
> raspberrypi.c
> index 8d3acf3ee053..cee634cb5323 100644
> --- a/drivers/clk/bcm/clk-raspberrypi.c
> +++ b/drivers/clk/bcm/clk-raspberrypi.c
> @@ -36,6 +36,23 @@ enum rpi_firmware_clk_id {
>  	RPI_FIRMWARE_NUM_CLK_ID,
>  };
>  
> +static char *rpi_firmware_clk_names[] = {
> +	[RPI_FIRMWARE_EMMC_CLK_ID]	= "emmc",
> +	[RPI_FIRMWARE_UART_CLK_ID]	= "uart",
> +	[RPI_FIRMWARE_ARM_CLK_ID]	= "arm",
> +	[RPI_FIRMWARE_CORE_CLK_ID]	= "core",
> +	[RPI_FIRMWARE_V3D_CLK_ID]	= "v3d",
> +	[RPI_FIRMWARE_H264_CLK_ID]	= "h264",
> +	[RPI_FIRMWARE_ISP_CLK_ID]	= "isp",
> +	[RPI_FIRMWARE_SDRAM_CLK_ID]	= "sdram",
> +	[RPI_FIRMWARE_PIXEL_CLK_ID]	= "pixel",
> +	[RPI_FIRMWARE_PWM_CLK_ID]	= "pwm",
> +	[RPI_FIRMWARE_HEVC_CLK_ID]	= "hevc",
> +	[RPI_FIRMWARE_EMMC2_CLK_ID]	= "emmc2",
> +	[RPI_FIRMWARE_M2MC_CLK_ID]	= "m2mc",
> +	[RPI_FIRMWARE_PIXEL_BVB_CLK_ID]	= "pixel-bvb",
> +};
> +
>  #define RPI_FIRMWARE_STATE_ENABLE_BIT	BIT(0)
>  #define RPI_FIRMWARE_STATE_WAIT_BIT	BIT(1)
>  
> @@ -343,7 +360,9 @@ static struct clk_hw *raspberrypi_clk_register(struct
> raspberrypi_clk *rpi,
>  	data->rpi = rpi;
>  	data->id = id;
>  
> -	init.name = devm_kasprintf(rpi->dev, GFP_KERNEL, "fw-clk-%u", id);
> +	init.name = devm_kasprintf(rpi->dev, GFP_KERNEL,
> +				   "fw-clk-%s",
> +				   rpi_firmware_clk_names[id]);
>  	init.ops = &raspberrypi_firmware_clk_ops;
>  	init.flags = CLK_GET_RATE_NOCACHE;
>  
> @@ -367,8 +386,8 @@ static struct clk_hw *raspberrypi_clk_register(struct
> raspberrypi_clk *rpi,
>  		return ERR_PTR(ret);
>  	}
>  
> -	dev_info(rpi->dev, "Clock %d frequency range: min %u, max %u\n",
> -		 id, min_rate, max_rate);
> +	dev_info(rpi->dev, "Clock %s frequency range: min %u, max %u\n",
> +		 rpi_firmware_clk_names[id], min_rate, max_rate);

I belive this might change. Otherwise:

Acked-by: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>

Regards,
Nicolas


Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ