Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btrfs and TLP #128

Closed
m0nk33 opened this issue Feb 22, 2015 · 25 comments
Closed

btrfs and TLP #128

m0nk33 opened this issue Feb 22, 2015 · 25 comments
Assignees

Comments

@m0nk33
Copy link

m0nk33 commented Feb 22, 2015

I am using btrfs on archlinux 3.18.* and have massive issues with TLP. After installing TLP and rebooting it a few times I get random file corruptions until my filesystem breaks completely. I cant supply any logs since I needed to reinstall my system every time (maybe this could be done, but I am using LUKS so, after some file curruptions I cant open the container) but I am pretty sure its connected to TLP because it broke my system a few times. (Took me some time to figure out its TLP).

This error is reproducable maybe even in a VM.

Does anybody know anything about this issue?

@linrunner
Copy link
Owner

Hi, sorry to hear that.

On physical hardware SATA ALPM is a probable cause (on battery power for the default config). I would change the config immediately after install

SATA_LINKPWR_ON_BAT=max_performance 

and check for SATA Errors – eventually recheck with more aggressive settings.

This error is reproducable maybe even in a VM.

Maybe?! This would be a mystery. TLP doesn't touch any btrfs related settings. The only filesystem related settings are shown in tlp-stat output, "File System" section.

Please show full

tlp-stat

output before the first reboot. You may start TLP without reboot:

tlp start

@m0nk33
Copy link
Author

m0nk33 commented Feb 26, 2015

Hey, thank you for your help. Luckily I had a backup....

I changed the config file and disabled SATA_LINKPWR (commeted it out), just to be sure.

# SATA aggressive link power management (ALPM):
#   min_power, medium_power, max_performance
#SATA_LINKPWR_ON_AC=max_performance
#SATA_LINKPWR_ON_BAT=min_power

tlp-stat before first reboot/first start of tlp:

--- TLP 0.7 --------------------------------------------

+++ Configured Settings: /etc/default/tlp
TLP_ENABLE=1
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2
MAX_LOST_WORK_SECS_ON_AC=15
MAX_LOST_WORK_SECS_ON_BAT=60
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1
NMI_WATCHDOG=0
ENERGY_PERF_POLICY_ON_AC=performance
ENERGY_PERF_POLICY_ON_BAT=powersave
DISK_DEVICES="sda sdb"
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="128 128"
PCIE_ASPM_ON_AC=performance
PCIE_ASPM_ON_BAT=powersave
RADEON_POWER_PROFILE_ON_AC=high
RADEON_POWER_PROFILE_ON_BAT=low
RADEON_DPM_STATE_ON_AC=performance
RADEON_DPM_STATE_ON_BAT=battery
RADEON_DPM_PERF_LEVEL_ON_AC=auto
RADEON_DPM_PERF_LEVEL_ON_BAT=auto
WIFI_PWR_ON_AC=1
WIFI_PWR_ON_BAT=5
WOL_DISABLE=Y
SOUND_POWER_SAVE_ON_AC=0
SOUND_POWER_SAVE_ON_BAT=1
SOUND_POWER_SAVE_CONTROLLER=Y
BAY_POWEROFF_ON_BAT=0
BAY_DEVICE="sr0"
RUNTIME_PM_ON_AC=on
RUNTIME_PM_ON_BAT=auto
RUNTIME_PM_ALL=1
RUNTIME_PM_DRIVER_BLACKLIST="radeon nouveau"
USB_AUTOSUSPEND=1
USB_DRIVER_BLACKLIST="usbhid"
USB_BLACKLIST_WWAN=1
RESTORE_DEVICE_STATE_ON_STARTUP=0

+++ System Info
System         = LENOVO ThinkPad X240 20AMS21C00
BIOS           = GIET77WW (2.27 )
Release        = "Arch Linux"
Kernel         = 3.18.6-1-ARCH x86_64
/proc/cmdline  = BOOT_IMAGE=/vmlinuz-linux root=UUID=9446519c-1fe2-438a-b940-1d1d596bc00f rw rootflags=subvol=__active cryptdevice=/dev/sda5:crypt
Init system    = systemd

+++ System Status
TLP power save = enabled
***Warning: tlp.service is not enabled -- invoke "systemctl enable tlp.service" to correct this!
***Warning: tlp-sleep.service is not enabled -- invoke "systemctl enable tlp-sleep.service" to correct this!
power source   = ac

+++ Processor
CPU Model      = Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz

/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq  =  2900000 [kHz]

/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq  =  2900000 [kHz]

/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq  =  2900000 [kHz]

/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq  =  2900000 [kHz]

/sys/devices/system/cpu/intel_pstate/min_perf_pct      = 27
/sys/devices/system/cpu/intel_pstate/max_perf_pct      = 100
/sys/devices/system/cpu/intel_pstate/no_turbo          = 0

x86_energy_perf_policy.cpu0                            = normal
x86_energy_perf_policy.cpu1                            = normal
x86_energy_perf_policy.cpu2                            = normal
x86_energy_perf_policy.cpu3                            = normal

/proc/sys/kernel/nmi_watchdog                          = 1

+++ Undervolting
PHC kernel not available.

+++ Temperatures
CPU temp               =    51 [°C]
/proc/acpi/ibm/fan     =  3051 [/min]

+++ File System
/proc/sys/vm/laptop_mode               =     0
/proc/sys/vm/dirty_writeback_centisecs =   500
/proc/sys/vm/dirty_expire_centisecs    =  3000
/proc/sys/vm/dirty_ratio               =    20
/proc/sys/vm/dirty_background_ratio    =    10
/proc/sys/fs/xfs/age_buffer_centisecs  = (not available)
/proc/sys/fs/xfs/xfssyncd_centisecs    = (not available)
/proc/sys/fs/xfs/xfsbufd_centisecs     = (not available)

+++ Storage Devices
/dev/sda:
          Model     = Samsung SSD 840 PRO Series              
          Firmware  = DXM05B0Q
          APM Level = none/disabled
          Status    = active/idle
          TRIM      = supported
          Scheduler = cfq

        SMART info:
            5 Reallocated_Sector_Ct     =     2813 
            9 Power_On_Hours            =     1494 [h]
          177 Wear_Leveling_Count       =       98 [%]
          179 Used_Rsvd_Blk_Cnt_Tot     =     2813 
          190 Airflow_Temperature_Cel   =       29 [°C]
          241 Total_LBAs_Written        =    3.174 [TB]


+++ SATA Aggressive Link Power Management
/sys/class/scsi_host/host0/link_power_management_policy  = max_performance
/sys/class/scsi_host/host1/link_power_management_policy  = max_performance
/sys/class/scsi_host/host2/link_power_management_policy  = max_performance

+++ PCIe Active State Power Management
/sys/module/pcie_aspm/parameters/policy = default (using bios preferences)

+++ Intel Graphics
/sys/module/i915/parameters/powersave        =  1 (enabled)
/sys/module/i915/parameters/enable_rc6       =  1 (enabled)
/sys/module/i915/parameters/enable_fbc       = -1 (use per-chip default)
/sys/module/i915/parameters/lvds_downclock   =  0 (disabled)
/sys/module/i915/parameters/semaphores       = -1 (use per-chip default)

+++ Wireless
bluetooth = on
wifi      = on
wwan      = none (no device)

hci0(btusb)         : not connected
wlp3s0(iwlwifi)     : connected, power management = on

+++ Audio
/sys/module/snd_hda_intel/parameters/power_save            = 0
/sys/module/snd_hda_intel/parameters/power_save_controller = Y

+++ Docks and Device Bays
/sys/devices/platform/dock.0: battery_bay   = battery present

+++ Runtime Power Management
device classes   = all
device blacklist = (not configured)
driver blacklist = radeon nouveau

/sys/bus/pci/devices/0000:00:00.0/power/control = on   (0x060000, Host bridge, no driver)
/sys/bus/pci/devices/0000:00:02.0/power/control = on   (0x030000, VGA compatible controller, i915)
/sys/bus/pci/devices/0000:00:03.0/power/control = on   (0x040300, Audio device, snd_hda_intel)
/sys/bus/pci/devices/0000:00:14.0/power/control = on   (0x0c0330, USB controller, xhci_hcd)
/sys/bus/pci/devices/0000:00:16.0/power/control = on   (0x078000, Communication controller, mei_me)
/sys/bus/pci/devices/0000:00:16.3/power/control = on   (0x070002, Serial controller, serial)
/sys/bus/pci/devices/0000:00:19.0/power/control = on   (0x020000, Ethernet controller, e1000e)
/sys/bus/pci/devices/0000:00:1b.0/power/control = on   (0x040300, Audio device, snd_hda_intel)
/sys/bus/pci/devices/0000:00:1c.0/power/control = on   (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1c.1/power/control = on   (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1d.0/power/control = on   (0x0c0320, USB controller, ehci-pci)
/sys/bus/pci/devices/0000:00:1f.0/power/control = on   (0x060100, ISA bridge, lpc_ich)
/sys/bus/pci/devices/0000:00:1f.2/power/control = on   (0x010601, SATA controller, ahci)
/sys/bus/pci/devices/0000:00:1f.3/power/control = on   (0x0c0500, SMBus, i801_smbus)
/sys/bus/pci/devices/0000:02:00.0/power/control = on   (0xff0000, Unassigned class [ff00], rtsx_pci)
/sys/bus/pci/devices/0000:03:00.0/power/control = on   (0x028000, Network controller, iwlwifi)

+++ USB
autosuspend        = enabled
device whitelist   = (not configured)
device blacklist   = (not configured)
driver blacklist   = usbhid
wwan blacklist     = enabled (cdc_acm cdc_wdm cdc_ether hso qcserial sierra)

Bus 001 Device 003 ID 058f:9540 control = on,   autosuspend_delay_ms =  2000 -- Alcor Micro Corp. AU9540 Smartcard Reader (no driver)
Bus 001 Device 002 ID 8087:8000 control = auto, autosuspend_delay_ms =     0 -- Intel Corp.  (hub)
Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms =     0 -- Linux Foundation 2.0 root hub (hub)
Bus 003 Device 002 ID 17ef:1010 control = auto, autosuspend_delay_ms =     0 -- Lenovo  (hub)
Bus 003 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms =     0 -- Linux Foundation 3.0 root hub (hub)
Bus 002 Device 005 ID 5986:0268 control = auto, autosuspend_delay_ms =  2000 -- Acer, Inc  (uvcvideo)
Bus 002 Device 003 ID 8087:07dc control = on,   autosuspend_delay_ms =  2000 -- Intel Corp.  (btusb)
Bus 002 Device 006 ID 17ef:100f control = auto, autosuspend_delay_ms =     0 -- Lenovo  (hub)
Bus 002 Device 007 ID 093a:2510 control = on,   autosuspend_delay_ms =  2000 -- Pixart Imaging, Inc. Optical Mouse (usbhid)
Bus 002 Device 002 ID 17ef:1010 control = auto, autosuspend_delay_ms =     0 -- Lenovo  (hub)
Bus 002 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms =     0 -- Linux Foundation 2.0 root hub (hub)

+++ ThinkPad Extended Battery Functions
tp-smapi   = inactive (kernel module 'tp_smapi' load error)
tpacpi-bat = active

+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer                   = SONY
/sys/class/power_supply/BAT0/model_name                     = 45N1111
/sys/class/power_supply/BAT0/cycle_count                    = (not supported)
/sys/class/power_supply/BAT0/energy_full_design             =  23200 [mWh]
/sys/class/power_supply/BAT0/energy_full                    =  22270 [mWh]
/sys/class/power_supply/BAT0/energy_now                     =  21730 [mWh]
/sys/class/power_supply/BAT0/power_now                      =      0 [mW]
/sys/class/power_supply/BAT0/status                         = Unknown

tpacpi-bat.BAT0.startThreshold                              =     96 [%]
tpacpi-bat.BAT0.stopThreshold                               =    100 [%]
tpacpi-bat.BAT0.forceDischarge                              =      0

+++ ThinkPad Battery Status: BAT1 (Ultrabay / Slice / Replaceable)
/sys/class/power_supply/BAT1/manufacturer                   = SANYO
/sys/class/power_supply/BAT1/model_name                     = 45N1737
/sys/class/power_supply/BAT1/cycle_count                    = (not supported)
/sys/class/power_supply/BAT1/energy_full_design             =  71280 [mWh]
/sys/class/power_supply/BAT1/energy_full                    =  68230 [mWh]
/sys/class/power_supply/BAT1/energy_now                     =  67770 [mWh]
/sys/class/power_supply/BAT1/power_now                      =      0 [mW]
/sys/class/power_supply/BAT1/status                         = Unknown

tpacpi-bat.BAT1.startThreshold                              =     96 [%]
tpacpi-bat.BAT1.stopThreshold                               =    100 [%]
tpacpi-bat.BAT1.forceDischarge                              =      0

I just started tlp like you suggested with tlp start but I did not reboot yet. Now I wait and reboot a few times. Lets see what happens.....

edit1
I just started journalctl -f and found

-- Logs begin at Sat 2015-02-21 11:38:04 CET. --
Feb 26 15:46:28 1 dbus[472]: [system] Activating via systemd: service name='org.freedesktop.UPower' unit='upower.service'
Feb 26 15:46:28 1 systemd[1]: Starting Daemon for power management...
Feb 26 15:46:28 1 dbus[472]: [system] Successfully activated service 'org.freedesktop.UPower'
Feb 26 15:46:28 1 systemd[1]: Started Daemon for power management.
Feb 26 15:47:25 1 sudo[21624]: m : TTY=pts/3 ; PWD=/home/m/test/tlp ; USER=root ; COMMAND=/usr/bin/tlp start
Feb 26 15:47:25 1 sudo[21624]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 26 15:47:25 1 kernel: thinkpad_ec: thinkpad_ec_request_row: arg0 rejected: (0x01:0x00)->0x00
Feb 26 15:47:25 1 kernel: thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x01:0x00)->0xfffffffb
Feb 26 15:47:25 1 kernel: thinkpad_ec: initial ec test failed
Feb 26 15:47:26 1 sudo[21624]: pam_unix(sudo:session): session closed for user root

if this helps...

edit2
juts rebooted the first time....

dmesg | grep thinkpad_ec

[   14.531804] thinkpad_ec: thinkpad_ec_request_row: arg0 rejected: (0x01:0x00)->0x00
[   14.531806] thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x01:0x00)->0xfffffffb
[   14.531806] thinkpad_ec: initial ec test failed
[   15.143971] thinkpad_ec: thinkpad_ec_request_row: arg0 rejected: (0x01:0x00)->0x00
[   15.143973] thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x01:0x00)->0xfffffffb
[   15.143973] thinkpad_ec: initial ec test failed

I doubt this has something to do with the btrfs problem....But if you know a solution it would just be nice! ;)

tlp-stat -w still has no output.

@linrunner
Copy link
Owner

tp-smapi is not compatible with the X240. Remove it and the messages will disappear.

Your install is not finished yet:

Warning: tlp.service is not enabled -- invoke "systemctl enable tlp.service" to correct this!
Warning: tlp-sleep.service is not enabled -- invoke "systemctl enable tlp-sleep.service" to correct

Please enable the services. See https://wiki.archlinux.org/index.php/TLP too.

@linrunner linrunner self-assigned this Feb 26, 2015
@m0nk33
Copy link
Author

m0nk33 commented Mar 3, 2015

I forgot to mention it, but of course I started the systemd service as explained.

After a couple of days I can say for sure that my system is still running fine, thanks to your help.

I changed the arch wiki and added a part about btrfs. Maybe it helps other people.

In short: I recommend for every btrfs user to do the discussed steps to avoid breaking the filesystem.

Thank you and keep up the good work.

@linrunner
Copy link
Owner

You're welcome.

@strelec
Copy link

strelec commented Oct 31, 2015

Was there any extended research as to why this has happened? It seems like that from now on, everybody with btrfs disables power saving, just out of caution.

In my case, the system power usage is about 4W higher and I am not sure whether I should turn the option back on.

@strelec
Copy link

strelec commented Nov 30, 2015

@m0nk33: Can you post the output of lspci and lshw?

@m0nk33
Copy link
Author

m0nk33 commented Dec 3, 2015

~ » s lshw                                                                                                monkee@banana
banana                    
    description: Notebook
    product: 20AMS21C00 (LENOVO_MT_20AM_BU_Think_FM_ThinkPad X240)
    vendor: LENOVO
    version: ThinkPad X240
    serial: PF00L5CP
    width: 64 bits
    capabilities: smbios-2.7 dmi-2.7 vsyscall32
    configuration: administrator_password=disabled chassis=notebook family=ThinkPad X240 power-on_password=disabled sku=LENOVO_MT_20AM_BU_Think_FM_ThinkPad X240 uuid=01DB6E38-0E52-CB11-BFD5-A6BE3A98E0F7
  *-core
       description: Motherboard
       product: 20AMS21C00
       vendor: LENOVO
       physical id: 0
       version: Not Defined
       serial: L1HF41H04MG
       slot: Not Available
     *-cpu
          description: CPU
          product: Core i5 (None)
          vendor: Intel Corp.
          physical id: 0
          bus info: cpu@0
          version: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
          serial: None
          slot: CPU Socket - U3E1
          size: 2855MHz
          capacity: 2900MHz
          width: 64 bits
          clock: 100MHz
          capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt cpufreq
          configuration: cores=2 enabledcores=2 threads=4
        *-cache:0
             description: L1 cache
             physical id: 2
             slot: L1-Cache
             size: 32KiB
             capacity: 32KiB
             capabilities: asynchronous internal write-back instruction
        *-cache:1
             description: L2 cache
             physical id: 3
             slot: L2-Cache
             size: 256KiB
             capacity: 256KiB
             capabilities: asynchronous internal write-back unified
        *-cache:2
             description: L3 cache
             physical id: 4
             slot: L3-Cache
             size: 3MiB
             capacity: 3MiB
             capabilities: asynchronous internal write-back unified
     *-cache
          description: L1 cache
          physical id: 1
          slot: L1-Cache
          size: 32KiB
          capacity: 32KiB
          capabilities: asynchronous internal write-back data
     *-memory
          description: System Memory
          physical id: 5
          slot: System board or motherboard
          size: 8GiB
        *-bank
             description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)
             product: M471B1G73DB0-YK0
             vendor: Samsung
             physical id: 0
             serial: 376991EE
             slot: ChannelA-DIMM0
             size: 8GiB
             width: 64 bits
             clock: 1600MHz (0.6ns)
     *-firmware
          description: BIOS
          vendor: LENOVO
          physical id: 39
          version: GIET77WW (2.27 )
          date: 10/02/2014
          size: 128KiB
          capacity: 15MiB
          capabilities: pci pnp upgrade shadowing cdboot bootselect acpi usb biosbootspecification uefi
     *-pci
          description: Host bridge
          product: Haswell-ULT DRAM Controller
          vendor: Intel Corporation
          physical id: 100
          bus info: pci@0000:00:00.0
          version: 0b
          width: 32 bits
          clock: 33MHz
          configuration: driver=hsw_uncore
          resources: irq:0
        *-display
             description: VGA compatible controller
             product: Haswell-ULT Integrated Graphics Controller
             vendor: Intel Corporation
             physical id: 2
             bus info: pci@0000:00:02.0
             version: 0b
             width: 64 bits
             clock: 33MHz
             capabilities: msi pm vga_controller bus_master cap_list rom
             configuration: driver=i915 latency=0
             resources: irq:49 memory:f0000000-f03fffff memory:e0000000-efffffff ioport:3000(size=64)
        *-multimedia:0
             description: Audio device
             product: Haswell-ULT HD Audio Controller
             vendor: Intel Corporation
             physical id: 3
             bus info: pci@0000:00:03.0
             version: 0b
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi pciexpress bus_master cap_list
             configuration: driver=snd_hda_intel latency=0
             resources: irq:45 memory:f0630000-f0633fff
        *-usb:0
             description: USB controller
             product: 8 Series USB xHCI HC
             vendor: Intel Corporation
             physical id: 14
             bus info: pci@0000:00:14.0
             version: 04
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi xhci bus_master cap_list
             configuration: driver=xhci_hcd latency=0
             resources: irq:43 memory:f0620000-f062ffff
           *-usbhost:0
                product: xHCI Host Controller
                vendor: Linux 4.2.5-1-ARCH xhci-hcd
                physical id: 0
                bus info: usb@3
                logical name: usb3
                version: 4.02
                capabilities: usb-3.00
                configuration: driver=hub slots=4 speed=5000Mbit/s
              *-usb
                   description: USB hub
                   product: Lenovo ThinkPad Dock
                   vendor: LENOVO
                   physical id: 3
                   bus info: usb@3:3
                   version: 50.31
                   capabilities: usb-3.00
                   configuration: driver=hub slots=4 speed=5000Mbit/s
           *-usbhost:1
                product: xHCI Host Controller
                vendor: Linux 4.2.5-1-ARCH xhci-hcd
                physical id: 1
                bus info: usb@2
                logical name: usb2
                version: 4.02
                capabilities: usb-2.00
                configuration: driver=hub slots=9 speed=480Mbit/s
              *-usb:0
                   description: USB hub
                   product: Lenovo ThinkPad Dock
                   vendor: LENOVO
                   physical id: 3
                   bus info: usb@2:3
                   version: 50.30
                   capabilities: usb-2.00
                   configuration: driver=hub slots=4 speed=480Mbit/s
                 *-usb
                      description: USB hub
                      product: Lenovo ThinkPad Dock
                      vendor: Lenovo
                      physical id: 4
                      bus info: usb@2:3.4
                      version: 0.01
                      serial: Rev1.2
                      capabilities: usb-2.00
                      configuration: driver=hub maxpower=2mA slots=3 speed=480Mbit/s
                    *-usb
                         description: Mouse
                         product: USB-PS/2 Optical Mouse
                         vendor: Logitech
                         physical id: 2
                         bus info: usb@2:3.4.2
                         version: 30.00
                         capabilities: usb-2.00
                         configuration: driver=usbhid maxpower=98mA speed=2Mbit/s
              *-usb:1
                   description: Bluetooth wireless interface
                   vendor: Intel Corp.
                   physical id: 7
                   bus info: usb@2:7
                   version: 0.01
                   capabilities: bluetooth usb-2.00
                   configuration: driver=btusb maxpower=100mA speed=12Mbit/s
              *-usb:2
                   description: Video
                   product: Integrated Camera
                   vendor: SunplusIT INC.
                   physical id: 8
                   bus info: usb@2:8
                   version: 0.03
                   capabilities: usb-2.00
                   configuration: driver=uvcvideo maxpower=500mA speed=480Mbit/s
        *-communication:0
             description: Communication controller
             product: 8 Series HECI #0
             vendor: Intel Corporation
             physical id: 16
             bus info: pci@0000:00:16.0
             version: 04
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi bus_master cap_list
             configuration: driver=mei_me latency=0
             resources: irq:46 memory:f0639000-f063901f
        *-communication:1
             description: Serial controller
             product: 8 Series HECI KT
             vendor: Intel Corporation
             physical id: 16.3
             bus info: pci@0000:00:16.3
             version: 04
             width: 32 bits
             clock: 66MHz
             capabilities: pm msi 16550 bus_master cap_list
             configuration: driver=serial latency=0
             resources: irq:17 ioport:30b0(size=8) memory:f063f000-f063ffff
        *-network
             description: Ethernet interface
             product: Ethernet Connection I218-LM
             vendor: Intel Corporation
             physical id: 19
             bus info: pci@0000:00:19.0
             logical name: enp0s25
             version: 04
             serial: 28:d2:44:53:27:d3
             capacity: 1Gbit/s
             width: 32 bits
             clock: 33MHz
             capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
             configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.5-k firmware=0.6-3 latency=0 link=no multicast=yes port=twisted pair
             resources: irq:50 memory:f0600000-f061ffff memory:f063e000-f063efff ioport:3080(size=32)
        *-multimedia:1
             description: Audio device
             product: 8 Series HD Audio Controller
             vendor: Intel Corporation
             physical id: 1b
             bus info: pci@0000:00:1b.0
             version: 04
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi pciexpress bus_master cap_list
             configuration: driver=snd_hda_intel latency=0
             resources: irq:48 memory:f0634000-f0637fff
        *-pci:0
             description: PCI bridge
             product: 8 Series PCI Express Root Port 6
             vendor: Intel Corporation
             physical id: 1c
             bus info: pci@0000:00:1c.0
             version: e4
             width: 32 bits
             clock: 33MHz
             capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
             configuration: driver=pcieport
             resources: irq:17 memory:f0500000-f05fffff
           *-generic
                description: Unassigned class
                product: RTS5227 PCI Express Card Reader
                vendor: Realtek Semiconductor Co., Ltd.
                physical id: 0
                bus info: pci@0000:02:00.0
                version: 01
                width: 32 bits
                clock: 33MHz
                capabilities: pm msi pciexpress bus_master cap_list
                configuration: driver=rtsx_pci latency=0
                resources: irq:42 memory:f0500000-f0500fff
        *-pci:1
             description: PCI bridge
             product: 8 Series PCI Express Root Port 3
             vendor: Intel Corporation
             physical id: 1c.1
             bus info: pci@0000:00:1c.1
             version: e4
             width: 32 bits
             clock: 33MHz
             capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
             configuration: driver=pcieport
             resources: irq:18 memory:f0400000-f04fffff
           *-network
                description: Wireless interface
                product: Wireless 7260
                vendor: Intel Corporation
                physical id: 0
                bus info: pci@0000:03:00.0
                logical name: wlp3s0
                version: 83
                serial: 7c:7a:91:0d:a1:a1
                width: 64 bits
                clock: 33MHz
                capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
                configuration: broadcast=yes driver=iwlwifi driverversion=4.2.5-1-ARCH firmware=25.30.13.0 ip=192.168.178.69 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
                resources: irq:47 memory:f0400000-f0401fff
        *-usb:1
             description: USB controller
             product: 8 Series USB EHCI #1
             vendor: Intel Corporation
             physical id: 1d
             bus info: pci@0000:00:1d.0
             version: 04
             width: 32 bits
             clock: 33MHz
             capabilities: pm debug ehci bus_master cap_list
             configuration: driver=ehci-pci latency=0
             resources: irq:23 memory:f063d000-f063d3ff
           *-usbhost
                product: EHCI Host Controller
                vendor: Linux 4.2.5-1-ARCH ehci_hcd
                physical id: 1
                bus info: usb@1
                logical name: usb1
                version: 4.02
                capabilities: usb-2.00
                configuration: driver=hub slots=3 speed=480Mbit/s
              *-usb
                   description: USB hub
                   vendor: Intel Corp.
                   physical id: 1
                   bus info: usb@1:1
                   version: 0.04
                   capabilities: usb-2.00
                   configuration: driver=hub slots=8 speed=480Mbit/s
                 *-usb UNCLAIMED
                      description: Smart card reader
                      product: EMV Smartcard Reader
                      vendor: Generic
                      physical id: 5
                      bus info: usb@1:1.5
                      version: 1.20
                      capabilities: usb-2.01
                      configuration: maxpower=50mA speed=12Mbit/s
        *-isa
             description: ISA bridge
             product: 8 Series LPC Controller
             vendor: Intel Corporation
             physical id: 1f
             bus info: pci@0000:00:1f.0
             version: 04
             width: 32 bits
             clock: 33MHz
             capabilities: isa bus_master cap_list
             configuration: driver=lpc_ich latency=0
             resources: irq:0
        *-storage
             description: SATA controller
             product: 8 Series SATA Controller 1 [AHCI mode]
             vendor: Intel Corporation
             physical id: 1f.2
             bus info: pci@0000:00:1f.2
             version: 04
             width: 32 bits
             clock: 66MHz
             capabilities: storage msi pm ahci_1.0 bus_master cap_list
             configuration: driver=ahci latency=0
             resources: irq:44 ioport:30a8(size=8) ioport:30bc(size=4) ioport:30a0(size=8) ioport:30b8(size=4) ioport:3060(size=32) memory:f063c000-f063c7ff
        *-serial
             description: SMBus
             product: 8 Series SMBus Controller
             vendor: Intel Corporation
             physical id: 1f.3
             bus info: pci@0000:00:1f.3
             version: 04
             width: 64 bits
             clock: 33MHz
             configuration: driver=i801_smbus latency=0
             resources: irq:18 memory:f0638000-f06380ff ioport:efa0(size=32)
  *-battery:0
       product: 45N1111
       vendor: SONY
       physical id: 1
       slot: Front
       capacity: 23200mWh
       configuration: voltage=11.1V
  *-battery:1
       product: 45N1737
       vendor: SANYO
       physical id: 2
       slot: Rear
       capacity: 71280mWh
       configuration: voltage=10.8V
-------------------------------------------------------


~ » lspci                                                                                                 monkee@banana
00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 0b)
00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)
00:16.3 Serial controller: Intel Corporation 8 Series HECI KT (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I218-LM (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 6 (rev e4)
00:1c.1 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4)
00:1d.0 USB controller: Intel Corporation 8 Series USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)
02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 83)
------------------------------------------------------------


@m0nk33
Copy link
Author

m0nk33 commented Apr 19, 2016

@linrunner
Copy link
Owner

TLP can't fix this. It's a kernel issue.

@strelec
Copy link

strelec commented Apr 19, 2016

Does anybody know to what extent this applies to the Core 2 Duo era of laptops?

@saladpanda
Copy link

Matthew Garrett - https://mjg59.dreamwidth.org/42156.html:

First, these probably only have relevance to users of mobile Intel parts in the U or S range (/proc/cpuinfo will tell you - you're looking for a four-digit number that starts with 4 (Haswell), 5 (Broadwell) or 6 (Skylake) and ends with U or S), and won't do anything unless you have SATA drives (including PCI-based SATA).

@ActualizeInMaterial
Copy link

ActualizeInMaterial commented Jun 7, 2016

Note: this workaround is not required on Lenovo T400 (Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz)

Tested via powertop (put everything from Bad into Good mode, while on AC not battery - does it matter? also did re-run tlp start with SATA_LINKPWR_ON_AC=min_power prior and even after that) sporting btrfs root(I've nothing else, other than swap) on kernel Linux mighty4 4.5.6-1-MANJARO #1 SMP PREEMPT Thu Jun 2 17:33:22 UTC 2016 x86_64 GNU/Linux
The disk is an 80G SSD INTEL SSDSA2M080G2GC Firmware Revision: 2CV102M3
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 23
model name  : Intel(R) Core(TM)2 Duo CPU     T9400  @ 2.53GHz
stepping    : 6
microcode   : 0x610
cpu MHz     : 800.000
cache size  : 6144 KB
physical id : 0
siblings    : 2
core id     : 1
cpu cores   : 2
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 10
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority dtherm
bugs        :
bogomips    : 5056.78
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

EDIT: my tlp-stat is here: #194 (comment)

@Konfekt
Copy link

Konfekt commented May 1, 2017

The article http://refugeeks.com/use-tlp-to-optimize-the-power-consumption-in-ubuntu/ tells us that Ubuntu disables ALPM by default because it causes data corruption on hard discs. This thread confirms it. Perhaps TLP should keep it safe as well and disable it by default? If not, warn the user.

@linrunner
Copy link
Owner

@Konfekt : are you affected or just asking?

tlp-stat issues a warning message when it detects related SATA errors.

@Konfekt
Copy link

Konfekt commented May 3, 2017

I might have been affected since the BTRFS and to a lesser extent XFS-file systems of my hard disc were being continually corrupted. I was also extensively using hibernation.

Since switching to EXT4 the problem did not reoccur.

@linrunner
Copy link
Owner

Did you check for SATA error warnings with

tlp-stat

or

tlp-stat -w

?

@Konfekt
Copy link

Konfekt commented May 3, 2017

Yes, no errors at all at any point. Then suddenly an error of the form parent transid verify failed at which point a re-installation is the only viable path to restoration.

@snj33v
Copy link

snj33v commented Aug 16, 2017

its been advised to disable ssd optimization too

@marcmerlin
Copy link

Sata ALPM has been safe since 4.15: https://www.spinics.net/lists/linux-btrfs/msg101833.html

@linrunner
Copy link
Owner

Thanks for the info. I get it that this statement comes from the btrfs dev David Sterba

@nibazshab
Copy link

@linrunner hi, i use Arch Linux from btrfs now, i want to install tlp, at now, do i need add SATA_LINKPWR_ON_BAT=max_performance in tlp.conf?

@linrunner
Copy link
Owner

linrunner commented Aug 12, 2022

@nibazshab Why don't you just read the two posts above yours and also look at the corresponding FAQ entry?

@nibazshab
Copy link

@nibazshab Why don't you just read the two posts above yours and also look at the corresponding FAQ entry?

ok, in fact i've already read those and i just worry for my computer, if it bothers you i'm so sorry

@linrunner
Copy link
Owner

linrunner commented Aug 12, 2022

@nibazshab If you've already read the posts, what's your point then? The underlying kernel problem was solved 4.5 years(!) ago according to the BTRFS developer.

I'm not going to give you an assurance for your system, which by the way I don't know. All known facts are publicly mentioned or linked in this issue. You will have to decide for yourself.

Backups of important data are mandatory anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants