• Quan Zhou's avatar
    wifi: mt76: mt7921e: improve reliability of dma reset · 87714bf6
    Quan Zhou authored
    The hardware team has advised the driver that it is necessary to first put
    WFDMA into an idle state before resetting the WFDMA. Otherwise, the WFDMA
    may enter an unknown state where it cannot be polled with the right state
    successfully. To ensure that the DMA can work properly while a stressful
    cold reboot test was being made, we have reordered the programming sequence
    in the driver based on the hardware team's guidance.
    
    The patch would modify the WFDMA disabling flow from
    
    "DMA reset -> disabling DMASHDL -> disabling WFDMA -> polling and waiting
    until DMA idle" to "disabling WFDMA -> polling and waiting for DMA idle ->
    disabling DMASHDL -> DMA reset.
    
    Where he polling and waiting until WFDMA is idle is coordinated with the
    operation of disabling WFDMA. Even while WFDMA is being disabled, it can
    still handle Tx/Rx requests. The additional polling allows sufficient time
    for WFDMA to process the last T/Rx request. When the idle state of WFDMA is
    reached, it is a reliable indication that DMASHDL is also idle to ensure it
    is safe to disable it and perform the DMA reset.
    
    Fixes: 0a1059d0
    
     ("mt76: mt7921: move mt7921_dma_reset in dma.c")
    Co-developed-by: default avatarSean Wang <sean.wang@mediatek.com>
    Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
    Co-developed-by: default avatarDeren Wu <deren.wu@mediatek.com>
    Signed-off-by: default avatarDeren Wu <deren.wu@mediatek.com>
    Co-developed-by: default avatarWang Zhao <wang.zhao@mediatek.com>
    Signed-off-by: default avatarWang Zhao <wang.zhao@mediatek.com>
    Signed-off-by: default avatarQuan Zhou <quan.zhou@mediatek.com>
    Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
    87714bf6
dma.c 8.1 KB