lkml.org 
[lkml]   [2021]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 2/2] hwrng: bcm2835: add reset support
From
Date
Hi Álvaro,

On Wed, 2021-02-24 at 09:22 +0100, Álvaro Fernández Rojas wrote:
[...]
> @@ -115,6 +121,8 @@ static void bcm2835_rng_cleanup(struct hwrng *rng)
> /* disable rng hardware */
> rng_writel(priv, 0, RNG_CTRL);
>
> + reset_control_rearm(priv->reset);
> +
> if (!IS_ERR(priv->clk))
> clk_disable_unprepare(priv->clk);
> }
> @@ -159,6 +167,10 @@ static int bcm2835_rng_probe(struct platform_device *pdev)
> if (PTR_ERR(priv->clk) == -EPROBE_DEFER)
> return -EPROBE_DEFER;
>
> + priv->reset = devm_reset_control_get_optional_exclusive(dev, NULL);
> + if (IS_ERR(priv->reset))
> + return PTR_ERR(priv->reset);
> +
> priv->rng.name = pdev->name;
> priv->rng.init = bcm2835_rng_init;
> priv->rng.read = bcm2835_rng_read;

That doesn't seem right. reset_control_rearm() doesn't do anything if
the reset control is exclusive. Either the reset control should be
requested as shared, or the _rearm should be removed.

regards
Philipp

\
 
 \ /
  Last update: 2021-03-03 19:10    [W:0.332 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site