* [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
@ 2019-08-02 8:32 Arnaud Patard
2019-08-02 14:43 ` Andrew Lunn
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Arnaud Patard @ 2019-08-02 8:32 UTC (permalink / raw)
To: netdev; +Cc: Andrew Lunn, Arnaud Patard
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;
}
- if (IS_ERR(dev->clk[i]))
- break;
- clk_prepare_enable(dev->clk[i]);
+ if (!IS_ERR(dev->clk[0]))
+ clk_prepare_enable(dev->clk[0]);
}
- 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");
dev->err_interrupt = platform_get_irq(pdev, 0);
if (dev->err_interrupt > 0 &&
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
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
2019-08-02 16:21 ` Arnaud Patard
2019-08-03 22:22 ` Andrew Lunn
2019-08-05 20:31 ` David Miller
2 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2019-08-02 14:43 UTC (permalink / raw)
To: Arnaud Patard; +Cc: netdev
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
2019-08-02 14:43 ` Andrew Lunn
@ 2019-08-02 16:21 ` Arnaud Patard
0 siblings, 0 replies; 9+ messages in thread
From: Arnaud Patard @ 2019-08-02 16:21 UTC (permalink / raw)
To: Andrew Lunn; +Cc: netdev
Andrew Lunn <andrew@lunn.ch> writes:
Hi,
> 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.
I was not sure if the else clause was needed or not so I only restored
similar behaviour to what was there before the commit 96cb4342382290c9.
By looking at the commit logs, the commit adding the clock support
3d604da1e9547c09 (net: mvmdio: get and enable optional clock) doesn't
mention the SoC names. So, I've no idea if it's needed or not.
Arnaud
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
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
@ 2019-08-03 22:22 ` Andrew Lunn
2019-08-05 20:31 ` David Miller
2 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2019-08-03 22:22 UTC (permalink / raw)
To: Arnaud Patard; +Cc: netdev
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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
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
2019-08-03 22:22 ` Andrew Lunn
@ 2019-08-05 20:31 ` David Miller
2 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-08-05 20:31 UTC (permalink / raw)
To: arnaud.patard; +Cc: netdev, andrew
From: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
Date: Fri, 02 Aug 2019 10:32:40 +0200
> 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>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
@ 2020-10-15 9:32 Arnaud Patard
2020-10-15 10:04 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: Arnaud Patard @ 2020-10-15 9:32 UTC (permalink / raw)
To: stable; +Cc: netdev, Andrew Lunn, David S. Miller
commit d934423ac26ed373dfe089734d505dca5ff679b6 upstream.
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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Index: linux/drivers/net/ethernet/marvell/mvmdio.c
===================================================================
--- linux.orig/drivers/net/ethernet/marvell/mvmdio.c
+++ linux/drivers/net/ethernet/marvell/mvmdio.c
@@ -319,15 +319,25 @@ 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]);
+ }
+ } else {
+ dev->clk[0] = clk_get(&pdev->dev, NULL);
+ if (PTR_ERR(dev->clk[0]) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
goto out_clk;
}
- if (IS_ERR(dev->clk[i]))
- break;
- clk_prepare_enable(dev->clk[i]);
+ if (!IS_ERR(dev->clk[0]))
+ clk_prepare_enable(dev->clk[0]);
}
dev->err_interrupt = platform_get_irq(pdev, 0);
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
2020-10-15 9:32 Arnaud Patard
@ 2020-10-15 10:04 ` Greg KH
2020-10-15 10:08 ` Arnaud Patard
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2020-10-15 10:04 UTC (permalink / raw)
To: Arnaud Patard; +Cc: stable, netdev, Andrew Lunn, David S. Miller
On Thu, Oct 15, 2020 at 11:32:15AM +0200, Arnaud Patard wrote:
> commit d934423ac26ed373dfe089734d505dca5ff679b6 upstream.
>
> 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>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
What stable tree(s) are you asking for this to be backported to?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
2020-10-15 10:04 ` Greg KH
@ 2020-10-15 10:08 ` Arnaud Patard
2020-10-16 8:01 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: Arnaud Patard @ 2020-10-15 10:08 UTC (permalink / raw)
To: Greg KH; +Cc: stable, netdev, Andrew Lunn, David S. Miller
Greg KH <gregkh@linuxfoundation.org> writes:
> On Thu, Oct 15, 2020 at 11:32:15AM +0200, Arnaud Patard wrote:
>> commit d934423ac26ed373dfe089734d505dca5ff679b6 upstream.
>>
>> 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>
>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>> Signed-off-by: David S. Miller <davem@davemloft.net>
>>
>
> What stable tree(s) are you asking for this to be backported to?
oops, forgot to put it in the mail subject. It's for 4.19.X, which is
used in Debian stable.
Arnaud
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch 1/1] drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case
2020-10-15 10:08 ` Arnaud Patard
@ 2020-10-16 8:01 ` Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2020-10-16 8:01 UTC (permalink / raw)
To: Arnaud Patard; +Cc: stable, netdev, Andrew Lunn, David S. Miller
On Thu, Oct 15, 2020 at 12:08:00PM +0200, Arnaud Patard wrote:
> Greg KH <gregkh@linuxfoundation.org> writes:
>
> > On Thu, Oct 15, 2020 at 11:32:15AM +0200, Arnaud Patard wrote:
> >> commit d934423ac26ed373dfe089734d505dca5ff679b6 upstream.
> >>
> >> 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>
> >> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> >> Signed-off-by: David S. Miller <davem@davemloft.net>
> >>
> >
> > What stable tree(s) are you asking for this to be backported to?
>
> oops, forgot to put it in the mail subject. It's for 4.19.X, which is
> used in Debian stable.
Also works on 4.14.y, so I've put it there as well.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-10-16 8:00 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).