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: <20190706155428.GG4428@lunn.ch>
Date:   Sat, 6 Jul 2019 17:54:28 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     josua@...id-run.com
Cc:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH 4/4] net: mvmdio: defer probe of orion-mdio if a clock is
 not ready

On Sat, Jul 06, 2019 at 05:19:00PM +0200, josua@...id-run.com wrote:
> From: Josua Mayer <josua@...id-run.com>
> 
> Defer probing of the orion-mdio interface when enabling of either of the
> clocks defer probing.

Hi Josua

I'm having trouble parsing that sentence.

How about:

Defer probing of the orion-mdio interface when getting a clock returns
EPROBE_DEFER.

Otherwise:

Reviewed-by: Andrew Lunn <andrew@...n.ch>

    Andrew




 This avoids locking up the Armada 8k SoC when mdio
> is used before all clocks have been enabled.
> 
> Signed-off-by: Josua Mayer <josua@...id-run.com>
> ---
>  drivers/net/ethernet/marvell/mvmdio.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
> index 89a99bf8e87b..1034013426ad 100644
> --- a/drivers/net/ethernet/marvell/mvmdio.c
> +++ b/drivers/net/ethernet/marvell/mvmdio.c
> @@ -321,6 +321,10 @@ static int orion_mdio_probe(struct platform_device *pdev)
>  
>  	for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
>  		dev->clk[i] = of_clk_get(pdev->dev.of_node, i);
> +		if (dev->clk[i] == PTR_ERR(-EPROBE_DEFER)) {
> +			ret = -EPROBE_DEFER;
> +			goto out_clk;
> +		}
>  		if (IS_ERR(dev->clk[i]))
>  			break;
>  		clk_prepare_enable(dev->clk[i]);
> @@ -366,6 +370,7 @@ static int orion_mdio_probe(struct platform_device *pdev)
>  	if (dev->err_interrupt > 0)
>  		writel(0, dev->regs + MVMDIO_ERR_INT_MASK);
>  
> +out_clk:
>  	for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
>  		if (IS_ERR(dev->clk[i]))
>  			break;
> -- 
> 2.16.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ