Re: [PATCH net-next v3 2/2] net: phy: at803x: disable delay only for RGMII mode

2019-02-19 Thread Marc Gonzalez
On 19/02/2019 13:33, Niklas Cassel wrote: > However, since the bootloader might have enabled delay on > TX, I still think that this patch does the right thing by > starting out with disabling delays for both RX and TX. > > But we should probably make the comment more elaborate: > > The value aft

Re: [PATCH net-next v3 2/2] net: phy: at803x: disable delay only for RGMII mode

2019-02-19 Thread Marc Gonzalez
On 19/02/2019 07:18, Vinod Koul wrote: > Per "Documentation/devicetree/bindings/net/ethernet.txt" RGMII mode > should not have delay in PHY whereas RGMII_ID and RGMII_RXID/RGMII_TXID > can have delay in phy. PHY or phy? :-) > So disable the delay only for RGMII mode and enable for other modes. >

Re: [PATCH net-next v3 1/2] net: phy: at803x: don't inline helpers

2019-02-19 Thread Marc Gonzalez
ct phy_device *phydev) > { > return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, >AT803X_DEBUG_TX_CLK_DLY_EN, 0); Reviewed-by: Marc Gonzalez

Re: [PATCH] net: phy: at803x: disable delay only for RGMII mode

2019-02-14 Thread Marc Gonzalez
On 14/02/2019 17:38, David Miller wrote: > From: Vinod Koul > Date: Tue, 12 Feb 2019 19:49:22 +0530 > >> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c >> index 8ff12938ab47..7b54b54e3316 100644 >> --- a/drivers/net/phy/at803x.c >> +++ b/drivers/net/phy/at803x.c >> @@ -110,6 +1

Re: [PATCH] net: phy: at803x: disable delay only for RGMII mode

2019-02-13 Thread Marc Gonzalez
On 13/02/2019 14:29, Andrew Lunn wrote: >> So we have these modes: >> >> PHY_INTERFACE_MODE_RGMII: TX and RX delays disabled >> PHY_INTERFACE_MODE_RGMII_ID: TX and RX delays enabled >> PHY_INTERFACE_MODE_RGMII_RXID: RX delay enabled, TX delay disabled >> PHY_INTERFACE_MODE_RGMII_TXID: TX delay ena

Re: [v3,4/5] net: phy: at803x: Disable phy delay for RGMII mode

2019-02-12 Thread Marc Gonzalez
On 12/02/2019 11:55, Peter Ujfalusi wrote: > On 21/01/2019 11.13, Vinod Koul wrote: > >> For RGMII mode, phy delay should be disabled. Add this case along >> with disable delay routines. > > In next-20190211 I need to revert this patch to get cpsw networking > to work on am335x-evmsk. The board

Re: [RFC net-next 4/4] net: phy: Correctly process PHY_HALTED in phy_stop_machine()

2017-12-04 Thread Marc Gonzalez
On 27/11/2017 08:48, Geert Uytterhoeven wrote: > The MDIO bus callback is not called from the network device ... > >>> smsc hangs of [fec1.bus, which is started only here ---> >>> >>> Workqueue: events_power_efficient phy_state_machine >>> [] (unwind_backtrace) from [] (show_stack+0x1

Re: [PATCH v3 3/4] net: nb8800: Move HW init to ndo_open()

2017-11-16 Thread Marc Gonzalez
On 16/11/2017 17:23, Andrew Lunn wrote: > Maybe take a look at your memory barriers. Most accesses using the > _relaxed() version, i.e, no barrier. And then there are specific > barriers when needed. One could be missing. > > As a quick test, drop the _relaxed. Force a barrier with each > access.

Re: [PATCH v3 3/4] net: nb8800: Move HW init to ndo_open()

2017-11-16 Thread Marc Gonzalez
On 15/11/2017 17:15, Marc Gonzalez wrote: > Given the out-of-order datagrams, I'm wondering if it's possible > for the DMA engine to overwrite a not-yet-read descriptor? > > The EOC flag should stop the DMA engine though... > > Maybe some kind of race... > &g

Re: [PATCH v3 3/4] net: nb8800: Move HW init to ndo_open()

2017-11-15 Thread Marc Gonzalez
On 15/11/2017 16:11, Måns Rullgård wrote: > Well, that's not good. I'll see if I can replicate it later this week. In my latest test, I started from v4.14 and only applied the following patch: diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index e94159

Re: [PATCH v3 2/4] net: nb8800: Simplify nb8800_pause_config()

2017-11-15 Thread Marc Gonzalez
On 15/11/2017 16:03, Andrew Lunn wrote: > On Wed, Nov 15, 2017 at 03:33:47PM +0100, Marc Gonzalez wrote: > >> On 15/11/2017 15:17, Andrew Lunn wrote: >> >> In our local branch, I have completely disabled flow control support, >> so I don't have to worry

Re: [PATCH v3 3/4] net: nb8800: Move HW init to ndo_open()

2017-11-15 Thread Marc Gonzalez
On 14/11/2017 17:55, Måns Rullgård wrote: > Marc Gonzalez wrote: > >> I will run iperf3 tests with RX_DESC_COUNT lowered to 2. >> Would that produce conclusive results? >> Do you have other suggestions? > > Leave RX_DESC_COUNT alone but add a delay in the nb8

Re: [PATCH v3 2/4] net: nb8800: Simplify nb8800_pause_config()

2017-11-15 Thread Marc Gonzalez
On 15/11/2017 15:17, Andrew Lunn wrote: > nb8800_link_reconfigure() can be called whenever the link to the peer > changes. auto-neg may happen later because the cable was not plugged > in until later, etc. Hello Andrew, AFAICS, Mans was right: trying to toggle the flow control bit when the RX DM

Re: [PATCH v3 2/4] net: nb8800: Simplify nb8800_pause_config()

2017-11-15 Thread Marc Gonzalez
On 14/11/2017 14:22, Måns Rullgård wrote: > Marc Gonzalez wrote: > >> On 14/11/2017 13:38, Måns Rullgård wrote: >> >>> Marc Gonzalez writes: >>> >>>> The "flow control enable" bit can be tweaked, even if DMA is enabled. >>> >

Re: [PATCH v3 4/4] net: nb8800: Add support for suspend/resume

2017-11-14 Thread Marc Gonzalez
On 14/11/2017 17:31, Andrew Lunn wrote: > On Tue, Nov 14, 2017 at 03:22:04PM +0100, Marc Gonzalez wrote: > >> On 14/11/2017 14:02, Måns Rullgård wrote: >> >>> Missing patch description. Don't bother though. I won't approve of >>> this implementati

Re: [PATCH v3 3/4] net: nb8800: Move HW init to ndo_open()

2017-11-14 Thread Marc Gonzalez
On 14/11/2017 17:55, Måns Rullgård wrote: > Marc Gonzalez wrote: > >> On 14/11/2017 14:54, Måns Rullgård wrote: >> >>> The hack originated from your company. >> >> So why are you so insistent that we keep using it? > > Because it's the o

Re: [PATCH v3 3/4] net: nb8800: Move HW init to ndo_open()

2017-11-14 Thread Marc Gonzalez
On 14/11/2017 14:54, Måns Rullgård wrote: > Marc Gonzalez writes: > >> On 14/11/2017 13:40, Måns Rullgård wrote: >> >>> Marc Gonzalez wrote: >>> >>>> Power entire ethernet block down in ndo_stop(). >>>> Power it back up in

Re: [PATCH v3 4/4] net: nb8800: Add support for suspend/resume

2017-11-14 Thread Marc Gonzalez
On 14/11/2017 14:02, Måns Rullgård wrote: > Missing patch description. Don't bother though. I won't approve of > this implementation. I hope I can convince David that you should not have veto power over this driver just because it was you who submitted it upstream first. Per the copyright noti

Re: [PATCH v3 3/4] net: nb8800: Move HW init to ndo_open()

2017-11-14 Thread Marc Gonzalez
On 14/11/2017 13:40, Måns Rullgård wrote: > Marc Gonzalez wrote: > >> Power entire ethernet block down in ndo_stop(). >> Power it back up in ndo_open() and perform HW init. >> Delete nb8800_dma_stop. > > Leave it alone, please. Not all chips might have a separate

Re: [PATCH v3 2/4] net: nb8800: Simplify nb8800_pause_config()

2017-11-14 Thread Marc Gonzalez
On 14/11/2017 13:38, Måns Rullgård wrote: > Marc Gonzalez writes: > >> The "flow control enable" bit can be tweaked, even if DMA is enabled. > > No, it can't. Maybe on some of your newer chips it can, but not on the > older ones. Again, I suppose you are r

Re: [PATCH v3 1/4] net: nb8800: Drop generic support

2017-11-14 Thread Marc Gonzalez
On 14/11/2017 13:37, Måns Rullgård wrote: > Marc Gonzalez writes: > >> According to our HW dev, there is no provision for software to safely >> disable RX DMA in the AU-NB8800 hardware block (ethernet DMA). Thus, >> it is the responsibility of the SoC designer t

[PATCH v3 1/4] net: nb8800: Drop generic support

2017-11-14 Thread Marc Gonzalez
, but it breaks the DMA state machine in rare cases. Therefore, let's drop generic support. FWIW, tango chips provide a reset register. When the ethernet block comes out of reset, DMA is disabled. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 3 --- 1 file chang

[PATCH v3 3/4] net: nb8800: Move HW init to ndo_open()

2017-11-14 Thread Marc Gonzalez
Power entire ethernet block down in ndo_stop(). Power it back up in ndo_open() and perform HW init. Delete nb8800_dma_stop. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 146 +-- drivers/net/ethernet/aurora/nb8800.h | 4 +- 2 files

[PATCH v3 4/4] net: nb8800: Add support for suspend/resume

2017-11-14 Thread Marc Gonzalez
Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index b71d8fb80610..9af2423aed03 100644 --- a/drivers/net/ethernet/aurora

[PATCH v3 2/4] net: nb8800: Simplify nb8800_pause_config()

2017-11-14 Thread Marc Gonzalez
The "flow control enable" bit can be tweaked, even if DMA is enabled. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ether

[PATCH v3 0/4] Various nb8800 tweaks

2017-11-14 Thread Marc Gonzalez
annel is idle - the Enable bit in it is "0". Marc Gonzalez (4): net: nb8800: Drop generic support net: nb8800: Simplify nb8800_pause_config() net: nb8800: Move HW init to ndo_open() net: nb8800: Add support for suspend/resume drivers/net/e

Re: [RFC net-next 0/4] net: phy: PHY_HALTED, the return of the state

2017-10-30 Thread Marc Gonzalez
On 26/10/2017 01:21, Florian Fainelli wrote: > This patch series tries to address the shortcomings of the previously and then > quickly reverted commit 7ad813f208533cebfcc32d3d7474dc1677d1b09a ("net: phy: > Correctly process PHY_HALTED in phy_stop_machine()") > > This time, the empire returns and

Re: [PATCH net] Revert "net: phy: Correctly process PHY_HALTED in phy_stop_machine()"

2017-08-31 Thread Marc Gonzalez
On 31/08/2017 14:29, Marc Gonzalez wrote: > On 31/08/2017 02:49, Florian Fainelli wrote: > >> The original motivation for this change originated from Marc Gonzalez >> indicating that his network driver did not have its adjust_link callback >> executing with phyde

Re: [PATCH net] Revert "net: phy: Correctly process PHY_HALTED in phy_stop_machine()"

2017-08-31 Thread Marc Gonzalez
On 31/08/2017 02:49, Florian Fainelli wrote: > This reverts commit 7ad813f208533cebfcc32d3d7474dc1677d1b09a ("net: phy: > Correctly process PHY_HALTED in phy_stop_machine()") because it is > creating the possibility for a NULL pointer dereference. > > David Daney provide the following call trace

Re: [PATCH net v2] net: phy: Correctly process PHY_HALTED in phy_stop_machine()

2017-07-28 Thread Marc Gonzalez
> adjust_link() function. > > Reported-by: Marc Gonzalez > Fixes: a390d1f379cf ("phylib: convert state_queue work to delayed_work") > Signed-off-by: Florian Fainelli > --- > Changes in v2: > > - reword subject and commit message based on changes > - dr

Re: [RFC PATCH v1] net: ethernet: nb8800: Reset HW block in ndo_open

2017-07-28 Thread Marc Gonzalez
On 28/07/2017 18:17, Måns Rullgård wrote: > Marc Gonzalez wrote: > >> ndo_stop breaks RX in a way that ndo_open is unable to undo. > > Please elaborate. Why can't it be fixed in a less heavy-handed way? I'm not sure what "elaborate" means. After we'v

[RFC PATCH v1] net: ethernet: nb8800: Reset HW block in ndo_open

2017-07-28 Thread Marc Gonzalez
ndo_stop breaks RX in a way that ndo_open is unable to undo. Work around the issue by resetting the HW in ndo_open. This will provide the basis for suspend/resume support. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 40 +--- drivers

[PATCH v3] ARM: dts: tango4: Request RGMII RX and TX clock delays

2017-07-28 Thread Marc Gonzalez
RX and TX clock delays are required. Request them explicitly. Fixes: cad008b8a77e6 ("ARM: dts: tango4: Initial device trees") Signed-off-by: Marc Gonzalez --- Arnd, Kevin, Olof, can one of you take this patch through arm-soc? Greg will apply it to all stable branches, right? --- arc

[PATCH v2] net: phy: Log only PHY state transitions

2017-07-28 Thread Marc Gonzalez
In the current code, old and new PHY states are always logged. >From now on, log only PHY state transitions. Signed-off-by: Marc Gonzalez --- Fix indentation. I was trying to minimize the diff. I also considered using a goto to jump over the phydev_dbg() call, but that didn't fe

Re: [PATCH net] net: phy: Run state machine to completion

2017-07-28 Thread Marc Gonzalez
and let it run to completion. We also need to have > a synchronous call to phy_state_machine() in order to have the state > machine actually act on PHY_HALTED, set the PHY device's link down, turn > the network device's carrier off and finally call the adjust_link() > function. &

[PATCH v3] net: ethernet: nb8800: Handle all 4 RGMII modes identically

2017-07-25 Thread Marc Gonzalez
s attached. In the interim, this driver will handle all 4 RGMII modes identically (no skew). Fixes: 52dfc8301248 ("net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller") Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 9 - 1 file changed

[PATCH] net: phy: Log only PHY state transitions

2017-07-25 Thread Marc Gonzalez
In the current code, old and new PHY states are always logged. >From now on, log only PHY state transitions. Signed-off-by: Marc Gonzalez --- drivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c in

[PATCH] net: phy: Remove trailing semicolon in macro definition

2017-07-25 Thread Marc Gonzalez
Commit e5a03bfd873c2 ("phy: Add an mdio_device structure") introduced a spurious trailing semicolon. Remove it. Signed-off-by: Marc Gonzalez --- include/linux/phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/phy.h b/include/linux/phy.h index 2a

Re: [PATCH v2 1/4] net: phy: at803x: Document RGMII RX and TX clock delay issues

2017-07-21 Thread Marc Gonzalez
On 21/07/2017 16:06, Timur Tabi wrote: > On 7/21/17 8:29 AM, Marc Gonzalez wrote: > >> I don't understand what you're saying. >> >> It is a correct observation that the code enabling >> RGMII RX clock delay is a NOP, since that bit will >> always be

Re: [PATCH v2 3/4] net: ethernet: nb8800: Fix RGMII TX clock delay setup

2017-07-21 Thread Marc Gonzalez
On 21/07/2017 15:47, Måns Rullgård wrote: > Marc Gonzalez wrote: > >> On 21/07/2017 15:04, Måns Rullgård wrote: >> >>> Marc Gonzalez wrote: >>> >>>> According to commit e5f3a4a56ce2a707b2fb8ce37e4414dcac89c672 >>>> ("Documentati

Re: [PATCH v2 3/4] net: ethernet: nb8800: Fix RGMII TX clock delay setup

2017-07-21 Thread Marc Gonzalez
On 21/07/2017 15:04, Måns Rullgård wrote: > Marc Gonzalez wrote: > >> According to commit e5f3a4a56ce2a707b2fb8ce37e4414dcac89c672 >> ("Documentation: devicetree: clarify usage of the RGMII phy-modes") >> there are 4 RGMII modes to handle: >> >>

Re: [PATCH v2 1/4] net: phy: at803x: Document RGMII RX and TX clock delay issues

2017-07-21 Thread Marc Gonzalez
On 21/07/2017 15:20, Timur Tabi wrote: > On 7/21/17 6:25 AM, Marc Gonzalez wrote: > >> + * NB: This code assumes that RGMII RX clock delay is disabled >> + * at reset, but actually, RX clock delay is enabled at reset. > > Could we change this to say, "RX cl

Re: [PATCH v2 0/4] RGMII RX and TX clock delays using Atheros 8035

2017-07-21 Thread Marc Gonzalez
On 21/07/2017 14:47, Marc Gonzalez wrote: > fping caps at 1000 packets per second, which limits > its usefulness as a benchmarking tool. "Normal" ping is slightly faster (5000 packets per second). time ping -f -c 6 -s 1450 -q 172.27.64.1 --- 172.27.64.1 ping statistics -

Re: [PATCH v2 0/4] RGMII RX and TX clock delays using Atheros 8035

2017-07-21 Thread Marc Gonzalez
On 21/07/2017 13:22, Marc Gonzalez wrote: > Changes from v1 > - Drop support for disabling RX and TX clock delays > (it breaks some boards). Document the issues instead. > - Split the MAC patch in two unrelated parts > - Fix the vantage 1172 DTS > > Marc Gonzalez (4):

[PATCH v2 3/4] net: ethernet: nb8800: Fix RGMII TX clock delay setup

2017-07-21 Thread Marc Gonzalez
the MAC should not add an TX delay in this case) Add TX delay in the MAC only for rgmii and rgmii-rxid. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/aurora/nb88

[PATCH v2 1/4] net: phy: at803x: Document RGMII RX and TX clock delay issues

2017-07-21 Thread Marc Gonzalez
s TX clock delay, it will remain enabled at reset in Linux. Signed-off-by: Marc Gonzalez --- drivers/net/phy/at803x.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index c1e52b9dc58d..7a0954513b91 100644 --- a/drivers/net/ph

[PATCH v2 2/4] net: ethernet: nb8800: Set RGMII_MODE for all RGMII modes

2017-07-21 Thread Marc Gonzalez
There are 4 RGMII phy-modes to handle. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index 041cfb7952f8..ded041dbafe7 100644

[PATCH v2 0/4] RGMII RX and TX clock delays using Atheros 8035

2017-07-21 Thread Marc Gonzalez
Changes from v1 - Drop support for disabling RX and TX clock delays (it breaks some boards). Document the issues instead. - Split the MAC patch in two unrelated parts - Fix the vantage 1172 DTS Marc Gonzalez (4): net: phy: at803x: Document RGMII RX and TX clock delay issues net: ethernet

[PATCH v2 4/4] ARM: dts: tango4: Add RGMII RX and TX clock delays

2017-07-21 Thread Marc Gonzalez
RX and TX clock delays are required. Signed-off-by: Marc Gonzalez --- arch/arm/boot/dts/tango4-vantage-1172.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/tango4-vantage-1172.dts b/arch/arm/boot/dts/tango4-vantage-1172.dts index 86d8df98802f

[PATCH 0/2] Atheros 803x PHY RGMII clock delays

2017-07-19 Thread Marc Gonzalez
These patches address the quirks of the Atheros PHY, with respect to RGMII RX and TX clock delays. Once the PHY driver is fixed, the second patch fixes the ethernet controller used on tango boards. Marc Gonzalez (2): net: phy: at803x: Fix RGMII RX and TX clock delays setup net: ethernet

[PATCH 2/2] net: ethernet: nb8800: Fix RGMII TX clock delay setup

2017-07-19 Thread Marc Gonzalez
PHY, the MAC should not add an TX delay in this case) Let the MAC handle TX clock delay for rgmii and rgmii-rxid. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/auror

[PATCH 1/2] net: phy: at803x: Fix RGMII RX and TX clock delays setup

2017-07-19 Thread Marc Gonzalez
s TX clock delay, it will remain enabled at reset in Linux. Provide disable functions to configure the RGMII clock delays exactly as specified in the fwspec. Signed-off-by: Marc Gonzalez --- drivers/net/phy/at803x.c | 32 1 file changed, 24 insertions(+), 8 deletion