From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17B2CC433E7 for ; Mon, 12 Oct 2020 19:08:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C54F220878 for ; Mon, 12 Oct 2020 19:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602529695; bh=JfJrETBGPlmVofOd8R80YNhoHt6mdpLDLhMuRCd33Ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CZvCNcZy2yFhJ9p+qvpXp1IUsxai8dCKzUyJdGASJ8fUiuV8qAjTFWvaf6aZWcFu/ di6rRzOeo2V/KfDNMA60ydBWkr9/hCUV9b0dOZnEzq4zQMX5s2R6y4BDEy688ONPRz /F+A1jnou3WewAA8AV3pJib9uQwWtfaV4jxcQRfc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391504AbgJLTIO (ORCPT ); Mon, 12 Oct 2020 15:08:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:52586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390587AbgJLTD0 (ORCPT ); Mon, 12 Oct 2020 15:03:26 -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 E9DA62074A; Mon, 12 Oct 2020 19:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602529405; bh=JfJrETBGPlmVofOd8R80YNhoHt6mdpLDLhMuRCd33Ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x23KmicwegwxBt7U4PZrOGHQs0mxu7bAFw3heZrUemMSsjgzjNvgVQbh43UoChhg8 BQUO9wpRceSAGtlvU8dEGWIQeL9XKkqVEYTC3pEVS6R8Ji6k/Q8NWmK3emjxWqfZQL K0iD/DGV2YRCp+/4EF/YBv4kQ8AIM2GK9b4HqL78= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kevin Brace , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 09/15] via-rhine: Fix for the hardware having a reset failure after resume Date: Mon, 12 Oct 2020 15:03:06 -0400 Message-Id: <20201012190313.3279397-9-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201012190313.3279397-1-sashal@kernel.org> References: <20201012190313.3279397-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kevin Brace [ Upstream commit d120c9a81e32c43cba8017dec873b6a414898716 ] In rhine_resume() and rhine_suspend(), the code calls netif_running() to see if the network interface is down or not. If it is down (i.e., netif_running() returning false), they will skip any housekeeping work within the function relating to the hardware. This becomes a problem when the hardware resumes from a standby since it is counting on rhine_resume() to map its MMIO and power up rest of the hardware. Not getting its MMIO remapped and rest of the hardware powered up lead to a soft reset failure and hardware disappearance. The solution is to map its MMIO and power up rest of the hardware inside rhine_open() before soft reset is to be performed. This solution was verified on ASUS P5V800-VM mainboard's integrated Rhine-II Ethernet MAC inside VIA Technologies VT8251 South Bridge. Signed-off-by: Kevin Brace Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/via/via-rhine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index ed12dbd156f03..691c041e6cfb6 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c @@ -1706,6 +1706,8 @@ static int rhine_open(struct net_device *dev) goto out_free_ring; alloc_tbufs(dev); + enable_mmio(rp->pioaddr, rp->quirks); + rhine_power_init(dev); rhine_chip_reset(dev); rhine_task_enable(rp); init_registers(dev); -- 2.25.1