]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: ethernet: ravb: Suspend and resume the transmission flow
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 1 Apr 2026 18:36:08 +0000 (20:36 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 3 Apr 2026 23:04:28 +0000 (16:04 -0700)
The current driver does not follow the latest datasheet and does not
suspend the flow when stopping DMA and resume it when starting. Update
the driver to do so.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
[Niklas: Rebase from BSP and reword commit message]
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://patch.msgid.link/20260401183608.1852225-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/renesas/ravb_main.c

index 2c725824b34885ae98c9957c811fe79d41d570c1..1dbfadb2a88145b5e006d106b8f6c0edfb469865 100644 (file)
@@ -694,6 +694,9 @@ static int ravb_dmac_init(struct net_device *ndev)
        const struct ravb_hw_info *info = priv->info;
        int error;
 
+       /* Clear transmission suspension */
+       ravb_modify(ndev, CCC, CCC_DTSR, 0);
+
        /* Set CONFIG mode */
        error = ravb_set_opmode(ndev, CCC_OPC_CONFIG);
        if (error)
@@ -1103,6 +1106,12 @@ static int ravb_stop_dma(struct net_device *ndev)
        if (error)
                return error;
 
+       /* Request for transmission suspension */
+       ravb_modify(ndev, CCC, CCC_DTSR, CCC_DTSR);
+       error = ravb_wait(ndev, CSR, CSR_DTS, CSR_DTS);
+       if (error)
+               netdev_err(ndev, "failed to stop AXI BUS\n");
+
        /* Stop AVB-DMAC process */
        return ravb_set_opmode(ndev, CCC_OPC_CONFIG);
 }