Page 1 of 1

Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 11:16 am
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.

Re: Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 11:27 am
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).

Re: Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 11:52 am
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.

Re: Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 11:59 am
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

Re: Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 12:11 pm
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

Re: Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 12:48 pm
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.

Re: Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 2:25 pm
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.

Re: Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 4:44 pm
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.

Re: Make MX Linux charge your phone

Posted: Tue Aug 05, 2025 5:19 pm
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.

Re: Make MX Linux charge your phone

Posted: Tue Aug 19, 2025 2:54 pm
by Mtrying
seasoned_geek wrote: Tue Aug 05, 2025 12:48 pm
.............. because I run BOINC for my idle time, helping to cure cancer, HIV, and many other projects. ............
I personally think you are getting hoaxed by BOINC (and those 'projects') but if you want to...... just personal.

Re: Make MX Linux charge your phone

Posted: Tue Aug 19, 2025 3:04 pm
by seasoned_geek
Mtrying wrote: Tue Aug 19, 2025 2:54 pm
seasoned_geek wrote: Tue Aug 05, 2025 12:48 pm
.............. because I run BOINC for my idle time, helping to cure cancer, HIV, and many other projects. ............
I personally think you are getting hoaxed by BOINC (and those 'projects') but if you want to...... just personal.
Ehh. Papers get published. Some medical device projects actually use the disease research. ClimatePrediction actually tests out models that eventually find their way into your local weather forecast.

I am old enough to remember when a PC that had run for months got turned off for months, it simply wouldn't turn back on again. A lot of clients had that happen as did I. It happens less often now. Lots of machines went to landfills back then because it was too time consuming to track down what was wrong.

Being old I also hope, perhaps falsely, that all the cancer and drug research projects I participate in will one day save my life.

Of course, if I get to life's great check-out counter and hear "Hi! Welcome to Walmart!" I most definitely didn't end up where I wanted to be.

Re: Make MX Linux charge your phone

Posted: Tue Aug 19, 2025 3:21 pm
by Mtrying
You should check out: retractionwatch.com

is that link allowed to put up here? will see.

Re: Make MX Linux charge your phone

Posted: Tue Aug 19, 2025 3:25 pm
by pimandra
dreamer wrote: Tue Aug 05, 2025 4:44 pm 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.
I didn't notice this problem up to now, but in fact my phone connected to USB started charging but stopped to do it immediately.
I installed tlpui and noticed that in the USB section of the menu there is the possibility to exclude several types of devices from the autosuspend feature, including phones.

I just marked the USB_EXCLUDE_PHONE setting and now my phone charges normally, without even the need to disable completely the autosuspend feature.

Thanks for posting this solution!

Re: Make MX Linux charge your phone

Posted: Wed Aug 20, 2025 4:01 am
by Stevo
For those that prefer a GUI for setting kernel boot parameters, there's MX Boot Options.

Re: Make MX Linux charge your phone

Posted: Wed Aug 20, 2025 5:39 am
by MikeR
My solution, because my go-to desktop is inconveniently situated as an under-the-desk-desktop is an USB extension glued to a convenient corner, permanently connected to a PC USB port and a 5V power supply,
This provides constant phone charge even if the PC shuts down, reboots or whatever.
It is also convenient for handy usage of USB devices.
Note: the phone does not appear in the picture as it's being used to take the picture

Just a data point
Mike

Image

Re: Make MX Linux charge your phone

Posted: Wed Aug 20, 2025 5:39 am
by mxrd
Honestly i avoid charging my phone via precious PC-usb-controller.
Prefer a cheap 1$ usb-charger, working well, much cheaper then exchanging the main board cause of
prematurely degraded controllers.

(Phone Communication with MX since years working absolute flawless for me, may depend on phone,
mine a o what was the name something like Motololola or similar, something phone that did NOT
downgrade security by disabeling additional accounts)