Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4914491imc; Mon, 25 Feb 2019 13:32:02 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib2okPi44S0HfLCo0ztZ4gN3L7JXfADa1hLscfkHk3ZatpR+m+eESdjw5fuuTad0wUbT1/E X-Received: by 2002:a63:c745:: with SMTP id v5mr21197106pgg.261.1551130322764; Mon, 25 Feb 2019 13:32:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551130322; cv=none; d=google.com; s=arc-20160816; b=rKJHocXaf6qDKM3w4A6sddEtX4YyINvxIC5L/jUBudF6agh2ZZ77FDKA8c9IpUOmvg djzMXHo7wfqCTrNYaQ1ckJ5JXgxjZ3+NTsTgSJfluScZjZeAIvC88mKk1KHKmOmEt/gG hzMmdZhuW3DATmuQ5wIHw7bLppfxMPL4EStGbO7gPZu8lgob/TklMIFhDpiwr8y1ioVB spECTQ5ZXD/J8TmZ5XNH4gv/urfc57kYpUwntqguskPbBvX4xEdQgPY+DrR3+vzic6gq 9LDgqbFwv4DB6iiJFC3Dl6fVX770/2Jw7t0MAUgVAXWbpCFW0iv8QB6DX3vkrNZ0d0n6 rGKw== 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=VvpSTQfe5dvFpN84q1fz4t4HhfNNAXmkrSv/OwqTbbw=; b=xN+hQ07TtX5o3LK9BFNrvgl9CLZKwjE34U3hr2Ce2OXIA9+zAYwy/r4aQQ4r9th40c dPGBhyBNgIe7Aeh3sZkOxuRy7A6hUGPFUUSd2BuuG6w6guEPYDhT93sSiDb5RVFIUTlC hgtM3ntT561KGrwEciHOflXrPn/pFk8FhqrqhbrfIL34BXDLXAkHgSvpmOEqF0/7Puih ukc+iG6PUmvs14xFJx+mQQ38KPTOCL38KsDZccdmfqkwv/EEQDWdWaGDmfIFxWyxRM5W GQjgldpmhg2zJ6KsybZ2qy37LeXTZncRxDKNI8xzvnUwjSyB5aqpLlMK41qkykemfKkB VV7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gvJoYNUy; 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 g4si11048462plm.184.2019.02.25.13.31.47; Mon, 25 Feb 2019 13:32:02 -0800 (PST) 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=gvJoYNUy; 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 S1731756AbfBYVbb (ORCPT + 99 others); Mon, 25 Feb 2019 16:31:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:37068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728926AbfBYVb2 (ORCPT ); Mon, 25 Feb 2019 16:31:28 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 1F4D0217F5; Mon, 25 Feb 2019 21:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551130287; bh=DOvJp1zRdUUBbbELKNR6m++4ofzbSGkH8KWfysevvmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gvJoYNUyBDsiIqYNbdkECuALeJ2Ax7EMfNetnD7tRScLf7wnRKvYFZa0hGmziGo0N H0ruj9eFwg4y+lRCnh+RfAW4Dgk2RNhhUU0pmcldQk6Iab53z5OJYiASIi50B+LxQH kPD9wB+n21VFBmRbWhAg7q4Xs6HAAEH2G6k0r/2E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joao Pinto , "David S. Miller" , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Sasha Levin Subject: [PATCH 4.20 074/183] net: stmmac: Fix the logic of checking if RX Watchdog must be enabled Date: Mon, 25 Feb 2019 22:10:47 +0100 Message-Id: <20190225195106.916142493@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190225195054.748060397@linuxfoundation.org> References: <20190225195054.748060397@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 3b5094665e273c4a2a99f7f5f16977c0f1e19095 ] RX Watchdog can be disabled by platform definitions but currently we are initializing the descriptors before checking if Watchdog must be disabled or not. Fix this by checking earlier if user wants Watchdog disabled or not. Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: Jose Abreu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index c4a35e932f052..fe9240e15aeac 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4194,6 +4194,18 @@ static int stmmac_hw_init(struct stmmac_priv *priv) return ret; } + /* Rx Watchdog is available in the COREs newer than the 3.40. + * In some case, for example on bugged HW this feature + * has to be disable and this can be done by passing the + * riwt_off field from the platform. + */ + if (((priv->synopsys_id >= DWMAC_CORE_3_50) || + (priv->plat->has_xgmac)) && (!priv->plat->riwt_off)) { + priv->use_riwt = 1; + dev_info(priv->device, + "Enable RX Mitigation via HW Watchdog Timer\n"); + } + return 0; } @@ -4326,18 +4338,6 @@ int stmmac_dvr_probe(struct device *device, if (flow_ctrl) priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ - /* Rx Watchdog is available in the COREs newer than the 3.40. - * In some case, for example on bugged HW this feature - * has to be disable and this can be done by passing the - * riwt_off field from the platform. - */ - if (((priv->synopsys_id >= DWMAC_CORE_3_50) || - (priv->plat->has_xgmac)) && (!priv->plat->riwt_off)) { - priv->use_riwt = 1; - dev_info(priv->device, - "Enable RX Mitigation via HW Watchdog Timer\n"); - } - /* Setup channels NAPI */ maxq = max(priv->plat->rx_queues_to_use, priv->plat->tx_queues_to_use); -- 2.19.1