Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4204779pxu; Mon, 12 Oct 2020 12:11:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqSVgVNwRsDblqyLSia1kNOUZZj5DO31d7rJ/0K7pPL1kEpo3xQJw6QZ9lRfc3gZDU4eSV X-Received: by 2002:aa7:de82:: with SMTP id j2mr16556693edv.3.1602529908321; Mon, 12 Oct 2020 12:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602529908; cv=none; d=google.com; s=arc-20160816; b=QlasNDRamdETDidJh23w/8TJhvJkBSz12cYPtWvxLQ1DKzwdCs3FjAvwy8U/SN2w33 +sElqitHZVIIxxR35Rltu1JZ48r+YvFWvIfoK9bYK7yS7CyJuohaVM43OEo+/VrBM5nB raa8j9rKNyJ0fp7CN9ccQeESmyImSWtXMcxsFRMKNWgg+FrVTUKToHPYLWQUGl7Os6xt ZQbn4dvF7iUlU31yI7yeq+1LVnXieR8IyRllx+hV+u9VnvBB/HNdxM8ve4FEN08u68fI fHk+vIhtTNplhniv77hjdWHt6XEHef5Fj0hLrrMFUrVU8dSw+xOxp2QIbVmyRB7JGMO8 I9Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CZApHJKPDhRJMEr8lWdqol9UTAwQxsgCSVBbOacToNA=; b=ZjV7IabyPAahdjnDR9l5nj598gkibXyqwidU5OyXv8yAB2Ox6eIyu1XrxCf0ncANcj SbljXaKTSXbi3Mc2G2cAWKMNNT3smeo6b/KqoVmBpAxUQcZ+nZLdHn+qD36zxd9alqyn /ctmXRdZbUZ3nhnzDnAQNyMfGGmsAwwdRY0VobCAVJxB06Ci1PQ0n/kzHtA1O6zADy47 DW+rUbOnf1sOcjFlUD4XPczICXwnwxWJFDYlPNPcN9GytF3WccEClKL8NtQfgGxeS0oI yaF/G9RRLl72DuWV+vWSLTiTPzv79L10ufjcW0JnJVc6+42BvXw8dl0BWmCxc/LdDHqZ EwWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0rA11wBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id d17si12407567ejt.519.2020.10.12.12.11.24; Mon, 12 Oct 2020 12:11:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0rA11wBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730999AbgJLTJO (ORCPT + 99 others); Mon, 12 Oct 2020 15:09:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:52310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388079AbgJLTC6 (ORCPT ); Mon, 12 Oct 2020 15:02:58 -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 31341208B8; Mon, 12 Oct 2020 19:02:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602529377; bh=IOYeINVP1ew2BrOT6hrCrX2sP6E5o8bREZQwm0QZx5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0rA11wBzNOTSxcwaxY9KxEKGbgcjj61I8XY4V7dGoxvyrKPQoUqqGcratRrLTFJ49 ztegk+K3nOzj4fEWB9JCreubTpxZ5ut3veCUUa2aTPxdGTODXVHRoJQQP4d7O8aoPz Lgs4uy8+z01xbsTfoJG6HcdrtdIwo/Qf5PU0pV90= 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.8 14/24] via-rhine: Fix for the hardware having a reset failure after resume Date: Mon, 12 Oct 2020 15:02:29 -0400 Message-Id: <20201012190239.3279198-14-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201012190239.3279198-1-sashal@kernel.org> References: <20201012190239.3279198-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 803247d51fe97..a20492da34079 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