[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190706160925.GI4428@lunn.ch>
Date: Sat, 6 Jul 2019 18:09:25 +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 3/4] net: mvmdio: print warning when orion-mdio has too
many clocks
On Sat, Jul 06, 2019 at 05:18:59PM +0200, josua@...id-run.com wrote:
> From: Josua Mayer <josua@...id-run.com>
>
> Print a warning when device tree specifies more than the maximum of four
> clocks supported by orion-mdio. Because reading from mdio can lock up
> the Armada 8k when a required clock is not initialized, it is important
> to notify the user when a specified clock is ignored.
>
> Signed-off-by: Josua Mayer <josua@...id-run.com>
> ---
> drivers/net/ethernet/marvell/mvmdio.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
> index e17d563e97a6..89a99bf8e87b 100644
> --- a/drivers/net/ethernet/marvell/mvmdio.c
> +++ b/drivers/net/ethernet/marvell/mvmdio.c
> @@ -326,6 +326,10 @@ static int orion_mdio_probe(struct platform_device *pdev)
> clk_prepare_enable(dev->clk[i]);
> }
>
> + if (!IS_ERR(of_clk_get(pdev->dev.of_node, i)))
> + dev_warn(dev, "unsupported number of clocks, limiting to the first "
> + __stringify(ARRAY_SIZE(dev->clk)) "\n");
> +
Hi Josua
Humm. Say getting clock 0 returned -EINVAL, or some other error code.
We break out of the loop, since such errors are being ignored. We then
hit this new code. Getting clock 1 works, and then we incorrectly
print this message.
Rather than getting the i'th clock, get ARRAY_SIZE(dev->clk)'th clock.
Andrew
Powered by blists - more mailing lists