RE: [EXT] Re: Fwd: net: fec: rx descriptor ring out of order

2020-11-14 Thread Andy Duan
From: Kegl Rohit Sent: Sunday, November 15, 2020 1:37 AM > On Sat, Nov 14, 2020 at 2:58 AM Andy Duan wrote: > > > > From: Kegl Rohit Sent: Friday, November 13, 2020 > > 8:21 PM > > > On Fri, Nov 13, 2020 at 8:33 AM Kegl Rohit wrote: > > > > > >

RE: [EXT] Re: Fwd: net: fec: rx descriptor ring out of order

2020-11-13 Thread Andy Duan
From: Kegl Rohit Sent: Friday, November 13, 2020 8:21 PM > On Fri, Nov 13, 2020 at 8:33 AM Kegl Rohit wrote: > > > > > What are the addresses of the ring entries? > > > I bet there is something wrong with the cache coherency and/or > > > flushing. > > > > > > So the MAC hardware has done the writ

RE: [EXT] Fwd: net: fec: rx descriptor ring out of order

2020-11-11 Thread Andy Duan
From: Kegl Rohit Sent: Wednesday, November 11, 2020 10:27 PM > Hello! > > We are using a imx6q platform. > The fec interface is used to receive a continuous stream of custom / raw > ethernet packets. The packet size is fixed ~132 bytes and they get sent every > 250µs. > > While testing I observ

RE: [PATCH] net: fec: Fix reference count leak in fec series ops

2020-11-08 Thread Andy Duan
From: zhangqilong ent: Monday, November 9, 2020 10:52 AM > > From: Zhang Qilong Sent: Sunday, November 8, > > 2020 5:53 PM > > > pm_runtime_get_sync() will increment pm usage at first and it will > > > resume the device later. If runtime of the device has error or > > > device is in inaccessible

RE: [PATCH] net: fec: Fix reference count leak in fec series ops

2020-11-08 Thread Andy Duan
From: Zhang Qilong Sent: Sunday, November 8, 2020 5:53 PM > pm_runtime_get_sync() will increment pm usage at first and it will resume the > device later. If runtime of the device has error or device is in inaccessible > state(or other error state), resume operation will fail. If we do not call pu

RE: [EXT] [PATCH v2] net: fec: fix MDIO probing for some FEC hardware blocks

2020-10-28 Thread Andy Duan
From: Greg Ungerer Sent: Wednesday, October 28, 2020 1:23 PM > Some (apparently older) versions of the FEC hardware block do not like the > MMFR register being cleared to avoid generation of MII events at > initialization > time. The action of clearing this register results in no future MII even

RE: [EXT] Re: [PATCH] net: ethernet: fec: Replace interrupt driven MDIO with polled IO

2020-10-26 Thread Andy Duan
From: Greg Ungerer Sent: Tuesday, October 27, 2020 8:18 AM > Hi Andy, > > On 22/10/20 7:04 pm, Andy Duan wrote: > > From: Greg Ungerer Sent: Thursday, October 22, > > 2020 9:14 AM > >> Hi Andrew, > >> > >> On 21/10/20 11:37 pm

RE: [EXT] Re: [PATCH] net: ethernet: fec: Replace interrupt driven MDIO with polled IO

2020-10-22 Thread Andy Duan
From: Greg Ungerer Sent: Thursday, October 22, 2020 9:14 AM > Hi Andrew, > > On 21/10/20 11:37 pm, Andrew Lunn wrote: > >> +if (fep->quirks & FEC_QUIRK_CLEAR_SETUP_MII) { > >> +/* Clear MMFR to avoid to generate MII event by writing > MSCR. > >> + * MII event generati

RE: [EXT] Re: [PATCH] net: ethernet: fec: Replace interrupt driven MDIO with polled IO

2020-10-21 Thread Andy Duan
From: Greg Ungerer Sent: Thursday, October 22, 2020 9:14 AM > Hi Andrew, > > On 21/10/20 11:37 pm, Andrew Lunn wrote: > >> +if (fep->quirks & FEC_QUIRK_CLEAR_SETUP_MII) { > >> +/* Clear MMFR to avoid to generate MII event by writing > MSCR. > >> + * MII event generati

RE: [EXT] Re: [PATCH] net: ethernet: fec: Replace interrupt driven MDIO with polled IO

2020-10-20 Thread Andy Duan
From: Greg Ungerer Sent: Wednesday, October 21, 2020 9:52 AM > Hi Andrew, > > Thanks for the quick response. > > > On 20/10/20 12:40 pm, Andrew Lunn wrote: > > On Tue, Oct 20, 2020 at 12:14:04PM +1000, Greg Ungerer wrote: > >> Hi Andrew, > >> > >> Commit f166f890c8f0 ("[PATCH] net: ethernet: f

RE: [EXT] Re: [PATCH] net: ethernet: fec: Replace interrupt driven MDIO with polled IO

2020-10-20 Thread Andy Duan
From: Chris Healy Sent: Tuesday, October 20, 2020 9:07 PM > On Mon, Oct 19, 2020 at 8:02 PM Andy Duan wrote: > > > > From: Andrew Lunn Sent: Tuesday, October 20, 2020 > > 10:40 AM > > > On Tue, Oct 20, 2020 at 12:14:04PM +1000, Greg Ungerer wrote: > > &

RE: [EXT] Re: [PATCH] net: ethernet: fec: Replace interrupt driven MDIO with polled IO

2020-10-19 Thread Andy Duan
From: Andrew Lunn Sent: Tuesday, October 20, 2020 10:40 AM > On Tue, Oct 20, 2020 at 12:14:04PM +1000, Greg Ungerer wrote: > > Hi Andrew, > > > > Commit f166f890c8f0 ("[PATCH] net: ethernet: fec: Replace interrupt > > driven MDIO with polled IO") breaks the FEC driver on at least one of > > the Co

RE: [EXT] Re: [PATCH] net: fec: Keep device numbering consistent with datasheet

2020-09-23 Thread Andy Duan
From: David Miller Sent: Thursday, September 24, 2020 4:32 AM > From: Stefan Riedmueller > Date: Wed, 23 Sep 2020 16:25:28 +0200 > > > From: Christian Hemp > > > > Make use of device tree alias for device enumeration to keep the > > device order consistent with the naming in the datasheet. > >

RE: [PATCH net-next] net: fec: ptp: remove unused variable 'ns' in fec_time_keep()

2020-09-14 Thread Andy Duan
From: Zhang Changzhong Sent: Monday, September 14, 2020 9:14 PM > Fixes the following W=1 kernel build warning(s): > > drivers/net/ethernet/freescale/fec_ptp.c:523:6: warning: > variable 'ns' set but not used [-Wunused-but-set-variable] > 523 | u64 ns; > | ^~ > > After commit 660

RE: [PATCH net-next] net: ethernet: fec: remove redundant null check before clk_disable_unprepare()

2020-09-07 Thread Andy Duan
From: Zhang Changzhong Sent: Monday, September 7, 2020 8:50 PM > Because clk_prepare_enable() and clk_disable_unprepare() already checked > NULL clock parameter, so the additional checks are unnecessary, just remove > them. > > Reported-by: Hulk Robot > Signed-off-by: Zhang Changzhong Acked-b

RE: [EXT] Re: [RESENT PATCH net--stat 1/1] net: ethernet: fec: Revert "net: ethernet: fec: Replace interrupt driven MDIO with polled IO"

2020-07-26 Thread Andy Duan
From: Chris Healy Sent: Monday, July 27, 2020 11:01 AM > It appears quite a few boards were affected by this micrel PHY driver change: > > 2ccb0161a0e9eb06f538557d38987e436fc39b8d > 80bf72598663496d08b3c0231377db6a99d7fd68 > 2de00450c0126ec8838f72157577578e85cae5d8 > 820f8a870f6575acda1bf7f1a03c7

RE: [EXT] Re: [RESENT PATCH net--stat 1/1] net: ethernet: fec: Revert "net: ethernet: fec: Replace interrupt driven MDIO with polled IO"

2020-07-26 Thread Andy Duan
From: Chris Healy Sent: Monday, July 27, 2020 10:40 AM > Actually, I was a little quick to say it went from broken to working. > > With net-next, I'm getting CRC errors on 100% of inbound packets. > With bcf3440c6dd78bfe5836ec0990fe36d7b4bb7d20 reverted, I drop down to a > 1% error rate. > > Thi

RE: [EXT] Re: [RESENT PATCH net--stat 1/1] net: ethernet: fec: Revert "net: ethernet: fec: Replace interrupt driven MDIO with polled IO"

2020-07-26 Thread Andy Duan
From: Chris Healy Sent: Monday, July 27, 2020 10:13 AM > On Sun, Jul 26, 2020 at 7:06 PM Laurent Pinchart > wrote: > > > > On Mon, Jul 27, 2020 at 04:24:02AM +0300, Laurent Pinchart wrote: > > > On Mon, Apr 27, 2020 at 10:08:04PM +0800, Fugang Duan wrote: > > > > This reverts commit 29ae6bd1b0d8a

RE: [EXT] [PATCH net-next v2 0/4] net: fec: a few improvements

2020-07-15 Thread Andy Duan
From: Sergey Organov Sent: Wednesday, July 15, 2020 11:43 PM > This is a collection of simple improvements that reduce and/or simplify code. > They got developed out of attempt to use DP83640 PTP PHY connected to > built-in FEC (that has its own PTP support) of the iMX 6SX micro-controller. > The

RE: [EXT] [PATCH 4/5] net: fec: get rid of redundant code in fec_ptp_set()

2020-07-08 Thread Andy Duan
From: Sergey Organov Sent: Wednesday, July 8, 2020 4:49 PM > Andy Duan writes: > > > From: Sergey Organov Sent: Tuesday, July 7, 2020 > > 10:43 PM > >> Andy Duan writes: > >> > >> > From: Sergey Organov Sent: Monday, July 6, > >> &

RE: [EXT] [PATCH 4/5] net: fec: get rid of redundant code in fec_ptp_set()

2020-07-07 Thread Andy Duan
From: Sergey Organov Sent: Tuesday, July 7, 2020 10:43 PM > Andy Duan writes: > > > From: Sergey Organov Sent: Monday, July 6, 2020 > 10:26 PM > >> Code of the form "if(x) x = 0" replaced with "x = 0". > >> > >> Code of the fo

RE: [EXT] net: ethernet: freescale: fec: copybreak handling throughput, dma_sync_* optimisations allowed?

2020-07-07 Thread Andy Duan
From: Robin Murphy On 2020-07-07 04:44, Andy Duan wrote: > > Hi mm experts, > > > > From: Kegl Rohit Sent: Monday, July 6, 2020 > > 10:18 PM > >> So you would also say a single dma_sync_single_for_cpu is enough. > >> You are right it would be great if s

RE: [EXT] [PATCH 4/5] net: fec: get rid of redundant code in fec_ptp_set()

2020-07-06 Thread Andy Duan
From: Sergey Organov Sent: Monday, July 6, 2020 10:26 PM > Code of the form "if(x) x = 0" replaced with "x = 0". > > Code of the form "if(x == a) x = a" removed. > > Signed-off-by: Sergey Organov > --- > drivers/net/ethernet/freescale/fec_ptp.c | 4 +--- > 1 file changed, 1 insertion(+), 3 del

RE: [EXT] [PATCH 2/5] net: fec: enable to use PPS feature without time stamping

2020-07-06 Thread Andy Duan
From: Sergey Organov Sent: Monday, July 6, 2020 10:26 PM > PPS feature could be useful even when hardware time stamping of network > packets is not in use, so remove offending check for this condition from > fec_ptp_enable_pps(). If hardware time stamping of network packets is not in use, PPS is

RE: [EXT] net: ethernet: freescale: fec: copybreak handling throughput, dma_sync_* optimisations allowed?

2020-07-06 Thread Andy Duan
dle > 23:50:03 all3.210.00 47.270.000.00 25.02 > 0.000.00 24.51 > 23:50:03 00.000.000.500.000.00 99.50 > 0.000.000.00 > 23:50:03 10.000.000.260.000.000.00 > 0.000.00 99.74 > 23:50:0

RE: [EXT] Re: [PATCH v5 3/3] ARM: imx6plus: optionally enable internal routing of clk_enet_ref

2020-07-06 Thread Andy Duan
From: Sven Van Asbroeck Sent: Monday, July 6, 2020 11:00 PM > On Mon, Jul 6, 2020 at 10:58 AM Sven Van Asbroeck > wrote: > > > > Hi Fabio, > > > > On Mon, Jul 6, 2020 at 9:46 AM Fabio Estevam > wrote: > > > > > > Would it make sense to use compatible = "mmio-mux"; like we do on > > > imx7s, imx

RE: [EXT] [PATCH v3 net] net: ethernet: fec: prevent tx starvation under high rx load

2020-07-06 Thread Andy Duan
From: Tobias Waldekranz Sent: Friday, July 3, 2020 10:11 PM > In the ISR, we poll the event register for the queues in need of service and > then enter polled mode. After this point, the event register will never be > read > again until we exit polled mode. > > In a scenario where a UDP flow is

RE: [EXT] Re: [PATCH v5 3/3] ARM: imx6plus: optionally enable internal routing of clk_enet_ref

2020-07-05 Thread Andy Duan
From: Sven Van Asbroeck Sent: Sunday, July 5, 2020 11:34 PM > > ext phy-| \ > | | > enet_ref-o--|M |pad--| \ >| |_/ | | >| |M |mac_gtx >| | | >

RE: [EXT] Re: [PATCH v5 3/3] ARM: imx6plus: optionally enable internal routing of clk_enet_ref

2020-07-05 Thread Andy Duan
From: Sven Van Asbroeck > Hi Fabio, Andy, > > On Thu, Jul 2, 2020 at 6:29 PM Fabio Estevam wrote: > > > > With the device tree approach, I think that a better place to touch > > GPR5 would be inside the fec driver. > > > > Are we 100% sure this is the best way forward, though? > > All the FEC

RE: [EXT] [PATCH v2 net] net: ethernet: fec: prevent tx starvation under high rx load

2020-07-03 Thread Andy Duan
From: Tobias Waldekranz Sent: Friday, July 3, 2020 3:55 PM > On Fri Jul 3, 2020 at 4:45 AM CEST, Andy Duan wrote: > > From: Tobias Waldekranz Sent: Friday, July 3, > > 2020 4:58 AM > > > In the ISR, we poll the event register for the queues in need of > > > s

RE: [EXT] [PATCH v2 net] net: ethernet: fec: prevent tx starvation under high rx load

2020-07-02 Thread Andy Duan
From: Tobias Waldekranz Sent: Friday, July 3, 2020 4:58 AM > In the ISR, we poll the event register for the queues in need of service and > then enter polled mode. After this point, the event register will never be > read > again until we exit polled mode. > > In a scenario where a UDP flow is

RE: [EXT] Re: [PATCH v5 3/3] ARM: imx6plus: optionally enable internal routing of clk_enet_ref

2020-07-02 Thread Andy Duan
From: Sven Van Asbroeck Sent: Friday, July 3, 2020 8:51 AM > Hi Fabio, > > On Thu, Jul 2, 2020 at 6:29 PM Fabio Estevam wrote: > > > > With the device tree approach, I think that a better place to touch > > GPR5 would be inside the fec driver. > > > > Cool idea. I notice that the latest FEC dri

RE: [EXT] net: ethernet: freescale: fec: copybreak handling throughput, dma_sync_* optimisations allowed?

2020-07-02 Thread Andy Duan
From: Kegl Rohit Sent: Thursday, July 2, 2020 3:39 PM > On Thu, Jul 2, 2020 at 6:18 AM Andy Duan wrote: > > That should ensure the whole area is not dirty. > > dma_sync_single_for_cpu() and dma_sync_single_for_device() can or must be > used in pairs? > So in this case it i

RE: [EXT] net: ethernet: freescale: fec: copybreak handling throughput, dma_sync_* optimisations allowed?

2020-07-01 Thread Andy Duan
From: Kegl Rohit Sent: Thursday, July 2, 2020 2:45 AM > fec_enet_copybreak(u32 length, ...) uses > > dma_sync_single_for_cpu(&fep->pdev->dev, > fec32_to_cpu(bdp->cbd_bufaddr), FEC_ENET_RX_FRSIZE - fep->rx_align, > DMA_FROM_DEVICE); if (!swap) >memcpy(new_skb->data, (*skb)->data, length); > >

RE: [EXT] Re: [PATCH net] net: ethernet: fec: prevent tx starvation under high rx load

2020-06-30 Thread Andy Duan
From: David Miller Sent: Wednesday, July 1, 2020 3:58 AM > From: "Tobias Waldekranz" > Date: Tue, 30 Jun 2020 08:39:58 +0200 > > > On Mon Jun 29, 2020 at 3:07 PM CEST, David Miller wrote: > >> I don't see how this can happen since you process the TX queue > >> unconditionally every NAPI pass, re

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: prevent tx starvation under high rx load

2020-06-30 Thread Andy Duan
From: Tobias Waldekranz Sent: Tuesday, June 30, 2020 7:02 PM > On Tue Jun 30, 2020 at 11:47 AM CEST, Andy Duan wrote: > > Tobias, sorry, I am not running the net tree, I run the linux-imx tree: > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsour > >

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: prevent tx starvation under high rx load

2020-06-30 Thread Andy Duan
From: Tobias Waldekranz Sent: Tuesday, June 30, 2020 5:13 PM > On Tue Jun 30, 2020 at 11:02 AM CEST, Andy Duan wrote: > > From: Tobias Waldekranz Sent: Tuesday, June > > 30, > > 2020 4:56 PM > > > On Tue Jun 30, 2020 at 10:26 AM CEST, Andy Duan wrote: > &g

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: prevent tx starvation under high rx load

2020-06-30 Thread Andy Duan
From: Tobias Waldekranz Sent: Tuesday, June 30, 2020 4:56 PM > On Tue Jun 30, 2020 at 10:26 AM CEST, Andy Duan wrote: > > From: Tobias Waldekranz Sent: Tuesday, June > > 30, > > 2020 3:31 PM > > > On Tue Jun 30, 2020 at 8:27 AM CEST, Andy Duan wrote: > &g

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: prevent tx starvation under high rx load

2020-06-30 Thread Andy Duan
From: Tobias Waldekranz Sent: Tuesday, June 30, 2020 3:31 PM > On Tue Jun 30, 2020 at 8:27 AM CEST, Andy Duan wrote: > > From: Tobias Waldekranz Sent: Tuesday, June > > 30, > > 2020 12:29 AM > > > On Sun Jun 28, 2020 at 8:23 AM CEST, Andy Duan wrote: > > &

RE: [EXT] [PATCH net] net: ethernet: fec: prevent tx starvation under high rx load

2020-06-29 Thread Andy Duan
From: Tobias Waldekranz Sent: Tuesday, June 30, 2020 3:16 AM > In the ISR, we poll the event register for the queues in need of service and > then enter polled mode. After this point, the event register will never be > read > again until we exit polled mode. > > In a scenario where a UDP flow i

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: prevent tx starvation under high rx load

2020-06-29 Thread Andy Duan
From: Tobias Waldekranz Sent: Tuesday, June 30, 2020 12:29 AM > On Sun Jun 28, 2020 at 8:23 AM CEST, Andy Duan wrote: > > I never seem bandwidth test cause netdev watchdog trip. > > Can you describe the reproduce steps on the commit, then we can > > reproduce it on my l

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: prevent tx starvation under high rx load

2020-06-27 Thread Andy Duan
From: David Miller Sent: Friday, June 26, 2020 3:20 AM > From: Tobias Waldekranz > Date: Thu, 25 Jun 2020 10:57:28 +0200 > > > In the ISR, we poll the event register for the queues in need of > > service and then enter polled mode. After this point, the event > > register will never be read agai

RE: [EXT] Re: [PATCH] net: fec: fix ref count leaking when pm_runtime_get_sync fails

2020-06-15 Thread Andy Duan
From: David Miller Sent: Tuesday, June 16, 2020 4:42 AM > From: Navid Emamdoost > Date: Sun, 14 Jun 2020 00:38:01 -0500 > > > in fec_enet_mdio_read, fec_enet_mdio_write, fec_enet_get_regs, > > fec_enet_open and fec_drv_remove, pm_runtime_get_sync is called which > > increments the counter even i

RE: [PATCH net,stable 1/1] net: ethernet: stmmac: free tx skb buffer in stmmac_resume()

2020-06-09 Thread Andy Duan
Giuseppe/Alexandre/Jose/David, can you give comment on the patch ? From: Andy Duan Sent: Friday, June 5, 2020 10:06 AM > Ping... > > From: Andy Duan Sent: Tuesday, June 2, 2020 3:58 > PM > > From: Fugang Duan > > > > When do suspend/resume test, ther

RE: [PATCH net,stable 1/1] net: ethernet: stmmac: free tx skb buffer in stmmac_resume()

2020-06-04 Thread Andy Duan
Ping... From: Andy Duan Sent: Tuesday, June 2, 2020 3:58 PM > From: Fugang Duan > > When do suspend/resume test, there have WARN_ON() log dump from > stmmac_xmit() funciton, the code logic: > entry = tx_q->cur_tx; > first_entry = entry; > WARN_ON(tx_

RE: [EXT] [PATCH net-next] net: ethernet: dwmac: Fix an error code in imx_dwmac_probe()

2020-06-03 Thread Andy Duan
From: Dan Carpenter Sent: Thursday, June 4, 2020 1:50 AM > The code is return PTR_ERR(NULL) which is zero or success. We should > return -ENOMEM instead. > > Fixes: 94abdad6974a5 ("net: ethernet: dwmac: add ethernet glue logic for > NXP imx8 chip") > Signed-off-by: Dan Carpenter Thanks! Acke

RE: [EXT] Re: [PATCH net 1/2] net: ethernet: dwmac: add Ethernet glue logic for NXP imx8 chip

2020-05-25 Thread Andy Duan
From: David Miller Sent: Tuesday, May 26, 2020 9:13 AM > From: Fugang Duan > Date: Mon, 25 May 2020 18:29:13 +0800 > > > +static int imx_dwmac_init(struct platform_device *pdev, void *priv) { > > + struct imx_priv_data *dwmac = priv; > > + struct plat_stmmacenet_data *plat_dat = dwmac->p

RE: [EXT] Re: [PATCH] stmmac: platform: add "snps,dwmac-5.10a" IP compatible string

2020-05-25 Thread Andy Duan
From: Andrew Lunn Sent: Tuesday, May 26, 2020 12:06 AM > On Mon, May 25, 2020 at 04:00:29PM +0000, Andy Duan wrote: > > From: Andrew Lunn Sent: Monday, May 25, 2020 10:11 > PM > > > On Mon, May 25, 2020 at 04:22:25PM +0800, Fugang Duan wrote: > > > > Add "s

RE: [EXT] Re: [PATCH] stmmac: platform: add "snps,dwmac-5.10a" IP compatible string

2020-05-25 Thread Andy Duan
From: Andrew Lunn Sent: Monday, May 25, 2020 10:11 PM > On Mon, May 25, 2020 at 04:22:25PM +0800, Fugang Duan wrote: > > Add "snps,dwmac-5.10a" compatible string for 5.10a version that can > > avoid to define some plat data in glue layer. > > Documentation/devicetree/bindings/net/snps,dwmac.yaml

RE: [EXT] Re: [PATCH net v2 0/4] net: ethernet: fec: move GPR reigster offset and bit into DT

2020-05-25 Thread Andy Duan
From: Andrew Lunn Sent: Monday, May 25, 2020 9:55 PM > On Mon, May 25, 2020 at 03:09:25PM +0800, fugang.d...@nxp.com wrote: > > From: Fugang Duan > > > > The commit da722186f654 (net: fec: set GPR bit on suspend by DT > configuration) set the GPR reigster offset and bit in driver for wol feature.

RE: [EXT] Re: [PATCH net v2 4/4] ARM: dts: imx6qdl-sabresd: enable fec wake-on-lan

2020-05-25 Thread Andy Duan
From: Andrew Lunn Sent: Monday, May 25, 2020 9:52 PM > On Mon, May 25, 2020 at 03:09:29PM +0800, fugang.d...@nxp.com wrote: > > From: Fugang Duan > > > > Enable ethernet wake-on-lan feature for imx6q/dl/qp sabresd boards > > since the PHY clock is supplied by exteranl osc. > > external > > Revi

RE: [EXT] Re: [PATCH net v2 3/4] ARM: dts: imx: add ethernet stop mode property

2020-05-25 Thread Andy Duan
From: Andrew Lunn Sent: Monday, May 25, 2020 9:51 PM > On Mon, May 25, 2020 at 03:09:28PM +0800, fugang.d...@nxp.com wrote: > > From: Fugang Duan > > > > - Update the imx6qdl gpr property to define gpr register > > offset and bit in DT. > > - Add imx6sx/imx6ul/imx7d ethernet stop mode property.

RE: [EXT] Re: [PATCH net v2 1/4] net: ethernet: fec: move GPR register offset and bit into DT

2020-05-25 Thread Andy Duan
From: Sascha Hauer Sent: Monday, May 25, 2020 6:49 PM > On Mon, May 25, 2020 at 03:09:26PM +0800, fugang.d...@nxp.com wrote: > > From: Fugang Duan > > > > The commit da722186f654 (net: fec: set GPR bit on suspend by DT > > configuration) set the GPR reigster offset and bit in driver for wake > >

Recall: [PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a

2020-05-25 Thread Andy Duan
Andy Duan would like to recall the message, "[PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a".

RE: [EXT] Re: [PATCH net 2/4] dt-bindings: fec: update the gpr property

2020-05-24 Thread Andy Duan
From: Fuzzey, Martin Sent: Saturday, May 23, 2020 6:16 PM > > - gpr: phandle of SoC general purpose register mode. Required for > > wake on LAN > > - on some SoCs > > + on some SoCs. Register bits of stop mode control, the format is > > + <&gpr req_gpr req_bit>. > > +gpr is the p

RE: [EXT] Re: [PATCH net 1/4] net: ethernet: fec: move GPR register offset and bit into DT

2020-05-24 Thread Andy Duan
From: Fuzzey, Martin Sent: Saturday, May 23, 2020 5:56 PM > Hi Andy, > > > Fixes: da722186f654(net: fec: set GPR bit on suspend by DT > > configuration) > > Just a nitpick maybe but I don't really think this need as Fixes: tag. > That commit didn't actually *break* anything AFAIK. > It added Wo

RE: [EXT] Re: [PATCH net 3/4] ARM: dts: imx6: update fec gpr property to match new format

2020-05-24 Thread Andy Duan
From: Andrew Lunn Sent: Saturday, May 23, 2020 7:50 AM > > Yes, I don't think anyone is saying otherwise. > > Correct. > > > > > The problem is just that there are already .dtsi files for i.MX chips > > having multiple ethernet interfaces in the mainline kernel (at least > > imx6ui.dtsi, imx6sx.

RE: [EXT] Re: [PATCH net 3/4] ARM: dts: imx6: update fec gpr property to match new format

2020-05-24 Thread Andy Duan
From: Fuzzey, Martin Sent: Saturday, May 23, 2020 2:03 AM > Hi Andy, > > On Fri, 22 May 2020, 03:01 Andy Duan, wrote: > > > > Andrew, many customers require the wol feature, NXP NPI release always > > support the wol feature to match customers requirement. > &

RE: [EXT] Re: [PATCH net 3/4] ARM: dts: imx6: update fec gpr property to match new format

2020-05-21 Thread Andy Duan
From: Andrew Lunn Sent: Thursday, May 21, 2020 9:07 PM > > Andrew, patch#1 in the series will parse the property to get register offset > and bit. > > Patch#2 describes the property format as below: > ><&gpr req_gpr req_bit>. > > gpr is the phandle to general purpose register node.

RE: [EXT] Re: [PATCH net 3/4] ARM: dts: imx6: update fec gpr property to match new format

2020-05-20 Thread Andy Duan
From: Andrew Lunn Sent: Thursday, May 21, 2020 1:03 AM > On Wed, May 20, 2020 at 04:31:55PM +0800, fugang.d...@nxp.com wrote: > > From: Fugang Duan > > > > Update the gpr property to define gpr register offset and bit in DT. > > > > Signed-off-by: Fugang Duan > > --- > > arch/arm/boot/dts/imx6q

RE: [EXT] Re: [PATCH net 1/4] net: ethernet: fec: move GPR register offset and bit into DT

2020-05-20 Thread Andy Duan
From: Jakub Kicinski Sent: Thursday, May 21, 2020 12:54 AM > On Wed, 20 May 2020 16:31:53 +0800 fugang.d...@nxp.com wrote: > > From: Fugang Duan > > > > The commit da722186f654(net: fec: set GPR bit on suspend by DT > > configuration) set the GPR reigster offset and bit in driver for wake > > on

RE: [EXT] [PATCH net-next v2] net: ethernet: fec: Prevent MII event after MII_SPEED write

2020-04-29 Thread Andy Duan
register before writing to the speed register, > this > MII event for the MII_SPEED is suppressed, and polled IO works as expected. > > v2 - Only infec_enet_mii_init() > > Fixes: 29ae6bd1b0d8 ("net: ethernet: fec: Replace interrupt driven MDIO with > polled IO") >

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: Prevent MII event after MII_SPEED write

2020-04-28 Thread Andy Duan
From: David Miller Sent: Wednesday, April 29, 2020 11:35 AM > From: Andy Duan > Date: Wed, 29 Apr 2020 01:55:35 + > > > From: David Miller Sent: Wednesday, April 29, > > 2020 5:34 AM > >> From: Andrew Lunn > >> Date: Tue, 28 Apr 2020 19:58:33 +0200

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: Prevent MII event after MII_SPEED write

2020-04-28 Thread Andy Duan
8 ("net: ethernet: fec: Replace interrupt driven > > MDIO with polled IO") > > Reported-by: Andy Duan > > Suggested-by: Andy Duan > > Signed-off-by: Andrew Lunn > > Applied to net-next, thanks. David, it is too early to apply the patch, it will introduce another break issue as I explain in previous mail for the patch.

RE: [EXT] [PATCH net-next] net: ethernet: fec: Prevent MII event after MII_SPEED write

2020-04-28 Thread Andy Duan
register before writing to the speed register, > this > MII event for the MII_SPEED is suppressed, and polled IO works as expected. > > Fixes: 29ae6bd1b0d8 ("net: ethernet: fec: Replace interrupt driven MDIO with > polled IO") > Reported-by: Andy Duan > Suggested-

RE: [EXT] Re: [PATCH net-next] net: ethernet: fec: Prevent MII event after MII_SPEED write

2020-04-28 Thread Andy Duan
From: Andrew Lunn Sent: Wednesday, April 29, 2020 2:02 AM > On Tue, Apr 28, 2020 at 07:58:33PM +0200, Andrew Lunn wrote: > > The change to polled IO for MDIO completion assumes that MII events > > are only generated for MDIO transactions. However on some SoCs writing > > to the MII_SPEED register

RE: [EXT] Re: [PATCH] net: ethernet: fec: Replace interrupt driven MDIO with polled IO

2020-04-28 Thread Andy Duan
From: Andrew Lunn Sent: Tuesday, April 28, 2020 9:35 PM > > Andrew, after investigate the issue, there have one MII event coming > > later then clearing MII pending event when writing MSCR register > (MII_SPEED). > > > > Check the rtl design by co-working with our IC designer, the MII event > > ge

RE: [EXT] Re: [PATCH] net: ethernet: fec: Replace interrupt driven MDIO with polled IO

2020-04-28 Thread Andy Duan
From: Andrew Lunn Sent: Tuesday, April 28, 2020 4:14 AM > Hi Leonard > > > Does not help. > > Thanks for testing it. > > > What does seem to help is inserting prints after the FEC_ENET_MII > > check but that's probably because it inject a long delay equivalent to > > the long udelay Andy has me

RE: [EXT] [PATCH net-next v2 1/2] net: fec_main: Use netdev_err() instead of pr_err()

2019-06-03 Thread Andy Duan
From: Fabio Estevam Sent: Tuesday, June 4, 2019 11:05 AM > netdev_err() is more appropriate for printing error messages inside network > drivers, so switch to netdev_err(). > > Signed-off-by: Fabio Estevam > --- > Changes since v1: > - Split the changes from fec_main and fec_ptp in two different

RE: [EXT] [PATCH net-next v2 2/2] net: fec_ptp: Use dev_err() instead of pr_err()

2019-06-03 Thread Andy Duan
From: Fabio Estevam Sent: Tuesday, June 4, 2019 11:05 AM > dev_err() is more appropriate for printing error messages inside drivers, so > switch to dev_err(). > > Signed-off-by: Fabio Estevam Acked-by: Fugang Duan > --- > Changes since v1: > - Use dev_err() instead of netdev_err() - Andy > >

RE: [EXT] [PATCH net-next] net: fec: Use netdev_err() instead of pr_err()

2019-06-03 Thread Andy Duan
From: Fabio Estevam [mailto:feste...@gmail.com] > netdev_err() is more appropriate for printing error messages inside network > drivers, so switch to netdev_err(). > > Signed-off-by: Fabio Estevam > --- > drivers/net/ethernet/freescale/fec_main.c | 8 > drivers/net/ethernet/freescale/fec

RE: [EXT] Re: [PATCH net,stable 1/1] net: fec: add defer probe for of_get_mac_address

2019-05-26 Thread Andy Duan
From: David Miller Sent: Saturday, May 25, 2019 4:12 AM > From: Andy Duan > Date: Thu, 23 May 2019 01:55:23 + > > > @@ -3146,7 +3150,10 @@ static int fec_enet_init(struct net_device *ndev) > > memset(cbd_base, 0, bd_size); > > > >

[PATCH net,stable 1/1] net: fec: fix the clk mismatch in failed_reset path

2019-05-22 Thread Andy Duan
Fix the clk mismatch in the error path "failed_reset" because below error path will disable clk_ahb and clk_ipg directly, it should use pm_runtime_put_noidle() instead of pm_runtime_put() to avoid to call runtime resume callback. Reported-by: Baruch Siach Signed-off-by: Fugang Duan --- drivers/

[PATCH net,stable 1/1] net: fec: add defer probe for of_get_mac_address

2019-05-22 Thread Andy Duan
If MAC address read from nvmem efuse by calling .of_get_mac_address(), but nvmem efuse is registerred later than the driver, then it return -EPROBE_DEFER value. So modify the driver to support defer probe when read MAC address from nvmem efuse. Signed-off-by: Fugang Duan --- drivers/net/ethernet

RE: [EXT] i.MX8MQ clk: enet1_root_clk already disabled

2019-05-22 Thread Andy Duan
From: Baruch Siach > I'm testing kernel v5.2-rc1 on my i.MX8MQ system, SolidRun Hummingboard > Pulse. The fec driver happens to probe before the gpio driver that we need for > the PHY reset. So fec_reset_phy() returns -EPROBE_DEFER. This triggers the > splat below when clk_ahb is disabled somewher

RE: [EXT] Re: [PATCH net 2/3] of_net: add property "nvmem-mac-address" for of_get_mac_addr()

2019-05-13 Thread Andy Duan
From: Petr Štetiar Sent: Monday, May 13, 2019 4:00 PM > Andy Duan [2019-05-13 03:31:59]: > > > From: Andrew Lunn Sent: Saturday, May 11, 2019 2:18 > > AM > > > On Fri, May 10, 2019 at 08:24:03AM +, Andy Duan wrote: > > > > If MAC address read from

RE: [EXT] Re: [PATCH net 0/3] add property "nvmem_macaddr_swap" to swap macaddr bytes order

2019-05-12 Thread Andy Duan
From: Maxime Ripard Sent: Friday, May 10, 2019 7:32 PM > On Fri, May 10, 2019 at 01:28:22PM +0200, Petr Štetiar wrote: > > Andy Duan [2019-05-10 08:23:58]: > > > > Hi Andy, > > > > you've probably forget to Cc some maintainers and mailing lists, so > &

RE: [EXT] Re: [PATCH net 2/3] of_net: add property "nvmem-mac-address" for of_get_mac_addr()

2019-05-12 Thread Andy Duan
From: Andrew Lunn Sent: Saturday, May 11, 2019 2:18 AM > On Fri, May 10, 2019 at 08:24:03AM +0000, Andy Duan wrote: > > If MAC address read from nvmem cell and it is valid mac address, > > .of_get_mac_addr_nvmem() add new property "nvmem-mac-address" in > >

RE: [EXT] Re: [PATCH net 1/3] net: ethernet: add property "nvmem_macaddr_swap" to swap macaddr bytes order

2019-05-12 Thread Andy Duan
From: Andrew Lunn Sent: Saturday, May 11, 2019 2:17 AM > On Fri, May 10, 2019 at 08:24:00AM +0000, Andy Duan wrote: > > ethernet controller driver call .of_get_mac_address() to get the mac > > address from devictree tree, if these properties are not present, then > > t

RE: [EXT] Re: [PATCH net 0/3] add property "nvmem_macaddr_swap" to swap macaddr bytes order

2019-05-12 Thread Andy Duan
From: Petr Štetiar Sent: Friday, May 10, 2019 7:28 PM > Andy Duan [2019-05-10 08:23:58]: > > Hi Andy, > > you've probably forget to Cc some maintainers and mailing lists, so I'm adding > them now to the Cc loop. This patch series should be posted against net-nex

[PATCH net 1/3] net: ethernet: add property "nvmem_macaddr_swap" to swap macaddr bytes order

2019-05-10 Thread Andy Duan
ethernet controller driver call .of_get_mac_address() to get the mac address from devictree tree, if these properties are not present, then try to read from nvmem. For example, read MAC address from nvmem: of_get_mac_address() of_get_mac_addr_nvmem() nvmem_get_mac_address()

[PATCH net 2/3] of_net: add property "nvmem-mac-address" for of_get_mac_addr()

2019-05-10 Thread Andy Duan
If MAC address read from nvmem cell and it is valid mac address, .of_get_mac_addr_nvmem() add new property "nvmem-mac-address" in ethernet node. Once user call .of_get_mac_address() to get MAC address again, it can read valid MAC address from device tree in directly. Signed-off-by: Fugang Duan --

[PATCH net 3/3] dt-bindings: doc: add new properties for of_get_mac_address from nvmem

2019-05-10 Thread Andy Duan
Currently, of_get_mac_address supports NVMEM, some platforms MAC address that read from NVMEM efuse requires to swap bytes order, so add new property "nvmem_macaddr_swap" to specify the behavior. If the MAC address is valid from NVMEM, add new property "nvmem-mac-address" in ethernet node. Update

[PATCH net 0/3] add property "nvmem_macaddr_swap" to swap macaddr bytes order

2019-05-10 Thread Andy Duan
ethernet controller driver call .of_get_mac_address() to get the mac address from devictree tree, if these properties are not present, then try to read from nvmem. i.MX6x/7D/8MQ/8MM platforms ethernet MAC address read from nvmem ocotp eFuses, but it requires to swap the six bytes order. The patch

[PATCH net,stable 1/1] net: fec: manage ahb clock in runtime pm

2019-04-08 Thread Andy Duan
Some SOC like i.MX6SX clock have some limits: - ahb clock should be disabled before ipg. - ahb and ipg clocks are required for MAC MII bus. So, move the ahb clock to runtime management together with ipg clock. Signed-off-by: Fugang Duan --- drivers/net/ethernet/freescale/fec_main.c | 30

RE: [PATCH] net: fec: get regulator optional

2019-01-21 Thread Andy Duan
From: Stefan Agner Sent: Monday, January 21, 2019 10:59 PM > According to the device tree binding the phy-supply property is optional. Use > the regulator_get_optional API accordingly. The code already handles NULL > just fine. > > This gets rid of the following warning: > fec 2188000.ethernet:

RE: iMX6 FEC driver Linux-fslc 4.17 - IPV6 Multicast not working when unplugging/plugging ethernet cable

2018-12-27 Thread Andy Duan
From: Stefano Cappa > Hi everyone, > I already posted this in NXP forum as a comment > (https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fco > mmunity.nxp.com%2Fthread%2F359397&data=02%7C01%7Cfugang.dua > n%40nxp.com%7C189d5cad534e470a162508d66c068de2%7C686ea1d3bc2b > 4c6fa92cd99c

RE: [PATCH net-next 1/2] net: phy: don't stop state machine in case of MDIO error

2018-12-16 Thread Andy Duan
From: Heiner Kallweit Sent: 2018年12月16日 0:19 > If we detect a MDIO error, it seems to be a little bit too aggressive to stop > the > state machine and bring down the PHY completely. > E.g. when polling and we miss one update, then this has no relevant impact. > And in phy_stop_interrupts() actual

RE: [PATCH net-next 2/2] net: fec: remove workaround to restart state machine on MDIO error

2018-12-16 Thread Andy Duan
From: Heiner Kallweit Sent: 2018年12月16日 0:20 > Now that the PHY isn't stopped any longer by phylib in case of a MDIO error, > we can remove this workaround. > > Signed-off-by: Heiner Kallweit The old workaround can be removed NOW, thanks. Acked-by: Fugang Duan > --- > drivers/net/ethernet/f

RE: [PATCH] net: ethernet:fec: Consistently use SPEED_ prefix

2018-10-21 Thread Andy Duan
From: netdev-ow...@vger.kernel.org > All other calls to phy_set_max_speed() use the SPEED_ prefix. Make the > FEC driver follow this common pattern. This makes no different to > generated code since SPEED_1000 is 1000, and SPEED_100 is 100. > Please also add more information that was introduced

[PATCH net,stable 1/1] net: fec: don't dump RX FIFO register when not available

2018-10-14 Thread Andy Duan
From: Fugang Duan Commit db65f35f50e0 ("net: fec: add support of ethtool get_regs") introduce ethool "--register-dump" interface to dump all FEC registers. But not all silicon implementations of the Freescale FEC hardware module have the FRBR (FIFO Receive Bound Register) and FRSR (FIFO Receive

RE: [PATCH, net-next] net: ethernet: freescale: fix false-positive string overflow warning

2018-05-28 Thread Andy Duan
From: Arnd Bergmann Sent: 2018年5月28日 23:50 > While compile-testing on arm64 with gcc-8.1, I ran into a build diagnostic: > > drivers/net/ethernet/freescale/fec_main.c: In function 'fec_probe': > drivers/net/ethernet/freescale/fec_main.c:3517:25: error: '%d' directive > writing between 1 and 10 by

RE: [PATCH net-next] net: fec: remove stale comment

2018-05-24 Thread Andy Duan
> From: YueHaibing Sent: 2018年5月24日 19:27 > This comment is outdated as fec_ptp_ioctl has been replaced by > fec_ptp_set/fec_ptp_get since commit 1d5244d0e43b ("fec: Implement > the SIOCGHWTSTAMP ioctl") > > Signed-off-by: YueHaibing Thanks. Acked-by: Fugang Duan > --- > drivers/net/ethernet/

RE: [PATCH 1/2] net: fec: ptp: Switch to SPDX identifier

2018-05-20 Thread Andy Duan
From: Fabio Estevam Sent: 2018年5月21日 0:55 > Adopt the SPDX license identifier headers to ease license compliance > management. > > Signed-off-by: Fabio Estevam Acked-by: Fugang Duan > --- > drivers/net/ethernet/freescale/fec_ptp.c | 14 +- > 1 file changed, 1 insertion(+), 13 del

RE: [PATCH 2/2] net: fec: Add a SPDX identifier

2018-05-20 Thread Andy Duan
From: Fabio Estevam Sent: 2018年5月21日 0:55 > From: Fabio Estevam > > Currently there is no license information in the header of this file. > > The MODULE_LICENSE field contains ("GPL"), which means GNU Public > License v2 or later, so add a corresponding SPDX license identifier. > > Signed-off

RE: [PATCH net-next v3 2/3] net: ethernet: freescale: Allow FEC with COMPILE_TEST

2018-05-17 Thread Andy Duan
From: Florian Fainelli Sent: 2018年5月18日 4:08 > The Freescale FEC driver builds fine with COMPILE_TEST, so make that > possible. > > Signed-off-by: Florian Fainelli Acked-by: Fugang Duan > --- > drivers/net/ethernet/freescale/Kconfig| 2 +- > drivers/net/ethernet/freescale/fec.h | 2

RE: [PATCH net-next v2 2/2] drivers: net: Remove device_node checks with of_mdiobus_register()

2018-05-15 Thread Andy Duan
From: Florian Fainelli Sent: 2018年5月16日 7:56 > A number of drivers have the following pattern: > > if (np) > of_mdiobus_register() > else > mdiobus_register() > > which the implementation of of_mdiobus_register() now takes care of. > Remove that pattern in drivers that strictly adher

RE: [PATCH net-next 2/3] net: ethernet: freescale: Allow FEC with COMPILE_TEST

2018-05-15 Thread Andy Duan
From: Florian Fainelli Sent: 2018年5月16日 7:48 > The Freescale FEC driver builds fine with COMPILE_TEST, so make that > possible. > > Signed-off-by: Florian Fainelli Acked-by: Fugang Duan > --- > drivers/net/ethernet/freescale/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

RE: [PATCH] net: fec: set dma_coherent_mask

2018-03-28 Thread Andy Duan
From: Geert Uytterhoeven Sent: 2018年3月28日 15:07 > Hi Andy, > > On Wed, Mar 28, 2018 at 5:04 AM, Andy Duan wrote: > > From: Geert Uytterhoeven Sent: 2018年3月27日 > 20:59 > >> On Mon, Mar 26, 2018 at 3:36 PM, Greg Ungerer > wrote: > >> > As of commit 205e

RE: [PATCH] net: fec: set dma_coherent_mask

2018-03-27 Thread Andy Duan
From: Geert Uytterhoeven Sent: 2018年3月27日 20:59 > Hi Greg, > > On Mon, Mar 26, 2018 at 3:36 PM, Greg Ungerer wrote: > > As of commit 205e1b7f51e4 ("dma-mapping: warn when there is no > > coherent_dma_mask") the Freescale FEC driver is issuing the following > > warning on driver initialization on

  1   2   >