UX21E ZENBOOK, i5 2467M

daeme
  11 years ago
  Asus (Laptop or Netbook)
  LMDE
  Works fine with some minor problems
What works:

- WebCam (tested with cheese)
- TouchPad

What doesn't work:

- FIXED: Asix AX88772B Low-Power USB 2.0 to 10/100M Fast Ethernet Controller
- FIXED: Suspend to RAM (standby)
- IMPROVED: Powersavings

What was done to make it work:

> Asix AX88772B Low-Power USB 2.0 to 10/100M Fast Ethernet Controller:
see also for latest driver: http://asix.com.tw/products.php?op=pItemdetail&PItemID=105;71;101&PLine=71
What I did to make it work (Shell):

$> wget http:// asix.com.tw/FrootAttach/driver/AX88772B_772A_760_772_178_LINUX_Driver_v4.2.0_Source.zip

$> aptitude install unzip

$> unzip AX88772B_772A_760_772_178_LINUX_Driver_v4.2.0_Source.zip

$> cd AX88772B_772A_760_772_178_LINUX_Driver_v4.2.0_Source

$> make
[if no error occurs, there should be a file asix.ko in the current dir]

$> sudo make install

$> sudo modprobe asix
[now the adapter worked as expected wen pluged into usb]

$> echo asix >> /etc/modules
[and now also after reboot without modprobe each time]

Change the interface name after USB port change (ethX), edit: /etc/udev/rules.d/70-persistent-net.rules

======================================================================

Suspend mode FIX: Add custom sleep script to /etc/pc/sleep.d/

I named it '20_custom-ehci':

#!/bin/sh
# File: "/etc/pm/sleep.d/20_custom-ehci_hcd".

# Found matsching adresses using "lspci |grep USB":
# 00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
# 00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
# 03:00.0 USB Controller: Fresco Logic Device 1009 (rev 02)

case "${1}" in
hibernate|suspend)
# Unbind ehci_hcd/xhci_hcd devices
echo -n "0000:00:1a.0" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
echo -n "0000:03:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind
;;
resume|thaw)
# Bind ehci_hcd/xhci_hcd devices
echo -n "0000:00:1a.0" | tee /sys/bus/pci/drivers/ehci_hcd/bind
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci_hcd/bind
echo -n "0000:03:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/bind
;;
esac
#EoF


======================================================================
POWERSAVING scripts:

#!/bin/bash

# optimize power settings (after boot/suspend)

# VM writeback timeout
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

# set pci power settings all to auto
find /sys/devices/pci* -path "*power/control" -exec bash -c "echo auto > '{}'" \;

# Mouse hack (Logitech optical mouse doesn't work correctly in auto power mode)

# Find USB BUS Controller to which the mouse is conneted
USB1=`find /sys/devices/pci* -path "*power/control" -exec bash -c "echo '{}'" \; | grep mouse | cut -c1-55`

# Find the USB Mouse itself
USB2=`find /sys/devices/pci* -path "*power/control" -exec bash -c "echo '{}'" \; | grep mouse | cut -c1-59`
if [ -f $USB1/power/control ]; then
# Power on bus
echo on > $USB1/power/control
if [ -f $USB2/power/control ]; then
# Power on Mouse
echo on > $USB2/power/control
fi
# bus back to auto
echo auto > $USB1/power/control
fi

# Intel HD Audio codec power management
if [ -f /sys/module/snd_hda_intel/parameters/power_save ]; then
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
fi
if [ -f /sys/module/snd_hda_intel/parameters/power_save_controller ]; then
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
fi

# SATA link power management
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
echo min_power > /sys/class/scsi_host/host1/link_power_management_policy
echo min_power > /sys/class/scsi_host/host2/link_power_management_policy
echo min_power > /sys/class/scsi_host/host3/link_power_management_policy
echo min_power > /sys/class/scsi_host/host4/link_power_management_policy
echo min_power > /sys/class/scsi_host/host5/link_power_management_policy

# LCD Backlight (to 50%)
#xbacklight -set 50

# power aware cpu schedules
sysctl kernel.sched_domain.cpu0.domain0.flags=687
sysctl kernel.sched_domain.cpu0.domain1.flags=559
sysctl kernel.sched_domain.cpu1.domain0.flags=687
sysctl kernel.sched_domain.cpu1.domain1.flags=559
sysctl kernel.sched_domain.cpu2.domain0.flags=687
sysctl kernel.sched_domain.cpu2.domain1.flags=559
sysctl kernel.sched_domain.cpu3.domain0.flags=687
sysctl kernel.sched_domain.cpu3.domain1.flags=559

#Disable NMI watchdog
sysctl kernel.nmi_watchdog=0

Additional notes:

Since there is "only" a SSD disk, I considered to not use swap which I think makes hibernation impossible to work, but I don't care but for me, having suspend to ram working would be nice but doesn't work either - I have still to figure out what the cause could be.

My SSD settings:
- Enable trim support (discard) and disable file access time (noeatime)
- No swap partition
- /tmp, /var/run and /var/run/ock to ram (tmpfs)


/etc/fstab:
UUID={UUID} / ext4 rw,discard,noatime,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults,noexec,nosuid 0 0

/etc/default/rcS:
RAMRUN=yes
RAMLOCK=yes

/etc/sysctl.conf:
vm.swappiness=0

==================================

Some additional fine tuning in power management may has to be done (according to powertop)