Re: [PATCH 2/2] at803x: double check SGMII side autoneg

2017-06-01 Thread Zefir Kurtisi
Hello Timur, all, sorry for being late to chime in here, as Matthias said I have been AFK while this discussion took place. The related patch I committed is meant to double check that the SGMII side is done aneg when copper side is. Usually it does, but this expectation admittedly might fail in

Re: [PATCH net] at803x: insure minimum delay for SGMII link AN completion ckeck

2017-02-13 Thread Zefir Kurtisi
On 02/13/2017 02:15 PM, Claudiu Manoil wrote: >> -Original Message- >> From: Zefir Kurtisi [mailto:zefir.kurt...@neratec.com] >> Sent: Monday, February 13, 2017 12:16 PM >> To: Claudiu Manoil >> Cc: netdev@vger.kernel.org; David S. Miller ; Florian >>

Re: [PATCH net] at803x: insure minimum delay for SGMII link AN completion ckeck

2017-02-13 Thread Zefir Kurtisi
On 02/10/2017 05:42 PM, Claudiu Manoil wrote: > Commit: f62265b "at803x: double check SGMII side autoneg" > introduced a regression for the p1010rdb board which has > two of the ethernet controllers (eTSEC) connected through > SGMII links to external Atheros SGMII AR8033 PHYs. > The issue consists

Re: [PATCH 2/2] at803x: double check SGMII side autoneg

2017-01-20 Thread Zefir Kurtisi
On 01/20/2017 03:38 AM, Timur Tabi wrote: > Zefir Kurtisi wrote: >> It always operates at 675MHz, which with two lines gives 1.25Gbps, >> which at 10/8 coding gives exactly 1Gbps net data rate. If the >> at803x's copper side autonegotiates to 1Gbps, the bits traversing &

Re: [PATCH 2/2] at803x: double check SGMII side autoneg

2017-01-19 Thread Zefir Kurtisi
On 01/18/2017 04:02 PM, Timur Tabi wrote: > On 01/18/2017 07:53 AM, Zefir Kurtisi wrote: >> No, not necessarily. The SGMII link default configuration is set such that >> you do >> not have to bother at all. > > Does the SGMII link need to make the speed and

Re: [PATCH 2/2] at803x: double check SGMII side autoneg

2017-01-18 Thread Zefir Kurtisi
On 01/18/2017 02:13 PM, Timur Tabi wrote: > Zefir Kurtisi wrote: >> The fact that you see the warning means external autoneg completes before the >> SGMII side in best case or SGMII link remains down in worst case. > > So I'm no expert on this. Are you saying that

Re: [PATCH] net: add regs attribute to phy device for user diagnose

2017-01-18 Thread Zefir Kurtisi
r hand, having direct RW access to MDIO regs can ease your life greatly during bring-up / debugging of PHYs. Attached is a patch we are using to track down PHY problems at register level, not for integrating into the kernel but as a handy tool for developers. Cheers, Zefir >From f90fced08ca60

Re: [PATCH 2/2] at803x: double check SGMII side autoneg

2017-01-18 Thread Zefir Kurtisi
On 01/18/2017 12:32 AM, Timur Tabi wrote: > On 10/24/2016 05:40 AM, Zefir Kurtisi wrote: >> As a result, if you ever see a warning >> '803x_aneg_done: SGMII link is not ok' you will >> end up having an Ethernet link up but won't get >> any data thro

Re: Setting link down or up in software

2017-01-18 Thread Zefir Kurtisi
On 01/13/2017 06:35 PM, Mason wrote: > On 13/01/2017 17:28, Zefir Kurtisi wrote: > >> As for your specific problem: since I fought myself with the PHY/ETH >> subsystems >> over the past months, I might remember something relevant to your issue. >> Could you >&g

Re: Setting link down or up in software

2017-01-13 Thread Zefir Kurtisi
On 01/13/2017 04:17 PM, Mason wrote: > On 13/01/2017 10:20, Zefir Kurtisi wrote: >> On 01/12/2017 04:16 PM, Mason wrote: >>> On 12/01/2017 14:05, Mason wrote: >>> >>>> I'm wondering what are the semantics of calling >>>> >>>>

Re: Setting link down or up in software

2017-01-13 Thread Zefir Kurtisi
On 01/12/2017 04:16 PM, Mason wrote: > On 12/01/2017 14:05, Mason wrote: > >> I'm wondering what are the semantics of calling >> >> ip link set dev eth0 down >> >> I was expecting that to somehow instruct the device's ethernet driver >> to shut everything down, have the PHY tell the peer that

Re: Correct method for initializing Pause and Asymmetrical Pause support in phy drivers

2017-01-12 Thread Zefir Kurtisi
On 01/12/2017 04:21 PM, Marc Bertola wrote: > Hello netdev list, > > I am currently investigating a problem related to Ethernet > auto-negotiation of Pause and Asymmetrical Pause capabilities. > > TL;DR: I am using a Picozed system-on-module with a Xilinx Gigabit > Ethernet MAC and a Marvell PHY.

[PATCH v2] phy state machine: failsafe leave invalid RUNNING state

2017-01-06 Thread Zefir Kurtisi
. Signed-off-by: Zefir Kurtisi --- Changes to v1: * fix kbuild test robot error: use phydev_err instead of dev_warn (adapt to changed struct phy_device after 4.4.21) --- drivers/net/phy/phy.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/ph

Re: [PATCH] phy state machine: failsafe leave invalid RUNNING state

2017-01-05 Thread Zefir Kurtisi
On 01/04/2017 10:44 PM, Florian Fainelli wrote: > On 01/04/2017 08:10 AM, Zefir Kurtisi wrote: >> On 01/04/2017 04:30 PM, Florian Fainelli wrote: >>> >>> >>> On 01/04/2017 07:27 AM, Zefir Kurtisi wrote: >>>> On 01/04/2017 04:13 PM, Florian Fainelli

Re: [PATCH] phy state machine: failsafe leave invalid RUNNING state

2017-01-04 Thread Zefir Kurtisi
On 01/04/2017 04:30 PM, Florian Fainelli wrote: > > > On 01/04/2017 07:27 AM, Zefir Kurtisi wrote: >> On 01/04/2017 04:13 PM, Florian Fainelli wrote: >>> >>> >>> On 01/04/2017 07:04 AM, Zefir Kurtisi wrote: >>>> While in RUNNING

Re: [PATCH] phy state machine: failsafe leave invalid RUNNING state

2017-01-04 Thread Zefir Kurtisi
On 01/04/2017 04:13 PM, Florian Fainelli wrote: > > > On 01/04/2017 07:04 AM, Zefir Kurtisi wrote: >> While in RUNNING state, phy_state_machine() checks for link changes by >> comparing phydev->link before and after calling phy_read_status(). >> This works as long a

[PATCH] phy state machine: failsafe leave invalid RUNNING state

2017-01-04 Thread Zefir Kurtisi
. Signed-off-by: Zefir Kurtisi --- drivers/net/phy/phy.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 28548af..0f9a61e 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -966,6 +966,15 @@ void phy_state_machi

Re: [patch net / RFC] net: fec: increase frame size limitation to actually available buffer

2016-11-30 Thread Zefir Kurtisi
On 11/29/2016 07:35 PM, Nikita Yushchenko wrote: > Fec driver uses Rx buffers of 2k, but programs hardware to limit > incoming frames to 1522 bytes. This raises issues when FEC device > is used with DSA (since DSA tag can make frame larger), and also > disallows manual sending and receiving larger

Re: [PATCH 2/2] at803x: double check SGMII side autoneg

2016-11-01 Thread Zefir Kurtisi
On 10/29/2016 12:24 AM, Timur Tabi wrote: > Zefir Kurtisi wrote: >> +/* check if the SGMII link is OK. */ >> +if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) { >> +pr_warn("803x_aneg_done: SGMII link is not ok\n"); >>

Re: [PATCH 0/2] at803x: don't power-down SGMII link

2016-10-27 Thread Zefir Kurtisi
On 10/25/2016 07:31 PM, Timur Tabi wrote: > Zefir Kurtisi wrote: >> In a device where the ar8031 operates in SGMII mode, we >> observed that after a suspend-resume cycle in very rare >> cases the copper side autonegotiation secceeds but the >> SGMII side fails to come up

[PATCH 0/2] at803x: don't power-down SGMII link

2016-10-24 Thread Zefir Kurtisi
this series provides an alternative handling: * the first patch reverts the prvious fix that powers down SGMII * the second patch adds double-checking for the observed failure condition Zefir Kurtisi (2): Revert "at803x: fix suspend/resume for SGMII link" at803x: double check SGM

[PATCH 2/2] at803x: double check SGMII side autoneg

2016-10-24 Thread Zefir Kurtisi
e. As a result, if you ever see a warning '803x_aneg_done: SGMII link is not ok' you will end up having an Ethernet link up but won't get any data through. This should not happen, if it does, please contact the module maintainer. Signed-off-by: Zefir Kurtisi --- drivers/n

[PATCH 1/2] Revert "at803x: fix suspend/resume for SGMII link"

2016-10-24 Thread Zefir Kurtisi
This reverts commit 98267311fe3b334ae7c107fa0e2413adcf3ba735. Suspending the SGMII alongside the copper side made the at803x inaccessable while powered down, e.g. it can't be re-probed after suspend. Signed-off-by: Zefir Kurtisi --- drivers/net/phy/at803x.c | 26

Re: Need help with mdiobus_register and phy

2016-10-21 Thread Zefir Kurtisi
On 10/20/2016 02:55 PM, Zefir Kurtisi wrote: > [...] > > Now the interesting (and new for me) part is: if I remove the at803x driver > from > the system and use the generic phy instead, the problem does not happen (or at > least not while running for one full day). [...] >

Re: Need help with mdiobus_register and phy

2016-10-20 Thread Zefir Kurtisi
On 10/19/2016 02:16 PM, Timur Tabi wrote: > Zefir Kurtisi wrote: >> Ok then, if you can wait some days, I'll prepare and provide you a more >> detailed >> failure report to allow you testing if the issue happens with other NICs. > > That sounds great. > I

Re: Need help with mdiobus_register and phy

2016-10-19 Thread Zefir Kurtisi
On 10/18/2016 02:40 PM, Timur Tabi wrote: > Zefir Kurtisi wrote: > >>> I have never seen the original problem that you noticed. When I use the >>> generic >>> phy driver instead of the at803x driver, everything works great for me. >>> Perhaps >>

Re: Need help with mdiobus_register and phy

2016-10-18 Thread Zefir Kurtisi
On 10/17/2016 10:53 PM, Timur Tabi wrote: > Zefir Kurtisi wrote: >> Anyway, since the SGMII reset is required, instead of reverting the patch in >> full >> I suggest to move the SGMII power down from at803x_suspend() and do a SerDes >> power >> cycle in at803x_r

Re: Need help with mdiobus_register and phy

2016-10-17 Thread Zefir Kurtisi
izing a suspended PHY fails. Instead of powering down SerDes at suspend(), leave it as is and power-cycle it on resume(). Signed-off-by: Zefir Kurtisi --- drivers/net/phy/at803x.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/net/phy/at803x.c b/driv

[PATCH v2] gianfar: prevent fragmentation in DSA environments

2016-08-22 Thread Zefir Kurtisi
buffer size by 8 and rounds up to the next multiple of 64, which the hardware's defines as RX buffer granularity. Signed-off-by: Zefir Kurtisi --- drivers/net/ethernet/freescale/gianfar.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Changes to v1: * used roundup() for b

[PATCH v2] gianfar: fix size of scatter-gathered frames

2016-08-22 Thread Zefir Kurtisi
e size of the last fragment. It was tested by setting MRBLR to different multiples of 64, proving correct scatter-gather operation on frames with up to 9000 octets in size. Signed-off-by: Zefir Kurtisi --- drivers/net/ethernet/freescale/gianfar.c | 20 ++-- 1 file changed, 1

Re: [PATCH] gianfar: prevent fragmentation in DSA environments

2016-08-22 Thread Zefir Kurtisi
On 08/19/2016 11:45 PM, Andrew Lunn wrote: >> Nice improvement. > > Thanks > >> But what's so special about 8? > > When talking to Marvell Switch chips, there are two different headers > which can be added. The DSA header is 4 bytes, and the EDSA header is > 8 bytes. However, if there is already

Re: [PATCH] gianfar: fix size of fragmented frames

2016-08-22 Thread Zefir Kurtisi
Hi Claudiu, On 08/19/2016 11:12 PM, Claudiu Manoil wrote: > Hi Zefir, > > [sorry if the message indentation is wrong ... webmail] > > > From: Zefir Kurtisi > Sent: Friday, August 19, 2016 8:11 PM > To: Claudiu Manoil > Subject: Re: [PATCH] gianfar: fix size of fr

Re: [PATCH] gianfar: prevent fragmentation in DSA environments

2016-08-19 Thread Zefir Kurtisi
On 08/19/2016 04:59 PM, Andrew Lunn wrote: > On Fri, Aug 19, 2016 at 11:16:14AM +0200, Zefir Kurtisi wrote: >> The eTSEC register MRBLR defines the maximum space in >> the RX buffers and is set to 1536 by gianfar. This >> reasonably covers the common use case where the MTU

[PATCH] gianfar: prevent fragmentation in DSA environments

2016-08-19 Thread Zefir Kurtisi
-off-by: Zefir Kurtisi --- drivers/net/ethernet/freescale/gianfar.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index 373fd09..02b794b 100644 --- a/drivers/net/ethernet/freescale

[PATCH] gianfar: fix size of fragmented frames

2016-08-19 Thread Zefir Kurtisi
This patch fixes the problem by adjusting the size of the last fragment. Signed-off-by: Zefir Kurtisi --- drivers/net/ethernet/freescale/gianfar.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/ne

Re: [PATCH -next] bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict

2016-03-14 Thread Zefir Kurtisi
On 03/12/2016 11:14 AM, Florian Westphal wrote: > Zefir Kurtisi reported kernel panic with an openwrt specific patch. > However, it turns out that mainline has a similar bug waiting to happen. > > Once NF_HOOK() returns the skb is in undefined state and must not be > used. Mor

[PATCH] at803x: fix suspend/resume for SGMII link

2016-03-11 Thread Zefir Kurtisi
ensures that power down handling in supspend() and resume() is also applied to the SGMII link. Signed-off-by: Zefir Kurtisi --- drivers/net/phy/at803x.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 2174ec9