Make MX Linux charge your phone

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
seasoned_geek
Posts: 23
Joined: Wed Jul 30, 2025 11:53 am

Make MX Linux charge your phone

#1 Post by seasoned_geek »

I was shocked when, after installing MX Linux on my HP Z2G4 desktop that my phone would no longer charge from any USB port. Tried different cable, nothing worked. Plugged into a different machine and all was well. There are two things you need to do, though the first should have worked by itself.

Code: Select all

sudo nano /etc/default/grub
add usbcore.autosuspend=-1 to the end of this line, inside the quotes.

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1"
Rumor has it the parameter name will change in future releases, but that is the name for now.

Code: Select all

sudo update-grub
Next identify your phone.

Code: Select all

sudo lsusb

Code: Select all

Bus 002 Device 002: ID 1058:259f Western Digital Technologies, Inc. My Passport Ultra (WD10JMVW)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 18d1:4ee1 Google Inc. Nexus/Pixel Device (MTP)
Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 007: ID 1267:0103 Logic3 / SpectraVideo plc G-720 Keyboard
Bus 001 Device 006: ID 046d:c077 Logitech, Inc. Mouse
Bus 001 Device 005: ID 10d5:1234 Uni Class Technology Co., Ltd 
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
One can only hope they will one day add a rule of some kind where MTP devices always get power.

Code: Select all

sudo nano /etc/udev/rules.d/91-usb-power.rules
paste in the following line using your own vediro and product ids. In case it isn't obvious it is vendor:id in the list above.

Code: Select all

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee1", ATTR{power/control}="auto"
save and exit.

Code: Select all

sudo udevadm control --reload-rules
just for good measure, reboot. Your phone should now charge.

User avatar
wdscharff
Posts: 1130
Joined: Mon Feb 24, 2020 1:07 am

Re: Make MX Linux charge your phone

#2 Post by wdscharff »

I often connect my smartphones and tablets to one of the USB ports, both for charging and for data transfer.
The last time (smartphone) was yesterday.
Never had a problem, although I only use the USB2 ports (the others are all in use).
my working horse Desktop AMD Ryzen 9 3900x, 32GB Ram // SSD ... enough
mx-fluxbox, what else?

In nature there are neither rewards nor punishments.
There are consequences.


my wallpaper gallery

User avatar
Eadwine Rose
Administrator
Posts: 15069
Joined: Wed Jul 12, 2006 2:10 am

Re: Make MX Linux charge your phone

#3 Post by Eadwine Rose »

I have had my phone on my usb port of this system and it charging and doing the data thing just fine, nothing special was needed to make it do that. Other than plug a cable in between the two.
MX-23.6_x64 July 31 2023 * 6.1.0-38amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
chrispop99
Global Moderator
Posts: 3387
Joined: Tue Jan 27, 2009 2:07 pm

Re: Make MX Linux charge your phone

#4 Post by chrispop99 »

I can only imagine the OP wanted to use a USB port for charging that stays alive when the computer is in standby.

The machines I have with that capability work as expected, but not all do on Linux.

Chris
MX Facebook Group Administrator.
Home-built desktop - Core i5 9400, 970 EVO Plus, 8GB
DELL XPS 15
Lots of test machines

User avatar
Michael-IDA
Posts: 371
Joined: Sat Jan 12, 2019 8:00 pm

Re: Make MX Linux charge your phone

#5 Post by Michael-IDA »

seasoned_geek wrote: Tue Aug 05, 2025 11:16 am I was shocked when, after installing MX Linux on my HP Z2G4 desktop that my phone would no longer charge from any USB port.
The kernel is trying to save you money :p

Seriously though, saving a few watts and creating a pita situation for the end user....

@seasoned_geek thanks for this, it helped me 'fix' a USB hub that kept dropping connections to plugged in components.

Thanks again,
Michael

If anyone cares (and I found the right doc?):
https://www.kernel.org/doc/html/v4.16/d ... ement.html
NIH Cancer Study: The group supplemented with both vitamins and fenbendazole exhibited significant (P = 0.009) inhibition of tumor growth.
The day Microsoft makes a product that doesn't suck...
... is the day they make a vacuum cleaner.

seasoned_geek
Posts: 23
Joined: Wed Jul 30, 2025 11:53 am

Re: Make MX Linux charge your phone

#6 Post by seasoned_geek »

chrispop99 wrote: Tue Aug 05, 2025 11:59 am I can only imagine the OP wanted to use a USB port for charging that stays alive when the computer is in standby.

The machines I have with that capability work as expected, but not all do on Linux.

Chris
No. This is in a desktop where I turn off (as best I can) power management because I run BOINC for my idle time, helping to cure cancer, HIV, and many other projects. Fresh MXLinux install would not charge the phone from either USB-2 or USB-3 ports. Front or rear did not matter. Made these tweaks, and now my phone charges. It has been a fairly recent change to the Linux kernel from what I find. The bug does not exist in Debian 12, but it does in MX Linux.

seasoned_geek
Posts: 23
Joined: Wed Jul 30, 2025 11:53 am

Re: Make MX Linux charge your phone

#7 Post by seasoned_geek »

Eadwine Rose wrote: Tue Aug 05, 2025 11:52 am I have had my phone on my usb port of this system and it charging and doing the data thing just fine, nothing special was needed to make it do that. Other than plug a cable in between the two.
Just to round this out, most/many/possibly-all newer motherboards have a BIOS setting under either Advanced or Power (not all have a top level Power menu) worded something like OS Power management. If that is turned off, or your motherboard is so old it does not provide OS power management capabilities, then you can never be burned by this bug.

Some, most likely well-meaning, individual hacked this change into the kernel because all they had was a laptop and who wouldn't want another 5 minutes of battery life on their laptop? What they didn't hack in was

if ! plugged-into-wall

in front of the USB power management stuff.

Once again, a change for laptop users trashed desktops.

I'm just waiting for the "only touchscreen input supported" kernel mod to well and truly hose us all just to make tablet users happy.

User avatar
dreamer
Posts: 945
Joined: Sun Oct 15, 2017 11:34 am

Re: Make MX Linux charge your phone

#8 Post by dreamer »

seasoned_geek wrote: Tue Aug 05, 2025 12:48 pm
Fresh MXLinux install would not charge the phone from either USB-2 or USB-3 ports. Front or rear did not matter. Made these tweaks, and now my phone charges. It has been a fairly recent change to the Linux kernel from what I find. The bug does not exist in Debian 12, but it does in MX Linux.
I appreciate your general Linux knowledge. I don't know how long you have used MX Linux, but I have used it long enough to know some of its pitfalls (which are few compared to vanilla Debian). The bug you describe is called TLP. It is installed by default in MX-23, but not in Debian 12. TLP is what enables usb_autosuspend by default. If you have a desktop you can uninstall the tlp package and reboot. If you want to explore all the functionality that tlp provides you can install tlpui which is a GUI for tlp. I usually install tlpui, disable usb_autosuspend and then I'm done.

seasoned_geek
Posts: 23
Joined: Wed Jul 30, 2025 11:53 am

Re: Make MX Linux charge your phone

#9 Post by seasoned_geek »

dreamer wrote: Tue Aug 05, 2025 4:44 pm
seasoned_geek wrote: Tue Aug 05, 2025 12:48 pm
Fresh MXLinux install would not charge the phone from either USB-2 or USB-3 ports. Front or rear did not matter. Made these tweaks, and now my phone charges. It has been a fairly recent change to the Linux kernel from what I find. The bug does not exist in Debian 12, but it does in MX Linux.
I appreciate your general Linux knowledge. I don't know how long you have used MX Linux, but I have used it long enough to know some of its pitfalls (which are few compared to vanilla Debian). The bug you describe is called TLP. It is installed by default in MX-23, but not in Debian 12. TLP is what enables usb_autosuspend by default. If you have a desktop you can uninstall the tlp package and reboot. If you want to explore all the functionality that tlp provides you can install tlpui which is a GUI for tlp. I usually install tlpui, disable usb_autosuspend and then I'm done.
Thanks for the info.

40 years in IT. First two decades on real computers with real operating systems (RSTS/E, RSX-11, RT-11, VMS, MVS, OS/400) designed to handle hundreds of users at once while running massive batch jobs. Slowly transitioned to the little ones with OS/2 and SuSE when it came with printed books and floppies. Spent the past decade creating embedded systems and doing yocto builds. I've used a lot of different Linux distros. Even do Debian and RPM packaging for my OpenSource projects.

Only first few days with MX Linux because Ubuntu's nag-o-grams about updating to Ubuntu-Pro finally honked me off enough to look for something else where I could, at least semi-easily cross compile for ARM iMX8Plus (and other) targets without having to work inside a docker container.

Most of my posts on here this past week or so has been trying to get back to good. I'm almost there.

Post Reply

Return to “Tips & Tricks by users (not for help)”