mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: thomas.lendacky@amd.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: amd: xgbe: fix possible sleep-in-atomic-context bugs in xgbe_powerdown()
Date: Thu, 19 Dec 2019 10:40:39 +0800	[thread overview]
Message-ID: <62131c40-e69b-0664-2b2a-177a031a6f1f@gmail.com> (raw)
In-Reply-To: <20191218.132601.160360469201947283.davem@davemloft.net>



On 2019/12/19 5:26, David Miller wrote:
> From: Jia-Ju Bai <baijiaju1990@gmail.com>
> Date: Wed, 18 Dec 2019 22:01:02 +0800
>
>> @@ -1257,17 +1257,18 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
>>   	netif_tx_stop_all_queues(netdev);
>>   
>>   	xgbe_stop_timers(pdata);
>> -	flush_workqueue(pdata->dev_workqueue);
>>   
>>   	hw_if->powerdown_tx(pdata);
>>   	hw_if->powerdown_rx(pdata);
>>   
>> -	xgbe_napi_disable(pdata, 0);
>> -
>>   	pdata->power_down = 1;
>>   
>>   	spin_unlock_irqrestore(&pdata->lock, flags);
>>   
>> +	flush_workqueue(pdata->dev_workqueue);
>> +
>> +	xgbe_napi_disable(pdata, 0);
>> +
> Nope, this doesn't work at all.
>
> You can't leave NAPI enabled, and thus packet processing, after the TX
> and RX units of the chip have been powered down.

Looking at the code, only xgbe_powerup() and xgbe_powerdown() use the 
spinlock "pdata->lock".
How about change the spinlock to a mutex?


Best wishes,
Jia-Ju Bai

      reply	other threads:[~2019-12-19  2:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 14:01 Jia-Ju Bai
2019-12-18 14:30 ` Markus Elfring
2019-12-18 21:26 ` David Miller
2019-12-19  2:40   ` Jia-Ju Bai [this message]

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=62131c40-e69b-0664-2b2a-177a031a6f1f@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.lendacky@amd.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

Powered by JetHome