Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3729146imm; Mon, 8 Oct 2018 08:36:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV607mfzkh6JpmylwMgiJSj2Yqc717p50cR0qutcdVr6RRTs1aim/j/EQZm5+dDP79LJ8Za+k X-Received: by 2002:a63:86c8:: with SMTP id x191-v6mr21968159pgd.39.1539013004282; Mon, 08 Oct 2018 08:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539013004; cv=none; d=google.com; s=arc-20160816; b=SbFp8FiOh9Y+ac6QJSO/S2AR2uGxovEDYGuJ1TMgavnc3wlo2ejefzIicYn7lllabX +QUTZG0vsmubKhGZEusxoqtpuunILpC8Zw0dBeha6ASHwlCp/TAamjzTNHgHmQdJnn0y wo7UCnytQK3wp9pXAWAzen/lrSv0KzrThKxFq0M9RepII5S2UJt22u7q41sDPs4YQMWT fSOD7S4cPrN7Jhj9WiF5Lfa/yaUoPOHbdfQSdE0fdHj3CM6Neiw2Ogly/XgTLZLcFd8u NQE2dsysS0qZWtqbmHBvVw8kZH61/94/6QzKh81fxqTeU0OMn5YLAmK8nJ7qKtaM8Fw/ inuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=uh1GMt7traq/XpzsVkZWTWbwCKpaOat0pxkVWqZf/1g=; b=Z8pLUgp8Xdz1JcCTSjWeochl1AYfPQLI+4pG++TkvJfUraog1S0UrQoWaBMV92gzSw ycPWdZx0Y5WtqnaG2Mpu2R6NHTsMnNfVZVn0bxhN/DTGCWLsjBaRm5c8GecxN/Jz7Bqb llCo40BmTWGlJZ+i1JG3hzfDAkXAz+5oddne0Zk9B/vRd8TLx1TXXEC5LuXw9Ni3qDs0 9Zt5LYEAX0xssdEbQLnTPlVtezmHJ4Idh3JCEBf/JWZZhOzZ9au9x8yeMYjBhDOY5BA7 FPM3LXSaMfR8mo1SjPQ0bN2MhrLOJpHfRnH2S6OnmhMHhofsJyAiLrL4Iu8xp+PeXqSa nXWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=My92qQye; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si17194192plz.175.2018.10.08.08.36.29; Mon, 08 Oct 2018 08:36:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=My92qQye; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727587AbeJHWiN (ORCPT + 99 others); Mon, 8 Oct 2018 18:38:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:56544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727524AbeJHWiM (ORCPT ); Mon, 8 Oct 2018 18:38:12 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 317272150B; Mon, 8 Oct 2018 15:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539012357; bh=jTnMrgMdxxY9A+ljdAEFjBKwKM/i0ryfptcUnhaIWGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=My92qQyejPPG1Uqf5iMnEomfcpnVyRh31vXhj2dICTeCmHfL0NP66Gtb8Ldd/06CV cMqHKF/ZyNZj9ft56Tqnx9p1udOfTrccIqvgHTlEFx1FyWJxJOtjYV79IcWppUuu/u uv13lgPC6cqn71cTl2dg7LtPc7PwMYHTM1G8w2/0= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Antoine Tenart , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 32/58] net: mvpp2: fix a txq_done race condition Date: Mon, 8 Oct 2018 11:24:57 -0400 Message-Id: <20181008152523.70705-32-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008152523.70705-1-sashal@kernel.org> References: <20181008152523.70705-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Antoine Tenart [ Upstream commit 774268f3e51b53ed432a1ec516574fd5ba469398 ] When no Tx IRQ is available, the txq_done() routine (called from tx_done()) shouldn't be called from the polling function, as in such case it is already called in the Tx path thanks to an hrtimer. This mostly occurred when using PPv2.1, as the engine then do not have Tx IRQs. Fixes: edc660fa09e2 ("net: mvpp2: replace TX coalescing interrupts with hrtimer") Reported-by: Stefan Chulski Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 661fa5a38df2..a1c7193cf858 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -3055,10 +3055,12 @@ static int mvpp2_poll(struct napi_struct *napi, int budget) cause_rx_tx & ~MVPP2_CAUSE_MISC_SUM_MASK); } - cause_tx = cause_rx_tx & MVPP2_CAUSE_TXQ_OCCUP_DESC_ALL_MASK; - if (cause_tx) { - cause_tx >>= MVPP2_CAUSE_TXQ_OCCUP_DESC_ALL_OFFSET; - mvpp2_tx_done(port, cause_tx, qv->sw_thread_id); + if (port->has_tx_irqs) { + cause_tx = cause_rx_tx & MVPP2_CAUSE_TXQ_OCCUP_DESC_ALL_MASK; + if (cause_tx) { + cause_tx >>= MVPP2_CAUSE_TXQ_OCCUP_DESC_ALL_OFFSET; + mvpp2_tx_done(port, cause_tx, qv->sw_thread_id); + } } /* Process RX packets */ -- 2.17.1