[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1396123694.2898.93.camel@deadeye.wl.decadent.org.uk>
Date: Sat, 29 Mar 2014 20:08:14 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Russell King - ARM Linux <linux@....linux.org.uk>
Cc: netdev@...r.kernel.org
Subject: Re: Proper suspend/resume flow
On Sat, 2014-03-29 at 18:03 +0000, Russell King - ARM Linux wrote:
[...]
> That said, for the case where a network driver does all it's packet
> processing in the NAPI poll function, I think calling napi_disable()
> is a good way to ensure that the poll function is not running, and
> therefore there are can be no netif_wake_queue() calls - or anything
> other than the ndo_start_xmit touching the rings or the device. This
> is needed anyway to stop receive packet processing looking at its
> ring.
>
> So, I've now come to this sequence:
>
> suspend()
> {
> if (netif_running()) {
> napi_disable();
> netif_tx_lock();
> netif_device_detach();
> netif_tx_unlock();
> }
> ... suspend device ...
> }
[...]
This is missing netif_stop_queue(), but I assume you do that somewhere
after netif_device_detach(). I think this should work.
Ben.
--
Ben Hutchings
[W]e found...that it wasn't as easy to get programs right as we had thought.
... I realized that a large part of my life from then on was going to be spent
in finding mistakes in my own programs. - Maurice Wilkes, 1949
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists