Re: [PATCH] qca8k: enable port flow control

2019-07-19 Thread Niklas Cassel
On Fri, Jul 19, 2019 at 10:53:11AM +0800, xiaofeis wrote: > Set phy device advertising to enable MAC flow control. > > Change-Id: Ibf0f554b072fc73136ec9f7ffb90c20b25a4faae > Signed-off-by: Xiaofei Shen > --- > drivers/net/dsa/qca8k.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >

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

2019-02-19 Thread Niklas Cassel
have delay in phy. > > PHY or phy? :-) > > > So disable the delay only for RGMII mode and enable for other modes. > > Also treat the default case as disabled delays. > > > > Fixes: cd28d1d6e52e: ("net: phy: at803x: Disable phy delay for RGMII mode") &

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

2019-02-18 Thread Niklas Cassel
; 0) > - return ret; > + if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || > + phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { > + /* If RGMII_ID or RGMII_TXID are specified enable TX delay, > + * otherwise keep it disabled > + */ > + ret = at803x_enable_tx_delay(phydev); > } > > - return 0; > + return ret; > } > > static int at803x_ack_interrupt(struct phy_device *phydev) > -- > 2.20.1 > Reviewed-by: Niklas Cassel

Re: [PATCH v2 1/2] net: phy: at803x: dont inline helpers

2019-02-18 Thread Niklas Cassel
delay(struct phy_device *phydev) > { > return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, > AT803X_DEBUG_TX_CLK_DLY_EN, 0); > -- > 2.20.1 > Reviewed-by: Niklas Cassel

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

2019-02-14 Thread Niklas Cassel
On Thu, Feb 14, 2019 at 03:22:28PM +0200, Peter Ujfalusi wrote: > Hi Niklas, > > On 14/02/2019 14.39, Niklas Cassel wrote: > >>> So, I've rebased your old patch, see attachment. > >>> I suggest that Peter test it on am335x-evm. > >> > >&

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

2019-02-14 Thread Niklas Cassel
On Thu, Feb 14, 2019 at 12:49:36PM +0200, Peter Ujfalusi wrote: > Hi Niklas, > > On 13/02/2019 19.40, Niklas Cassel wrote: > > On Wed, Feb 13, 2019 at 02:40:18PM +0100, Marc Gonzalez wrote: > >> On 13/02/2019 14:29, Andrew Lunn wrote: > >&

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

2019-02-13 Thread Niklas Cassel
On Wed, Feb 13, 2019 at 09:59:43AM -0800, Florian Fainelli wrote: > On 2/13/19 9:40 AM, Niklas Cassel wrote: > > On Wed, Feb 13, 2019 at 02:40:18PM +0100, Marc Gonzalez wrote: > >> On 13/02/2019 14:29, Andrew Lunn wrote: > >> > >>>> So we have these mod

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

2019-02-13 Thread Niklas Cassel
Thus, if the bootloader enables 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. Fixes: cd28d1d6e52e: ("net: phy: at803x: Disable phy delay for RGMII mode") Reported-by: Peter

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

2019-02-13 Thread Niklas Cassel
On Tue, Feb 12, 2019 at 07:49:22PM +0530, 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. > > So disable the delay only for RGMII mode and disable for other mo

Re: [PATCH net 0/3] net: stmmac: Misc fixes

2019-02-05 Thread Niklas Cassel
On Wed, Jan 30, 2019 at 03:54:18PM +0100, Jose Abreu wrote: > > Some misc fixes for stmmac targeting -net. > > Cc: Joao Pinto > Cc: David S. Miller > Cc: Giuseppe Cavallaro > Cc: Alexandre Torgue > > Jose Abreu (3): > net: stmmac: Fallback to Platform Data clock in Watchdog conversion >

Re: Request for stable backport: stmmac: Use correct values in TQS/RQS fields

2019-01-29 Thread Niklas Cassel
Adding stable since I see Greg's Sign-off-by on recent backports to this driver. On Wed, Dec 19, 2018 at 10:55:16AM +0100, Niklas Cassel wrote: > Hello David, > > I can observe a netdev watchdog timeout on kernel 4.14.78 when using stmmac > with multiple tx queues. >

Re: [PATCH net-next] net: stmmac: Fix return value check in qcom_ethqos_probe()

2019-01-23 Thread Niklas Cassel
> ethqos->por = of_device_get_match_data(&pdev->dev); > > ethqos->rgmii_clk = devm_clk_get(&pdev->dev, "rgmii"); > - if (!ethqos->rgmii_clk) { > - ret = -ENOMEM; > + if (IS_ERR(ethqos->rgmii_clk)) { > + ret = PTR_ERR(ethqos->rgmii_clk); > goto err_mem; > } > > > Acked-by: Niklas Cassel

Re: [PATCH net 0/2] net: stmmac: Coalesce and tail addr fixes

2018-12-19 Thread Niklas Cassel
On Tue, Sep 18, 2018 at 07:48:46PM -0700, David Miller wrote: > > From: Jose Abreu > Date: Mon, 17 Sep 2018 09:22:55 +0100 > > > The fix for coalesce timer and a fix in tail address setting that impacts > > XGMAC2 operation. > > > > The series is: > > Tested-by: Jerome Brunet > > on a1

Request for stable backport: stmmac: Use correct values in TQS/RQS fields

2018-12-19 Thread Niklas Cassel
Hello David, I can observe a netdev watchdog timeout on kernel 4.14.78 when using stmmac with multiple tx queues. Backporting the following commit: commit 52a76235d0c4dd259cd0df503afed4757c04ba1d Author: Jose Abreu Date: Fri Oct 13 10:58:36 2

Re: [PATCH] ath10k: transmit queued frames after waking queues

2018-05-25 Thread Niklas Cassel
On Fri, May 25, 2018 at 08:50:23AM -0400, Bob Copeland wrote: > On Fri, May 25, 2018 at 02:36:56PM +0200, Niklas Cassel wrote: > > A spin lock does have the advantage of ordering: memory operations issued > > before the spin_unlock_bh() will be completed before the spin_unlock_bh(

Re: [PATCH] ath10k: transmit queued frames after waking queues

2018-05-25 Thread Niklas Cassel
On Thu, May 24, 2018 at 11:50:34AM -0400, Bob Copeland wrote: > On Mon, May 21, 2018 at 10:37:01PM +0200, Niklas Cassel wrote: > > On Thu, May 17, 2018 at 03:26:25PM -0700, Adrian Chadd wrote: > > > On Thu, 17 May 2018 at 16:16, Niklas Cassel > > > wrote: > > &g

Re: [PATCH v2] ath10k: transmit queued frames after waking queues

2018-05-23 Thread Niklas Cassel
On Wed, May 23, 2018 at 06:25:49PM +0200, Erik Stromdahl wrote: > > > On 05/22/2018 11:15 PM, Niklas Cassel wrote: > > > > > > > > Earlier we observed performance issues in calling push_pending from each > > > tx completion. IMHO this change may in

Re: [PATCH v3] ath10k: transmit queued frames after processing rx packets

2018-05-23 Thread Niklas Cassel
On Thu, May 24, 2018 at 12:15:08AM +0200, Niklas Cassel wrote: > This problem cannot be reproduced on low-latency devices, e.g. pci, > since they call ath10k_mac_tx_push_pending() from > ath10k_htt_txrx_compl_task(). ath10k_htt_txrx_compl_task() is not called > on high-latency device

[PATCH v3] ath10k: transmit queued frames after processing rx packets

2018-05-23 Thread Niklas Cassel
Since we are calling ath10k_mac_tx_push_pending() directly, we also need to export it. Signed-off-by: Niklas Cassel --- Changes since V2: Moved ath10k_mac_tx_push_pending() call to ath10k_sdio_irq_handler(). drivers/net/wireless/ath/ath10k/mac.c | 1 + drivers/net/wireless/ath/ath10k/sdio.

Re: [PATCH v2] ath10k: transmit queued frames after waking queues

2018-05-22 Thread Niklas Cassel
On Mon, May 21, 2018 at 04:11:38PM -0700, Rajkumar Manoharan wrote: > On 2018-05-21 13:43, Niklas Cassel wrote: > > The following problem was observed when running iperf: > [...] > > > > In order to avoid trying to flush the queue every time we free a frame, > > on

[PATCH v2] ath10k: transmit queued frames after waking queues

2018-05-21 Thread Niklas Cassel
3 or less frames pending, and while we actually have frames in the queue. This logic was copied from mt76_txq_schedule (mt76), one of few other drivers that are actually using wake_tx_queue. Suggested-by: Toke Høiland-Jørgensen Signed-off-by: Niklas Cassel --- Changes since V1: use READ_ONCE

Re: [PATCH] ath10k: transmit queued frames after waking queues

2018-05-21 Thread Niklas Cassel
On Thu, May 17, 2018 at 03:26:25PM -0700, Adrian Chadd wrote: > On Thu, 17 May 2018 at 16:16, Niklas Cassel > wrote: > > > diff --git a/drivers/net/wireless/ath/ath10k/txrx.c > b/drivers/net/wireless/ath/ath10k/txrx.c > > index cda164f6e9f6..1d3b2d2c3fee 100644 > >

[PATCH] ath10k: transmit queued frames after waking queues

2018-05-17 Thread Niklas Cassel
3 or less frames pending, and while we actually have frames in the queue. This logic was copied from mt76_txq_schedule (mt76), one of few other drivers that are actually using wake_tx_queue. Suggested-by: Toke Høiland-Jørgensen Signed-off-by: Niklas Cassel --- drivers/net/wireless/ath/ath10k/t

[PATCH] ath10k: sdio: jump to correct label in error handling path

2018-04-26 Thread Niklas Cassel
originally introduced in commit d96db25d2025 ("ath10k: add initial SDIO support"). Fixes: d96db25d2025 ("ath10k: add initial SDIO support") Signed-off-by: Niklas Cassel --- drivers/net/wireless/ath/ath10k/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

Re: [PATCH net-next] net: stmmac: remove superfluous wmb() memory barriers

2018-03-12 Thread Niklas Cassel
On Fri, Mar 09, 2018 at 10:15:20AM -0500, David Miller wrote: > From: Jose Abreu > Date: Fri, 9 Mar 2018 10:26:11 + > > > Sorry but I know at least two architectures which don't do a > > wmb() upon an writel [1] [2]. This can be critical if if we are > > accessing the device through some slow

[PATCH net-next] net: stmmac: remove superfluous wmb() memory barriers

2018-03-08 Thread Niklas Cassel
superfluous, and removing them should thus not change any existing behavior. Ordering within the descriptor writes is already ensured with dma_wmb() barriers inside prepare_tx_desc(first, ..)/prepare_tso_tx_desc(first, ..). Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac

Re: [PATCH net-next 2/4] net: stmmac: use correct barrier between coherent memory and MMIO

2018-03-07 Thread Niklas Cassel
On Wed, Mar 07, 2018 at 12:42:49PM -0500, David Miller wrote: > From: Niklas Cassel > Date: Wed, 7 Mar 2018 18:21:57 +0100 > > > Considering this, you can drop/revert: > > 95eb930a40a0 ("net: stmmac: use correct barrier between coherent memory and > > MMIO")

Re: [PATCH net-next 2/4] net: stmmac: use correct barrier between coherent memory and MMIO

2018-03-07 Thread Niklas Cassel
On Wed, Mar 07, 2018 at 10:32:26AM -0500, David Miller wrote: > From: Niklas Cassel > Date: Sat, 3 Mar 2018 00:28:53 +0100 > > > However, the last write we do is "DMA start transmission", > > this is a register in the IP, i.e. it is a write to the cache > >

Re: [PATCH net-next 2/4] net: stmmac: use correct barrier between coherent memory and MMIO

2018-03-02 Thread Niklas Cassel
On Fri, Mar 02, 2018 at 09:54:11AM -0500, David Miller wrote: > From: Pavel Machek > Date: Fri, 2 Mar 2018 10:20:00 +0100 > Hello Pavel, David > >> This barrier cannot be a simple dma_wmb(), since a dma_wmb() is only > >> used to guarantee the ordering, with respect to other writes, > >> to cach

[PATCH net-next 0/4] stmmac barrier fixes and cleanup

2018-02-26 Thread Niklas Cassel
stmmac barrier fixes and cleanup Niklas Cassel (4): net: stmmac: ensure that the MSS desc is the last desc to set the own bit net: stmmac: use correct barrier between coherent memory and MMIO net: stmmac: ensure that the device has released ownership before reading data net

[PATCH net-next 2/4] net: stmmac: use correct barrier between coherent memory and MMIO

2018-02-26 Thread Niklas Cassel
region, we need to use the more heavyweight barrier wmb(). Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac

[PATCH net-next 1/4] net: stmmac: ensure that the MSS desc is the last desc to set the own bit

2018-02-26 Thread Niklas Cassel
esc, in order to ensure that the MSS descriptor is the last descriptor to set the own bit. Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

[PATCH net-next 4/4] net: stmmac: make dwmac4_release_tx_desc() clear all descriptor fields

2018-02-26 Thread Niklas Cassel
ions might reuse a DMA descriptor with old TDES1 data. I haven't observed any misbehavior even though TDES1 sometimes point to an old skb, however, explicitly clearing both TDES0 and TDES1 in dwmac4_release_tx_desc() minimizes the chances of undefined behavior. Signed-off-by: Niklas Cassel -

[PATCH net-next 3/4] net: stmmac: ensure that the device has released ownership before reading data

2018-02-26 Thread Niklas Cassel
, e.g. reading the tx hardware timestamp (if PTP is enabled). Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac

[PATCH net-next 0/7] stmmac multi-queue fixes and cleanups

2018-02-19 Thread Niklas Cassel
stmmac multi-queue fixes and cleanups Niklas Cassel (7): net: stmmac: set MSS for each tx DMA channel net: stmmac: do not clear tx_skbuff entries in stmmac_xmit()/stmmac_tso_xmit() net: stmmac: WARN if tx_skbuff entries are reused before cleared net: stmmac: rename

[PATCH net-next 1/7] net: stmmac: set MSS for each tx DMA channel

2018-02-19 Thread Niklas Cassel
value can be removed from stmmac_open(). This fixes tx queue timeouts for dwmac4, with DT property snps,tx-queues-to-use > 1, when running iperf3 with multiple threads. Fixes: ce736788e8a9 ("net: stmmac: adding multiple buffers for TX") Signed-off-by: Niklas Cassel --- drivers

[PATCH net-next 2/7] net: stmmac: do not clear tx_skbuff entries in stmmac_xmit()/stmmac_tso_xmit()

2018-02-19 Thread Niklas Cassel
reader the impression that it is needed. Do not clear tx_skbuff entries in stmmac_xmit()/stmmac_tso_xmit(). Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b

[PATCH net-next 3/7] net: stmmac: WARN if tx_skbuff entries are reused before cleared

2018-02-19 Thread Niklas Cassel
. Add WARN_ONs to verify that each entry in tx_skbuff is NULL before it is assigned a new value. Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers

[PATCH net-next 4/7] net: stmmac: rename dwmac4_tx_queue_routing() to match reality

2018-02-19 Thread Niklas Cassel
Looking at dwmac4_tx_queue_routing(), it is obvious that it sets up rx queue routing. Rename dwmac4_tx_queue_routing() to dwmac4_rx_queue_routing() to better match reality. Fixes: abe80fdc6ee6 ("net: stmmac: RX queue routing configuration") Signed-off-by: Niklas Cassel --- drivers/ne

[PATCH net-next 5/7] net: stmmac: call correct function in stmmac_mac_config_rx_queues_routing()

2018-02-19 Thread Niklas Cassel
() are very similar in structure. Fixes: abe80fdc6ee6 ("net: stmmac: RX queue routing configuration") Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmi

[PATCH net-next 6/7] net: stmmac: add error handling in stmmac_mtl_setup()

2018-02-19 Thread Niklas Cassel
initializes as many queues as it finds subnodes. Potentially leaving some queues uninitialized. To avoid hard to debug issues, return an error if the number of subnodes differ from snps,tx-queues-to-use/snps,rx-queues-to-use. Signed-off-by: Niklas Cassel --- .../net/ethernet/stmicro/stmmac

[PATCH net-next 7/7] net: stmmac: honor error code from stmmac_dt_phy()

2018-02-19 Thread Niklas Cassel
Honor error code from stmmac_dt_phy() instead of always returning -ENODEV. No functional change intended. Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro

Re: Commit 05cf0d1bf4 ("net: stmmac: free an skb first when there are no longer any descriptors using it") breaks stmmac?

2018-02-16 Thread Niklas Cassel
On Fri, Feb 16, 2018 at 09:34:39AM +, Jose Abreu wrote: > Hi Niklas, > > Thank you for looking into this! > > On 13-02-2018 13:33, Niklas Cassel wrote: > > Hello Jose, > > > > > > I remember that you had a problem > > with a use after free in st

Re: Re: Commit 05cf0d1bf4 ("net: stmmac: free an skb first when there are no longer any descriptors using it") breaks stmmac?

2018-02-13 Thread Niklas Cassel
Hello Jose, I remember that you had a problem with a use after free in stmmac_tx_clean(). I still don't think that it is related to commit 05cf0d1bf4, however, when comparing the stmmac driver to the amd-xgbe driver I realized that: xgbe_tx_poll() has both a smp_rmb() after fetching cur_tx, and

[PATCH net-next 0/3] stmmac irq fixes/cleanups

2018-02-09 Thread Niklas Cassel
A couple of small stmmac irq fixes/cleanups. Niklas Cassel (3): net: stmmac: discard disabled flags in interrupt status register net: stmmac: rename GMAC_INT_DEFAULT_MASK for dwmac4 net: stmmac: remove redundant enable of PMT irq drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2

[PATCH net-next 2/3] net: stmmac: rename GMAC_INT_DEFAULT_MASK for dwmac4

2018-02-09 Thread Niklas Cassel
GMAC_INT_DEFAULT_MASK is written to the interrupt enable register. In previous versions of the IP (e.g. dwmac1000), this register was instead an interrupt mask register. To improve clarity and reflect reality, rename GMAC_INT_DEFAULT_MASK to GMAC_INT_DEFAULT_ENABLE. Signed-off-by: Niklas Cassel

[PATCH net-next 3/3] net: stmmac: remove redundant enable of PMT irq

2018-02-09 Thread Niklas Cassel
ing an already cleared bit. Improve code readability by removing this redundant code. Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 -- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c| 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff -

[PATCH net-next 1/3] net: stmmac: discard disabled flags in interrupt status register

2018-02-09 Thread Niklas Cassel
tmmac: Discard masked flags in interrupt status register") fixed this for dwmac1000. Fix the same issue for dwmac4. Just like commit 0a764db10337 ("stmmac: Discard masked flags in interrupt status register"), this makes sure that we do not get spurious link up/link down prints. S

Re: Subject: [RFC][PATCH 04/11] stmmac: fix breakage in stmmac_hw_setup()

2018-01-25 Thread Niklas Cassel
On Tue, Jan 9, 2018 at 3:02 AM, David Miller wrote: > From: Al Viro > Date: Fri, 05 Jan 2018 19:31:58 + > >> Since "drivers: net: stmmac: reworking the PCS code" ->pcs_ctrl_ane() >> had been taking iomem address to access as the first argument; its >> predecessor (->ctrl_ane()) used to take s

Re: stmmac smatch error rx_queue_routing

2018-01-22 Thread Niklas Cassel
On Mon, Jan 22, 2018 at 04:55:10PM +, Jose Abreu wrote: > Hi Niklas, Hello Jose, and thanks for your reply. > > Looking at the code raises some questions: > > > > > > static void dwmac4_tx_queue_routing(struct mac_device_info *hw, > > u8 packet, u32 queue)

stmmac smatch error rx_queue_routing

2018-01-22 Thread Niklas Cassel
Hello stmmac peeps, I found this smatch error: drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c:132 dwmac4_tx_queue_routing() error: buffer overflow 'route_possibilities' 5 <= 254 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c:133 dwmac4_tx_queue_routing() error: buffer overflow 'route_

[PATCH net-next] net: stmmac: do not use a bitwise AND operator with a bool operand

2018-01-22 Thread Niklas Cassel
tmmac/dwmac4_descs.c:380 dwmac4_rd_prepare_tso_tx_desc() warn: maybe use && instead of & Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 4 ++-- drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-

Re: [PATCH v2] net: phy: Have __phy_modify return 0 on success

2018-01-15 Thread Niklas Cassel
Tested-by: Niklas Cassel On Fri, Jan 12, 2018 at 03:01:36PM +0100, Andrew Lunn wrote: > __phy_modify would return the old value of the register before it was > modified. Thus on success, it does not return 0, but a positive value. > Thus functions using phy_modify, which is a wrapp

Re: [PATCH] net: phy: Fix phy_modify() semantic difference fallout

2018-01-09 Thread Niklas Cassel
blem on ARTPEC-6: [2.562607] dwc-eth-dwmac f801.ethernet eth0: device MAC address 00:aa:bb:cc:13:36 [ 2.670029] dwc-eth-dwmac f801.ethernet eth0: Could not attach to PHY [2.676826] dwc-eth-dwmac f801.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19) When using linux-next: next-20180109 next-20180109 contains: fea23fb591cc ("net: phy: convert read-modify-write to phy_modify()") and f102852f980e ("net: phy: fix wrong masks to phy_modify()") Tested-by: Niklas Cassel

Re: [PATCH net-next] net: stmmac: fix broken dma_interrupt handling for multi-queues

2017-12-07 Thread Niklas Cassel
On Thu, Dec 07, 2017 at 11:56:10PM +0100, Niklas Cassel wrote: > Since each DMA channel can be used for rx and tx simultaneously, > the current code should probably be rewritten so that napi_struct is > embedded in a new struct stmmac_channel. > That way, stmmac_poll() can call stm

[PATCH net-next] net: stmmac: fix broken dma_interrupt handling for multi-queues

2017-12-07 Thread Niklas Cassel
48ef99 ("net: stmmac: adding multiple napi mechanism") Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 54 +++ 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net

Re: Commit 05cf0d1bf4 ("net: stmmac: free an skb first when there are no longer any descriptors using it") breaks stmmac?

2017-12-06 Thread Niklas Cassel
On Thu, Nov 30, 2017 at 04:50:38PM +, Jose Abreu wrote: > Hi Niklas, > > Thanks for the detailed explanation! > > On 30-11-2017 03:51, Niklas Cassel wrote: > > > > Could you try to see if the following patch > > solves your problem: > > (

Re: Commit 05cf0d1bf4 ("net: stmmac: free an skb first when there are no longer any descriptors using it") breaks stmmac?

2017-11-29 Thread Niklas Cassel
On Mon, Nov 27, 2017 at 02:41:00PM +, Jose Abreu wrote: > Hi Niklas, Hello Jose, > > I think your commit 05cf0d1bf4 ("net: stmmac: free an skb first > when there are no longer any descriptors using it") is breaking > stmmac driver in multi-queue configuration (this stacktrace may > contain s

[PATCH net-next v2] net: stmmac: fix LPI transitioning for dwmac4

2017-11-14 Thread Niklas Cassel
s that are always enabled are: LPI and PMT. Looking at dwmac4_core.c, the irqs that are always enabled are: PMT. To be able to read the LPI irq status, we need to enable the LPI irq also for dwmac4. Signed-off-by: Niklas Cassel --- Changes since v1: Fixed two typos in the commit message.

[PATCH net-next] net: stmmac: fix LPI transitioning for dwmac4

2017-11-13 Thread Niklas Cassel
irqs that are always enabled are: LPI and PMT. Looking at dwmac4_core.c, the irqs that are always enabled are: PMT. To be able to read the LPI irq status, we need to enable the LPI irq also for dwmac4. Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 7

[PATCH net-next] bindings: net: stmmac: correctify note about LPI interrupt

2017-11-09 Thread Niklas Cassel
its the LPI state. Update the DT binding description to reflect reality. Signed-off-by: Niklas Cassel --- Documentation/devicetree/bindings/net/stmmac.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bi

[PATCH net] net: stmmac: free an skb first when there are no longer any descriptors using it

2017-06-20 Thread Niklas Cassel
pointer from the first descriptor to the last descriptor, a skb will get freed only when the IP has cleared the own bit of all the descriptors that are using that skb. Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 20 1 file changed, 16

[PATCH net-next] net: stmmac: enable TSO for IPv6

2017-06-19 Thread Niklas Cassel
(94.52 MiB/s) Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 6a1cb59728fe..fefbf8

Re: stmmac tx timeout

2017-06-06 Thread Niklas Cassel
On 05/23/2017 03:39 PM, Pavel Machek wrote: > Hi! > >> I'm debugging a transmit queue 0 timeout on stmmac with DWMAC4 (4.10a). >> I'm using kernel v4.9.23, which is before multi queue support was added. >> I've cherry-picked >> 98a29944774a ("net: ethernet: stmmac: remove private tx queue lock") >

Re: [PATCH net] net: stmmac: fix completely hung TX when using TSO

2017-06-06 Thread Niklas Cassel
e that triggers the bug. It should be possible to trigger the bug more easily if you know what buffer size to write to your TCP socket, together with some manual TCP corking. Regards, Niklas > > On 6/6/2017 9:25 AM, Niklas Cassel wrote: >> stmmac_tso_allocator can fail to set

[PATCH net] net: stmmac: fix completely hung TX when using TSO

2017-06-06 Thread Niklas Cassel
the bit set, the DMA will hang. When the DMA hangs, we get a tx timeout, however, since stmmac does not do a complete reset of the IP in stmmac_tx_timeout, we end up in a state with completely hung TX. Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1

stmmac tx timeout

2017-05-23 Thread Niklas Cassel
Hello I'm debugging a transmit queue 0 timeout on stmmac with DWMAC4 (4.10a). I'm using kernel v4.9.23, which is before multi queue support was added. I've cherry-picked 98a29944774a ("net: ethernet: stmmac: remove private tx queue lock") 84c53b4baef8 ("stmmac: fix memory barriers") but I still g

stmmac dtc warnings 4.12-rc1

2017-05-16 Thread Niklas Cassel
Hello With the dtc in linux 4.12-rc1 we get the following warning when compiling our stmmac node: Warning (simple_bus_reg): Node /amba/stmmac-axi-config missing or empty reg/ranges property Note that we do follow the example binding for stmmac: https://git.kernel.org/pub/scm/linux/kernel/git/t

[PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring

2017-05-15 Thread Niklas Cassel
There are two pointers in sysfs_display_ring, one that increments if using normal dma descriptors, another if using extended dma descriptors. When printing the normal dma descriptors, the wrong pointer is used, thus the printed descriptor addresses are incorrect. Signed-off-by: Niklas Cassel

[PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring

2017-05-09 Thread Niklas Cassel
From: Niklas Cassel Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index cd8c60132390

Re: [PATCH v2] cpsw: ethtool: add support for getting/setting EEE registers

2017-04-25 Thread Niklas Cassel
On 04/18/2017 06:40 PM, Florian Fainelli wrote: > On 04/18/2017 06:23 AM, Niklas Cassel wrote: >> On 01/04/2017 03:33 PM, Florian Fainelli wrote: >>> On 12/02/2016 09:48 AM, Florian Fainelli wrote: >>>>>> Peppe, any thoughts on this? >>>>> >

Re: Re: [PATCH v2] cpsw: ethtool: add support for getting/setting EEE registers

2017-04-18 Thread Niklas Cassel
On 01/04/2017 03:33 PM, Florian Fainelli wrote: > On 12/02/2016 09:48 AM, Florian Fainelli wrote: Peppe, any thoughts on this? >>> >>> I share what you say. >>> >>> In sum, the EEE management inside the stmmac is: >>> >>> - the driver looks at own HW cap register if EEE is supported >>> >>>

[PATCH net-next v3] bindings: net: stmmac: add missing note about LPI interrupt

2017-04-18 Thread Niklas Cassel
From: Niklas Cassel The hardware has a LPI interrupt. There is already code in the stmmac driver to parse and handle the interrupt. However, this information was missing from the DT binding. At the same time, improve the description of the existing interrupts. Signed-off-by: Niklas Cassel

Re: [PATCH net-next] net: stmmac: set total length of the packet to be transmitted in TDES3

2017-04-11 Thread Niklas Cassel
On 04/11/2017 10:48 AM, Joao Pinto wrote: > > Hi Niklas, > > Às 7:33 PM de 4/10/2017, Niklas Cassel escreveu: >> From: Niklas Cassel >> >> Field FL/TPL in register TDES3 is not correctly set on GMAC4. >> TX appears to be functional on GMAC 4.10a even if t

[PATCH net-next] net: stmmac: set total length of the packet to be transmitted in TDES3

2017-04-10 Thread Niklas Cassel
From: Niklas Cassel Field FL/TPL in register TDES3 is not correctly set on GMAC4. TX appears to be functional on GMAC 4.10a even if this field is not set, however, to avoid relying on undefined behavior, set the length in TDES3. The field has a different meaning depending on if the TSE bit in

[PATCH net-next v2] bindings: net: stmmac: add missing note about LPI interrupt

2017-04-10 Thread Niklas Cassel
From: Niklas Cassel The hardware has a LPI interrupt. There is already code in the stmmac driver to parse and handle the interrupt. However, this information was missing from the DT binding. Signed-off-by: Niklas Cassel --- Documentation/devicetree/bindings/net/stmmac.txt | 8 1 file

Re: [PATCH net-next] bindings: net: stmmac: add missing note about LPI interrupt

2017-04-10 Thread Niklas Cassel
On 04/07/2017 06:48 PM, Sergei Shtylyov wrote: > Hello! > > On 04/07/2017 05:30 PM, Niklas Cassel wrote: > >> From: Niklas Cassel >> >> The hardware has a LPI interrupt. >> There is already code in the stmmac driver to parse and handle the >> interr

[PATCH net-next] bindings: net: stmmac: add missing note about LPI interrupt

2017-04-07 Thread Niklas Cassel
From: Niklas Cassel The hardware has a LPI interrupt. There is already code in the stmmac driver to parse and handle the interrupt. However, this information was missing from the DT binding. Signed-off-by: Niklas Cassel --- Documentation/devicetree/bindings/net/stmmac.txt | 8 1 file

Re: [PATCH 3/4 v3 net-next] net: stmmac: adding multiple buffers for TX

2017-04-06 Thread Niklas Cassel
Survived 10/10 reboot + ping test Tested-by: Niklas Cassel On 04/06/2017 10:49 AM, Joao Pinto wrote: > This patch adds the structure stmmac_tx_queue which contains > tx queues specific data (previously in stmmac_priv). > > Signed-off-by: Joao Pinto > --- > changes v1->v3

Re: [PATCH 2/4 v3 net-next] net: stmmac: adding multiple buffers for rx

2017-04-06 Thread Niklas Cassel
Survived 10/10 reboot + ping test Tested-by: Niklas Cassel On 04/06/2017 10:49 AM, Joao Pinto wrote: > This patch adds the structure stmmac_rx_queue which contains > rx queues specific data (previously in stmmac_priv). > > Signed-off-by: Joao Pinto > --- > changes v2->v

Re: [PATCH 1/4 v3 net-next] net: stmmac: break some functions into RX and TX scopes

2017-04-06 Thread Niklas Cassel
Survived 10/10 reboot + ping test Tested-by: Niklas Cassel On 04/06/2017 10:49 AM, Joao Pinto wrote: > This patch breaks several functions into RX and TX scopes, which > will be useful when adding multiple buffers mechanism. > > Signed-off-by: Joao Pinto > --- > changes v

Re: [PATCH 4/4 v3 net-next] net: stmmac: adding multiple napi mechanism

2017-04-06 Thread Niklas Cassel
Survived 10/10 reboot + ping test Tested-by: Niklas Cassel On 04/06/2017 10:49 AM, Joao Pinto wrote: > This patch adds the napi variable to the stmmac_rx_queue > structure and forces that operations like netif_queue_stopped, > netif_wake_queue, netif_stop_queue, netdev_reset_

Re: [PATCH v2] selftests: add a generic testsuite for ethernet device

2017-04-04 Thread Niklas Cassel
On 04/04/2017 03:32 PM, Corentin Labbe wrote: > This patch add a generic testsuite for testing ethernet network device driver. > > Signed-off-by: Corentin Labbe > --- > > Changes since v1: > - Test for starting master interface > - Changed printing format to "RESULT: $netdev: line" > - Use "ip l

[PATCH net-next] net: stmmac: allow changing the MTU while the interface is running

2017-04-04 Thread Niklas Cassel
From: Niklas Cassel Setting ethtool ops for stmmac is only allowed when the interface is up. Setting MTU (a netdev op) for stmmac is only allowed when the interface is down. It seems that the only reason why MTU cannot be changed when running is that we have not bothered to implement a nice way

stmmac CBS configuration for TX AVB queue

2017-03-31 Thread Niklas Cassel
Hello Joao I was looking at commit 19d9187317979cf0c25f67017d2676149abc46b2 Author: Joao Pinto Date: Fri Mar 10 18:24:59 2017 + net: stmmac: configuration of CBS in case of a TX AVB queue This patch adds the configuration of the AVB Credit-Based Shaper. It looks to me tha

Re: Re: [PATCH] [net-next] stmmac: use netif_set_real_num_{rx,tx}_queues

2017-03-30 Thread Niklas Cassel
On 03/30/2017 04:34 PM, Thierry Reding wrote: > On Thu, Mar 30, 2017 at 09:45:36AM +0200, Corentin Labbe wrote: >> On Tue, Mar 28, 2017 at 06:01:05PM -0700, David Miller wrote: >>> From: Arnd Bergmann >>> Date: Tue, 28 Mar 2017 11:48:21 +0200 >>> A driver must not access the two fields direct

Re: [PATCH 3/3] net: stmmac: Prefer kcalloc() over kmalloc_array()

2017-03-29 Thread Niklas Cassel
many changes, so it might be hard to point to a single commit. Nevertheless: Tested-by: Niklas Cassel On 03/28/2017 03:57 PM, Thierry Reding wrote: > From: Thierry Reding > > Some of the data in the new queue structures seems to not be properly > initialized, causing undefined behaviour

Re: [PATCH 2/3] net: stmmac: Always use the number of configured TX queues

2017-03-28 Thread Niklas Cassel
On 03/28/2017 03:57 PM, Thierry Reding wrote: > From: Thierry Reding > > Even if hardware supports multiple queues, software can choose to only > use a subset of them. Make sure we never try to access uninitialized > queues. > > Signed-off-by: Thierry Reding > --- > drivers/net/ethernet/stmi

Re: [PATCH net-next 2/2] net: stmmac: fix number of tx queues in stmmac_poll

2017-03-28 Thread Niklas Cassel
On 03/27/2017 07:44 PM, Joao Pinto wrote: > Às 6:28 PM de 3/27/2017, David Miller escreveu: >> From: Corentin Labbe >> Date: Mon, 27 Mar 2017 19:00:58 +0200 >> >>> On Mon, Mar 27, 2017 at 04:26:48PM +0100, Joao Pinto wrote: Hi David, Às 7:26 AM de 3/25/2017, Corentin Labbe escreve

Re: [PATCH net-next 0/2] net: stmmac: multiple queue fixes

2017-03-28 Thread Niklas Cassel
On 03/24/2017 06:16 PM, Joao Pinto wrote: > This patch set contains two fixes for problems I detected when ran the driver > in single queue mode. > > Please test in your setups to check if you get better results. > > Joao Pinto (2): > net: stmmac: fix netdev release > net: stmmac: fix number

Re: [PATCH net-next 2/2] net: stmmac: fix number of tx queues in stmmac_poll

2017-03-27 Thread Niklas Cassel
On 03/27/2017 11:12 AM, Joao Pinto wrote: > Às 10:09 AM de 3/27/2017, Corentin Labbe escreveu: >> On Mon, Mar 27, 2017 at 10:04:57AM +0100, Joao Pinto wrote: >>> Às 7:26 AM de 3/25/2017, Corentin Labbe escreveu: On Fri, Mar 24, 2017 at 05:16:45PM +, Joao Pinto wrote: > For cores that

Re: [PATCH net-next] stmmac: call stmmac_init_phy from stmmac_dvr_probe

2017-03-21 Thread Niklas Cassel
On 03/20/2017 11:07 PM, Florian Fainelli wrote: > > (snip) >> >> However, it is kind of sad that drivers are so inconsistent of what goes >> in probe and what goes in ndo_open...which is tied together with the >> whole mess of when certain ethtool commands work or do not work. > Well, inconsistent

Re: [PATCH net-next] stmmac: call stmmac_init_phy from stmmac_dvr_probe

2017-03-20 Thread Niklas Cassel
On 03/20/2017 06:43 PM, Florian Fainelli wrote: > On 03/20/2017 10:29 AM, Niklas Cassel wrote: >> From: Niklas Cassel >> >> It is usually possible to do >> ethtool -s autoneg on >> so that you trigger an autoneg before calling >> ip link set dev eth0 up &

Re: [PATCH net-next] stmmac: call stmmac_init_phy from stmmac_dvr_probe

2017-03-20 Thread Niklas Cassel
On 03/20/2017 06:42 PM, Joao Pinto wrote: > Às 5:29 PM de 3/20/2017, Niklas Cassel escreveu: >> From: Niklas Cassel >> >> It is usually possible to do >> ethtool -s autoneg on >> so that you trigger an autoneg before calling >> ip link set dev eth0 up

[PATCH net-next] stmmac: call stmmac_init_phy from stmmac_dvr_probe

2017-03-20 Thread Niklas Cassel
From: Niklas Cassel It is usually possible to do ethtool -s autoneg on so that you trigger an autoneg before calling ip link set dev eth0 up However, stmmac returns -EBUSY if !netif_running. The only reason for this appears to be that stmmac_init_phy is called from stmmac_open instead of from

Re: [PATCH v2 net-next 2/8] net: stmicro: configure mtl rx and tx algorithms

2017-03-09 Thread Niklas Cassel
On 03/08/2017 05:48 PM, Joao Pinto wrote: > Às 4:45 PM de 3/8/2017, Niklas Cassel escreveu: >> On 03/08/2017 01:22 PM, Joao Pinto wrote: >>> This patch adds the RX and TX scheduling algorithms programming. >>> It introduces the multiple queues configuration function &g

Re: [PATCH v2 net-next 2/8] net: stmicro: configure mtl rx and tx algorithms

2017-03-08 Thread Niklas Cassel
On 03/08/2017 01:22 PM, Joao Pinto wrote: > This patch adds the RX and TX scheduling algorithms programming. > It introduces the multiple queues configuration function > (stmmac_mtl_configuration) in stmmac_main. > > Signed-off-by: Joao Pinto > --- > changes v1->v2: > - Just to keep up with patch-

phy deadlock -stable backport request

2017-02-27 Thread Niklas Cassel
Hello I would like to request that commit eab127717a6af54401ba534790c793ec143cd1fc Author: Florian Fainelli Date: Fri Jan 20 15:31:52 2017 -0800 net: phy: Avoid deadlock during phy_error() phy_error() is called in the PHY state machine workqueue context, and calls phy_trigger_

Re: [PATCH] synopsys: remove dwc_eth_qos driver

2017-01-13 Thread Niklas Cassel
On 01/12/2017 04:54 PM, Joao Pinto wrote: > Às 3:48 PM de 1/12/2017, David Miller escreveu: >> From: Joao Pinto >> Date: Thu, 12 Jan 2017 15:46:31 + >> >>> Hope we can meet in a LinuxCon soon and have a talk, for you to know >>> me and this way you will see that I am a guy that is only focused

Re: Re: [PATCH] MIPS: NI 169445 board support

2017-01-05 Thread Niklas Cassel
On 01/04/2017 05:38 PM, Nathan Sullivan wrote: > On Tue, Dec 20, 2016 at 05:34:34PM +0100, Ralf Baechle wrote: >> On Fri, Dec 02, 2016 at 09:42:09AM -0600, Nathan Sullivan wrote: >>> Date: Fri, 2 Dec 2016 09:42:09 -0600 >>> From: Nathan Sullivan >>> To: r...@linux-mips.org, mark.rutl...@arm.com,

  1   2   >