mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: nicolas.ferre@microchip.com, claudiu.beznea@tuxon.dev,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	linux@armlinux.org.uk, vadim.fedorenko@linux.dev,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, git@amd.com
Subject: Re: [PATCH net-next v3 1/4] net: macb: queue tie-off or disable during WOL suspend
Date: Fri, 7 Jun 2024 11:24:09 +0530	[thread overview]
Message-ID: <8829c75f-eea5-41e2-b594-5c648216756a@amd.com> (raw)
In-Reply-To: <90da3dd6-e361-46d0-b547-c662b649b03d@lunn.ch>

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





  reply	other threads:[~2024-06-07  5:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 10:24 [PATCH net-next v3 0/4] net: macb: WOL enhancements Vineeth Karumanchi
2024-06-05 10:24 ` [PATCH net-next v3 1/4] net: macb: queue tie-off or disable during WOL suspend Vineeth Karumanchi
2024-06-06  1:44   ` Andrew Lunn
2024-06-07  5:54     ` Vineeth Karumanchi [this message]
2024-06-05 10:24 ` [PATCH net-next v3 2/4] net: macb: Enable queue disable Vineeth Karumanchi
2024-06-06  2:00   ` Andrew Lunn
2024-06-05 10:24 ` [PATCH net-next v3 3/4] net: macb: Add ARP support to WOL Vineeth Karumanchi
2024-06-06  1:59   ` Andrew Lunn
2024-06-07  5:19     ` Vineeth Karumanchi
2024-06-05 10:24 ` [PATCH net-next v3 4/4] dt-bindings: net: cdns,macb: Deprecate magic-packet property Vineeth Karumanchi
2024-06-05 15:41   ` Rob Herring
2024-06-06  5:13     ` Vineeth Karumanchi
2024-06-06  6:17       ` Krzysztof Kozlowski
2024-06-06  7:04         ` Vineeth Karumanchi
2024-06-06  2:00   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8829c75f-eea5-41e2-b594-5c648216756a@amd.com \
    --to=vineeth.karumanchi@amd.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=git@amd.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®