Re: [PATCH 3/5] ARM: sun8i: dt: Add DT bindings documentation for Allwinner sun8i-emac

2016-06-06 Thread Corentin LABBE
Le 06/06/2016 16:14, Rob Herring a écrit : > On Fri, Jun 03, 2016 at 11:56:28AM +0200, LABBE Corentin wrote: >> This patch adds documentation for Device-Tree bindings for the >> Allwinner sun8i-emac driver. >> >> Signed-off-by: LABBE Corentin >> --- >>

[PATCH 14/17] net: stmmac: print phy information

2017-01-31 Thread Corentin Labbe
When a PHY is found, printing which one was found (and which type/model) is a good information to know. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/s

[PATCH 01/17] net: stmmac: fix the typo on MAC_RNABLE_RX

2017-01-31 Thread Corentin Labbe
the define MAC_RNABLE_RX have a typo, rename it to MAC_ENABLE_RX Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/common.h| 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)

[PATCH 00/17] net: stmmac: misc fix

2017-01-31 Thread Corentin Labbe
Hello I am currently working on dwmac-sun8i glue driver for Allwinner H3/A83T/A64. This serie is the result of all minor problem found in the stmmac driver. Regards Corentin Labbe (17): net: stmmac: fix the typo on MAC_RNABLE_RX net: stmmac: Remove the bus_setup function pointer net

[PATCH 17/17] net: stmmac: replace unsigned by u32

2017-01-31 Thread Corentin Labbe
checkpatch complains about two unsigned without type after. Since the value return is u32, it is simpler to replace it by u32 instead of "unsigned int" Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1

[PATCH 13/17] net: stmmac: Implement NAPI for TX

2017-01-31 Thread Corentin Labbe
140Mbit/s to 500Mbit/s. Under dwmac-sunxi an iperf run use half less interrupts. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drive

[PATCH 16/17] net: stmmac: remove unused variable in sysfs_display_ring

2017-01-31 Thread Corentin Labbe
The u64 x variable in sysfs_display_ring is unused. This patch remove it. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mai

[PATCH 09/17] net: stmmac: replace ENOSYS by EINVAL

2017-01-31 Thread Corentin Labbe
As said by checkpatch ENOSYS means 'invalid syscall nr' and nothing else. This patch replace ENOSYS by the more appropriate value EINVAL. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +- 1 file changed, 1 insertion

[PATCH 15/17] net: stmmac: remove dead code in stmmac_tx_clean

2017-01-31 Thread Corentin Labbe
Since commit cf32deec16e4 ("stmmac: add tx_skbuff_dma to save descriptors used by PTP"), the struct dma_desc *p in stmmac_tx_clean was not used at all. This patch remove this dead code. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/etherne

Re: [PATCH 07/17] net: stmmac: replace stmmac_mdio_busy_wait by readl_poll_timeout

2017-01-31 Thread Corentin Labbe
On Tue, Jan 31, 2017 at 11:13:49AM +0100, Giuseppe CAVALLARO wrote: > On 1/31/2017 10:11 AM, Corentin Labbe wrote: > > The stmmac_mdio_busy_wait() function do the same job than > > readl_poll_timeout(). > > So is is better to replace it. > > > > Signed-off

[PATCH 04/17] net: stmmac: remove freesoftware address

2017-01-31 Thread Corentin Labbe
This patch fix the checkpatch warning about free software address. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/chain_mode.c | 4 drivers/net/ethernet/stmicro/stmmac/common.h | 4 drivers/net/ethernet/stmicro/

[PATCH 11/17] net: stmmac: Rewrite two test against NULL value

2017-01-31 Thread Corentin Labbe
This patch rewrite two test against NULL value with correct style. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/

[PATCH 10/17] net: stmmac: Correct the error message about invalid speed

2017-01-31 Thread Corentin Labbe
Add 1000 as a valid speed in the error message about invalid speed in stmmac_adjust_link() Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/et

[PATCH 08/17] net: stmmac: Use readl_poll_timeout

2017-01-31 Thread Corentin Labbe
The dwmac_dma_reset function use an open coded of readl_poll_timeout(). Replace the open coded handling with the proper function. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 14 ++ 1 file changed, 6 insertions

[PATCH 12/17] net: stmmac: rename rx_crc to rx_crc_errors

2017-01-31 Thread Corentin Labbe
The ethtool stat counter rx_crc from stmmac is mis-named, the name seems to speak about the number of RX CRC done, but in fact it is about errors. This patch rename it to rx_crc_errors, just like the same ifconfig counter. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- d

[PATCH 07/17] net: stmmac: replace stmmac_mdio_busy_wait by readl_poll_timeout

2017-01-31 Thread Corentin Labbe
The stmmac_mdio_busy_wait() function do the same job than readl_poll_timeout(). So is is better to replace it. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 33 --- 1 file changed, 11 insertions(

[PATCH 03/17] net: stmmac: fix some typos in comments

2017-01-31 Thread Corentin Labbe
This patch fix some typos in comments. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 6 +++--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 16 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.

[PATCH 02/17] net: stmmac: Remove the bus_setup function pointer

2017-01-31 Thread Corentin Labbe
The bus_setup function pointer is not used at all, this patch remove it. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 include/linux/stmmac.h| 1 - 2 files changed, 5 deletions(-) diff

[PATCH 05/17] net: stmmac: remplace asm/io.h by linux/io.h

2017-01-31 Thread Corentin Labbe
This patch fix the checkpatch warning about asm/io.h. Sorting all includes in the process. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH 06/17] net: stmmac: fix some code style problem

2017-01-31 Thread Corentin Labbe
Checkpatch complains about some code style problem on stmmac_mdio.c. This patch fix them. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drive

Re: [PATCH 13/17] net: stmmac: Implement NAPI for TX

2017-01-31 Thread Corentin Labbe
On Tue, Jan 31, 2017 at 11:28:03AM +0100, Giuseppe CAVALLARO wrote: > On 1/31/2017 10:11 AM, Corentin Labbe wrote: > > The stmmac driver run TX completion under NAPI but without checking the > > work done by the TX completion function. > > > > This patch add work/

Re: [PATCH v2 06/16] net: stmmac: fix some code style problem

2017-02-08 Thread Corentin Labbe
On Wed, Feb 08, 2017 at 02:41:58AM -0800, Joe Perches wrote: > On Wed, 2017-02-08 at 09:31 +0100, Corentin Labbe wrote: > > Checkpatch complains about some code style problem on stmmac_mdio.c. > > This patch fix them. > [] > > diff --git a/drivers/net/ethernet/stmicro/stm

[PATCH v2 11/16] net: stmmac: Rewrite two test against NULL value

2017-02-08 Thread Corentin Labbe
This patch rewrite two test against NULL value with correct style. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH v2 09/16] net: stmmac: replace ENOSYS by EINVAL

2017-02-08 Thread Corentin Labbe
As said by checkpatch ENOSYS means 'invalid syscall nr' and nothing else. This patch replace ENOSYS by the more appropriate value EINVAL. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/st

[PATCH v2 12/16] net: stmmac: rename rx_crc to rx_crc_errors

2017-02-08 Thread Corentin Labbe
The ethtool stat counter rx_crc from stmmac is mis-named, the name seems to speak about the number of RX CRC done, but in fact it is about errors. This patch rename it to rx_crc_errors, just like the same ifconfig counter. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com>

[PATCH v2 13/16] net: stmmac: print phy information

2017-02-08 Thread Corentin Labbe
When a PHY is found, printing which one was found (and which type/model) is a good information to know. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/d

[PATCH v2 07/16] net: stmmac: replace stmmac_mdio_busy_wait by readl_poll_timeout

2017-02-08 Thread Corentin Labbe
The stmmac_mdio_busy_wait() function do the same job than readl_poll_timeout(). So is is better to replace it. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac

[PATCH v2 15/16] net: stmmac: remove unused variable in sysfs_display_ring

2017-02-08 Thread Corentin Labbe
The u64 x variable in sysfs_display_ring is unused. This patch remove it. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 --- 1 file changed, 3 deletions(-)

[PATCH v2 16/16] net: stmmac: replace unsigned by u32

2017-02-08 Thread Corentin Labbe
checkpatch complains about two unsigned without type after. Since the value return is u32, it is simpler to replace it by u32 instead of "unsigned int" Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- driver

[PATCH v2 14/16] net: stmmac: remove dead code in stmmac_tx_clean

2017-02-08 Thread Corentin Labbe
Since commit cf32deec16e4 ("stmmac: add tx_skbuff_dma to save descriptors used by PTP"), the struct dma_desc *p in stmmac_tx_clean was not used at all. This patch remove this dead code. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavalla

[PATCH v2 03/16] net: stmmac: fix some typos in comments

2017-02-08 Thread Corentin Labbe
This patch fix some typos in comments. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 6 +++--- drivers/net/ethernet/stmicro/stmmac/stmmac

[PATCH v2 02/16] net: stmmac: Remove the bus_setup function pointer

2017-02-08 Thread Corentin Labbe
The bus_setup function pointer is not used at all, this patch remove it. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 include/linux/stmmac.h| 1 - 2 files changed, 5 deletions(-) diff

[PATCH v2 05/16] net: stmmac: remplace asm/io.h by linux/io.h

2017-02-08 Thread Corentin Labbe
This patch fix the checkpatch warning about asm/io.h. Sorting all includes in the process. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH v2 10/16] net: stmmac: Correct the error message about invalid speed

2017-02-08 Thread Corentin Labbe
The message about invalid speed does not state 1000 as a valid speed. It is much simpler to said that the speed is invalid. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 del

[PATCH v2 04/16] net: stmmac: remove freesoftware address

2017-02-08 Thread Corentin Labbe
This patch fix the checkpatch warning about free software address. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/chain_mode.c | 4 drivers/net/ethernet/stmicro/stmmac/common.h | 4 drivers/net/ethernet/stmicro/

[PATCH v2 06/16] net: stmmac: fix some code style problem

2017-02-08 Thread Corentin Labbe
Checkpatch complains about some code style problem on stmmac_mdio.c. This patch fix them. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 7 --- 1 fil

[PATCH v2 08/16] net: stmmac: Use readl_poll_timeout

2017-02-08 Thread Corentin Labbe
The dwmac_dma_reset function use an open coded of readl_poll_timeout(). Replace the open coded handling with the proper function. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 14 ++ 1 file changed, 6 insertions

[PATCH v2 00/16] net: stmmac: misc fix

2017-02-08 Thread Corentin Labbe
netdev_dbg() in "net: stmmac: print phy information" - Removed patch "net: stmmac: Implement NAPI for TX", it will be reworked - Changed error message in "Correct the error message about invalid speed" - Added some acked-by Corentin Labbe (16): net: stmmac: fix the typo

[PATCH v2 01/16] net: stmmac: fix the typo on MAC_RNABLE_RX

2017-02-08 Thread Corentin Labbe
the define MAC_RNABLE_RX have a typo, rename it to MAC_ENABLE_RX Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/common.h| 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c

Re: [PATCH 14/17] net: stmmac: print phy information

2017-02-03 Thread Corentin Labbe
On Tue, Jan 31, 2017 at 11:10:04AM +0100, Giuseppe CAVALLARO wrote: > On 1/31/2017 10:11 AM, Corentin Labbe wrote: > > When a PHY is found, printing which one was found (and which type/model) is > > a good information to know. > > > > Signed-off-by: Corentin Labbe

Re: [PATCH 13/17] net: stmmac: Implement NAPI for TX

2017-02-03 Thread Corentin Labbe
On Fri, Feb 03, 2017 at 10:15:30AM -0500, David Miller wrote: > From: Corentin Labbe <clabbe.montj...@gmail.com> > Date: Fri, 3 Feb 2017 14:41:45 +0100 > > > On Tue, Jan 31, 2017 at 11:12:25PM -0500, David Miller wrote: > >> From: Corentin Labbe <clabbe.montj...@

Re: [PATCH 13/17] net: stmmac: Implement NAPI for TX

2017-02-03 Thread Corentin Labbe
On Tue, Jan 31, 2017 at 11:12:25PM -0500, David Miller wrote: > From: Corentin Labbe <clabbe.montj...@gmail.com> > Date: Tue, 31 Jan 2017 10:11:48 +0100 > > > The stmmac driver run TX completion under NAPI but without checking > > the work done by the TX completion

Re: [PATCH] Net: ethernet: mediatek - Fix possible NULL derefrence.

2017-01-27 Thread Corentin Labbe
return -ENODEV; > + } > soc = (struct mtk_soc_data *)match->data; > > eth = devm_kzalloc(>dev, sizeof(*eth), GFP_KERNEL); > -- Hello You could use of_device_get_match_data() and simplifiy code Regards Corentin Labbe

[PATCH RFC] net: stmmac: unify registers dumps methods

2017-02-20 Thread Corentin Labbe
htool". Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/common.h | 4 +- .../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 10 +-- .../net/ethernet/stmicro/stmmac/dwmac1000_dma.c| 16 ++--- .../net/ethernet/stmicro/stmm

[PATCH RFC] net: stmmac: unify registers dumps methods

2017-02-20 Thread Corentin Labbe
. What do you think about this issue ? Corentin Labbe (1): net: stmmac: unify registers dumps methods drivers/net/ethernet/stmicro/stmmac/common.h | 4 +- .../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 10 +-- .../net/ethernet/stmicro/stmmac/dwmac1000_dma.c| 16 ++--- .../net/eth

Re: [PATCH 04/21] ARM: sun8i: dt: Add DT bindings documentation for Allwinner dwmac-sun8i

2017-02-20 Thread Corentin Labbe
On Thu, Feb 16, 2017 at 12:58:46PM -0800, Florian Fainelli wrote: > On 02/16/2017 04:48 AM, Corentin Labbe wrote: > > + > > +Optional properties: > > +- allwinner,tx-delay: TX clock delay chain value. Range value is 0-0x07. > > Default is 0) > > +- allwinner,rx-

[PATCH] net: vxge: fix typo argumnet argument

2017-02-25 Thread Corentin Labbe
This commit fix the typo argumnet/argument Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/neterion/vxge/vxge-ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/neterion/vxge/vxge-ethtool.c b/drivers/net/et

[PATCH] net: s2io: fix typo argumnet argument

2017-02-25 Thread Corentin Labbe
This commit fix the typo argumnet/argument Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/neterion/s2io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c

[PATCH] net: stmmac: unify registers dumps methods

2017-02-23 Thread Corentin Labbe
htool". Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/common.h | 4 +- .../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 10 +-- .../net/ethernet/stmicr

[PATCH v3 7/8] net: stmmac: reduce indentation by adding a continue

2017-02-15 Thread Corentin Labbe
As suggested by Joe Perches, replacing the "if phydev" logic permit to reduce indentation in the for loop. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> Reviewed-by: Giuseppe Cavallaro <peppe.cavall...

[PATCH v3 8/8] net: stmmac: invert the logic for dumping regs

2017-02-15 Thread Corentin Labbe
It is easier to follow the logic by removing the not operator Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> Reviewed-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/stm

[PATCH v3 5/8] net: stmmac: run stmmac_hw_fix_mac_speed when speed is valid

2017-02-15 Thread Corentin Labbe
This patch mutualise a bit by running stmmac_hw_fix_mac_speed() after the switch in case of valid speed. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> Reviewed-by: Giuseppe Cavallaro <peppe.cavall...@st.com>

[PATCH v3 3/8] net: stmmac: use SPEED_UNKNOWN/DUPLEX_UNKNOWN

2017-02-15 Thread Corentin Labbe
It is better to use DUPLEX_UNKNOWN instead of just "-1". Using 0 for an invalid speed is bad since 0 is a valid value for speed. So this patch replace 0 by SPEED_UNKNOWN. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall.

[PATCH v3 4/8] net: stmmac: set speed at SPEED_UNKNOWN in case of broken speed

2017-02-15 Thread Corentin Labbe
In case of invalid speed given, stmmac_adjust_link() still record it as current speed. This patch modify the default case to set speed as SPEED_UNKNOWN if not 10/100/1000. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com&

[PATCH v3 0/8] misc patchs

2017-02-15 Thread Corentin Labbe
Hello This is a follow up of my previous stmmac serie which address some comment done in v2. Corentin Labbe (8): net: stmmac: remove useless parenthesis net: stmmac: likely is useless in occasional function net: stmmac: use SPEED_UNKNOWN/DUPLEX_UNKNOWN net: stmmac: set speed

[PATCH v3 1/8] net: stmmac: remove useless parenthesis

2017-02-15 Thread Corentin Labbe
This patch remove some useless parenthesis. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> Reviewed-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 +++

[PATCH v3 2/8] net: stmmac: likely is useless in occasional function

2017-02-15 Thread Corentin Labbe
The stmmac_adjust_link() function is called too rarely for having likely() macros being useful. Just remove likely annotation in it. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> Reviewed-by: Giuseppe Cavallaro &

[PATCH v3 6/8] net: stmmac: split the stmmac_adjust_link 10/100 case

2017-02-15 Thread Corentin Labbe
The 10/100 case have too many ifcase. This patch split it for removing an if. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavall...@st.com> Reviewed-by: Giuseppe Cavallaro <peppe.cavall...@st.com> --- drivers/net/ether

[PATCH 7/8] net: stmmac: reduce indentation by adding a continue

2017-02-14 Thread Corentin Labbe
As suggested by Joe Perches, replacing the "if phydev" logic permit to reduce indentation in the for loop. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 82 +++ 1 file changed, 40 insertions(

[PATCH 8/8] net: stmmac: invert the logic for dumping regs

2017-02-14 Thread Corentin Labbe
It is easier to follow the logic by removing the not operator Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/s

[PATCH 4/8] net: stmmac: set speed at SPEED_UNKNOWN in case of broken speed

2017-02-14 Thread Corentin Labbe
In case of invalid speed given, stmmac_adjust_link() still record it as current speed. This patch modify the default case to set speed as SPEED_UNKNOWN if not 10/100/1000. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |

[PATCH 6/8] net: stmmac: split the stmmac_adjust_link 10/100 case

2017-02-14 Thread Corentin Labbe
The 10/100 case have too many ifcase. This patch split it for removing an if. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/et

[PATCH 5/8] net: stmmac: run stmmac_hw_fix_mac_speed when speed is valid

2017-02-14 Thread Corentin Labbe
This patch mutualise a bit by running stmmac_hw_fix_mac_speed() after the switch in case of valid speed. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[PATCH 1/8] net: stmmac: remove useless parenthesis

2017-02-14 Thread Corentin Labbe
This patch remove some useless parenthesis. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff

[PATCH 0/8] net: stmmac: misc patchs

2017-02-14 Thread Corentin Labbe
Hello This is a follow up of my previous stmmac serie which address some comment done in v2. Corentin Labbe (8): net: stmmac: remove useless parenthesis net: stmmac: likely is useless in occasional function net: stmmac: use SPEED_UNKNOWN/DUPLEX_UNKNOWN net: stmmac: set speed

[PATCH 3/8] net: stmmac: use SPEED_UNKNOWN/DUPLEX_UNKNOWN

2017-02-14 Thread Corentin Labbe
It is better to use DUPLEX_UNKNOWN instead of just "-1". Using 0 for an invalid speed is bad since 0 is a valid value for speed. So this patch replace 0 by SPEED_UNKNOWN. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/st

[PATCH 2/8] net: stmmac: likely is useless in occasional function

2017-02-14 Thread Corentin Labbe
The stmmac_adjust_link() function is called too rarely for having likely() macros being useful. Just remove likely annotation in it. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 1 file changed, 4 insertions

Re: [PATCH 0/8] net: stmmac: misc patchs

2017-02-14 Thread Corentin Labbe
On Wed, Feb 15, 2017 at 07:34:41AM +0100, Giuseppe CAVALLARO wrote: > Hello Corentin > > On 2/14/2017 8:54 PM, Corentin Labbe wrote: > > Hello > > > > This is a follow up of my previous stmmac serie which address some comment > > done in v2. > > I wonder

[PATCH 00/21] net-next: stmmac: add dwmac-sun8i ethernet driver

2017-02-16 Thread Corentin Labbe
are DT patch enabling it. Regards Corentin Labbe Corentin Labbe (16): net-next: stmmac add optional init_phy function net-next: stmmac: export stmmac_set_mac_addr/stmmac_get_mac_addr net-next: stmmac: add optional setup function ARM: sun8i: dt: Add DT bindings documentation for Allwinner

[PATCH 04/21] ARM: sun8i: dt: Add DT bindings documentation for Allwinner dwmac-sun8i

2017-02-16 Thread Corentin Labbe
This patch adds documentation for Device-Tree bindings for the Allwinner dwmac-sun8i driver. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- .../devicetree/bindings/net/dwmac-sun8i.txt| 86 ++ 1 file changed, 86 insertions(+) create mode

[PATCH 13/21] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange Pi plus

2017-02-16 Thread Corentin Labbe
The dwmac-sun8i hardware is present on the Orange PI plus. It uses an external PHY rtl8211e via RGMII. This patch create the needed regulator, emac and phy nodes. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/boot/dts/sun8i-h3-orangepi-plus.dt

[PATCH 12/21] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange PI One

2017-02-16 Thread Corentin Labbe
The dwmac-sun8i hardware is present on the Orange PI One. It uses the internal PHY. This patch create the needed emac node. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 8 1 file changed, 8 insertions(+) diff --git

[PATCH 08/21] ARM: dts: sun8i-h3: add dwmac-sun8i rgmii pins

2017-02-16 Thread Corentin Labbe
This patch add pinctrl node for dwmac-sun8i on H3. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/boot/dts/sun8i-h3.dtsi | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi index 6

[PATCH 17/21] ARM: dts: sun50i-a64: enable dwmac-sun8i on pine64

2017-02-16 Thread Corentin Labbe
The dwmac-sun8i hardware is present on the pine64 It uses an external PHY via RMII. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/all

[PATCH 01/21] net-next: stmmac add optional init_phy function

2017-02-16 Thread Corentin Labbe
For dwmac-sun8i, some actions must be done for enabling attached PHY. Thoses actions must be done after stmmac_probe_config_dt() and at start of stmmac_init_phy(). The best way to handle that is to add an optional init_phy() function. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.

[PATCH 02/21] net-next: stmmac: export stmmac_set_mac_addr/stmmac_get_mac_addr

2017-02-16 Thread Corentin Labbe
Thoses symbol will be needed for the dwmac-sun8i ethernet driver. For letting it to be build as module, they need to be exported. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

[PATCH 20/21] ARM: sunxi: Enable dwmac-sun8i driver on sunxi_defconfig

2017-02-16 Thread Corentin Labbe
From: LABBE Corentin <clabbe.montj...@gmail.com> Enable the dwmac-sun8i driver in the sunxi default configuration Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/configs/sunxi_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/sunxi

[PATCH 14/21] ARM: dts: sun8i: orangepi-pc-plus: Set EMAC activity LEDs to active high

2017-02-16 Thread Corentin Labbe
On the Orange Pi PC Plus, the polarity of the LEDs on the RJ45 Ethernet port were changed from active low to active high. Signed-off-by: Chen-Yu Tsai <w...@csie.org> Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts | 5 +

[PATCH 15/21] ARM64: dts: sun50i-a64: Add dt node for the syscon control module

2017-02-16 Thread Corentin Labbe
This patch add the dt node for the syscon register present on the Allwinner A64. Only two register are present in this syscon and the only one useful is the one dedicated to EMAC clock. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm64/boot/dts/allwinner/sun50i-a6

[PATCH 16/21] ARM64: dts: sun50i-a64: add dwmac-sun8i Ethernet driver

2017-02-16 Thread Corentin Labbe
at this level. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 37 +++ 1 file changed, 37 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

[PATCH 18/21] ARM: dts: sun50i-a64: enable dwmac-sun8i on pine64 plus

2017-02-16 Thread Corentin Labbe
The dwmac-sun8i hardware is present on the pine64 plus. It uses an external PHY rtl8211e via RGMII. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-)

[PATCH 21/21] ARM: sunxi: Enable dwmac-sun8i driver on multi_v7_defconfig

2017-02-16 Thread Corentin Labbe
Enable the dwmac-sun8i driver in the multi_v7 default configuration Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_def

[PATCH 19/21] ARM: dts: sun50i-a64: enable dwmac-sun8i on the BananaPi M64

2017-02-16 Thread Corentin Labbe
The dwmac-sun8i hardware is present on the BananaPi M64. It uses an external PHY rtl8211e via RGMII. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 14 ++ 1 file changed, 14 insertions(+) diff --git

[PATCH 05/21] net-next: stmmac: Add dwmac-sun8i

2017-02-16 Thread Corentin Labbe
The dwmac-sun8i is a heavy hacked version of stmmac hardware by allwinner. In fact the only common part is the descriptor management and the first register function. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/Kconfig| 11 + d

[PATCH 07/21] ARM: dts: sun8i-h3: add dwmac-sun8i ethernet driver

2017-02-16 Thread Corentin Labbe
From: LABBE Corentin <clabbe.montj...@gmail.com> The dwmac-sun8i is an ethernet MAC hardware that support 10/100/1000 speed. This patch enable the dwmac-sun8i on the Allwinner H3 SoC Device-tree. The SoC H3 have an internal PHY, so optionals syscon and ephy are set. Signed-off-by: Co

[PATCH 10/21] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange PI PC

2017-02-16 Thread Corentin Labbe
From: LABBE Corentin <clabbe.montj...@gmail.com> The dwmac-sun8i hardware is present on the Orange PI PC. It uses the internal PHY. This patch create the needed emac node. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 8

[PATCH 06/21] ARM: dts: sun8i-h3: Add dt node for the syscon control module

2017-02-16 Thread Corentin Labbe
From: LABBE Corentin <clabbe.montj...@gmail.com> This patch add the dt node for the syscon register present on the Allwinner H3. Only two register are present in this syscon and the only one useful is the one dedicated to EMAC clock. Signed-off-by: Corentin Labbe <clabbe.montj...@

[PATCH 03/21] net-next: stmmac: add optional setup function

2017-02-16 Thread Corentin Labbe
Instead of ading more ifthen login for adding a new mac_device_info setup function, it is easier to add a function pointer to the function needed. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++- include/linux/st

[PATCH 09/21] ARM: dts: sun8i: Enable dwmac-sun8i on the Banana Pi M2+

2017-02-16 Thread Corentin Labbe
From: LABBE Corentin <clabbe.montj...@gmail.com> The dwmac-sun8i hardware is present on the Banana Pi M2+ It uses an external PHY rtl8211e via RGMII. This patch create the needed regulator, emac and phy nodes. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/

[PATCH 11/21] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange Pi 2

2017-02-16 Thread Corentin Labbe
The dwmac-sun8i hardware is present on the Orange PI 2. It uses the internal PHY. This patch create the needed emac node. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 1 file changed, 8 insertions(+) diff --git a/ar

Re: [linux-sunxi] [PATCH 03/21] net-next: stmmac: add optional setup function

2017-02-17 Thread Corentin Labbe
On Thu, Feb 16, 2017 at 09:38:33PM +0100, Peter Korsgaard wrote: > >>>>> "Corentin" == Corentin Labbe <clabbe.montj...@gmail.com> writes: > > > Instead of ading more ifthen login for adding a new mac_device_info > > s/login/logic/ > > -

Re: [PATCH 20/21] ARM: sunxi: Enable dwmac-sun8i driver on sunxi_defconfig

2017-02-17 Thread Corentin Labbe
On Thu, Feb 16, 2017 at 08:08:27PM +0100, Maxime Ripard wrote: > Hi, > > On Thu, Feb 16, 2017 at 01:48:58PM +0100, Corentin Labbe wrote: > > From: LABBE Corentin <clabbe.montj...@gmail.com> > > > > Enable the dwmac-sun8i driver in the sunxi default configuration

Re: [PATCH 08/21] ARM: dts: sun8i-h3: add dwmac-sun8i rgmii pins

2017-02-17 Thread Corentin Labbe
On Thu, Feb 16, 2017 at 08:06:32PM +0100, Maxime Ripard wrote: > On Thu, Feb 16, 2017 at 01:48:46PM +0100, Corentin Labbe wrote: > > This patch add pinctrl node for dwmac-sun8i on H3. > > > > Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> > > --- >

Re: [PATCH 04/21] ARM: sun8i: dt: Add DT bindings documentation for Allwinner dwmac-sun8i

2017-02-17 Thread Corentin Labbe
On Thu, Feb 16, 2017 at 07:48:18PM +0100, Maxime Ripard wrote: > Hi, > > On Thu, Feb 16, 2017 at 01:48:42PM +0100, Corentin Labbe wrote: > > This patch adds documentation for Device-Tree bindings for the > > Allwinner dwmac-sun8i driver. > > > > Signed-off

Re: [PATCH 05/21] net-next: stmmac: Add dwmac-sun8i

2017-02-17 Thread Corentin Labbe
id) > > +{ > > + struct mac_device_info *mac; > > + > > + mac = kzalloc(sizeof(const struct mac_device_info), GFP_KERNEL); > > + if (!mac) > > + return NULL; > > Do you ever free that memory? > Good catch, I believed that the "stmmac framework" would free it. I will send a fix for this memory leak. [...] > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c > > b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c > > index 5ff6bc4..11db658 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c > > @@ -450,6 +450,9 @@ static void stmmac_ethtool_gregs(struct net_device *dev, > > for (i = 0; i < 22; i++) > > reg_space[i + 55] = > > readl(priv->ioaddr + (DMA_BUS_MODE + (i * 4))); > > + } else if (priv->plat->has_sun8i) { > > Surely we don't want to add a new flag to the common structure for > every new platform supported. > > Can't you base that on the compatible instead? This part will be fixed with the debugfs speaked early in the mail. But yes I have tried to avoid use of has_sun8i at maximum. > > Thanks a lot for your work, > Maxime > Thanks for the review Corentin Labbe

[PATCH v3 0/9] net-next: ethernet: add sun8i-emac driver

2016-09-09 Thread Corentin Labbe
stats strings - Removed all unneeded __packked and __aligned - Added tuning of RX/TX ring size via ethtool - Corrected use of sk/skb naming - Added some wmb when needed - Moved irq claim/free to emac_open/close - Lots of code refactoring Corentin Labbe (8): ethernet: sun8i-emac: add pm_runtime

[PATCH v3 3/9] ARM: sun8i: dt: Add DT bindings documentation for Allwinner sun8i-emac

2016-09-09 Thread Corentin Labbe
This patch adds documentation for Device-Tree bindings for the Allwinner sun8i-emac driver. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- .../bindings/net/allwinner,sun8i-emac.txt | 64 ++ 1 file changed, 64 insertions(+) create mode

[PATCH v3 5/9] ARM: dts: sun8i-h3: add sun8i-emac ethernet driver

2016-09-09 Thread Corentin Labbe
The sun8i-emac is an ethernet MAC hardware that support 10/100/1000 speed. This patch enable the sun8i-emac on the Allwinner H3 SoC Device-tree. The SoC H3 have an internal PHY, so optionals syscon and ephy are set. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/bo

[PATCH v3 6/9] ARM: dts: sun8i: Enable sun8i-emac on the Orange PI PC

2016-09-09 Thread Corentin Labbe
The sun8i-emac hardware is present on the Orange PI PC. It uses the internal PHY. This patch create the needed emac and phy nodes. Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 10 ++ 1 file changed, 10 insertions(+)

[RFC PATCH 9/9] ethernet: sun8i-emac: add pm_runtime support

2016-09-09 Thread Corentin Labbe
This patch add pm_runtime support to sun8i-emac. For the moment, only basic support is added, (the device is marked as used when net/open) Signed-off-by: Corentin Labbe <clabbe.montj...@gmail.com> --- drivers/net/ethernet/allwinner/sun8i-emac.c | 62 - 1 file c

  1   2   3   4   5   >