[PATCH net-next v1 6/6] arm64: dts: mt7622: Enlarge the SGMII register range

2019-05-31 Thread sean.wang
From: Sean Wang Enlarge the SGMII register range and using 2.5G force mode on default. Signed-off-by: Sean Wang --- arch/arm64/boot/dts/mediatek/mt7622.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/med

[PATCH net v1] net: ethernet: mediatek: Fixed several errors caused by undefined symbols

2019-06-04 Thread sean.wang
From: Sean Wang Fixed several errors caused by undefined symbols catched by kbuild test robot. ERROR: "mtk_sgmii_init" [drivers/net/ethernet/mediatek/mtk_eth_soc.ko] undefined! ERROR: "mtk_setup_hw_path" [drivers/net/ethernet/mediatek/mtk_eth_soc.ko] undefined! ERROR: "mtk_sgmii_setup_mode_for

[PATCH net 2/2] net: dsa: mt7530: fix module autoloading for OF platform drivers

2018-03-26 Thread sean.wang
From: Sean Wang It's required to create a modules.alias via MODULE_DEVICE_TABLE helper for the OF platform driver. Otherwise, module autoloading cannot work. Signed-off-by: Sean Wang --- drivers/net/dsa/mt7530.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/mt7530.c b/dri

[PATCH net 1/2] net: dsa: mt7530: remove redundant MODULE_ALIAS entries

2018-03-26 Thread sean.wang
From: Sean Wang MODULE_ALIAS exports information to allow the module to be auto-loaded at boot for the drivers registered using legacy platform registration. However, currently the driver is always used by DT-only platform, MODULE_ALIAS is redundant and should be removed properly. Signed-off-by

[PATCH net 2/2] net: mediatek: remove superfluous pin setup for MT7622 SoC

2017-12-20 Thread sean.wang
From: Sean Wang Remove superfluous pin setup to get out of accessing invalid I/O pin registers because the way for pin configuring tends to be different from various SoCs and thus it should be better being managed and controlled by the pinctrl driver which MT7622 already can support. Signed-off-

[PATCH net 1/2] dt-bindings: net: mediatek: add condition to property mediatek,pctl

2017-12-20 Thread sean.wang
From: Sean Wang The property "mediatek,pctl" is only required for SoCs such as MT2701 and MT7623, so adding a few words for stating the condition. Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/net/mediatek-net.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH net-next] net: Update MAINTAINERS for MediaTek switch driver

2020-09-21 Thread sean.wang
From: Sean Wang Update maintainers for MediaTek switch driver with Landen Chao who is familiar with MediaTek MT753x switch devices and will help maintenance from the vendor side. Cc: Steven Liu Signed-off-by: Sean Wang Signed-off-by: Landen Chao --- MAINTAINERS | 1 + 1 file changed, 1 inser

[PATCH] net: ethernet: mediatek: fixed deadlock captured by lockdep

2017-07-03 Thread sean.wang
From: Sean Wang Lockdep found an inconsistent lock state when mtk_get_stats64 is called in user context while NAPI updates MAC statistics in softirq. Use spin_trylock_bh/spin_unlock_bh fix following lockdep warning. [ 81.321030] WARNING: inconsistent lock state [ 81.325266] 4.12.0-rc1-00035

[PATCH net-next 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC

2017-07-11 Thread sean.wang
From: Sean Wang The series adds the driver for ethernet controller found on MT7622 SoC. There are additions against with previous MT7623 SoC such as shared SGMII given for the dual GMACs and built-in 5-ports 10/100 embedded switch support (ESW). Thus more clocks consumers and SGMII hardware setup

[PATCH net-next 1/4] dt-bindings: net: mediatek: add support for MediaTek MT7623 and MT7622 SoC

2017-07-11 Thread sean.wang
From: Sean Wang The patch adds the supplements in the dt-binding document for MediaTek MT7622 SoC with extra SGMII system controller and relevant clock consumers listed as the requirements for those SoCs equipped with the SGMII circuit. Also, add the missing binding information for MT7623 SoC her

[PATCH net-next 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC

2017-07-11 Thread sean.wang
From: Sean Wang This patch adds the driver for ethernet controller on MT7622 SoC. It has the similar handling logic as the previously MT7623 does, but there are additions against with MT7623 SoC, the shared SGMII given for the dual GMACs and including 5-ports 10/100 embedded switch support (ESW)

[PATCH net-next 4/4] MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers

2017-07-11 Thread sean.wang
From: Sean Wang Sean and Nelson work for MediaTek on maintaining the MediaTek ethernet driver for the existing SoCs and adding support for the following SoCs. In the past, Sean has been active at making most of the qualifications , stress test and submitting a lot of patches for the driver while

[PATCH net-next 2/4] net-next: mediatek: add platform data to adapt into various hardware

2017-07-11 Thread sean.wang
From: Sean Wang This patch is the preparation patch in order to adapt into various hardware through adding platform data which holds specific characteristics among MediaTek SoCs and introducing the unified clock handler for those distinct clock requirements depending on different features such as

[PATCH net-next v2 1/4] dt-bindings: net: mediatek: add support for MediaTek MT7623 and MT7622 SoC

2017-07-17 Thread sean.wang
From: Sean Wang The patch adds the supplements in the dt-binding document for MediaTek MT7622 SoC with extra SGMII system controller and relevant clock consumers listed as the requirements for those SoCs equipped with the SGMII circuit. Also, add the missing binding information for MT7623 SoC her

[PATCH net-next v2 4/4] MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers

2017-07-17 Thread sean.wang
From: Sean Wang Sean and Nelson work for MediaTek on maintaining the MediaTek ethernet driver for the existing SoCs and adding support for the following SoCs. In the past, Sean has been active at making most of the qualifications , stress test and submitting a lot of patches for the driver while

[PATCH net-next v2 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC

2017-07-17 Thread sean.wang
From: Sean Wang This patch adds the driver for ethernet controller on MT7622 SoC. It has the similar handling logic as the previously MT7623 does, but there are additions against with MT7623 SoC, the shared SGMII given for the dual GMACs and including 5-ports 10/100 embedded switch support (ESW)

[PATCH net-next v2 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC

2017-07-17 Thread sean.wang
From: Sean Wang Changes since v1: - add refinement for ethernet clock management - take out the code block for ESW, add it until ESW driver is actually introduced The series adds the driver for ethernet controller found on MT7622 SoC. There are additions against with previous MT7623 SoC such as

[PATCH net-next v2 2/4] net-next: mediatek: add platform data to adapt into various hardware

2017-07-17 Thread sean.wang
From: Sean Wang This patch is the preparation patch in order to adapt into various hardware through adding platform data which holds specific characteristics among MediaTek SoCs and introducing the unified clock handler for those distinct clock requirements depending on different features such as

[PATCH net] net: ethernet: mediatek: avoid potential invalid memory access

2017-07-19 Thread sean.wang
From: Sean Wang Potential dangerous invalid memory might be accessed if invalid mac value reflected from the forward port field in rxd4 caused by possible potential hardware defects. So added a simple sanity checker to avoid the kind of situation happening. Signed-off-by: Sean Wang --- drivers

[PATCH v2 net] net: ethernet: mediatek: avoid potential invalid memory access

2017-07-22 Thread sean.wang
From: Sean Wang Potential dangerous invalid memory might be accessed if invalid mac value reflected from the forward port field in rxd4 caused by possible potential hardware defects. So added a simple sanity checker to avoid the kind of situation happening. Signed-off-by: Sean Wang Acked-by: Jo

[PATCH] net: dsa: fixup fail to get tag in mtk_get_tag_protocol

2017-07-24 Thread sean.wang
From: Sean Wang dsa_is_cpu_port() checking ds->cpu_port_mask is not available in ds->ops->get_tag_protocol Since commit 14be36c2c96c ("net: dsa: Initialize all CPU and enabled ports masks in dsa_ds_parse()") So force returning DSA_TAG_PROTO_MTK inside mtk_get_tag_protocol call after that. Cc: F

[PATCH net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag

2017-12-06 Thread sean.wang
From: Sean Wang In order to let MT7530 switch can recognize well those packets having both special tag and VLAN tag, the information about the special tag should be carried on the existing VLAN tag. Signed-off-by: Sean Wang --- net/dsa/tag_mtk.c | 38 +- 1 f

[PATCH net-next 1/3] net: dsa: mediatek: add VLAN support for MT7530

2017-12-06 Thread sean.wang
From: Sean Wang MT7530 can treat each port as either VLAN-unware port or VLAN-ware port through the implementation of port matrix mode or port security mode on the ingress port, respectively. On one hand, Each port has been acting as the VLAN-unware one whenever the device is created in the initi

[PATCH net-next 0/3] add VLAN support to DSA MT7530

2017-12-06 Thread sean.wang
From: Sean Wang The patchset extends DSA MT7530 to VLAN support through filling required callbacks in patch 1 and merging the special tag with VLAN tag in patch 2 for allowing that the hardware can handle these packets with VID from the CPU port. Sean Wang (3): net: dsa: mediatek: add VLAN sup

[PATCH net-next 3/3] net: dsa: mediatek: update MAINTAINERS entry with MediaTek switch driver

2017-12-06 Thread sean.wang
From: Sean Wang I work for MediaTek and maintain SoC targeting to home gateway and also will keep extending and testing the function from MediaTek switch. Signed-off-by: Sean Wang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index c0edf30

[PATCH v2 net-next 1/3] net: dsa: mediatek: add VLAN support for MT7530

2017-12-12 Thread sean.wang
From: Sean Wang MT7530 can treat each port as either VLAN-unaware port or VLAN-aware port through the implementation of port matrix mode or port security mode on the ingress port, respectively. On one hand, Each port has been acting as the VLAN-unaware one whenever the device is created in the in

[PATCH v2 net-next 3/3] net: dsa: mediatek: update MAINTAINERS entry with MediaTek switch driver

2017-12-12 Thread sean.wang
From: Sean Wang I work for MediaTek and maintain SoC targeting to home gateway and also will keep extending and testing the function from MediaTek switch. Signed-off-by: Sean Wang Reviewed-by: Andrew Lunn --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b

[PATCH v2 net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag

2017-12-12 Thread sean.wang
From: Sean Wang In order to let MT7530 switch can recognize well those egress packets having both special tag and VLAN tag, the information about the special tag should be carried on the existing VLAN tag. On the other hand, it's unnecessary for extra handling for ingress packets when VLAN tag is

[PATCH v2 net-next 0/3] add VLAN support to DSA MT7530

2017-12-12 Thread sean.wang
From: Sean Wang Changes since v1: - fix up the typo - prefer ordering declarations longest to shortest - update that vlan_prepare callback should not change any state - use lower case letter for function naming The patchset extends DSA MT7530 to VLAN support through filling required callbacks in

[PATCH v3 net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag

2017-12-14 Thread sean.wang
From: Sean Wang In order to let MT7530 switch can recognize well those egress packets having both special tag and VLAN tag, the information about the special tag should be carried on the existing VLAN tag. On the other hand, it's unnecessary for extra handling for ingress packets when VLAN tag is

[PATCH v3 net-next 3/3] net: dsa: mediatek: update MAINTAINERS entry with MediaTek switch driver

2017-12-14 Thread sean.wang
From: Sean Wang I work for MediaTek and maintain SoC targeting to home gateway and also will keep extending and testing the function from MediaTek switch. Signed-off-by: Sean Wang Reviewed-by: Andrew Lunn --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b

[PATCH v3 net-next 0/3] add VLAN support to DSA MT7530

2017-12-14 Thread sean.wang
From: Sean Wang Changes sicne v2: update to the latest code base from net-next and fix up all building errors with -Werror. Changes since v1: - fix up the typo - prefer ordering declarations longest to shortest - update that vlan_prepare callback should not change any state - use lower case lett

[PATCH v3 net-next 1/3] net: dsa: mediatek: add VLAN support for MT7530

2017-12-14 Thread sean.wang
From: Sean Wang MT7530 can treat each port as either VLAN-unaware port or VLAN-aware port through the implementation of port matrix mode or port security mode on the ingress port, respectively. On one hand, Each port has been acting as the VLAN-unaware one whenever the device is created in the in

[PATCH net] net: mediatek: setup proper state for disabled GMAC on the default

2017-12-18 Thread sean.wang
From: Sean Wang The current solution would setup fixed and force link of 1Gbps to the both GMAC on the default. However, The GMAC should always be put to link down state when the GMAC is disabled on certain target boards. Otherwise, the driver possibly receives unexpected data from the floating h

[PATCH net-next v3 2/4] net-next: mediatek: add platform data to adapt into various hardware

2017-07-31 Thread sean.wang
From: Sean Wang This patch is the preparation patch in order to adapt into various hardware through adding platform data which holds specific characteristics among MediaTek SoCs and introducing the unified clock handler for those distinct clock requirements depending on different features such as

[PATCH net-next v3 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC

2017-07-31 Thread sean.wang
From: Sean Wang This patch adds the driver for ethernet controller on MT7622 SoC. It has the similar handling logic as the previously MT7623 does, but there are additions against with MT7623 SoC, the shared SGMII given for the dual GMACs and including 5-ports 10/100 embedded switch support (ESW)

[PATCH net-next v3 1/4] dt-bindings: net: mediatek: add support for MediaTek MT7623 and MT7622 SoC

2017-07-31 Thread sean.wang
From: Sean Wang The patch adds the supplements in the dt-binding document for MediaTek MT7622 SoC with extra SGMII system controller and relevant clock consumers listed as the requirements for those SoCs equipped with the SGMII circuit. Also, add the missing binding information for MT7623 SoC her

[PATCH net-next v3 4/4] MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers

2017-07-31 Thread sean.wang
From: Sean Wang Sean and Nelson work for MediaTek on maintaining the MediaTek ethernet driver for the existing SoCs and adding support for the following SoCs. In the past, Sean has been active at making most of the qualifications , stress test and submitting a lot of patches for the driver while

[PATCH net-next v3 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC

2017-07-31 Thread sean.wang
From: Sean Wang Changes since v2: - update John's mail Changes since v1: - add refinement for ethernet clock management - take out the code block for ESW, add it until ESW driver is actually introduced The series adds the driver for ethernet controller found on MT7622 SoC. There are additions

[PATCH net-next v2 1/5] dt-bindings: net: dsa: add Mediatek MT7530 binding

2017-03-21 Thread sean.wang
From: Sean Wang Add device-tree binding for Mediatek MT7530 switch. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang --- .../devicetree/bindings/net/dsa/mt7530.txt | 92 ++ 1 file changed, 92 insertions(+) create mode 100644 Documentation/devicetree/bindings

[PATCH net-next v2 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch

2017-03-21 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N platform which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports connecting with t

[PATCH net-next v2 0/5] net-next: dsa: add Mediatek MT7530 support

2017-03-21 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports connecting with the remote

[PATCH net-next v2 3/5] net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA

2017-03-21 Thread sean.wang
From: Sean Wang The patch adds the setup for allowing CDM can recognize these packets with carrying port-distinguishing tag. Otherwise, these tagging packets will be handled incorrectly by CDM. The setup is working out for general untag packets as well. Signed-off-by: Sean Wang Signed-off-by: L

[PATCH net-next v2 4/5] net-next: ethernet: mediatek: add device_node of GMAC pointing into the netdev instance

2017-03-21 Thread sean.wang
From: Sean Wang the patch adds the setup of the corresponding device node of GMAC into the netdev instance which could allow other modules such as DSA to find the instance through the node in dt-bindings using of_find_net_device_by_node() call. Signed-off-by: Sean Wang --- drivers/net/ethernet

[PATCH net-next v2 2/5] net-next: dsa: add Mediatek tag RX/TX handler

2017-03-21 Thread sean.wang
From: Sean Wang Add the support for the 4-bytes tag for DSA port distinguishing inserted allowing receiving and transmitting the packet via the particular port. The tag is being added after the source MAC address in the ethernet header. Signed-off-by: Sean Wang Signed-off-by: Landen Chao Revie

[PATCH net-next v3 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch

2017-03-29 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N platform which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports connecting with t

[PATCH net-next v3 1/5] dt-bindings: net: dsa: add Mediatek MT7530 binding

2017-03-29 Thread sean.wang
From: Sean Wang Add device-tree binding for Mediatek MT7530 switch. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang Acked-by: Rob Herring --- .../devicetree/bindings/net/dsa/mt7530.txt | 92 ++ 1 file changed, 92 insertions(+) create mode 100644 Documentat

[PATCH net-next v3 0/5] net-next: dsa: add Mediatek MT7530 support

2017-03-29 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports connecting with the remote

[PATCH net-next v3 4/5] net-next: ethernet: mediatek: add device_node of GMAC pointing into the netdev instance

2017-03-29 Thread sean.wang
From: Sean Wang the patch adds the setup of the corresponding device node of GMAC into the netdev instance which could allow other modules such as DSA to find the instance through the node in dt-bindings using of_find_net_device_by_node() call. Signed-off-by: Sean Wang Reviewed-by: Andrew Lunn

[PATCH net-next v3 3/5] net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA

2017-03-29 Thread sean.wang
From: Sean Wang The patch adds the setup for allowing CDM can recognize these packets with carrying port-distinguishing tag. Otherwise, these tagging packets will be handled incorrectly by CDM. The setup is also working out for general untag packets as well. Signed-off-by: Sean Wang Signed-off-

[PATCH net-next v3 2/5] net-next: dsa: add Mediatek tag RX/TX handler

2017-03-29 Thread sean.wang
From: Sean Wang Add the support for the 4-bytes tag for DSA port distinguishing inserted allowing receiving and transmitting the packet via the particular port. The tag is being added after the source MAC address in the ethernet header. Signed-off-by: Sean Wang Signed-off-by: Landen Chao Revie

[PATCH net-next v4 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch

2017-04-07 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N platform which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports connecting with t

[PATCH net-next v4 4/5] net-next: ethernet: mediatek: add device_node of GMAC pointing into the netdev instance

2017-04-07 Thread sean.wang
From: Sean Wang the patch adds the setup of the corresponding device node of GMAC into the netdev instance which could allow other modules such as DSA to find the instance through the node in dt-bindings using of_find_net_device_by_node() call. Signed-off-by: Sean Wang Reviewed-by: Andrew Lunn

[PATCH net-next v4 1/5] dt-bindings: net: dsa: add Mediatek MT7530 binding

2017-04-07 Thread sean.wang
From: Sean Wang Add device-tree binding for Mediatek MT7530 switch. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang Acked-by: Rob Herring --- .../devicetree/bindings/net/dsa/mt7530.txt | 92 ++ 1 file changed, 92 insertions(+) create mode 100644 Documentat

[PATCH net-next v4 2/5] net-next: dsa: add Mediatek tag RX/TX handler

2017-04-07 Thread sean.wang
From: Sean Wang Add the support for the 4-bytes tag for DSA port distinguishing inserted allowing receiving and transmitting the packet via the particular port. The tag is being added after the source MAC address in the ethernet header. Signed-off-by: Sean Wang Signed-off-by: Landen Chao Revie

[PATCH net-next v4 0/5] net-next: dsa: add Mediatek MT7530 support

2017-04-07 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports connecting with the remote

[PATCH net-next v4 3/5] net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA

2017-04-07 Thread sean.wang
From: Sean Wang The patch adds the setup for allowing CDM can recognize these packets with carrying port-distinguishing tag. Otherwise, these tagging packets will be handled incorrectly by CDM. The setup is also working out for general untag packets as well. Signed-off-by: Sean Wang Signed-off-

[PATCH net 1/2] net: ethernet: mediatek: fix inconsistency between TXD and the used buffer

2017-04-11 Thread sean.wang
From: Sean Wang Fix inconsistency between the TXD descriptor and the used buffer that would cause unexpected logic at mtk_tx_unmap() during skb housekeeping. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 17 - 1 file changed, 8 insertions(+), 9 dele

[PATCH net 0/2] Fix crash caused by reporting inconsistent skb->len to BQL

2017-04-11 Thread sean.wang
From: Sean Wang The series fixes kernel BUG caused by inconsistent SKB length reported into BQL. The reason for inconsistent length comes from hardware BUG which results in different port number carried on the TXD within the lifecycle of SKB. So patch 2) is proposed for use a software way to trac

[PATCH net 2/2] net: ethernet: mediatek: fix inconsistency of port number carried in TXD

2017-04-11 Thread sean.wang
From: Sean Wang Fix port inconsistency on TXD due to hardware BUG that would cause different port number is carried on the same TXD between tx_map() and tx_unmap() with the iperf test. It would cause confusing BQL logic which leads to kernel panic when dual GMAC runs concurrently. Signed-off-by:

[PATCH net-next] net: ethernet: mediatek: enhance TX path with recycling more SKBs in one poll

2017-04-11 Thread sean.wang
From: Sean Wang The patch adds the enhancement for recycling more TX completed SKBs in one NAPI polling handler if NAPI budgets are still available and hardware raises status bit shown for certain SKBs are aready done. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c |

[PATCH v2 net 0/2] Fix crash caused by reporting inconsistent skb->len to BQL

2017-04-13 Thread sean.wang
From: Sean Wang Changes since v1: - fix inconsistent enumeration which easily causes the potential bug The series fixes kernel BUG caused by inconsistent SKB length reported into BQL. The reason for inconsistent length comes from hardware BUG which results in different port number carried on the

[PATCH v2 net 1/2] net: ethernet: mediatek: fix inconsistency between TXD and the used buffer

2017-04-13 Thread sean.wang
From: Sean Wang Fix inconsistency between the TXD descriptor and the used buffer that would cause unexpected logic at mtk_tx_unmap() during skb housekeeping. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 17 - 1 file changed, 8 insertions(+), 9 dele

[PATCH v2 net 2/2] net: ethernet: mediatek: fix inconsistency of port number carried in TXD

2017-04-13 Thread sean.wang
From: Sean Wang Fix port inconsistency on TXD due to hardware BUG that would cause different port number is carried on the same TXD between tx_map() and tx_unmap() with the iperf test. It would cause confusing BQL logic which leads to kernel panic when dual GMAC runs concurrently. Signed-off-by:

[PATCH net-next 0/4] net-next: dsa: add Mediatek MT7530 support

2017-03-13 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports connecting with the remote

[PATCH net-next 1/4] dt-bindings: net: dsa: add Mediatek MT7530 binding

2017-03-13 Thread sean.wang
From: Sean Wang Add device-tree binding for Mediatek MT7530 switch. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang --- .../devicetree/bindings/net/dsa/mt7530.txt | 94 ++ 1 file changed, 94 insertions(+) create mode 100644 Documentation/devicetree/bindings

[PATCH net-next 3/4] net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA

2017-03-13 Thread sean.wang
From: Sean Wang Allowing CDM can recognize these packets with carrying port-distinguishing tag when CONFIG_NET_DSA_TAG_MTK is enabled. Otherwise, these packets will be dropped by CDM ingress. Signed-off-by: Sean Wang Signed-off-by: Landen Chao --- drivers/net/ethernet/mediatek/mtk_eth_soc.c |

[PATCH net-next 2/4] net-next: dsa: add Mediatek tag RX/TX handler

2017-03-13 Thread sean.wang
From: Sean Wang Add the support for the 4-bytes tag for DSA port distinguishing inserted allowing receiving and transmitting the packet via the particular port. The tag is being added after the source MAC address in the ethernet header. Signed-off-by: Sean Wang Signed-off-by: Landen Chao ---

[PATCH net-next 4/4] net-next: dsa: add dsa support for Mediatek MT7530 switch

2017-03-13 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N platform which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports connecting with t

Re: [RESEND PATCH net 09/10] net: ethernet: mediatek: use devm_mdiobus_alloc instead of mdiobus_alloc inside mtk_mdio_init

2016-08-25 Thread sean.wang
On Date: Thu, 25 Aug 2016 15:39:08 +0200, John Crispin wrote: >Hi Sean, > >small nitpick inline > >On 25/08/2016 12:45, Sean Wang wrote: >> a lot of parts in the driver uses devm_* APIs to gain benefits from the >> -eth->mii_bus = mdiobus_alloc(); >> +eth->mii_bus = devm_mdiobus_all

[PATCH net v2 1/9] net: ethernet: mediatek: fix fails from TX housekeeping due to incorrect port setup

2016-08-28 Thread sean.wang
From: Sean Wang which net device the SKB is complete for depends on the forward port on txd4 on the corresponding TX descriptor, but the information isn't set up well in case of SKB fragments that would lead to watchdog timeout from the upper layer, so fix it up. Signed-off-by: Sean Wang Acked

[PATCH net v2 9/9] net: ethernet: mediatek: fix error handling inside mtk_mdio_init

2016-08-28 Thread sean.wang
From: Sean Wang return -ENODEV if no child is found in MDIO bus. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ether

[PATCH net v2 7/9] net: ethernet: mediatek: fix the missing of_node_put() after node is used done inside mtk_mdio_init

2016-08-28 Thread sean.wang
From: Sean Wang This patch adds the missing of_node_put() after finishing the usage of of_get_child_by_name. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mediatek/mtk_et

[PATCH net v2 4/9] net: ethernet: mediatek: remove redundant free_irq for devm_request_irq allocated irq

2016-08-28 Thread sean.wang
From: Sean Wang these irqs are not used for shared irq and disabled during ethernet stops. irq requested by devm_request_irq is safe to be freed automatically on driver detach. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 -- 1 file chang

[PATCH net v2 0/9] net: ethernet: mediatek: a couple of fixes

2016-08-28 Thread sean.wang
From: Sean Wang a couple of fixes come out from integrating with linux-4.8 rc1 they all are verified and workable on linux-4.8 rc1 changes since v1: - usage of loops to work out if all required clock are ready instead of tedious coding - remove redundant pinctrl setup that is already done by cor

[PATCH net v2 3/9] net: ethernet: mediatek: fix API usage with skb_free_frag

2016-08-28 Thread sean.wang
From: Sean Wang use skb_free_frag() instead of legacy put_page() Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ether

[PATCH net v2 6/9] net: ethernet: mediatek: fix issue of driver removal with interface is up

2016-08-28 Thread sean.wang
From: Sean Wang mtk_stop() must be called to stop for freeing DMA resources acquired and restoring state changed by mtk_open() firstly when module removal. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 8 1 file changed, 8 insertions(+) diff --git a/drive

[PATCH net v2 8/9] net: ethernet: mediatek: use devm_mdiobus_alloc instead of mdiobus_alloc inside mtk_mdio_init

2016-08-28 Thread sean.wang
From: Sean Wang a lot of parts in the driver uses devm_* APIs to gain benefits from the device resource management, so devm_mdiobus_alloc is also used instead of mdiobus_alloc to have more elegant code flow. Using common code provided by the devm_* helps to 1) have simplified the code flow as [1

[PATCH net v2 5/9] net: ethernet: mediatek: fix logic unbalance between probe and remove

2016-08-28 Thread sean.wang
From: Sean Wang original mdio_cleanup is not in the symmetric place against where mdio_init is, so relocate mdio_cleanup to the right one. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[PATCH net v2 2/9] net: ethernet: mediatek: fix incorrect return value of devm_clk_get with EPROBE_DEFER

2016-08-28 Thread sean.wang
From: Sean Wang 1) If the return value of devm_clk_get is EPROBE_DEFER, we should defer probing the driver. The change is verified and works based on 4.8-rc1 staying with the latest clk-next code for MT7623. 2) Changing with the usage of loops to work out if all clocks are fine Signed-off-by: Se

[PATCH net v3 0/9] net: ethernet: mediatek: a couple of fixes

2016-08-29 Thread sean.wang
From: Sean Wang a couple of fixes come out from integrating with linux-4.8 rc1 they all are verified and workable on linux-4.8 rc1 Changes since v1: - usage of loops to work out if all required clock are ready instead of tedious coding - remove redundant pinctrl setup that is already done by cor

[PATCH net v3 2/9] net: ethernet: mediatek: fix incorrect return value of devm_clk_get with EPROBE_DEFER

2016-08-29 Thread sean.wang
From: Sean Wang 1) If the return value of devm_clk_get is EPROBE_DEFER, we should defer probing the driver. The change is verified and works based on 4.8-rc1 staying with the latest clk-next code for MT7623. 2) Changing with the usage of loops to work out if all clocks required are fine Signed-o

[PATCH net v3 8/9] net: ethernet: mediatek: use devm_mdiobus_alloc instead of mdiobus_alloc inside mtk_mdio_init

2016-08-29 Thread sean.wang
From: Sean Wang a lot of parts in the driver uses devm_* APIs to gain benefits from the device resource management, so devm_mdiobus_alloc is also used instead of mdiobus_alloc to have more elegant code flow. Using common code provided by the devm_* helps to 1) have simplified the code flow as [1

[PATCH net v3 7/9] net: ethernet: mediatek: fix the missing of_node_put() after node is used done inside mtk_mdio_init

2016-08-29 Thread sean.wang
From: Sean Wang This patch adds the missing of_node_put() after finishing the usage of of_get_child_by_name. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mediatek/mtk_et

[PATCH net v3 1/9] net: ethernet: mediatek: fix fails from TX housekeeping due to incorrect port setup

2016-08-29 Thread sean.wang
From: Sean Wang which net device the SKB is complete for depends on the forward port on txd4 on the corresponding TX descriptor, but the information isn't set up well in case of SKB fragments that would lead to watchdog timeout from the upper layer, so fix it up. Signed-off-by: Sean Wang Acked

[PATCH net v3 5/9] net: ethernet: mediatek: fix logic unbalance between probe and remove

2016-08-29 Thread sean.wang
From: Sean Wang original mdio_cleanup is not in the symmetric place against where mdio_init is, so relocate mdio_cleanup to the right one. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[PATCH net v3 4/9] net: ethernet: mediatek: remove redundant free_irq for devm_request_irq allocated irq

2016-08-29 Thread sean.wang
From: Sean Wang these irqs are not used for shared irq and disabled during ethernet stops. irq requested by devm_request_irq is safe to be freed automatically on driver detach. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 -- 1 file chang

[PATCH net v3 9/9] net: ethernet: mediatek: fix error handling inside mtk_mdio_init

2016-08-29 Thread sean.wang
From: Sean Wang Return -ENODEV if the MDIO bus is disabled in the device tree. Signed-off-by: Sean Wang Acked-by: John Crispin Reviewed-by: Andrew Lunn --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/med

[PATCH net v3 3/9] net: ethernet: mediatek: fix API usage with skb_free_frag

2016-08-29 Thread sean.wang
From: Sean Wang use skb_free_frag() instead of legacy put_page() Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ether

[PATCH net v3 6/9] net: ethernet: mediatek: fix issue of driver removal with interface is up

2016-08-29 Thread sean.wang
From: Sean Wang mtk_stop() must be called to stop for freeing DMA resources acquired and restoring state changed by mtk_open() firstly when module removal. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 8 1 file changed, 8 insertions(+) diff --git a/drive

[PATCH net v4 4/9] net: ethernet: mediatek: remove redundant free_irq for devm_request_irq allocated irq

2016-08-31 Thread sean.wang
From: Sean Wang these irqs are not used for shared irq and disabled during ethernet stops. irq requested by devm_request_irq is safe to be freed automatically on driver detach. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 -- 1 file chang

[PATCH net v4 2/9] net: ethernet: mediatek: fix incorrect return value of devm_clk_get with EPROBE_DEFER

2016-08-31 Thread sean.wang
From: Sean Wang 1) If the return value of devm_clk_get is EPROBE_DEFER, we should defer probing the driver. The change is verified and works based on 4.8-rc1 staying with the latest clk-next code for MT7623. 2) Changing with the usage of loops to work out if all clocks required are fine Signed-o

[PATCH net v4 0/9] net: ethernet: mediatek: a couple of fixes

2016-08-31 Thread sean.wang
From: Sean Wang a couple of fixes come out from integrating with linux-4.8 rc1 they all are verified and workable on linux-4.8 rc1 Changes since v1: - usage of loops to work out if all required clock are ready instead of tedious coding - remove redundant pinctrl setup that is already done by cor

[PATCH net v4 8/9] net: ethernet: mediatek: use devm_mdiobus_alloc instead of mdiobus_alloc inside mtk_mdio_init

2016-08-31 Thread sean.wang
From: Sean Wang a lot of parts in the driver uses devm_* APIs to gain benefits from the device resource management, so devm_mdiobus_alloc is also used instead of mdiobus_alloc to have more elegant code flow. Using common code provided by the devm_* helps to 1) have simplified the code flow as [1

[PATCH net v4 9/9] net: ethernet: mediatek: fix error handling inside mtk_mdio_init

2016-08-31 Thread sean.wang
From: Sean Wang Return -ENODEV if the MDIO bus is disabled in the device tree. Signed-off-by: Sean Wang Acked-by: John Crispin Reviewed-by: Andrew Lunn --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/med

[PATCH net v4 3/9] net: ethernet: mediatek: fix API usage with skb_free_frag

2016-08-31 Thread sean.wang
From: Sean Wang use skb_free_frag() instead of legacy put_page() Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ether

[PATCH net v4 1/9] net: ethernet: mediatek: fix fails from TX housekeeping due to incorrect port setup

2016-08-31 Thread sean.wang
From: Sean Wang which net device the SKB is complete for depends on the forward port on txd4 on the corresponding TX descriptor, but the information isn't set up well in case of SKB fragments that would lead to watchdog timeout from the upper layer, so fix it up. Signed-off-by: Sean Wang Acked

[PATCH net v4 6/9] net: ethernet: mediatek: fix issue of driver removal with interface is up

2016-08-31 Thread sean.wang
From: Sean Wang mtk_stop() must be called to stop for freeing DMA resources acquired and restoring state changed by mtk_open() firstly when module removal. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 8 1 file changed, 8 insertions(+) diff --git a/drive

[PATCH net v4 7/9] net: ethernet: mediatek: fix the missing of_node_put() after node is used done inside mtk_mdio_init

2016-08-31 Thread sean.wang
From: Sean Wang This patch adds the missing of_node_put() after finishing the usage of of_get_child_by_name. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mediatek/mtk_et

[PATCH net v4 5/9] net: ethernet: mediatek: fix logic unbalance between probe and remove

2016-08-31 Thread sean.wang
From: Sean Wang original mdio_cleanup is not in the symmetric place against where mdio_init is, so relocate mdio_cleanup to the right one. Signed-off-by: Sean Wang Acked-by: John Crispin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

  1   2   >