From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from imap0.codethink.co.uk ([185.43.218.159]:37755 "EHLO imap0.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753412AbdF2OXp (ORCPT ); Thu, 29 Jun 2017 10:23:45 -0400 Message-ID: <1498746212.1935.47.camel@codethink.co.uk> Subject: Re: [PATCH 4.4 37/46] r8152: re-schedule napi for tx From: Ben Hutchings To: Hayes Wang Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, "David S. Miller" , Sasha Levin , Greg Kroah-Hartman Date: Thu, 29 Jun 2017 15:23:32 +0100 In-Reply-To: <20170615175220.039719417@linuxfoundation.org> References: <20170615175218.286057711@linuxfoundation.org> <20170615175220.039719417@linuxfoundation.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Thu, 2017-06-15 at 19:52 +0200, Greg Kroah-Hartman wrote: > 4.4-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > From: hayeswang > > > [ Upstream commit 248b213ad908b88db15941202ef7cb7eb137c1a0 ] > > Re-schedule napi after napi_complete() for tx, if it is necessay. > > In r8152_poll(), if the tx is completed after tx_bottom() and before > napi_complete(), the scheduling of napi would be lost. Then, no > one handles the next tx until the next napi_schedule() is called. [...] This (and other) tests of list_empty() aren't going to be reliable unless you take the same spinlock used when enqueueing packets. Alternately you could count packets added and removed from the driver internal queues and then you should only need memory barriers for synchronisation when comparing counters. Ben. -- Ben Hutchings Software Developer, Codethink Ltd.