Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7373356yba; Thu, 2 May 2019 08:47:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPyi9ELhoG4pwjuFNsNqKy/Ld2g/6fzOaRAeEhAavG6slyz8ju2fs7jrCrlTrY4KjxNvcs X-Received: by 2002:a62:470e:: with SMTP id u14mr4968447pfa.31.1556812036569; Thu, 02 May 2019 08:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556812036; cv=none; d=google.com; s=arc-20160816; b=KbZzaagc7hftGGpYA/mycYPX8hrdknh1O2/aqAOrtUyZ0uwu4fpZvG94mI2AjN0jiT OeaN3IYh5dlTkikWgLAkSC9uRLw/a/SJ3owS/Ae3mRUKAUi5Wc9djCwkD+puvFxLWVqq 36q1hhCVYEmSQ3TCrKXVSonJVunBbtzPOo83RJ4KQn/J23WuYHEYQQdBGvHYwO88iw1W NJuSwzqgXC8B/JX/npiHGc9P5JlrQ2Pami5w9N2rg6uZdGh24Rio6oxVg16Ds9fPHIlJ OxvBiWY7MG/ZSNT8HA/pG29KtktMYDOjQfGoBL9u64cEt807xXLjoK84GPfMLiA3wLIe gagA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bzTu1Zagl0eA5yjWR683CeDmEHvMy226u0/nffCWBNs=; b=ZxSKsBKUvybLGy39MFaZ/PfFWKZDznFnKvl2CCNCrbD7hzPc8YD+2qsKHlaqr+1Bij ir9pu9YDXbILUzCOA2ebPGkl6nCiy6MJak2xuwLMIw76B1EfTdPgdCbSviUjYFjki6Wk jzglZJx0J14RFAd9MMMzQ7ASk57aO/660TvPtix59veIzmA4V3tG5gWNxXyUHrFkizyL P9B7janmJQXuuaPdkQQpCw3X9zfvOBr7DbXfWOZNNW3R+zN/z0mT58GWYNoFqMOt0yan 3+qxs8sHu+P8XhBOhcwGteZ7gpYecbBWgwrjypjwVkFw1tRZzzsquz1qK8u/skCdw32w 507Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jxt9aYoT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k75si42815404pgc.515.2019.05.02.08.47.01; Thu, 02 May 2019 08:47:16 -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=jxt9aYoT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727661AbfEBP0C (ORCPT + 99 others); Thu, 2 May 2019 11:26:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:42530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbfEBP0A (ORCPT ); Thu, 2 May 2019 11:26:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4878A20675; Thu, 2 May 2019 15:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556810759; bh=qQn0/K5CrRb6a/UDIpJ0+TmSgtkLdapNLzx/sKNBoVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxt9aYoT+wR+xwBYwiLqNGB6To0o5Pr48t5tCXZnZ4Fv4HjsQEGPFAAouJnkLz23w GcVrNKPSzxFDS9faRugG8xVONCWWb6vt922HSRILlJ563b6wyD2FzsrvAaXgkCwRYG 9V2uug7VDesY7cy87yeeNhsTJSNJ1Py5Mf5Wo7PQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaro Koskinen , Jose Abreu , "David S. Miller" , "Sasha Levin (Microsoft)" Subject: [PATCH 4.19 11/72] net: stmmac: dont set own bit too early for jumbo frames Date: Thu, 2 May 2019 17:20:33 +0200 Message-Id: <20190502143334.324197718@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190502143333.437607839@linuxfoundation.org> References: <20190502143333.437607839@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 62460a5b4ad9..39c105092214 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3195,14 +3195,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