Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2916799yba; Mon, 22 Apr 2019 15:39:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi5KxuDFsbYnCzLhVdbcTqnf7mO7elX3bRBmkbM4mJvL1yrfedlx2iwAsQ6CKPbhYeYWWk X-Received: by 2002:a63:af45:: with SMTP id s5mr21187670pgo.420.1555972788851; Mon, 22 Apr 2019 15:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555972788; cv=none; d=google.com; s=arc-20160816; b=OIiUKRnyfxZT3Ks+Y/QY7It7M2CLGt5EOUiboHlLNVp1uqzhqP3nO6hUTxgTlmFKvu Piec11/gP1FRySWahw7HNqA6T3/xrfaqb5T+Yjj3ZCvCp+JAQH3OT1mqYJ9O6OXaqJ8U rXB+g1l8I2IuWerlTt76ISLKy+4NhkWt+eNMzZcEV9ntQJ6tVtpcwwhxJaOJACktUvlB 1S8Px4wrE0ln+FyWySWMyiBif9L8456ZPKL1pP/MVwz0a86akiudrfTJlm+bFGR1vhzV WhC9DmixB5HXG58mE4uBIF+EPhDbWMzTc3QBRhu+fyzHO+MSHWAk6qrx6Q+cE1hI8qC6 xUgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B8Q0v3DlZLIfMtWp6L6sdS8vVakL2nbEQQQScdZW+Es=; b=D+Ff4OvyUCVujL9Fvds8rkFI/iMrkSf6jCXKKoay1uOUJ3l6SIAFOY2KjTHfGyhBZK YnxlfrJVL0QzWVTlfcvjKHYqCseWlkuG/O5ny9zRulKbfAxOLApv/Wp6d8EobPHt8CJP C5AH3mq0JvAPz727nmJnleX5vvvwjBmry4nZuBN57R8vMSz5Bdn9AGTElPX8cOc8xUMB 1k0phKkKop4sOUcx3157Xhq5GzvqUIbBEm/cdzzMBP/CwwKVtP81A4/60EbZlKl+z7OA R8OULcF3Qkdrp9FTx5sdHlcsCZhh3d1m3vXkXeHrLi9uuJPssmHafpxdZGE2ZZD6bvak tBkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vvp2LcRA; 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 z9si13817713plo.118.2019.04.22.15.39.34; Mon, 22 Apr 2019 15:39:48 -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=Vvp2LcRA; 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 S1729750AbfDVTp3 (ORCPT + 99 others); Mon, 22 Apr 2019 15:45:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:47206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729692AbfDVTp1 (ORCPT ); Mon, 22 Apr 2019 15:45:27 -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 7CDDC218FF; Mon, 22 Apr 2019 19:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962326; bh=gmocDgUQYMyUOkmtWP4xkpkSiaPbVgR4wZ04EOQDWz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vvp2LcRAPwrFVMwAtCtVbIXQxPAwnIzjXJs16yPBO/IbUEPOQelv1TQx1Z5D44sAe 0ZC6tu/FbobRC9sM+F1QwK9PfrIuVCjdbqWLe0g/56SPddvzJlLeLeaEgaa1uAVaHR 7MDSIBLZN6HrIYBgc1ELmUk1Xq3VpbuJkQ4pAjVM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aaro Koskinen , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 05/68] net: stmmac: don't set own bit too early for jumbo frames Date: Mon, 22 Apr 2019 15:44:13 -0400 Message-Id: <20190422194516.11634-5-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194516.11634-1-sashal@kernel.org> References: <20190422194516.11634-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aaro Koskinen [ Upstream commit 80acbed9f8fca1db3fbe915540b756f048aa0fd7 ] Commit 0e80bdc9a72d ("stmmac: first frame prep at the end of xmit routine") overlooked jumbo frames when re-ordering the code, and as a result the own bit was not getting set anymore for the first jumbo frame descriptor. Commit 487e2e22ab79 ("net: stmmac: Set OWN bit for jumbo frames") tried to fix this, but now the bit is getting set too early and the DMA may start while we are still setting up the remaining descriptors. And with the chain mode the own bit remains still unset. Fix by setting the own bit at the end of xmit also with jumbo frames. Fixes: 0e80bdc9a72d ("stmmac: first frame prep at the end of xmit routine") Fixes: 487e2e22ab79 ("net: stmmac: Set OWN bit for jumbo frames") Signed-off-by: Aaro Koskinen Acked-by: Jose Abreu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin (Microsoft) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 886176be818e..3d35cbeb1028 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3197,14 +3197,16 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) stmmac_prepare_tx_desc(priv, first, 1, nopaged_len, csum_insertion, priv->mode, 1, last_segment, skb->len); - - /* The own bit must be the latest setting done when prepare the - * descriptor and then barrier is needed to make sure that - * all is coherent before granting the DMA engine. - */ - wmb(); + } else { + stmmac_set_tx_owner(priv, first); } + /* The own bit must be the latest setting done when prepare the + * descriptor and then barrier is needed to make sure that + * all is coherent before granting the DMA engine. + */ + wmb(); + netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len); stmmac_enable_dma_transmission(priv, priv->ioaddr); -- 2.19.1