You are not logged in.

#1 2022-05-26 21:36:21

overkill22
Member
Registered: 2016-01-16
Posts: 47

CPU frequency scaled after battery replacement [mint]

Hi guys,

I hope to find here a solution or hint to this problem that's making my laptop unusable.

I'm using Linux mint 19.3 cinnamon, kernel 5.4.0-91.
Everything was working great, then I replaced the battery since the original one was almost at the end of the life.
With the new one (original spare part), when running on battery, the CPU is put on the minimum @500 MHz, so the computer does not work and it is really slow.
This is the same behaviour that I had with the old battery, but only when the charge was under 10%.

I did the tests with battery fully charged, I also tried to completely empty the new battery and charge again in order to "reset" something, but nothing changed.


laptop on battery 
~$ cpufreq-info | grep "current CPU frequency"
  current CPU frequency is 599 MHz.
  current CPU frequency is 562 MHz.
  current CPU frequency is 591 MHz.
  current CPU frequency is 740 MHz.
  
laptop on AC
~$ cpufreq-info | grep "current CPU frequency"
  current CPU frequency is 1.26 GHz.
  current CPU frequency is 1.38 GHz.
  current CPU frequency is 1.20 GHz.
  current CPU frequency is 1.20 GHz.
inxi -CSM && cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
System:
  Host: ASA Kernel: 5.4.0-91-generic x86_64 bits: 64 
  Desktop: Cinnamon 4.4.8 Distro: Linux Mint 19.3 Tricia 
Machine:
  Type: Laptop System: ASUSTeK product: UX305FA v: 1.0 
  serial: <root required> 
  Mobo: ASUSTeK model: UX305FA v: 1.0 serial: <root required> 
  UEFI: American Megatrends v: UX305FA.213 date: 10/12/2015 
CPU:
  Topology: Dual Core model: Intel Core M-5Y71 bits: 64 type: MT MCP 
  L2 cache: 4096 KiB 
  Speed: 1731 MHz min/max: 500/2900 MHz Core speeds (MHz):

I tried to change the governor from powersave to performance (these are the only two available), but this does not change that when I unplug the cable, the CPU get reduced.

Any advice how to stop the CPU to go to 500 MHz when on battery (fully charged)?

Offline

#2 2022-05-26 23:20:18

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 978

Re: CPU frequency scaled after battery replacement [mint]

Does your machine have a bios/firmware callibrate battery function?  If so it may need running for the machine to correctly determine the state of charge at a hardware level, some are pretty stupid unless that's done.  Sadly it generally takes ages & involves running the battery down & recharging it (usually automated).

There may be some other things that could be done.. I'd have to research, but battery callibration (if available) is step 1.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#3 2022-05-27 14:56:23

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: CPU frequency scaled after battery replacement [mint]

No, I didn't find this option in the bios.
I've let the battery completely drain 2x from the bios page in order to do this calibration.
the system seems to recognise the battery with the correct capacity and percentage remaining.
I think it could be more related to the governor that for some reason decide to lower the CPU power.
i don't remember if I had the same problem back then when I purchased the computer, but if so, I don't know what could have triggered this behaviour again.
I tried also installing TLP but the system doesn't take the settings from TLP.

Offline

#4 2022-05-28 01:42:07

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 978

Re: CPU frequency scaled after battery replacement [mint]

I'd be looking at which parts of the very useful & seemingly fairly comprehensive information here https://wiki.archlinux.org/title/CPU_frequency_scaling might either solve it or lead me to a solution..

I'm afraid right this minute I've had slightly more to drink than I should, & thus can't really pick the applicable bones out of it for you, however if you're sober & literate.. it looks like a decent & appropriate resource.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#5 2022-05-31 08:58:34

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: CPU frequency scaled after battery replacement [mint]

Thank you for the link.
I've read it I think I already tried some solutions as setting the min_freq but doesn't seems to be working.
Also I'm not really good at understanding what to do in this situation.
I tried also to change the governor from powersave to persformance, but it doesn't change the fact that on battery the CPU is set to 500 MHz instead of the min of 1.2 GHz (max is 2.9 GHz).

So I'm stuck here as I kinda know what is the issue but I have no clue how to solve it, since the only solutions I tried didn't work.

Maybe I'm looking at the wrong thing, instead of CPU stuff I should be looking at battery related controls... I don't know...
the fact is that on battery the computer is absolutely unusable sad

Offline

#6 2022-05-31 09:35:59

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: CPU frequency scaled after battery replacement [mint]

I was able to set the min_freq with

cpupower frequency-set -d clock_freq

, I can see the setting is reflected in

/sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq

however, with

cpufreq-info | grep "current CPU frequency"

I see the CPU is aroun 700 Mhz when no tasks are performed, and when I try to do something (ie. open browser, watch video on youtube), the CPU goes to 500 Mhz (instead if it is connected to AC, the CPU will be at 1.2 GHz and when performing task will go around 2.4 GHz)

changing governor from powersave to performance doesn't do anything.

Offline

#7 2022-06-12 13:26:26

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: CPU frequency scaled after battery replacement [mint]

misko_2083 wrote:

And the output of

cat /sys/class/power_supply/BAT0/uevent

Maybe some info from the battery manager is wrong.

Thanks

$ cat /sys/class/power_supply/BAT0/uevent

POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=6
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11550000
POWER_SUPPLY_VOLTAGE_NOW=11550000
POWER_SUPPLY_POWER_NOW=5659000
POWER_SUPPLY_ENERGY_FULL_DESIGN=45045000
POWER_SUPPLY_ENERGY_FULL=49884000
POWER_SUPPLY_ENERGY_NOW=45010000
POWER_SUPPLY_CAPACITY=90
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=ASUS Battery
POWER_SUPPLY_MANUFACTURER=ASUSTeK
POWER_SUPPLY_SERIAL_NUMBER= 

Offline

#8 2022-06-12 13:41:14

sleekmason
zoom
Registered: 2018-05-22
Posts: 873
Website

Re: CPU frequency scaled after battery replacement [mint]

A couple of things to try if you haven't already . . 

Install a newer kernel and see if it fixes your problem, . . also, does this still happen in a live environment? Maybe try a different distro "live" to see if you still have the issue.

Neither of these should matter, but should also be ruled out.  Disregard if you already tried and I missed it above:)

Offline

#9 2022-06-15 15:13:58

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: CPU frequency scaled after battery replacement [mint]

sleekmason wrote:

A couple of things to try if you haven't already . . 

Install a newer kernel and see if it fixes your problem, . . also, does this still happen in a live environment? Maybe try a different distro "live" to see if you still have the issue.

Neither of these should matter, but should also be ruled out.  Disregard if you already tried and I missed it above:)

thanks for the advice.
New kernel didn't work.

Also I tried on a live environment and I have the same issue.

It is really frustrating as the computer is unusable on battery now... there must be something that trigger some power saving stuff that goes beyond the software setting.
I don't know what else to check but I'm sure there's a solution somewhere. If not why before changing the battery it was working?

Offline

#10 2022-06-17 12:48:08

overkill22
Member
Registered: 2016-01-16
Posts: 47

Re: CPU frequency scaled after battery replacement [mint]

I've mounted back the old battery, and with the old battery the problem does not arise.


cat /sys/class/power_supply/BAT0/uevent
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=752
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11400000
POWER_SUPPLY_VOLTAGE_NOW=11400000
POWER_SUPPLY_POWER_NOW=8755000
POWER_SUPPLY_ENERGY_FULL_DESIGN=45030000
POWER_SUPPLY_ENERGY_FULL=30141000
POWER_SUPPLY_ENERGY_NOW=20189000
POWER_SUPPLY_CAPACITY=66
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=ASUS Battery
POWER_SUPPLY_MANUFACTURER=ASUSTeK
POWER_SUPPLY_SERIAL_NUMBER= 

at this point I have zero idea what could be the issue.

Offline

Board footer

Powered by FluxBB