public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn•ch>
To: Arnaud Patard <arnaud.patard@rtp-net•org>
Cc: netdev@vger•kernel.org
Subject: Re: [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
Date: Fri, 2 Aug 2019 16:43:53 +0200	[thread overview]
Message-ID: <20190802144353.GG2099@lunn.ch> (raw)
In-Reply-To: <20190802083310.772136040@rtp-net.org>

On Fri, Aug 02, 2019 at 10:32:40AM +0200, Arnaud Patard wrote:
> Orion5.x systems are still using machine files and not device-tree.
> Commit 96cb4342382290c9 ("net: mvmdio: allow up to three clocks to be
> specified for orion-mdio") has replaced devm_clk_get() with of_clk_get(),
> leading to a oops at boot and not working network, as reported in 
> https://lists.debian.org/debian-arm/2019/07/msg00088.html and possibly in
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908712.
> 
> Link: https://lists.debian.org/debian-arm/2019/07/msg00088.html
> Fixes: 96cb4342382290c9 ("net: mvmdio: allow up to three clocks to be specified for orion-mdio")
> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net•org>
> Index: linux-next/drivers/net/ethernet/marvell/mvmdio.c
> ===================================================================
> --- linux-next.orig/drivers/net/ethernet/marvell/mvmdio.c
> +++ linux-next/drivers/net/ethernet/marvell/mvmdio.c
> @@ -319,20 +319,33 @@ static int orion_mdio_probe(struct platf
>  
>  	init_waitqueue_head(&dev->smi_busy_wait);
>  
> -	for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
> -		dev->clk[i] = of_clk_get(pdev->dev.of_node, i);
> -		if (PTR_ERR(dev->clk[i]) == -EPROBE_DEFER) {
> +	if (pdev->dev.of_node) {
> +		for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
> +			dev->clk[i] = of_clk_get(pdev->dev.of_node, i);
> +			if (PTR_ERR(dev->clk[i]) == -EPROBE_DEFER) {
> +				ret = -EPROBE_DEFER;
> +				goto out_clk;
> +			}
> +			if (IS_ERR(dev->clk[i]))
> +				break;
> +			clk_prepare_enable(dev->clk[i]);
> +		}
> +
> +		if (!IS_ERR(of_clk_get(pdev->dev.of_node,
> +				       ARRAY_SIZE(dev->clk))))
> +			dev_warn(&pdev->dev,
> +				 "unsupported number of clocks, limiting to the first "
> +				 __stringify(ARRAY_SIZE(dev->clk)) "\n");
> +	} else {
> +		dev->clk[0] = clk_get(&pdev->dev, NULL);
> +		if (PTR_ERR(dev->clk[0]) == -EPROBE_DEFER) {
>  			ret = -EPROBE_DEFER;
>  			goto out_clk;
>  		}

Hi Arnaud

It is a long time since i looked at Orion5x. Is this else clause even
needed? If my memory is right, i don't think it needs to enable tclk?
It was kirkwood which first added gateable clocks. And all kirkwood
boards are not DT.

Thanks
	Andrew

  reply	other threads:[~2019-08-02 14:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02  8:32 [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case Arnaud Patard
2019-08-02 14:43 ` Andrew Lunn [this message]
2019-08-02 16:21   ` Arnaud Patard
2019-08-03 22:22 ` Andrew Lunn
2019-08-05 20:31 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2020-10-15  9:32 Arnaud Patard
2020-10-15 10:04 ` Greg KH
2020-10-15 10:08   ` Arnaud Patard
2020-10-16  8:01     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190802144353.GG2099@lunn.ch \
    --to=andrew@lunn$(echo .)ch \
    --cc=arnaud.patard@rtp-net$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox