Re: [PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode

2021-02-21 Thread Serge Semin
On Sat, Feb 20, 2021 at 04:49:22PM +0100, Andrew Lunn wrote: > > If in doubt, leaving the patch as is would be fine with me. > > The patch is O.K. as is, no need to export something so simple for a > single users. When the next user come along, we can reconsider. Ok. Thanks for clarification. I p

Re: [PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode

2021-02-20 Thread Serge Semin
On Thu, Feb 11, 2021 at 10:39:41AM +, Russell King - ARM Linux admin wrote: > On Wed, Feb 10, 2021 at 07:47:20PM +0300, Serge Semin wrote: > > On Tue, Feb 09, 2021 at 10:56:46AM +, Russell King - ARM Linux admin > > wrote: > > > On Tue, Feb 09, 2021 at 11:37:29A

Re: [PATCH v2 04/24] dt-bindings: net: dwmac: Refactor snps,*-config properties

2021-02-18 Thread Serge Semin
On Thu, Feb 11, 2021 at 12:58:00AM +0300, Serge Semin wrote: > On Tue, Feb 09, 2021 at 04:26:08PM -0600, Rob Herring wrote: > > On Mon, Feb 08, 2021 at 04:55:48PM +0300, Serge Semin wrote: > > > Currently the "snps,axi-config", "snps,mtl-rx-config" and >

Re: [PATCH 01/16] dt-bindings: net: dwmac: Add DW GMAC GPIOs properties

2021-02-18 Thread Serge Semin
On Thu, Feb 11, 2021 at 01:28:06AM +0300, Serge Semin wrote: > On Tue, Feb 09, 2021 at 05:13:52PM -0600, Rob Herring wrote: > > On Mon, Feb 08, 2021 at 05:08:05PM +0300, Serge Semin wrote: > > > Synopsys DesignWare Ethernet controllers can be synthesized with > > >

Re: [PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode

2021-02-11 Thread Serge Semin
On Thu, Feb 11, 2021 at 10:39:41AM +, Russell King - ARM Linux admin wrote: > On Wed, Feb 10, 2021 at 07:47:20PM +0300, Serge Semin wrote: > > On Tue, Feb 09, 2021 at 10:56:46AM +, Russell King - ARM Linux admin > > wrote: > > > On Tue, Feb 09, 2021 at 11:37:29A

Re: [PATCH 01/16] dt-bindings: net: dwmac: Add DW GMAC GPIOs properties

2021-02-10 Thread Serge Semin
On Tue, Feb 09, 2021 at 05:13:52PM -0600, Rob Herring wrote: > On Mon, Feb 08, 2021 at 05:08:05PM +0300, Serge Semin wrote: > > Synopsys DesignWare Ethernet controllers can be synthesized with > > General-Purpose IOs support. GPIOs can work either as inputs or as outputs > &g

Re: [PATCH v2 16/24] net: stmmac: Use optional reset control API to work with stmmaceth

2021-02-10 Thread Serge Semin
On Wed, Feb 10, 2021 at 02:49:24PM +0800, Jisheng Zhang wrote: > Hi, > > On Mon, 8 Feb 2021 16:56:00 +0300 Serge Semin wrote: > > > > > > Since commit bb3222f71b57 ("net: stmmac: platform: use optional clk/reset > > get APIs") a manual implemen

Re: [PATCH v2 07/24] dt-bindings: net: dwmac: Detach Generic DW MAC bindings

2021-02-10 Thread Serge Semin
On Tue, Feb 09, 2021 at 04:32:58PM -0600, Rob Herring wrote: > On Mon, Feb 08, 2021 at 04:55:51PM +0300, Serge Semin wrote: > > Currently the snps,dwmac.yaml DT bindings file is used for both DT nodes > > describing generic DW MAC devices and as DT schema with common properties >

Re: [PATCH v2 04/24] dt-bindings: net: dwmac: Refactor snps,*-config properties

2021-02-10 Thread Serge Semin
On Tue, Feb 09, 2021 at 04:26:08PM -0600, Rob Herring wrote: > On Mon, Feb 08, 2021 at 04:55:48PM +0300, Serge Semin wrote: > > Currently the "snps,axi-config", "snps,mtl-rx-config" and > > "snps,mtl-tx-config" properties are declared as a single phand

Re: [PATCH 00/16] net: stmmac: Add DW MAC GPIOs and Baikal-T1 GMAC support

2021-02-10 Thread Serge Semin
On Tue, Feb 09, 2021 at 03:11:41PM +0100, Andrew Lunn wrote: > > Regarding splitting the series up. I don't see a problem in just > > sending the cover-letter patch and actual GPIO-related patches to > > the GPIO-maintainers with no need to have them added to Cc in the rest > > of the series. > >

Re: [PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode

2021-02-10 Thread Serge Semin
On Tue, Feb 09, 2021 at 10:56:46AM +, Russell King - ARM Linux admin wrote: > On Tue, Feb 09, 2021 at 11:37:29AM +0100, Heiner Kallweit wrote: > > Right, adding something like a genphy_{read,write}_mmd() doesn't make > > too much sense for now. What I meant is just exporting mmd_phy_indirect().

Re: [PATCH 00/16] net: stmmac: Add DW MAC GPIOs and Baikal-T1 GMAC support

2021-02-09 Thread Serge Semin
On Mon, Feb 08, 2021 at 08:36:33PM +0100, Andrew Lunn wrote: > On Mon, Feb 08, 2021 at 05:08:04PM +0300, Serge Semin wrote: > > Hi Serge > > I suggest you split this patchset up. This uses the generic GPIO > framework, which is great. But that also means you should be Cc: th

Re: [PATCH v2 00/24] net: stmmac: Fix clocks/reset-related procedures

2021-02-09 Thread Serge Semin
On Mon, Feb 08, 2021 at 11:05:21AM -0800, Jakub Kicinski wrote: > On Mon, 8 Feb 2021 16:55:44 +0300 Serge Semin wrote: > > Baikal-T1 SoC is equipped with two Synopsys DesignWare GMAC v3.73a-based > > ethernet interfaces with no internal Ethernet PHY attached. The IP-cores > &

Re: [PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode

2021-02-09 Thread Serge Semin
On Mon, Feb 08, 2021 at 09:14:02PM +0100, Heiner Kallweit wrote: > On 08.02.2021 15:03, Serge Semin wrote: > > It has been noticed that RTL8211E PHY stops detecting and reporting events > > when EEE is successfully advertised and RXC stopping in LPI is enabled. > > The freez

Re: [PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode

2021-02-08 Thread Serge Semin
On Mon, Feb 08, 2021 at 04:27:36PM +0100, Andrew Lunn wrote: > On Mon, Feb 08, 2021 at 05:03:22PM +0300, Serge Semin wrote: > > It has been noticed that RTL8211E PHY stops detecting and reporting events > > when EEE is successfully advertised and RXC stopping in LPI is enabled.

[PATCH 14/16] net: stmmac: Add Generic DW MAC GPIO port driver

2021-02-08 Thread Serge Semin
to the initial state too. Instead we suggest to at least restore the DMA/MAC registers to the initial state, when the software reset were supposed to happen. Signed-off-by: Serge Semin --- .../ethernet/stmicro/stmmac.rst | 4 + drivers/net/ethernet/stmicro/stmmac/Kconfig |

[PATCH 16/16] net: stmmac: Add DW MAC IPs of 3.72a/3.73a/3.74a versions

2021-02-08 Thread Serge Semin
if there were no more specific glue-driver for them. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c

[PATCH 15/16] net: stmmac: Add DW GMAC GPIOs support

2021-02-08 Thread Serge Semin
. Signed-off-by: Serge Semin --- Folks, I don't know whether the same GPIO CSR layout is defined for some other DW MAC IP-core. So for now the accessors have been created for GMACs only. But if you are sure the callbacks can be used for some other IP, I can move them to dwmac_lib.c. Though in

[PATCH 08/16] net: stmmac: Introduce Safety Feature IRQs enable/disable methods

2021-02-08 Thread Serge Semin
them have been enabled by default. Signed-off-by: Serge Semin --- Folks, the zero initialization of the DW xGMAC XGMAC_MTL_ECC_CONTROL register looks suspicious. Are you sure it is supposed to be cleared out in order to enable the safety IRQs? --- .../net/ethernet/stmicro/stmmac/dwmac4_core.c

[PATCH 12/16] net: stmmac: Introduce NIC software reset function

2021-02-08 Thread Serge Semin
uired for some early versions of DW GMAC (in our case it's DW GMAC v3.73a). Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 32 +-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

[PATCH 10/16] net: stmmac: Convert STMMAC_DOWN flag to STMMAC_UP

2021-02-08 Thread Serge Semin
onous flag switching together with the IRQs unmasking and masking. Luckily the IRQs are normally enabled/disable in the late/early network initialization stages respectively. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +- drivers/net/ethernet/stmi

[PATCH 06/16] net: stmmac: Extend DMA IRQs enable/disable interface

2021-02-08 Thread Serge Semin
le the DMA IRQs anymore. Such modification won't break the DMA-related code because the default macro has both Tx and Rx DMA IRQs flags set anyway. So in order to make things working as usual we just need to call the stmmac_enable_dma_irq() method aside with the generic IRQs activating function.

[PATCH 05/16] net: stmmac: Introduce MAC IRQs enable/disable methods

2021-02-08 Thread Serge Semin
uired for the case of the IRQs handler being setup at the device probe stage, which will be introduced later in one of the following up commits. Signed-off-by: Serge Semin --- .../ethernet/stmicro/stmmac/dwmac1000_core.c | 28 + .../net/ethernet/stmicro/stmmac/dwmac4_core.c

[PATCH 03/16] net: stmmac: Introduce MAC core cleanup method

2021-02-08 Thread Serge Semin
That method will be useful for devices with GPIOs support. For now we've got a chip with DW GMAC IP and GPIOs synthesied, so the cleanup method is added to the corresponding driver sub-module only. Signed-off-by: Serge Semin --- .../ethernet/stmicro/stmmac/dwmac1000_co

[PATCH 13/16] net: stmmac: Request IRQs at device probe stage

2021-02-08 Thread Serge Semin
ocess. Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 157 +++--- 1 file changed, 96 insertions(+), 61 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index c4c41b5

[PATCH 09/16] net: stmmac: Disable MMC IRQs in the generic IRQs disable method

2021-02-08 Thread Serge Semin
A/etc interrupt control methods. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ind

[PATCH 11/16] net: stmmac: Add STMMAC state getter

2021-02-08 Thread Serge Semin
stead because the latter gives more accurate notion of the network state as the flag is set only after all the NIC initializations are finished. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 + .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 4 ++- .../net/eth

[PATCH 04/16] net: stmmac: Introduce DMA core cleanup method

2021-02-08 Thread Serge Semin
For now we've created the DMA cleanup method for the DW GMAC IP only, since the chip we've got has been equipped with that IP and we lack the documents to add and test the rest of the IPs support. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c | 1

[PATCH 07/16] net: stmmac: Introduce MTL IRQs enable/disable methods

2021-02-08 Thread Serge Semin
tatus handler. Also note there is no need in enabling the MTL IRQs in the stmmac_set_dma_operation_mode() method, because the later is called from the DMA IRQ context and doesn't really intent the MTL IRQs setup change anyway. Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/

[PATCH 02/16] dt-bindings: net: Add Baikal-T1 GMAC bindings

2021-02-08 Thread Serge Semin
eight MAC address slots, one GPI and one GPO ports. Generic DW MAC/STMMAC driver will easily handle the DT-node describing the Baikal-T1 GMAC network devices, but the bindings still needs to be created to have a better understanding of what the interface looks like. Signed-off-by: Serge Semin

[PATCH 00/16] net: stmmac: Add DW MAC GPIOs and Baikal-T1 GMAC support

2021-02-08 Thread Serge Semin
of the next patchset: Link: https://lore.kernel.org/netdev/20210208140341.9271-1-sergey.se...@baikalelectronics.ru otherwise a few patches won't get merged in cleanly. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Pavel Parkhomenko Cc: Vyacheslav Mitrofanov Cc: Maxime Coquelin Cc: ne

[PATCH 01/16] dt-bindings: net: dwmac: Add DW GMAC GPIOs properties

2021-02-08 Thread Serge Semin
properties like "gpio-controller" and "#gpio-cells", and, if GPIs are supposed to be detected, IRQ-controller related properties. Signed-off-by: Serge Semin --- .../devicetree/bindings/net/snps,dwmac.yaml | 17 + 1 file changed, 17 insertions(+) diff --git

[PATCH 15/20] net: stmmac: Discard STMMAC_RESETING flag

2021-02-08 Thread Serge Semin
That flag is totally useless. It's set inside a non-reentrant mutex-protected section. For the same reason the test-and-set loop is also pointless. The flag is also unused anywhere else in the driver. So just drop it. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stm

[PATCH 19/20] net: stmmac: Move DMA stop procedure to HW-setup antagonist

2021-02-08 Thread Serge Semin
n the stmmac_hw_setup() error path and in the network device release callback. So by introducing this alteration we not only improve the code readability, but also make the stmmac_hw_teardown() doing better the HW cleanup work. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.

[PATCH 20/20] net: stmmac: Move MAC Tx/Rx disabling to HW-setup antagonist

2021-02-08 Thread Serge Semin
Since MAC Tx/Rx activity is enabled in the core hardware setup procedure it would be logically correct to it disabled in the HW-setup antagonist - stmmac_hw_teardown(). Let's do that to improve the driver code coherency and thus readability. Signed-off-by: Serge Semin --- drivers/net/eth

[PATCH 18/20] net: stmmac: Move PTP clock enabling to PTP-init method

2021-02-08 Thread Serge Semin
w_teardown(). Thus call the later one when the network device is closed to clean the PTP-interface too. Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 25 +-- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/stmi

[PATCH 17/20] net: stmmac: Add 'cause' arg to the service task executioner

2021-02-08 Thread Serge Semin
e reset. The changes provided here will also prevent the global error handler from being called twice if the service task has already being executed while reset sub-task still isn't started. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 15 -

[PATCH 16/20] net: stmmac: Discard conditional service task execution

2021-02-08 Thread Serge Semin
rvice sub-tasks shall determine whether they really need to be performed in particular situations. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 - drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 + 2 files changed, 1 insertion(+), 5 deletions(-)

[PATCH 14/20] net: stmmac: Add DW GMAC disable LPI IRQ mask macro

2021-02-08 Thread Serge Semin
Indeed the DW GMAC Interrupts mask register has got an ability to disable the LPI interrupts. Add the macro to close up the MAC IRQs mask macros set. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net

[PATCH 13/20] net: stmmac: Move DMA Tx/Rx init methods to DW MAC lib

2021-02-08 Thread Serge Semin
These methods are identical for both DW MAC100 and DW MAC1000 cores, so their implementation can be moved to the common for the core library. Signed-off-by: Serge Semin --- .../ethernet/stmicro/stmmac/dwmac1000_dma.c | 20 ++- .../ethernet/stmicro/stmmac/dwmac100_dma.c| 20

[PATCH 12/20] net: stmmac: Discard dwmac1000_dma_ops declaration from dwmac100.h

2021-02-08 Thread Serge Semin
Indeed it's redundant to have that variable declaration in the dwmac1000.h header file since it's used in the hwif.c module only and declared in its header together with the rest of the ops descriptors. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 1

[PATCH 11/20] net: stmmac: Discard index usage in the dirty_rx init

2021-02-08 Thread Serge Semin
Indeed in accordance with the initialization loop logics the statement "(i - priv->dma_rx_size)" will always equal to zero. Just initialize the dirty_rx pointer with zero then. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed

[PATCH 10/20] net: stmmac: Discard Rx copybreak ethtool setting

2021-02-08 Thread Serge Semin
af6106ae949 ("net: stmmac: Introducing support for Page Pool") and in commit d66e67bd4cc7 ("net: stmmac: Remove unused inline function stmmac_rx_threshold_count"). Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 - .../e

[PATCH 09/20] net: stmmac: Discard mii_irq array from private data

2021-02-08 Thread Serge Semin
There has been no user of the denoted array of the device private data since commit e7f4dc3536a4 ("mdio: Move allocation of interrupts into core"). Discard it then. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 - 1 file changed, 1 deletion(-) di

[PATCH 08/20] net: stmmac: Fix typo in the XGMAC_L3_ADDR3 macro name

2021-02-08 Thread Serge Semin
The macro has been declared as XMGAC_L3_ADDR3 with obvious second and third chars confused. Revert them then. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac

[PATCH 07/20] net: stmmac: Clear descriptors before initializing them

2021-02-08 Thread Serge Semin
discarding the Rx descriptor clearance from the init_dma_rx_desc_rings() method and move the generic method of all descriptors clearance to the head of the init_dma_desc_rings() function. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++ 1 file changed

[PATCH 05/20] net: stmmac: Use dwmac410_disable_dma_irq for DW MAC v4.10 DMA

2021-02-08 Thread Serge Semin
a coherent driver code. Fixes: 021bd5e36970 ("net: stmmac: Let TX and RX interrupts be independently enabled/disabled") Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 06/20] net: stmmac: Use LPI IRQ status-related macro in DW MAC1000 isr

2021-02-08 Thread Serge Semin
error because the bits position match in both DW MAC IRQ mask and status registers, but semantically the code still doesn't look correct. Let's fix that by using the correct macro there. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 +- 1 file chang

[PATCH 01/20] net: phy: realtek: Fix events detection failure in LPI mode

2021-02-08 Thread Serge Semin
fix that problem we suggest to locally re-implement the MMD write method for RTL8211E PHY and perform a dummy read right after the PC1R register is accessed to enable the RXC stopping in LPI mode. Signed-off-by: Serge Semin --- drivers/net/phy/realtek.c | 37 +

[PATCH 03/20] net: stmmac: Fix false MTL RX overflow handling for higher queues

2021-02-08 Thread Serge Semin
nt prepared for multiple queues") Signed-off-by: Serge Semin --- Folks, I haven't seen an effect of that bug. The patch has been created purely based on the code visual perception. If you think the handler is supposed to work like that and I am missing something (though I have much doubt ab

[PATCH 04/20] net: stmmac: Assert reset control after MDIO de-registration

2021-02-08 Thread Serge Semin
ned-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index d45af1ea2565..1c40dc26fbf7 100644 --- a/d

[PATCH v2 23/24] net: stmmac: Use pclk to set MDC clock frequency

2021-02-08 Thread Serge Semin
[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a, October 2013, p. 424. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/st

[PATCH v2 20/24] net: stmmac: dwc-qos: Discard Tx/Rx clocks request

2021-02-08 Thread Serge Semin
. Note also the deprecated clock "phy_ref_clk" have been defined as the Tx clock in the DWC QoS Eth bindings. Let's use a pointer to the Tx clock defined in the platform data then instead of the unrelated pclk pointer. Signed-off-by: Serge Semin --- .../stmicro/stmmac/dwma

[PATCH 00/20] net: stmmac: Obvious cleanups and several fixes

2021-02-08 Thread Serge Semin
ronics.ru/ otherwise a few patches won't get merged in cleanly. Fixes: 7bac4e1ec3ca ("net: stmmac: stmmac interrupt treatment prepared for multiple queues") Fixes: 021bd5e36970 ("net: stmmac: Let TX and RX interrupts be independently enabled/disabled") Signed-off-by

[PATCH 02/20] net: stmmac: Free Rx descs on Tx allocation failure

2021-02-08 Thread Serge Semin
the method a bit. Just move the Rx descriptors allocation method invocation out of the local variables declaration block and discard a pointless comment from there. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH v2 22/24] net: stmmac: Call stmmaceth clock as system clock in warn-message

2021-02-08 Thread Serge Semin
clock failed to be requested. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

[PATCH v2 17/24] net: stmmac: dwc-qos: Cleanup STMMAC platform data clock pointers

2021-02-08 Thread Serge Semin
The pointers need to be nullified otherwise the stmmac_remove_config_dt() method called after them being initialized will disable the clocks. That then will cause a WARN() backtrace being printed since the clocks would be also disabled in the locally defined remove method. Signed-off-by: Serge

[PATCH v2 18/24] net: stmmac: dwc-qos: Use dev_err_probe() for probe errors handling

2021-02-08 Thread Serge Semin
There is a very handy dev_err_probe() method to handle the deferred probe error number. It reduces the code size and identations, uniforms error handling, records the defer probe reason, etc. Use it to print the probe callback error message. Signed-off-by: Serge Semin Cc: Anson Huang

[PATCH v2 21/24] net: stmmac: dwmac-imx: Discard Tx clock request

2021-02-08 Thread Serge Semin
Since the Tx clock is now requested and enabled/disabled in the STMMAC DT-based platform config method, there is no need in duplicating the same procedures in the DW MAC iMX sub-driver. Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/stmmac/dwmac-imx.c | 21 +-- 1 file

[PATCH v2 24/24] net: stmmac: dwc-qos: Save master/slave clocks in the plat-data

2021-02-08 Thread Serge Semin
e "pclk" specified. So in order to have the STMMAC platform data properly initialized we need to set the "master_bus" clock handler to the "stmmaceth" clock pointer, and the "slave_bus" clock handler to the "pclk" clock pointer. Signed-off-by: Serge

[PATCH v2 19/24] net: stmmac: Add Tx/Rx platform clocks support

2021-02-08 Thread Serge Semin
generic STMMAC DT-based platform data initialization method under the names "tx" and "rx" respectively. The bindings schema has already been altered in accordance with that. Signed-off-by: Serge Semin --- .../ethernet/stmicro/stmmac/stmmac_platform.c | 22 ++

[PATCH v2 15/24] net: stmmac: Use optional clock request method to get ptp_clk

2021-02-08 Thread Serge Semin
e() method. The later will correctly handle it. So just discard the conditional statement of priv->plat->clk_ptp_ref pointer value testing in the stmmac_resume() method. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +-- drivers/net/etherne

[PATCH v2 16/24] net: stmmac: Use optional reset control API to work with stmmaceth

2021-02-08 Thread Serge Semin
7 ("net: stmmac: platform: use optional clk/reset get APIs") Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne

[PATCH v2 12/24] net: stmmac: Directly call reverse methods in stmmac_probe_config_dt()

2021-02-08 Thread Serge Semin
clk_ptp_ref and stmmac_rst to platform structure") Signed-off-by: Serge Semin --- .../ethernet/stmicro/stmmac/stmmac_platform.c | 23 ++- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethern

[PATCH v2 11/24] net: stmmac: dwmac-stm32: Cleanup STMMAC DT-config in remove cb

2021-02-08 Thread Serge Semin
The stmmac_remove_config_dt() method needs to be called on the device remove procedure otherwise for at least some of device-nodes will be left requested. Fixes: d2ed0a7755fe ("net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks") Signed-off-by: Serge Semin --- drivers/ne

[PATCH v2 08/24] net: stmmac: Add {axi,mtl-rx,mtl-tx}-config sub-nodes support

2021-02-08 Thread Serge Semin
the DW MAC device DT node with vendor-prefixless names. Make sure the STMMAC driver supports them. Signed-off-by: Serge Semin --- Changelog v2: - Discard "snps" vendor-prefix from the new AXI/MTL Tx/Rx config sub-nodes. --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 9

[PATCH v2 14/24] net: stmmac: Use optional clock request method to get stmmaceth

2021-02-08 Thread Serge Semin
prevent the error message from being printed. All of that can be fixed by using the devm_clk_get_optional() method here provided by the common clock framework. Signed-off-by: Serge Semin --- .../ethernet/stmicro/stmmac/stmmac_platform.c | 19 ++- 1 file changed, 10 insertions(+)

[PATCH v2 06/24] dt-bindings: net: dwmac: Add Tx/Rx clock sources

2021-02-08 Thread Serge Semin
Generic DW *MAC can be connected to an external Transmit and Receive clock generators. Add the corresponding clocks description and clock-names to the generic bindings schema so new DW *MAC-based bindings wouldn't declare its own names of the same clocks. Signed-off-by: Serge Semin Review

[PATCH v2 07/24] dt-bindings: net: dwmac: Detach Generic DW MAC bindings

2021-02-08 Thread Serge Semin
ation for each vendor-specific MAC bindings which refer to the common bindings file, while the generic DW MAC DT nodes will be checked against the new snps,dwmac-generic.yaml DT schema. Signed-off-by: Serge Semin --- Changelog v2: - Add a note to the snps,dwmac-generic.yaml bindings file des

[PATCH v2 13/24] net: stmmac: Fix clocks left enabled on glue-probes failure

2021-02-08 Thread Serge Semin
which of course is wrong. Fix it by moving the clocks disable/unprepare methods invocation to the stmmac_remove_config_dt() function. Fixes: f573c0b9c4e0 ("stmmac: move stmmac_clk, pclk, clk_ptp_ref and stmmac_rst to platform structure") Signed-off-by: Serge Semin --- drivers/net/ethe

[PATCH v2 10/24] net: stmmac: dwmac-sti: Cleanup STMMAC DT-config in remove cb

2021-02-08 Thread Serge Semin
The stmmac_remove_config_dt() method needs to be called on the device remove procedure otherwise for at least some of device-nodes will be left requested. Fixes: d2ed0a7755fe ("net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks") Signed-off-by: Serge Semin --- drivers/ne

[PATCH v2 05/24] dt-bindings: net: dwmac: Elaborate stmmaceth/pclk description

2021-02-08 Thread Serge Semin
ode, then it will be considered as a source of clocks for both application and CSR. But if "pclk" is also specified in the list of the device clocks, then it will be perceived as the separate CSR clock. [1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a, October 2013,

[PATCH v2 09/24] net: stmmac: dwmac-rk: Cleanup STMMAC DT-config in remove cb

2021-02-08 Thread Serge Semin
The stmmac_remove_config_dt() method needs to be called on the device remove procedure otherwise for at least some of device-nodes will be left requested. Fixes: d2ed0a7755fe ("net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks") Signed-off-by: Serge Semin --- drivers/ne

[PATCH v2 03/24] dt-bindings: net: dwmac: Fix the TSO property declaration

2021-02-08 Thread Serge Semin
27;s normally done in the most of the DT schemas. Signed-off-by: Serge Semin --- Note this won't break the bindings description, since the "snps,tso" property isn't parsed by the Allwinner SunX GMAC glue driver, but only by the generic platform DT-parser. Changelog v2: - Us

[PATCH v2 00/24] net: stmmac: Fix clocks/reset-related procedures

2021-02-08 Thread Serge Semin
" property settings. - Discard the patch [PATCH 15/25] net: stmmac: Use optional clock request method to get pclk since the corresponding functionality has already been integrated into the driver. - Rebase on top of the kernel 5.11-rc7. Fixes: d2ed0a7755fe ("net: ethernet: stmmac

[PATCH v2 04/24] dt-bindings: net: dwmac: Refactor snps,*-config properties

2021-02-08 Thread Serge Semin
ble to describe the configs sub-nodes bindings right in the snps,dwmac.yaml file. Note the former "snps,axi-config", "snps,mtl-rx-config" and "snps,mtl-tx-config" properties have been marked as deprecated in favor of the added by this commit "axi-config", &quo

[PATCH v2 02/24] dt-bindings: net: dwmac: Extend number of PBL values

2021-02-08 Thread Serge Semin
hernet MAC Universal Databook, Revision 3.73a, October 2013, p. 380. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Changelog v2: - Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'. --- Documentation/devicetree/bindings/net/snps,

[PATCH v2 01/24] dt-bindings: net: dwmac: Validate PBL for all IP-cores

2021-02-08 Thread Serge Semin
ff-by: Serge Semin Reviewed-by: Rob Herring --- Changelog v2: - Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'. --- .../devicetree/bindings/net/snps,dwmac.yaml | 69 +++ 1 file changed, 26 insertions(+), 43 d

Re: [PATCH 07/25] dt-bindings: net: dwmac: Detach Generic DW MAC bindings

2020-12-16 Thread Serge Semin
On Tue, Dec 15, 2020 at 11:50:02AM -0600, Rob Herring wrote: > On Mon, Dec 14, 2020 at 12:15:57PM +0300, Serge Semin wrote: > > Currently the snps,dwmac.yaml DT bindings file is used for both DT nodes > > describing generic DW MAC devices and as DT schema with common properties >

Re: [PATCH 03/25] dt-bindings: net: dwmac: Fix the TSO property declaration

2020-12-16 Thread Serge Semin
On Tue, Dec 15, 2020 at 11:22:40AM -0600, Rob Herring wrote: > On Mon, Dec 14, 2020 at 12:15:53PM +0300, Serge Semin wrote: > > Indeed the STMMAC driver doesn't take the vendor-specific compatible > > string into account to parse the "snps,tso" boolean property. It j

Re: [PATCH 04/25] dt-bindings: net: dwmac: Refactor snps,*-config properties

2020-12-15 Thread Serge Semin
On Tue, Dec 15, 2020 at 08:08:35AM -0600, Rob Herring wrote: > On Tue, Dec 15, 2020 at 2:54 AM Serge Semin > wrote: > > > > Hello Rob, > > > > On Mon, Dec 14, 2020 at 08:30:06AM -0600, Rob Herring wrote: > > > On Mon, Dec 14, 2020 at 12:15:54PM +0300, S

Re: [PATCH 06/25] dt-bindings: net: dwmac: Add Tx/Rx clock sources

2020-12-15 Thread Serge Semin
On Tue, Dec 15, 2020 at 11:32:04AM -0600, Rob Herring wrote: > On Mon, Dec 14, 2020 at 12:15:56PM +0300, Serge Semin wrote: > > Generic DW *MAC can be connected to an external Tramit and Receive clock > > s/Tramit/Transmit/ Thanks. I'll fix it in v2. -Sergey >

Re: [RFC] net: stmmac: Problem with adding the native GPIOs support

2020-12-15 Thread Serge Semin
On Wed, Dec 16, 2020 at 03:03:55AM +0100, Andrew Lunn wrote: > > > From what you are saying, it sounds like from software you cannot > > > independently control the GPIO controller reset? > > > > No. The hardware implements the default MAC reset behavior. So the > > GPIO controller gets reset sync

Re: [RFC] net: stmmac: Problem with adding the native GPIOs support

2020-12-15 Thread Serge Semin
On Tue, Dec 15, 2020 at 02:58:37PM +0100, Andrew Lunn wrote: > > > > Anyway the hardware setup depicted above doesn't seem > > > > problematic at the first glance, but in fact it is. See, the DW *MAC > > > > driver > > > > (STMMAC ethernet driver) is doing the MAC reset each time it performs > >

Re: [PATCH 04/25] dt-bindings: net: dwmac: Refactor snps,*-config properties

2020-12-15 Thread Serge Semin
Hello Rob, On Mon, Dec 14, 2020 at 08:30:06AM -0600, Rob Herring wrote: > On Mon, Dec 14, 2020 at 12:15:54PM +0300, Serge Semin wrote: > > Currently the "snps,axi-config", "snps,mtl-rx-config" and > > "snps,mtl-tx-config" properties are declared as

Re: [RFC] net: stmmac: Problem with adding the native GPIOs support

2020-12-15 Thread Serge Semin
Hello Andrew, On Mon, Dec 14, 2020 at 04:31:43PM +0100, Andrew Lunn wrote: > On Mon, Dec 14, 2020 at 12:25:16PM +0300, Serge Semin wrote: > > Hello folks, > > > > I've got a problem, which has been blowing by head up for more than three > > weeks now, and I'

Re: [RFC] net: stmmac: Problem with adding the native GPIOs support

2020-12-15 Thread Serge Semin
register is reset or the GPIO.GPO field is cleared PHY gets to be in reset state, and it concerns all the devices.( -Sergey > > regards > Alex > > On 12/14/20 10:25 AM, Serge Semin wrote: > > Hello folks, > > > > I've got a problem, which has been blowing

[PATCH 01/25] dt-bindings: net: dwmac: Validate PBL for all IP-cores

2020-12-14 Thread Serge Semin
ff-by: Serge Semin --- .../devicetree/bindings/net/snps,dwmac.yaml | 69 +++ 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 11a6fdb657c9..4b67249

[PATCH 02/25] dt-bindings: net: dwmac: Extend number of PBL values

2020-12-14 Thread Serge Semin
hernet MAC Universal Databook, Revision 3.73a, October 2013, p. 380. Signed-off-by: Serge Semin --- Documentation/devicetree/bindings/net/snps,dwmac.yaml | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Doc

[PATCH 08/25] net: stmmac: Add snps,*-config sub-nodes support

2020-12-14 Thread Serge Semin
sub-nodes to the DW MAC device DT node. Make sure the STMMAC driver supports it. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_plat

[PATCH 21/25] net: stmmac: dwc-qos: Discard Tx/Rx clocks request

2020-12-14 Thread Serge Semin
. Note also the deprecated clock "phy_ref_clk" have been defined as the Tx clock in the DWC QoS Eth bindings. Let's use a pointer to the Tx clock defined in the platform data then instead of the unrelated pclk pointer. Signed-off-by: Serge Semin --- .../stmicro/stmmac/dwma

[PATCH 22/25] net: stmmac: dwmac-imx: Discard Tx clock request

2020-12-14 Thread Serge Semin
Since the Tx clock is now requested and enabled/disabled in the STMMAC DT-based platform config method, there is no need in duplicating the same procedures in the DW MAC iMX sub-driver. Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/stmmac/dwmac-imx.c | 21 +-- 1 file

[RFC] net: stmmac: Problem with adding the native GPIOs support

2020-12-14 Thread Serge Semin
Hello folks, I've got a problem, which has been blowing by head up for more than three weeks now, and I'm desperately need your help in that matter. See our Baikal-T1 SoC is created with two DW GMAC v3.73a IP-cores. Each core has been synthesized with two GPIOs: one as GPI and another as GPO. Ther

[PATCH 15/25] net: stmmac: Use optional clock request method to get pclk

2020-12-14 Thread Serge Semin
evice, but the clock framework failed to request it. Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/stmmac/stmmac_platform.c| 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/st

[PATCH 10/25] net: stmmac: dwmac-sti: Cleanup STMMAC DT-config in remove cb

2020-12-14 Thread Serge Semin
The stmmac_remove_config_dt() method needs to be called on the device remove procedure otherwise for at least some of device-nodes will be left requested. Fixes: d2ed0a7755fe ("net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks") Signed-off-by: Serge Semin --- drivers/ne

[PATCH 25/25] net: stmmac: dwc-qos: Save master/slave clocks in the plat-data

2020-12-14 Thread Serge Semin
e "pclk" specified. So in order to have the STMMAC platform data properly initialized we need to set the "master_bus" clock handler to the "stmmaceth" clock pointer, and the "slave_bus" clock handler to the "pclk" clock pointer. Signed-off-by: Serge

[PATCH 19/25] net: stmmac: dwc-qos: Use dev_err_probe() for probe errors handling

2020-12-14 Thread Serge Semin
There is a very handy dev_err_probe() method to handle the deferred probe error number. It reduces the code size, uniforms error handling, records the defer probe reason, etc. Use it to print the probe callback error message. Signed-off-by: Serge Semin Cc: Anson Huang --- drivers/net/ethernet

[PATCH 13/25] net: stmmac: Fix clocks left enabled on glue-probes failure

2020-12-14 Thread Serge Semin
which of course is wrong. Fix it by moving the clocks disable/unprepare methods invocation to the stmmac_remove_config_dt() function. Fixes: f573c0b9c4e0 ("stmmac: move stmmac_clk, pclk, clk_ptp_ref and stmmac_rst to platform structure") Signed-off-by: Serge Semin --- drivers/net/ethe

[PATCH 14/25] net: stmmac: Use optional clock request method to get stmmaceth

2020-12-14 Thread Serge Semin
prevent the error message from being printed. All of that can be fixed by using the devm_clk_get_optional() method here provided by the common clock framework. Signed-off-by: Serge Semin --- .../ethernet/stmicro/stmmac/stmmac_platform.c | 20 ++- 1 file changed, 11 insertions(+)

[PATCH 09/25] net: stmmac: dwmac-rk: Cleanup STMMAC DT-config in remove cb

2020-12-14 Thread Serge Semin
The stmmac_remove_config_dt() method needs to be called on the device remove procedure otherwise for at least some of device-nodes will be left requested. Fixes: d2ed0a7755fe ("net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks") Signed-off-by: Serge Semin --- drivers/ne

  1   2   >