Closed john-cabaj closed 1 year ago
First of all: TLP does not have a function that shuts down the system, so I assume it must be something else.
What exactly happens during this "shutdown"?
a. The machine powers off suddenly b. Ubuntu shuts down (with corresponding messages on the console)
Case a. would be a hardware issue.
Case b. could be that Ubuntu does not take the connected charger into account and thinks it has to shut down because of a low charge level. However, this would not be the normal behavior of Ubuntu. On my machines, such a thing has never occurred during recalibration.
At what charge level (percentage) does the phenomenon occur? Does Ubuntu display any messages on the desktop before shutting down?
It was definitely case A. The charge threshold was well below 0% and continued depleting. The mV dropped to around 9000 last I looked at it. Then the machine had a hard shutdown, straight to black screen.
I was using the stock charger with a Thinkpad P14s Gen 2 (AMD). At no point did it come off AC power.
Your BIOS is up to date, therefore I guess the EC firmware is as well. The only remaining possibility is a hardware issue. Good luck.
I'll close here. I would be happy if you report whether the assumption hardware problem is confirmed.
I try not to recalibrate too often. My computer otherwise charges fine, and a “manual” recalibration (full discharge, full charge) yielded a higher “energy_full” value. So all things considered, I was able to recalibrate. I just didn’t expect the computer to shut down halfway through.
With the charger connected, the ThinkPad must not power off under any circumstances during recalibration. My own P14s Gen 2 AMD does not exhibit this behavior.
Could be the kernel. I’m in between 5.15 (no built-in calibration support without additional modules) and 5.19 (built-in calibration support). I’ll give it another shoot soon.
@linrunner I have experienced the same issue in my L14 Gen2. It's tlp-stat is as follows:
--- TLP 1.5.0 --------------------------------------------
+++ Configured Settings:
defaults.conf L0004: TLP_ENABLE="1"
defaults.conf L0005: TLP_WARN_LEVEL="3"
defaults.conf L0006: TLP_PERSISTENT_DEFAULT="0"
defaults.conf L0007: DISK_IDLE_SECS_ON_AC="0"
defaults.conf L0008: DISK_IDLE_SECS_ON_BAT="2"
defaults.conf L0009: MAX_LOST_WORK_SECS_ON_AC="15"
defaults.conf L0010: MAX_LOST_WORK_SECS_ON_BAT="60"
defaults.conf L0011: CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance"
defaults.conf L0012: CPU_ENERGY_PERF_POLICY_ON_BAT="balance_power"
defaults.conf L0013: SCHED_POWERSAVE_ON_AC="0"
defaults.conf L0014: SCHED_POWERSAVE_ON_BAT="1"
defaults.conf L0015: NMI_WATCHDOG="0"
defaults.conf L0016: DISK_DEVICES="nvme0n1 sda"
defaults.conf L0017: DISK_APM_LEVEL_ON_AC="254 254"
defaults.conf L0018: DISK_APM_LEVEL_ON_BAT="128 128"
defaults.conf L0019: DISK_APM_CLASS_DENYLIST="usb ieee1394"
defaults.conf L0020: DISK_IOSCHED="keep keep"
defaults.conf L0021: SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
defaults.conf L0022: SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
defaults.conf L0023: AHCI_RUNTIME_PM_ON_AC="on"
defaults.conf L0024: AHCI_RUNTIME_PM_ON_BAT="auto"
defaults.conf L0025: AHCI_RUNTIME_PM_TIMEOUT="15"
defaults.conf L0026: PCIE_ASPM_ON_AC="default"
defaults.conf L0027: PCIE_ASPM_ON_BAT="default"
defaults.conf L0028: RADEON_DPM_PERF_LEVEL_ON_AC="auto"
defaults.conf L0029: RADEON_DPM_PERF_LEVEL_ON_BAT="auto"
defaults.conf L0030: RADEON_POWER_PROFILE_ON_AC="default"
defaults.conf L0031: RADEON_POWER_PROFILE_ON_BAT="default"
defaults.conf L0032: WIFI_PWR_ON_AC="off"
defaults.conf L0033: WIFI_PWR_ON_BAT="on"
defaults.conf L0034: WOL_DISABLE="Y"
defaults.conf L0035: SOUND_POWER_SAVE_ON_AC="1"
defaults.conf L0036: SOUND_POWER_SAVE_ON_BAT="1"
defaults.conf L0037: SOUND_POWER_SAVE_CONTROLLER="Y"
defaults.conf L0038: BAY_POWEROFF_ON_AC="0"
defaults.conf L0039: BAY_POWEROFF_ON_BAT="0"
defaults.conf L0040: BAY_DEVICE="sr0"
defaults.conf L0041: RUNTIME_PM_ON_AC="on"
defaults.conf L0042: RUNTIME_PM_ON_BAT="auto"
defaults.conf L0043: RUNTIME_PM_DRIVER_DENYLIST="mei_me nouveau radeon"
defaults.conf L0044: USB_AUTOSUSPEND="1"
defaults.conf L0045: USB_EXCLUDE_AUDIO="1"
defaults.conf L0046: USB_EXCLUDE_BTUSB="0"
defaults.conf L0047: USB_EXCLUDE_PHONE="0"
defaults.conf L0048: USB_EXCLUDE_PRINTER="1"
defaults.conf L0049: USB_EXCLUDE_WWAN="0"
defaults.conf L0050: USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN="0"
defaults.conf L0051: RESTORE_DEVICE_STATE_ON_STARTUP="0"
defaults.conf L0052: RESTORE_THRESHOLDS_ON_BAT="0"
defaults.conf L0053: NATACPI_ENABLE="1"
defaults.conf L0054: TPACPI_ENABLE="1"
defaults.conf L0055: TPSMAPI_ENABLE="1"
+++ System Info
System = LENOVO ThinkPad L14 Gen 2 20X1S0Q700
BIOS = R1JET62W (1.62 )
OS Release = Ubuntu 22.04.2 LTS
Kernel = 5.19.0-50-generic #50-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 18:24:29 UTC 2023 x86_64
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-5.19.0-50-generic root=UUID=f0f3bcc6-f2eb-4008-8c5f-2e9087219fc9 ro quiet splash vt.handoff=7
Init system = systemd v249 (249.11-0ubuntu3.9)
Boot mode = UEFI
+++ TLP Status
State = enabled
RDW state = enabled
Last run = 02:03:37 PM IST, 142 sec(s) ago
Mode = AC
Power source = AC
+++ Processor
CPU model = 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
/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_available_governors = performance powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 400000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 4200000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_performance [HWP.EPP]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power
/sys/devices/system/cpu/cpu1..cpu7: omitted for clarity, use -v to show all
/sys/devices/system/cpu/intel_pstate/status = active
/sys/devices/system/cpu/intel_pstate/min_perf_pct = 9 [%]
/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%]
/sys/devices/system/cpu/intel_pstate/no_turbo = 0
/sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost = 0
/sys/devices/system/cpu/intel_pstate/turbo_pct = 47 [%]
/sys/devices/system/cpu/intel_pstate/num_pstates = 39
/sys/module/workqueue/parameters/power_efficient = Y
/proc/sys/kernel/nmi_watchdog = 0
+++ Platform Profile
/sys/firmware/acpi/platform_profile = performance
/sys/firmware/acpi/platform_profile_choices = low-power balanced performance
/sys/devices/platform/thinkpad_acpi/dytc_lapmode = 0
+++ Temperatures
/proc/acpi/ibm/thermal = 47 -128 38 0 39 35 47 -128 [°C]
/proc/acpi/ibm/fan = 2877 [/min]
+++ File System
/proc/sys/vm/laptop_mode = 0
/proc/sys/vm/dirty_writeback_centisecs = 1500
/proc/sys/vm/dirty_expire_centisecs = 1500
/proc/sys/vm/dirty_ratio = 20
/proc/sys/vm/dirty_background_ratio = 10
+++ Disks
Devices = nvme0n1 sda
/dev/nvme0n1:
Type = NVMe
Disk ID = nvme-SAMSUNG_MZVLB256HBHQ-000L7_S4ELNX1R857753
Model = SAMSUNG MZVLB256HBHQ-000L7
Firmware = 5M2QEXH7
Temp = 45 °C
Scheduler = [none] mq-deadline (multi queue)
Runtime PM:
/sys/block/nvme0n1/device/power/control = on, autosuspend_delay_ms = (not available)
/dev/sda: not present.
+++ Intel Graphics
/sys/class/drm/card0/device/driver = i915
/sys/class/drm/card0/power/rc6_enable = 1 (enabled)
/sys/kernel/debug/dri/0/i915_fbc_status = FBC enabled
/sys/module/i915/parameters/enable_psr = -1 (use per-chip default)
/sys/class/drm/card0/gt_min_freq_mhz = 100 [MHz]
/sys/class/drm/card0/gt_max_freq_mhz = 1300 [MHz]
/sys/class/drm/card0/gt_boost_freq_mhz = 1300 [MHz]
/sys/class/drm/card0/gt_RPn_freq_mhz = 100 [MHz] (GPU min)
/sys/class/drm/card0/gt_RP0_freq_mhz = 1300 [MHz] (GPU max)
+++ Wireless
bluetooth = on
nfc = none (no device)
wifi = on
wwan = none (no device)
hci0(btusb) : bluetooth, not connected
wlp9s0(iwlwifi) : wifi, connected, power management = off
+++ Audio
/sys/module/snd_hda_intel/parameters/power_save = 1
/sys/module/snd_hda_intel/parameters/power_save_controller = Y
+++ PCIe Active State Power Management
/sys/module/pcie_aspm/parameters/policy = [default] performance powersave powersupersave (using BIOS preferences)
+++ PCIe Runtime Power Management
Enable devices = (disabled)
Disable devices = (disabled)
Device denylist = (disabled)
Driver denylist = mei_me nouveau radeon
/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:04.0/power/control = on (0x118000, Signal processing controller, proc_thermal)
/sys/bus/pci/devices/0000:00:06.0/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:07.0/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:0d.0/power/control = on (0x0c0330, USB controller, xhci_hcd)
/sys/bus/pci/devices/0000:00:0d.2/power/control = on (0x0c0340, USB controller, thunderbolt)
/sys/bus/pci/devices/0000:00:14.0/power/control = on (0x0c0330, USB controller, xhci_hcd)
/sys/bus/pci/devices/0000:00:14.2/power/control = on (0x050000, RAM memory, no driver)
/sys/bus/pci/devices/0000:00:15.0/power/control = on (0x0c8000, Serial bus controller, intel-lpss)
/sys/bus/pci/devices/0000:00:15.1/power/control = on (0x0c8000, Serial bus controller, intel-lpss)
/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me)
/sys/bus/pci/devices/0000:00:1d.0/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1d.1/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1d.3/power/control = on (0x060400, PCI bridge, pcieport)
/sys/bus/pci/devices/0000:00:1f.0/power/control = on (0x060100, ISA bridge, no driver)
/sys/bus/pci/devices/0000:00:1f.3/power/control = on (0x040100, Multimedia audio controller, sof-audio-pci-intel-tgl)
/sys/bus/pci/devices/0000:00:1f.4/power/control = on (0x0c0500, SMBus, i801_smbus)
/sys/bus/pci/devices/0000:00:1f.5/power/control = on (0x0c8000, Serial bus controller, intel-spi)
/sys/bus/pci/devices/0000:00:1f.6/power/control = on (0x020000, Ethernet controller, e1000e)
/sys/bus/pci/devices/0000:04:00.0/power/control = on (0x010802, Non-Volatile memory controller, nvme)
/sys/bus/pci/devices/0000:09:00.0/power/control = on (0x028000, Network controller, iwlwifi)
/sys/bus/pci/devices/0000:0a:00.0/power/control = on (0x080501, SD Host controller, sdhci-pci)
+++ USB
Autosuspend = enabled
Device allowlist = (not configured)
Device denylist = (not configured)
Exclude audio = enabled
Exclude bluetooth = disabled
Exclude phones = disabled
Exclude printers = enabled
Exclude WWAN = disabled
Bus 004 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub)
Bus 003 Device 005 ID 046d:c31c control = on, autosuspend_delay_ms = 2000 -- Logitech, Inc. Keyboard K120 (usbhid)
Bus 003 Device 004 ID 30c9:0014 control = auto, autosuspend_delay_ms = 2000 -- Luxvisions Innotech Limited Integrated Camera (uvcvideo)
Bus 003 Device 003 ID 06cb:00bd control = auto, autosuspend_delay_ms = 2000 -- Synaptics, Inc. Prometheus MIS Touch Fingerprint Reader (no driver)
Bus 003 Device 006 ID 8087:0029 control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. AX200 Bluetooth (btusb)
Bus 003 Device 002 ID 093a:2510 control = on, autosuspend_delay_ms = 2000 -- Pixart Imaging, Inc. Optical Mouse (usbhid)
Bus 003 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub)
Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub)
Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub)
+++ Battery Care
Plugin: thinkpad
Supported features: charge thresholds, recalibration
Driver usage:
* natacpi (thinkpad_acpi) = active (charge thresholds, recalibration)
Parameter value ranges:
* START_CHARGE_THRESH_BAT0/1: 0(off)..96(default)..99
* STOP_CHARGE_THRESH_BAT0/1: 1..100(default)
+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer = LGC
/sys/class/power_supply/BAT0/model_name = 5B10W13894
/sys/class/power_supply/BAT0/cycle_count = 338
/sys/class/power_supply/BAT0/energy_full_design = 45000 [mWh]
/sys/class/power_supply/BAT0/energy_full = 6990 [mWh]
/sys/class/power_supply/BAT0/energy_now = 6980 [mWh]
/sys/class/power_supply/BAT0/power_now = 35864 [mW]
/sys/class/power_supply/BAT0/status = Charging
/sys/class/power_supply/BAT0/charge_control_start_threshold = 96 [%]
/sys/class/power_supply/BAT0/charge_control_end_threshold = 100 [%]
/sys/class/power_supply/BAT0/charge_behaviour = [auto] inhibit-charge force-discharge
Charge = 99.9 [%]
Capacity = 15.5 [%]
+++ Recommendations
* Install smartmontools for disk drive health info
I never had to recalibrate my battery and because I almost always keep my laptop plugged in I had set START as 40 and STOP at 50 sacrificing runtime for battery health.
Usually, with 50% if I had to disconnect the charger(lets say for a meeting or a break) it would still run on battery for ~45 mins to an hour.
But recently( in past week) I noticed that it didn't even give me 15 mins of backup on battery at 50%.
So I thought why not simply fullcharge
the system once? So I did that, I ran sudo tlp fullcharge BAT0
and it charged the system to 100% and then I disconnected it from AC power, then too it gave me ~20-25 mins which is unusually low.
I tried the sudo tlp fullcharge BAT0
again but this time I actually forgot that I had put it on fullcharge and did NOT disconnect the charger. At the end of my workday some 3-4 hours later I disconnected the charger and lo and behold, it gives me full ~4 hours on battery doing the same things I did in previous runs(mostly wrote code, some internet browsing). Which led me to believe that the actual battery is alright but there is some issue in percentages.
Tried to recalibrate, faced the same issue as @john-cabaj of laptop hard shutting down when it nears to almost depleted during the forced discharge while the ac charger was still plugged in.
Currently tlp-stat shows energy_full = 6990 but I know for a fact that that aint the case because if I remove the thresholds and charge it tlp-stat stops reporting the increase in energy after energy_now
reaches 6980(99.9% of energy_full) but if I remove the charger right then it doesn't decrease at all for a few minutes and then starts decreasing, telling me that the battery IS CHARGING to above 6990 mWh but it's not being reported to the OS for some reason.
I HAD INSTALLED acpi-call-dkms on my first time install because at that time I was on kernel <5.15, could it be causing issues with the newer kernels? Will uninstalling that help? Is it even safe to uninstall in the first place?
I will try @john-cabaj method of manually "calibrating" the battery but is there a way to reset the battery controller firmware so that it can reset the energy_full count? I tried uninstalling TLP but that didn't even revert the thresholds so I am assuming it's not that easy
To reset the EC (embedded controller), shutdown the machine, then actuate the emergency reset hole at the bottom with a paper clip.
That's the only advice I can give you. Yours is a hardware issue which is offtopic here. Better ask at Lenovo forums.
[x] I've read and accepted the Bug Reporting Howto [x] I've provided all required
tlp-stat
outputs via Gist (see below)Describe the bug
Computer shuts down after
tlp recalibrate BATx
rather than starting to chargeExpected behavior
My understanding of
tlp recalibrate
is that it fully discharges, then switches to charging to 100% once complete.To Reproduce
Steps to reproduce the unexpected behavior:
tlp recalibrate
tlp recalibrate
on Ubuntu 22.04.2, with 5.19 kerneltlp recalibrate BAT0
tlp-stat
via https://gist.github.com/ for all matching cases of 1 (not as file attachment, no screenshots)Additional context
N/A