2016-03-17 09:42:14

by Alexey Brodkin

[permalink] [raw]
Subject: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

Following commit broke DW GMAC functionality on AXS10x boards:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e34d65696d2ef13dc32f2a162556c86c461ed763

That's what happens on eth0 up:
--------------------------->8------------------------
libphy: PHY stmmac-0:ffffffff not found
eth0: Could not attach to PHY
stmmac_open: Cannot attach to PHY (error: -19)
--------------------------->8------------------------

Simplest solution is to add PHY description in board's .dts.
And so we do here.

Signed-off-by: Alexey Brodkin <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Phil Reid <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected] # 4.5.x
Cc: Sergei Shtylyov <[email protected]>
---

Changes v1 -> v2:
* PHY node name changed to match real PHY number being used (Sergei)

arch/arc/boot/dts/axs10x_mb.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index 44a578c..ab5d570 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -47,6 +47,14 @@
clocks = <&apbclk>;
clock-names = "stmmaceth";
max-speed = <100>;
+ mdio0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "snps,dwmac-mdio";
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
};

ehci@0x40000 {
--
2.5.0


2016-03-17 10:58:28

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

On 3/17/2016 12:41 PM, Alexey Brodkin wrote:

> Following commit broke DW GMAC functionality on AXS10x boards:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e34d65696d2ef13dc32f2a162556c86c461ed763

Note that scripts/checkpatch.pl now enforces certain format for citing
commits: commit <12-digit SHA1> ("<commit summary>").

[...]

MBR, Sergei

2016-03-17 11:13:55

by Vineet Gupta

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

On Thursday 17 March 2016 04:28 PM, Sergei Shtylyov wrote:
> On 3/17/2016 12:41 PM, Alexey Brodkin wrote:
>
>> > Following commit broke DW GMAC functionality on AXS10x boards:
>> > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e34d65696d2ef13dc32f2a162556c86c461ed763
> Note that scripts/checkpatch.pl now enforces certain format for citing
> commits: commit <12-digit SHA1> ("<commit summary>").
>
> [...]
>
> MBR, Sergei

Indeed - I've fixed this up and added to arc for-curr !

-Vineet

2016-03-17 11:38:08

by Alexey Brodkin

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

Hi Sergei,

On Thu, 2016-03-17 at 13:58 +-0300, Sergei Shtylyov wrote:
+AD4- On 3/17/2016 12:41 PM, Alexey Brodkin wrote:
+AD4-
+AD4- +AD4-
+AD4- +AD4- Following commit broke DW GMAC functionality on AXS10x boards:
+AD4- +AD4- http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id+AD0-e34d65696d2ef13dc32f2a162556c86c461ed763
+AD4- +AKAAoACgAKA-Note that scripts/checkpatch.pl now enforces certain format for citing+AKA-
+AD4- commits: commit +ADw-12-digit SHA1+AD4- (+ACIAPA-commit summary+AD4AIg-).

Frankly I haven't run that patch through checkpatch due to patch
simplicity.

But I'll try to not do any assumptions from now on and will try to
use checkpatch for each and every thing I send :)

Thanks for spotting all his+ACE-

-Alexey

2016-03-17 11:41:35

by Vineet Gupta

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

On Thursday 17 March 2016 05:08 PM, Alexey Brodkin wrote:
> Hi Sergei,
>
> On Thu, 2016-03-17 at 13:58 +0300, Sergei Shtylyov wrote:
>> On 3/17/2016 12:41 PM, Alexey Brodkin wrote:
>>
>>> Following commit broke DW GMAC functionality on AXS10x boards:
>>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e34d65696d2ef13dc32f2a162556c86c461ed763
>> Note that scripts/checkpatch.pl now enforces certain format for citing
>> commits: commit <12-digit SHA1> ("<commit summary>").
> Frankly I haven't run that patch through checkpatch due to patch
> simplicity.
>
> But I'll try to not do any assumptions from now on and will try to
> use checkpatch for each and every thing I send :)
>
> Thanks for spotting all his!
>
> -Alexey

Sergei, do you mind providing a Ack/Reviewed-by on the patch below

-------->
>From 67216d835d8c2a5748ba1631c8bfc19da4fb87fa Mon Sep 17 00:00:00 2001
From: Alexey Brodkin <[email protected]>
Date: Thu, 17 Mar 2016 12:41:52 +0300
Subject: [PATCH] ARC: axs10x - add Ethernet PHY description in .dts

Commit e34d65696d2e ("stmmac: create of compatible mdio bus for stmmac
driver") broke DW GMAC functionality on ARC AXS10x boards:

That's what happens on eth0 up:
--------------------------->8------------------------
| libphy: PHY stmmac-0:ffffffff not found
| eth0: Could not attach to PHY
| stmmac_open: Cannot attach to PHY (error: -19)
--------------------------->8------------------------

Simplest solution is to add PHY description in board's .dts.
And so we do here.

Signed-off-by: Alexey Brodkin <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Phil Reid <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected] # 4.5
Cc: Sergei Shtylyov <[email protected]>
Signed-off-by: Vineet Gupta <[email protected]>
---
arch/arc/boot/dts/axs10x_mb.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index 44a578c10732..ab5d5701e11d 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -47,6 +47,14 @@
clocks = <&apbclk>;
clock-names = "stmmaceth";
max-speed = <100>;
+ mdio0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "snps,dwmac-mdio";
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
};

ehci@0x40000 {
--
2.5.0

2016-03-17 11:59:16

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

Hello.

On 3/17/2016 2:41 PM, Vineet Gupta wrote:

>>>> Following commit broke DW GMAC functionality on AXS10x boards:
>>>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e34d65696d2ef13dc32f2a162556c86c461ed763
>>> Note that scripts/checkpatch.pl now enforces certain format for citing
>>> commits: commit <12-digit SHA1> ("<commit summary>").

>> Frankly I haven't run that patch through checkpatch due to patch
>> simplicity.
>>
>> But I'll try to not do any assumptions from now on and will try to
>> use checkpatch for each and every thing I send :)
>>
>> Thanks for spotting all his!
>>

Sorry for not reporting everything on the 1st review.

>> -Alexey
>
> Sergei, do you mind providing a Ack/Reviewed-by on the patch below
>

Reviewed-by: Sergei Shtylyov <[email protected]>

The patch here is white space damaged however: tabs were converted to
spaces. :-(

MBR, Sergei

2016-03-17 12:10:45

by Alexey Brodkin

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

Hi Sergei,

On Thu, 2016-03-17 at 14:59 +-0300, Sergei Shtylyov wrote:
+AD4- Hello.
+AD4-
+AD4- On 3/17/2016 2:41 PM, Vineet Gupta wrote:
+AD4-
+AD4- +AD4-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- +AD4- +AD4- Following commit broke DW GMAC functionality on AXS10x boards:
+AD4- +AD4- +AD4- +AD4- +AD4- http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id+AD0-e34d65696d2ef13dc32f2a162556c86c461e
+AD4- +AD4- +AD4- +AD4- +AD4- d763
+AD4- +AD4- +AD4- +AD4- +AKAAoACgAKAAoA-Note that scripts/checkpatch.pl now enforces certain format for citing
+AD4- +AD4- +AD4- +AD4- commits: commit +ADw-12-digit SHA1+AD4- (+ACIAPA-commit summary+AD4AIg-).
+AD4- +AD4-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- Frankly I haven't run that patch through checkpatch due to patch
+AD4- +AD4- +AD4- simplicity.
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- But I'll try to not do any assumptions from now on and will try to
+AD4- +AD4- +AD4- use checkpatch for each and every thing I send :)
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- Thanks for spotting all his+ACE-
+AD4- +AD4- +AD4-
+AD4- +AKAAoACgAKA-Sorry for not reporting everything on the 1st review.
+AD4-
+AD4- +AD4-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- -Alexey
+AD4- +AD4- Sergei, do you mind providing a Ack/Reviewed-by on the patch below
+AD4- +AKAAPg-
+AD4-
+AD4- Reviewed-by: Sergei Shtylyov +ADw-sergei.shtylyov+AEA-cogentembedded.com+AD4-
+AD4-
+AD4- +AKAAoACgAKA-The patch here is white space damaged however: tabs were converted to+AKA-
+AD4- spaces. :-(

Well, I'm not really sure why that substitution happened because my local patch
is indeed with tabs.

That's an output of checkpatch:
------------------------+AD4-8------------------------
./scripts/checkpatch.pl 0001-ARC-axs10x-add-Ethernet-PHY-description-in-.dts.patch+AKA-
+AFs-1+AF0AKwCgAKA-Done+AKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoA-gedit 0001-ARC-axs10x-add-Ethernet-PHY-description-in-.dts.patch
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
+ACM-7:+AKA-
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id+AD0-e34d65696d2ef13dc32f2a162556c86c461ed763

ERROR: Please use git commit description style 'commit +ADw-12+- chars of sha1+AD4- (+ACIAPA-title line+AD4AIg-)' - ie: 'commit e34d65696d2e
(+ACI-stmmac: create of compatible mdio bus for stmmac driver+ACI-)'
+ACM-7:+AKA-
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id+AD0-e34d65696d2ef13dc32f2a162556c86c461ed763

total: 1 errors, 1 warnings, 14 lines checked

0001-ARC-axs10x-add-Ethernet-PHY-description-in-.dts.patch has style problems, please review.
------------------------+AD4-8------------------------

If there were spaces we would see tons of:
------------------------+AD4-8------------------------
ERROR: code indent should use tabs where possible
+ACM-43: FILE: arch/arc/boot/dts/axs10x+AF8-mb.dtsi:50:
+-+AKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACg-mdio0 +AHsAJA-
------------------------+AD4-8------------------------
which I didn't see.

-Alexey

2016-03-17 12:16:19

by Vineet Gupta

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

On Thursday 17 March 2016 05:29 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 3/17/2016 2:41 PM, Vineet Gupta wrote:
>
>>>>> >>>> Following commit broke DW GMAC functionality on AXS10x boards:
>>>>> >>>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e34d65696d2ef13dc32f2a162556c86c461ed763
>>>> >>> Note that scripts/checkpatch.pl now enforces certain format for citing
>>>> >>> commits: commit <12-digit SHA1> ("<commit summary>").
>>> >> Frankly I haven't run that patch through checkpatch due to patch
>>> >> simplicity.
>>> >>
>>> >> But I'll try to not do any assumptions from now on and will try to
>>> >> use checkpatch for each and every thing I send :)
>>> >>
>>> >> Thanks for spotting all his!
>>> >>
> Sorry for not reporting everything on the 1st review.
>
>>> >> -Alexey
>> >
>> > Sergei, do you mind providing a Ack/Reviewed-by on the patch below
> >
>
> Reviewed-by: Sergei Shtylyov <[email protected]>

Thx.

> The patch here is white space damaged however: tabs were converted to
> spaces. :-(
>
> MBR, Sergei


That was just because of copy-paste into mailer before switching to plain-text.
Don't ask - corporate email !
I added it just to give u an idea of what fixup i did.

Tx,
-Vineet

2016-04-06 09:15:19

by Vineet Gupta

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

Hi,

On Thursday 17 March 2016 03:11 PM, Alexey Brodkin wrote:
> Following commit broke DW GMAC functionality on AXS10x boards:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e34d65696d2ef13dc32f2a162556c86c461ed763
>
> That's what happens on eth0 up:
> --------------------------->8------------------------
> libphy: PHY stmmac-0:ffffffff not found
> eth0: Could not attach to PHY
> stmmac_open: Cannot attach to PHY (error: -19)
> --------------------------->8------------------------
>
> Simplest solution is to add PHY description in board's .dts.
> And so we do here.
>
> Signed-off-by: Alexey Brodkin <[email protected]>
> Cc: Rob Herring <[email protected]>
> Cc: Phil Reid <[email protected]>
> Cc: David S. Miller <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected] # 4.5.x
> Cc: Sergei Shtylyov <[email protected]>
> ---
>
> Changes v1 -> v2:
> * PHY node name changed to match real PHY number being used (Sergei)
>
> arch/arc/boot/dts/axs10x_mb.dtsi | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
> index 44a578c..ab5d570 100644
> --- a/arch/arc/boot/dts/axs10x_mb.dtsi
> +++ b/arch/arc/boot/dts/axs10x_mb.dtsi
> @@ -47,6 +47,14 @@
> clocks = <&apbclk>;
> clock-names = "stmmaceth";
> max-speed = <100>;
> + mdio0 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + compatible = "snps,dwmac-mdio";
> + phy1: ethernet-phy@1 {
> + reg = <1>;
> + };
> + };
> };
>
> ehci@0x40000 {


So above DT fix for ARC went into 4.6-rc1 and ethernet was still broken on axs103
board.

---------->8-------------
libphy: PHY stmmac-0:ffffffff not found
eth0: Could not attach to PHY
stmmac_open: Cannot attach to PHY (error: -19)
---------->8-------------

On 4.6-rc2 if I revert the DT change, ethernet works again.

@Giuseppe, @Phil, @Gabriel, I see you have made changes in that area. I presume
that above revert is the right/sufficient thing or do we need to do something else
as well.

TIA,
-Vineet

2016-04-06 14:57:38

by Peppe CAVALLARO

[permalink] [raw]
Subject: Re: [PATCH v2] ARC: axs10x - add Ethernet PHY description in .dts

On 4/6/2016 11:12 AM, Vineet Gupta wrote:
> Hi,
>
> On Thursday 17 March 2016 03:11 PM, Alexey Brodkin wrote:
>> Following commit broke DW GMAC functionality on AXS10x boards:
>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e34d65696d2ef13dc32f2a162556c86c461ed763
>>
>> That's what happens on eth0 up:
>> --------------------------->8------------------------
>> libphy: PHY stmmac-0:ffffffff not found
>> eth0: Could not attach to PHY
>> stmmac_open: Cannot attach to PHY (error: -19)
>> --------------------------->8------------------------
>>
>> Simplest solution is to add PHY description in board's .dts.
>> And so we do here.
>>
>> Signed-off-by: Alexey Brodkin <[email protected]>
>> Cc: Rob Herring <[email protected]>
>> Cc: Phil Reid <[email protected]>
>> Cc: David S. Miller <[email protected]>
>> Cc: [email protected]
>> Cc: [email protected]
>> Cc: [email protected] # 4.5.x
>> Cc: Sergei Shtylyov <[email protected]>
>> ---
>>
>> Changes v1 -> v2:
>> * PHY node name changed to match real PHY number being used (Sergei)
>>
>> arch/arc/boot/dts/axs10x_mb.dtsi | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
>> index 44a578c..ab5d570 100644
>> --- a/arch/arc/boot/dts/axs10x_mb.dtsi
>> +++ b/arch/arc/boot/dts/axs10x_mb.dtsi
>> @@ -47,6 +47,14 @@
>> clocks = <&apbclk>;
>> clock-names = "stmmaceth";
>> max-speed = <100>;
>> + mdio0 {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + compatible = "snps,dwmac-mdio";
>> + phy1: ethernet-phy@1 {
>> + reg = <1>;
>> + };
>> + };
>> };
>>
>> ehci@0x40000 {
>
>
> So above DT fix for ARC went into 4.6-rc1 and ethernet was still broken on axs103
> board.
>
> ---------->8-------------
> libphy: PHY stmmac-0:ffffffff not found
> eth0: Could not attach to PHY
> stmmac_open: Cannot attach to PHY (error: -19)
> ---------->8-------------
>
> On 4.6-rc2 if I revert the DT change, ethernet works again.
>
> @Giuseppe, @Phil, @Gabriel, I see you have made changes in that area. I presume
> that above revert is the right/sufficient thing or do we need to do something else
> as well.

hmm I think so, we pushed all the changes in net-next to fix the MDIO
initialization according to the different DT parameter settings. So
unless there is some other case to cover, I think that the best
approach is to do the revert.

pls, let me know

peppe

>
> TIA,
> -Vineet
>
>