changes in v4:
since MTL_OPERATION_MODE write back issue has be fixed in the latest driver,
remove original patch#3
changes in v3:
add a Fixes:tag for each patch
changes in v2:
1. update rx_tail_addr as Jose's comment
2. changes clk_csr condition as Alex's proposition
3. remove init lines in dwmac-mediatek, get clk_csr from dts instead.
v1:
This series fix some bugs in stmmac driver
3 patches are for common stmmac or dwmac4:
1. update rx tail pointer to fix rx dma hang issue.
2. change condition for mdc clock to fix csr_clk can't be zero issue.
3. write the modified value back to MTL_OPERATION_MODE.
1 patch is for dwmac-mediatek:
modify csr_clk value to fix mdio read/write fail issue for dwmac-mediatek
Biao Huang (3):
net: stmmac: update rx tail pointer register to fix rx dma hang
issue.
net: stmmac: fix csr_clk can't be zero issue
net: stmmac: dwmac-mediatek: modify csr_clk value to fix mdio
read/write fail
.../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 --
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 ++++-
3 files changed, 8 insertions(+), 6 deletions(-)
--
1.7.9.5
The specific clk_csr value can be zero, and
stmmac_clk is necessary for MDC clock which can be set dynamically.
So, change the condition from plat->clk_csr to plat->stmmac_clk to
fix clk_csr can't be zero issue.
Fixes: cd7201f477b9 ("stmmac: MDC clock dynamically based on the csr clock input")
Signed-off-by: Biao Huang <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
@@ -408,7 +408,10 @@ struct plat_stmmacenet_data */* Default to phy auto-detection */plat->phy_addr=-1;-/* Get clk_csr from device tree */+/* Default to get clk_csr from stmmac_clk_crs_set(),+*orgetclk_csrfromdevicetree.+*/+plat->clk_csr=-1;of_property_read_u32(np,"clk_csr",&plat->clk_csr);/* "snps,phy-addr" is not a standard property. Mark it as deprecated
1. the frequency of csr clock is 66.5MHz, so the csr_clk value should
be 0 other than 5.
2. the csr_clk can be got from device tree, so remove initialization here.
Fixes: 9992f37e346b ("stmmac: dwmac-mediatek: add support for mt2712")
Signed-off-by: Biao Huang <redacted>
---
.../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 --
1 file changed, 2 deletions(-)
Currently we will not update the receive descriptor tail pointer in
stmmac_rx_refill. Rx dma will think no available descriptors and stop
once received packets exceed DMA_RX_SIZE, so that the rx only test will fail.
Update the receive tail pointer in stmmac_rx_refill to add more descriptors
to the rx channel, so packets can be received continually
Fixes: 54139cf3bb33 ("net: stmmac: adding multiple buffers for rx")
Signed-off-by: Biao Huang <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 +
1 file changed, 1 insertion(+)
The specific clk_csr value can be zero, and
stmmac_clk is necessary for MDC clock which can be set dynamically.
So, change the condition from plat->clk_csr to plat->stmmac_clk to
fix clk_csr can't be zero issue.
Fixes: cd7201f477b9 ("stmmac: MDC clock dynamically based on the csr clock input")
Signed-off-by: Biao Huang <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
@@ -408,7 +408,10 @@ struct plat_stmmacenet_data */* Default to phy auto-detection */plat->phy_addr=-1;-/* Get clk_csr from device tree */+/* Default to get clk_csr from stmmac_clk_crs_set(),+*orgetclk_csrfromdevicetree.+*/+plat->clk_csr=-1;of_property_read_u32(np,"clk_csr",&plat->clk_csr);/* "snps,phy-addr" is not a standard property. Mark it as deprecated
changes in v4:
since MTL_OPERATION_MODE write back issue has be fixed in the latest driver,
remove original patch#3
changes in v3:
add a Fixes:tag for each patch
changes in v2:
1. update rx_tail_addr as Jose's comment
2. changes clk_csr condition as Alex's proposition
3. remove init lines in dwmac-mediatek, get clk_csr from dts instead.
v1:
This series fix some bugs in stmmac driver
3 patches are for common stmmac or dwmac4:
1. update rx tail pointer to fix rx dma hang issue.
2. change condition for mdc clock to fix csr_clk can't be zero issue.
3. write the modified value back to MTL_OPERATION_MODE.
1 patch is for dwmac-mediatek:
modify csr_clk value to fix mdio read/write fail issue for dwmac-mediatek