public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail•com>
To: Francois Romieu <romieu@fr•zoreil.com>
Cc: David Miller <davem@davemloft•net>,
	Realtek linux nic maintainers <nic_swsd@realtek•com>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>
Subject: Re: [PATCH net-next] r8169: perform reset synchronously in __rtl8169_resume
Date: Tue, 22 May 2018 00:38:56 +0200	[thread overview]
Message-ID: <fcd4fd81-801a-e811-2575-4710e5aff504@gmail.com> (raw)
In-Reply-To: <20180521212422.GA25067@electric-eye.fr.zoreil.com>

Am 21.05.2018 um 23:24 schrieb Francois Romieu:
> Heiner Kallweit <hkallweit1@gmail•com> :
> [...]
>> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
>> index 75dfac024..1eb4f625a 100644
>> --- a/drivers/net/ethernet/realtek/r8169.c
>> +++ b/drivers/net/ethernet/realtek/r8169.c
>> @@ -7327,9 +7327,9 @@ static void __rtl8169_resume(struct net_device *dev)
>>  	rtl_lock_work(tp);
>>  	napi_enable(&tp->napi);
>>  	set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
>> +	if (netif_running(dev))
>> +		rtl_reset_work(tp);
>>  	rtl_unlock_work(tp);
>> -
>> -	rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
>>  }
>>  
>>  static int rtl8169_resume(struct device *device)
> 
> netif_running() returns true before rtl_open(): issuing rtl_reset_work()
> synchronously against uninitialized rings right at the start of rtl_open()
> won't work as expected.
> 
rtl8169_runtime_resume() has a check for tp->TxDescArray at the beginning.
Therefore it will return immediately before even calling
__rtl8169_resume(), because tp->TxDescArray is set in rtl_open() only.
So I don't think the described issue exists.

However I have to admit that I wasn't aware that netif_running() is true
already when entering rtl_open(), so thanks for the hint.

> pm_runtime_get_sync() could be issued later in rtl_open() (but I would
> not mind something different with runtime_{resume/suspend} in open/close).
> 

  reply	other threads:[~2018-05-21 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 17:01 [PATCH net-next] r8169: perform reset synchronously in __rtl8169_resume Heiner Kallweit
2018-05-21 21:24 ` Francois Romieu
2018-05-21 22:38   ` Heiner Kallweit [this message]
2018-05-22 17:59 ` David Miller
2018-05-22 22:51   ` Francois Romieu

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=fcd4fd81-801a-e811-2575-4710e5aff504@gmail.com \
    --to=hkallweit1@gmail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nic_swsd@realtek$(echo .)com \
    --cc=romieu@fr$(echo .)zoreil.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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