From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v2] net: mvneta: fix handling of the Tx descriptor counter Date: Tue, 14 Nov 2017 21:53:37 +0900 (KST) Message-ID: <20171114.215337.2029697539551703912.davem@davemloft.net> References: <20171108165835.13453-1-simon.guinot@sequanux.org> <20171113152702.14686-1-simon.guinot@sequanux.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: thomas.petazzoni@free-electrons.com, netdev@vger.kernel.org, musv@gmx.de, andreas.tobler@cloudguard.ch, gregory.clement@free-electrons.com, antoine.tenart@free-electrons.com, mw@semihalf.com, stable@vger.kernel.org, David.Laight@ACULAB.COM To: simon.guinot@sequanux.org Return-path: In-Reply-To: <20171113152702.14686-1-simon.guinot@sequanux.org> Sender: stable-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Simon Guinot Date: Mon, 13 Nov 2017 16:27:02 +0100 > The mvneta controller provides a 8-bit register to update the pending > Tx descriptor counter. Then, a maximum of 255 Tx descriptors can be > added at once. In the current code the mvneta_txq_pend_desc_add function > assumes the caller takes care of this limit. But it is not the case. In > some situations (xmit_more flag), more than 255 descriptors are added. > When this happens, the Tx descriptor counter register is updated with a > wrong value, which breaks the whole Tx queue management. > > This patch fixes the issue by allowing the mvneta_txq_pend_desc_add > function to process more than 255 Tx descriptors. > > Fixes: 2a90f7e1d5d0 ("net: mvneta: add xmit_more support") > Cc: stable@vger.kernel.org # 4.11+ > Signed-off-by: Simon Guinot Applied.