Commit 92b11696 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Paolo Abeni

net: ethernet: mtk_wed: move MTK_WDMA_RESET_IDX_TX configuration in mtk_wdma_tx_reset

Remove duplicated code. Increase poll timeout to 10ms in order to be
aligned with vendor sdk.
This is a preliminary patch to add Wireless Ethernet Dispatcher reset
support.
Co-developed-by: default avatarSujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: default avatarSujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent b0488c45
...@@ -135,16 +135,15 @@ mtk_wdma_tx_reset(struct mtk_wed_device *dev) ...@@ -135,16 +135,15 @@ mtk_wdma_tx_reset(struct mtk_wed_device *dev)
wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN); wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
if (readx_poll_timeout(mtk_wdma_read_reset, dev, status, if (readx_poll_timeout(mtk_wdma_read_reset, dev, status,
!(status & mask), 0, 1000)) !(status & mask), 0, 10000))
dev_err(dev->hw->dev, "tx reset failed\n"); dev_err(dev->hw->dev, "tx reset failed\n");
for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++) { wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_TX);
if (dev->tx_wdma[i].desc) wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
continue;
for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++)
wdma_w32(dev, wdma_w32(dev,
MTK_WDMA_RING_TX(i) + MTK_WED_RING_OFS_CPU_IDX, 0); MTK_WDMA_RING_TX(i) + MTK_WED_RING_OFS_CPU_IDX, 0);
}
} }
static void static void
...@@ -573,12 +572,6 @@ mtk_wed_detach(struct mtk_wed_device *dev) ...@@ -573,12 +572,6 @@ mtk_wed_detach(struct mtk_wed_device *dev)
mtk_wdma_rx_reset(dev); mtk_wdma_rx_reset(dev);
mtk_wed_reset(dev, MTK_WED_RESET_WED); mtk_wed_reset(dev, MTK_WED_RESET_WED);
if (mtk_wed_get_rx_capa(dev)) {
wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_TX);
wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
}
mtk_wed_free_tx_buffer(dev); mtk_wed_free_tx_buffer(dev);
mtk_wed_free_tx_rings(dev); mtk_wed_free_tx_rings(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment