Re: [PATCH net-next v3 1/4] net: macb: queue tie-off or disable during WOL suspend

From: Andrew Lunn
Date: Wed Jun 05 2024 - 21:44:40 EST


> @@ -5224,17 +5257,38 @@ static int __maybe_unused macb_suspend(struct device *dev)
>
> if (bp->wol & MACB_WOL_ENABLED) {
> spin_lock_irqsave(&bp->lock, flags);
> - /* Flush all status bits */
> - macb_writel(bp, TSR, -1);
> - macb_writel(bp, RSR, -1);
> +
> + /* Disable Tx and Rx engines before disabling the queues,
> + * this is mandatory as per the IP spec sheet
> + */
> + tmp = macb_readl(bp, NCR);
> + macb_writel(bp, NCR, tmp & ~(MACB_BIT(TE) | MACB_BIT(RE)));

Is there any need to wait for this to complete? What if there is a DMA
transaction in flight?

Andrew