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: <1738891.e3IbIVKTtj@diego>
Date:   Sun, 21 Nov 2021 19:00:55 +0100
From:   Heiko Stübner <heiko@...ech.de>
To:     linux-i2c@...r.kernel.org, John Keeping <john@...anate.com>
Cc:     John Keeping <john@...anate.com>,
        linux-arm-kernel@...ts.infradead.org,
        linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: rk3x: enable clock before getting rate

Am Montag, 4. Oktober 2021, 15:15:39 CET schrieb John Keeping:
> clk_get_rate() is documented as requiring the clock to be enabled.
> Ensure that the bus clock is enabled before calling clk_get_rate() in
> rk3x_i2c_probe() to satisfy this requirement.
> 
> Signed-off-by: John Keeping <john@...anate.com>

Reviewed-by: Heiko Stuebner <heiko@...ech.de>

Do you maybe want to repost and include the actual i2c-maintainers
in the recipient list?


Heiko

> ---
>  drivers/i2c/busses/i2c-rk3x.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> index 819ab4ee517e..332755fab2a1 100644
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -1338,8 +1338,15 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
>  		goto err_pclk;
>  	}
>  
> +	ret = clk_enable(i2c->clk);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "Can't enable bus clk: %d\n", ret);
> +		goto err_clk_notifier;
> +	}
> +
>  	clk_rate = clk_get_rate(i2c->clk);
>  	rk3x_i2c_adapt_div(i2c, clk_rate);
> +	clk_disable(i2c->clk);
>  
>  	ret = i2c_add_adapter(&i2c->adap);
>  	if (ret < 0)
> 




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ