[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8829c75f-eea5-41e2-b594-5c648216756a@amd.com>
Date: Fri, 7 Jun 2024 11:24:09 +0530
From: Vineeth Karumanchi <vineeth.karumanchi@....com>
To: Andrew Lunn <andrew@...n.ch>
Cc: nicolas.ferre@...rochip.com, claudiu.beznea@...on.dev,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
conor+dt@...nel.org, linux@...linux.org.uk, vadim.fedorenko@...ux.dev,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, git@....com
Subject: Re: [PATCH net-next v3 1/4] net: macb: queue tie-off or disable
during WOL suspend
Hi Andrew,
On 06/06/24 7:14 am, Andrew Lunn wrote:
>> @@ -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
For newer (r1p10 +) versions , there is a new bit in status register to
get the active axi transaction, we can leverage it.
For older versions, there is no mechanism to check the current ongoing
transaction, it is a corner case. Currently, in macb_close(), iflink
down and in suspend we are disabling / cutting clocks to the engine
without checking any DMA transaction in flight.
Thanks
Vineeth
Powered by blists - more mailing lists