via-rhine: Resume fix and other maintenance work
Subsystems (3)
v2 cover via-rhine: Resume fix and other maintenance work
I use via-rhine based Ethernet regularly, and the Ethernet dying after resume was really annoying me. I decided to take the matter into my own hands, and came up with a fix for the Ethernet disappearing after resume. I will also want to take over the code maintenance work for via-rhine. The patches apply to the latest code, but they should be backported to older kernels as well.
--
Kevin Brace (4):
via-rhine: Fix for the hardware having a reset failure after resume
via-rhine: VTunknown1 device is really VT8251 South Bridge
via-rhine: Eliminate version information
via-rhine: New device driver maintainer
MAINTAINERS | 3 ++- drivers/net/ethernet/via/via-rhine.c | 21 ++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-)
--
2.17.1
PATCH v2 1/4 via-rhine: Fix for the hardware having a reset failure after resume
From: Kevin Brace <[email protected]>
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.
--- drivers/net/ethernet/via/via-rhine.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/via/via-rhine.c +2 -0
@@ -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.17.1
PATCH v2 2/4 via-rhine: VTunknown1 device is really VT8251 South Bridge
In reply to Kevin BraceFrom: Kevin Brace <[email protected]>
The VIA Technologies VT8251 South Bridge's integrated Rhine-II Ethernet MAC comes has a PCI revision value of 0x7c. This was verified on ASUS P5V800-VM mainboard.
--- drivers/net/ethernet/via/via-rhine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/via/via-rhine.c +1 -1
@@ -243,7 +243,7 @@ enum rhine_revs {VT8233 =0x60 ,/* Integrated MAC */ VT8235 =0x74 ,/* Integrated MAC */ VT8237 =0x78 ,/* Integrated MAC */ - VTunknown1 =0x7C , +VT8251 =0x7C ,/* Integrated MAC */ VT6105 =0x80 ,VT6105_B0 =0x83 , VT6105L = 0x8A,
--
2.17.1
PATCH v2 3/4 via-rhine: Eliminate version information
In reply to Kevin BraceFrom: Kevin Brace <[email protected]>
--- drivers/net/ethernet/via/via-rhine.c | 15 --------------- 1 file changed, 15 deletions(-)
drivers/net/ethernet/via/via-rhine.c +0 -15
@@ -32,8 +32,6 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#define DRV_NAME "via-rhine" -#define DRV_VERSION "1.5.1" -#define DRV_RELDATE "2010-10-09"#include <linux/types.h>
@@ -117,10 +115,6 @@ static const int multicast_filter_limit = 32;#include <linux/uaccess.h> #include <linux/dmi.h> -/* These identify the driver base version and may not be removed. */ -static const char version[] = -"v1.10-LK" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker" ; -MODULE_AUTHOR ("Donald Becker <[email protected]>" );MODULE_DESCRIPTION ("VIA Rhine PCI Fast Ethernet driver" );MODULE_LICENSE ("GPL" );
@@ -1051,11 +1045,6 @@ static int rhine_init_one_pci(struct pci_dev *pdev,u32 quirks =0 ;#endif -/* when built into the kernel, we only print version if device is found */ -#ifndef MODULE -pr_info_once ("%s\n" , version); -#endif - rc =pci_enable_device (pdev);if (rc) goto err_out;
@@ -2296,7 +2285,6 @@ static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *istruct device *hwdev = dev->dev.parent;strlcpy (info->driver,DRV_NAME ,sizeof (info->driver)); -strlcpy (info->version,DRV_VERSION ,sizeof (info->version));strlcpy (info->bus_info,dev_name (hwdev),sizeof (info->bus_info)); }
@@ -2618,9 +2606,6 @@ static int __init rhine_init(void)int ret_pci, ret_platform;/* when a module, this is printed whether or not devices are found in probe */ -#ifdef MODULE -pr_info ("%s\n" , version); -#endif if (dmi_check_system (rhine_dmi_table)) {/* these BIOSes fail at PXE boot if chip is in D3 */ avoid_D3 = true;
--
2.17.1
PATCH v2 4/4 via-rhine: New device driver maintainer
In reply to Kevin BraceFrom: Kevin Brace <[email protected]>
--- MAINTAINERS | 3 ++- drivers/net/ethernet/via/via-rhine.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
MAINTAINERS +2 -1
@@ -18058,7 +18058,8 @@ F: drivers/gpu/vga/vga_switcheroo.c F: include/linux/vga_switcheroo.h VIA RHINE NETWORK DRIVER -S: Orphan +S: Maintained +M: Kevin Brace <[email protected]> F: drivers/net/ethernet/via/via-rhine.c VIA SD/MMC CARD CONTROLLER DRIVER
drivers/net/ethernet/via/via-rhine.c +1 -1
@@ -2,7 +2,7 @@/* Written 1998-2001 by Donald Becker. -Current Maintainer: Roger Luethi <[email protected]> +Current Maintainer: Kevin Brace <[email protected]> This software may be used and distributed according to the terms of the GNU General Public License (GPL), incorporated herein by reference.
--
2.17.1
David Miller
maintainerFrom: Kevin Brace <[email protected]>
Date: Tue, 29 Sep 2020 13:09:39 -0700
Quoted 6 lines
I use via-rhine based Ethernet regularly, and the Ethernet dying after resume was really annoying me. I decided to take the matter into my own hands, and came up with a fix for the Ethernet disappearing after resume. I will also want to take over the code maintenance work for via-rhine. The patches apply to the latest code, but they should be backported to older kernels as well.
Series applied, thank you.
Hi David,
Thank you for the quick application of the fixes.
Regards,
Kevin Brace
Brace Computer Laboratory blog
https://bracecomputerlab.com
Quoted 7 lines
Sent: Tuesday, September 29, 2020 at 2:24 PM
From: "David Miller" <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH net v2 0/4] via-rhine: Resume fix and other maintenance workFrom: Kevin Brace Date: Tue, 29 Sep 2020 13:09:39 -0700 > I use via-rhine based Ethernet regularly, and the Ethernet dying > after resume was really annoying me. I decided to take the > matter into my own hands, and came up with a fix for the Ethernet > disappearing after resume. I will also want to take over the code > maintenance work for via-rhine. The patches apply to the latest > code, but they should be backported to older kernels as well. Series applied, thank you.