public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rangoju, Raju" <raju.rangoju@amd.com>
To: Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	pabeni@redhat.com, kuba@kernel.org, edumazet@google.com,
	davem@davemloft.net, andrew+netdev@lunn.ch,
	Thomas.Lendacky@amd.com
Subject: Re: [PATCH net 1/2] amd-xgbe: fix sleep while atomic on suspend/resume
Date: Thu, 26 Feb 2026 21:07:58 +0530	[thread overview]
Message-ID: <c3aee4a6-9c8d-414a-a5cc-bf7beb9dc5da@amd.com> (raw)
In-Reply-To: <aaA-efqBThRji-Cz@horms.kernel.org>



On 2/26/2026 6:07 PM, Simon Horman wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> On Wed, Feb 25, 2026 at 04:30:00PM +0530, Raju Rangoju wrote:
>> The xgbe_powerdown() and xgbe_powerup() functions use spinlocks
>> (spin_lock_irqsave) while calling functions that may sleep:
>> - napi_disable() can sleep waiting for NAPI polling to complete
>> - flush_workqueue() can sleep waiting for pending work items
>>
>> This causes a "BUG: scheduling while atomic" error during suspend/resume
>> cycles on systems using the AMD XGBE Ethernet controller.
>>
>> The spinlock protection in these functions is unnecessary because:
>> 1. The functions are called from suspend/resume paths which are already
>>     serialized by the PM core
>> 2. The caller parameter was used to differentiate contexts, but the
>>     only current usage is from the driver context (suspend/resume)
>> 3. The power_down flag provides sufficient synchronization
>>
>> Fix this by:
>> - Removing the spinlock from xgbe_powerdown() and xgbe_powerup()
>> - Simplifying the function signatures by removing the unused caller
>>    parameter
>> - Removing the unused XGMAC_DRIVER_CONTEXT and XGMAC_IOCTL_CONTEXT macros
>> - Reordering operations in xgbe_powerdown() to disable NAPI before
>>    stopping TX/RX (matching the order used in xgbe_stop())
> 
> I don't think that all of these changes are necessary to fix the issue at hand.
> If so, please separate the fix(es) from other changes. And submit only
> the fixes to net - ideally one patch per fix if there is more than one
> discrete fix.
> 
> OTOH, enhancements and clean-ups should be submitted to net-next.

Sure, I'll separate the fixes from cleanup and submit.
Since the clean-ups have some dependency on fixes, will let the fixes go 
first.

> If there are dependencies on or conflicts with the fixes, then let
> them go into net first. net is merged into net-next each Thursday or Friday.
> 
>>
>> Fixes: c5aa9e3b8156 ("amd-xgbe: Initial AMD 10GbE platform driver")
>> Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
> 
> ...
> 
> --
> pw-bot: changes-requested


  reply	other threads:[~2026-02-26 15:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 10:59 [PATCH net 0/2] amd-xgbe: fix S0i3 suspend/resume issues Raju Rangoju
2026-02-25 11:00 ` [PATCH net 1/2] amd-xgbe: fix sleep while atomic on suspend/resume Raju Rangoju
2026-02-26 12:37   ` Simon Horman
2026-02-26 15:37     ` Rangoju, Raju [this message]
2026-02-26 12:40   ` Simon Horman
2026-02-26 15:39     ` Rangoju, Raju
2026-02-25 11:00 ` [PATCH net 2/2] amd-xgbe: add PCI power management for S0i3 support Raju Rangoju
2026-02-26 12:38   ` Simon Horman
2026-02-26 15:42     ` Rangoju, Raju

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=c3aee4a6-9c8d-414a-a5cc-bf7beb9dc5da@amd.com \
    --to=raju.rangoju@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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