Saturday, 21 October 2017

Using the long spoon: Realtek RTL8411 and Linux

I had a soft spot for Acer laptops, especially the Aspire range. They are cheap and cheerful and you can get models with CPUs that support native virtualization. They also use the same power adapter in all their models, and since I am forever forgetting to take the adapter with me, I simply leave one power adapter at likely locations where I am in danger of doing any real work.

But lately they have been failing after a year. The last three years have been almost continuous site work - two back-to-back major projects in KL (Q Sentral and MRT) each involved new designs (prototypes!). They did not like being lugged around every day in a heavy rucksack with my toolbox and spares.

When my last laptop failed, I commandeered the wife's Asus X751L gamer's laptop. A year ago, I had resized the Windows partition and installed Linux on it, Slackware 14.1. It worked fine as a dual-boot, Windows for games and Linux for everything else.

root@x751l:/home/heong# cat /proc/version
Linux version 3.10.17 (root@hive64) (gcc version 4.8.2 (GCC) ) #2 SMP Wed Oct 23
16:34:38 CDT 2013
root@x751l:/home/heong# cat /etc/slackware-version
Slackware 14.1

I upgraded it to Slackware 14.2 and without a second's thought upgraded it to the latest Linux kernel, 4.13.8.

heong@x751l:~$ cat /proc/version
Linux version 4.13.8 (root@x751l) (gcc version 5.3.0 (GCC)) #1 SMP Thu Oct 19 18:
17:53 MYT 2017
heong@x751l:~$ cat /etc/slackware-version
Slackware 14.2

The wired Ethernet LAN stopped working. It would not connect, would not ping, nothing. Yet it had been working fine with Slackware 14.1 and Linux kernel 3.10.17. The driver, r8169 reported no errors with the hardware. The Asus X751L has a Realtek RTL8411 Ethernet Controller. Come to think of it, the previous laptop, an Acer AspireF15 had problems with the Ethernet Controller just after upgrade to Slackware 14.2 and kernel 4.8.7. With the Acer, the link would be fine at first but would randomly drop. It seemed better with some network switches, but it always dropped the link after a while. And it also used the Realtek RTL8411.

When I googled the problem, the solution seemed to be to blacklist the r8169 driver (kernel module) and use the r8168. Or use the Realtek Linux driver. There are hints of lame Realtek hardware, as the r8169 had worked fine before in the older kernels. Switching to r8168 seemed a lot of work, and it needs to be redone every time I upgrade my kernel (usually when needed to run new applications like docker). Switching to the  Realtek driver seemed worse. I try to avoid anything not in the mainline kernel.

Running with the lame Realtek hardware hunch, this link suggested to boot into Windows and flip the 'LAN Auto-negotiation on Shutdown' setting in Device Manager. That seemed quicker, and while it went against grain to use Windows, I need to do it only once, and I end up with a clean mainline Linux.
When supping with the Great Satan of software, you  need a long spoon.   

So I booted into Windows, found the 'LAN Auto-negotiation on Shutdown' setting and flipped it. And it works - on booting back into Linux, the wired Ethernet works, just like that. And the link proved stable over the weekend despite a few hundred gigabytes of data transfer.

Thinking back, that turned out to be the cure for the Ethernet instability problem in the Acer Aspire F15 too. Except I had not recorded the fix in my journal, which runs on Linux, and the fix was done in Windows. I guess it is cumbersome working with Windows if you have one hand holding your nose all the time.

Well, fool me once

No comments:

Post a Comment