Wednesday, July 03, 2013

Workaround for Atheros Communications AR8152 Driver Hanging up Problem in Linux


My Ethernet controller AR8152 starts to hang up after few minutes of operation. I am running on Fedora 18. This issue was not there in Fedora 16.

[kasun@localhost ~]$ lspci | grep Atheros
03:00.0 Ethernet controller: Atheros Communications Inc. AR8152 v1.1 Fast Ethernet (rev c1)
[kasun@localhost ~]$

However this is a known issue which from February 2013.
Kernel Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=54021
Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=928220 
My kernel is "3.9.6-200.fc18.x86_64". Here is the workaround I used.



Step 1: Get some little old drivers from kernel.org as follows
wget https://www.kernel.org/pub/linux/kernel/projects/backports/2012/12/19/compat-drivers-2012-12-19-u.tar.gz

[kasun@localhost ~]$ wget https://www.kernel.org/pub/linux/kernel/projects/backports/2012/12/19/compat-drivers-\
2012-12-19-u.tar.gz
--2013-07-03 11:53:02--  https://www.kernel.org/pub/linux/kernel/projects/backports/2012/12/19/compat-drivers-
2012-12-19-u.tar.gz
Resolving www.kernel.org (www.kernel.org)... 198.145.20.140, 149.20.4.69
Connecting to www.kernel.org (www.kernel.org)|198.145.20.140|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8459872 (8.1M) [application/x-gzip]
Saving to: ‘compat-drivers-2012-12-19-u.tar.gz’

100%[======================================>] 8,459,872    320KB/s   in 24s    

2013-07-03 11:53:30 (344 KB/s) - ‘compat-drivers-2012-12-19-u.tar.gz’ saved [8459872/8459872]

[kasun@localhost ~]$

Step 2: Extract it and change directory in to it.
tar xf compat-drivers-2012-12-19-u.tar.gz

[kasun@localhost ~]$ tar xf compat-drivers-2012-12-19-u.tar.gz
[kasun@localhost ~]$ cd compat-drivers-2012-12-19-u/
[kasun@localhost compat-drivers-2012-12-19-u]$ 

Step 3: Select driver as atl1c.
./scripts/driver-select atl1c

[kasun@localhost compat-drivers-2012-12-19-u]$ ./scripts/driver-select atl1c
Processing new driver-select request...
Backing up makefile: Makefile.bk
Backup exists: Makefile.bk
Backing up makefile: drivers/net/ethernet/broadcom/Makefile.bk
Backing up makefile: drivers/net/ethernet/atheros/Makefile.bk
Backup exists: Makefile.bk
Backup exists: Makefile.bk
Backup exists: drivers/net/ethernet/broadcom/Makefile.bk
[kasun@localhost compat-drivers-2012-12-19-u]$ 

Step 4: Run make. (Hope you have installed, GCC and Kernel devel and headers.)
make

[kasun@localhost compat-drivers-2012-12-19-u]$ make
./scripts/gen-compat-autoconf.sh /home/kasun/compat-drivers-2012-12-19-u/.config /home/kasun/compat-drivers-
2012-12-19-u/config.mk > include/linux/compat_autoconf.h
make -C /lib/modules/3.9.6-200.fc18.x86_64/build M=/home/kasun/compat-drivers-2012-12-19-u modules
make[1]: Entering directory `/usr/src/kernels/3.9.6-200.fc18.x86_64'
  CC [M]  /home/kasun/compat-drivers-2012-12-19-u/compat/main.o
  LD [M]  /home/kasun/compat-drivers-2012-12-19-u/compat/compat.o
  CC [M]  /home/kasun/compat-drivers-2012-12-19-u/drivers/net/ethernet/atheros/atl1c/atl1c_main.o
  CC [M]  /home/kasun/compat-drivers-2012-12-19-u/drivers/net/ethernet/atheros/atl1c/atl1c_hw.o
  CC [M]  /home/kasun/compat-drivers-2012-12-19-u/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.o
  LD [M]  /home/kasun/compat-drivers-2012-12-19-u/drivers/net/ethernet/atheros/atl1c/atl1c.o
  Building modules, stage 2.
  MODPOST 2 modules
  CC      /home/kasun/compat-drivers-2012-12-19-u/compat/compat.mod.o
  LD [M]  /home/kasun/compat-drivers-2012-12-19-u/compat/compat.ko
  CC      /home/kasun/compat-drivers-2012-12-19-u/drivers/net/ethernet/atheros/atl1c/atl1c.mod.o
  LD [M]  /home/kasun/compat-drivers-2012-12-19-u/drivers/net/ethernet/atheros/atl1c/atl1c.ko
make[1]: Leaving directory `/usr/src/kernels/3.9.6-200.fc18.x86_64'
[kasun@localhost compat-drivers-2012-12-19-u]$ 

Step 5: Run sudo make install
sudo make install

[kasun@localhost compat-drivers-2012-12-19-u]$ sudo make install
make -C /lib/modules/3.9.6-200.fc18.x86_64/build M=/home/kasun/compat-drivers-2012-12-19-u modules
make[1]: Entering directory `/usr/src/kernels/3.9.6-200.fc18.x86_64'
  Building modules, stage 2.
  MODPOST 2 modules
make[1]: Leaving directory `/usr/src/kernels/3.9.6-200.fc18.x86_64'
make -C /lib/modules/3.9.6-200.fc18.x86_64/build M=/home/kasun/compat-drivers-2012-12-19-u "INSTALL_MOD_DIR=updates"  \
 modules_install
make[1]: Entering directory `/usr/src/kernels/3.9.6-200.fc18.x86_64'
  INSTALL /home/kasun/compat-drivers-2012-12-19-u/compat/compat.ko
Can't read private key
  INSTALL /home/kasun/compat-drivers-2012-12-19-u/drivers/net/ethernet/atheros/atl1c/atl1c.ko
Can't read private key
  DEPMOD  3.9.6-200.fc18.x86_64
make[1]: Leaving directory `/usr/src/kernels/3.9.6-200.fc18.x86_64'

Note: iwl4965 detected, we're going to disable it. If you would like to enable it later you can run:
    sudo iwl-load iwl4965

Running iwl-enable iwlagn...
modprobe: invalid option -- 'l'
Module iwl4965 not detected -- this is fine
modprobe: invalid option -- 'l'
depmod will prefer updates/ over kernel/ -- OK!

Now run:

sudo make unload to unload all: wireless, bluetooth and ethernet modules
sudo make wlunload to unload wireless modules
sudo make btunload to unload bluetooth modules

Run sudo modprobe driver-name to load your desired driver.
If unsure reboot.

[kasun@localhost compat-drivers-2012-12-19-u]$

Step 6: Reboot or run
sudo modprobe -r atl1c
sudo modprobe atl1c
sudo service NetworkManager restart

[kasun@localhost compat-drivers-2012-12-19-u]$ sudo modprobe -r atl1c
[kasun@localhost compat-drivers-2012-12-19-u]$ sudo modprobe atl1c
[kasun@localhost compat-drivers-2012-12-19-u]$ sudo service NetworkManager restart
Redirecting to /bin/systemctl restart  NetworkManager.service
[kasun@localhost compat-drivers-2012-12-19-u]$ 

This will solve the problem until next kernel update.

No comments: