Repository navigation
Conversation
derekross
left a comment
There was a problem hiding this comment.
Thank you, Lef. This is the piece I asked for on linux-omarchy-mobile#267, and keeping the blacklist is right: I checked that husky's published device tree binds the MAX77759 core at boot, that the charger is a module, and that nothing else in the package loads it, so the two lines and the blocker do nothing until someone runs modprobe by hand. The rule matches the driver's power-supply name, and your test bites: I changed the lock to --mode=delay, made the inner loop never let go, and took ACTION=="add" off the rule, and each one failed a named check.
The blocker is one of the three answers to the question I still owe you on #266 (awake on the cable, wake for it, or say the limit holds only while awake). I lean towards taking it as husky's answer for now, and I'll confirm when I answer on #266: it's the cautious one for a phone whose guard can't see temperature yet, and it runs nowhere until the blacklist goes. For the record, the 7 Pro and the Pixel 7 sleep on the cable under the same guard, with the chip's own JEITA as the backstop (CHG_CNFG_08 bit 2). Do you know what that bit reads on husky as the bootloader leaves it?
Three things before it goes in:
- A failed read lets go of the lock. Both loops test
= 1, so whencatfails the inner loop ends and the phone may sleep with the chip charging. I tried it with a stand-in: the lock was released within a second of the first failed read.onlineis two register reads in the driver, so an I2C error does this. Please let go only on a0(or when the file is gone), keep holding on an empty or failed read, and add that case to the test. - The comment in
omamobile-charger.confdescribes the 7 Pro's guard. On husky with a published kernel, a charger loaded by hand gets the gs201 phones' table (until linux-omarchy-mobile#265), a temperature that reads 22.0 C whatever the cell does (until the gauge fix), and the node's 4.20 V, where you measured the charge ending near 82 %. Whoever writes the runbook will read this file first, so please say those three things there and in the README row, with what lifts each. - A run from the package. First remove your own
/etc/modprobe.d/omamobile-max77759.conf(it replaces the package's file of the same name and drops the charger's blacklist) and your own blocker unit, and readconstant_charge_voltage_maxbefore the cable goes in, as you do now.- After a boot:
pacman -Q omamobile-device-husky,modprobe -c | grep max77759_charger,lsmod | grep max77759,systemctl is-active omamobile-plugged-inhibit, andtools/phone-smoke. - Then with you at the phone, on the 4.20 V float:
modprobe max77759_charger, the probe lines,systemctl status omamobile-plugged-inhibit,systemd-inhibit --list, unplug, replug, and asystemctl suspendon the cable that gets refused.
- After a boot:
Smaller: the new unit needs its # SPDX-License-Identifier: MIT line like husky's other units; the test's 3 s waits over a 1 s poll are thin for a loaded builder (10 s costs nothing when it passes), and the script and rule aren't husky-specific, so if this becomes the answer for every MAX77759 phone I'll move them somewhere shared.
On the number: #860 and #880 bump this package too, so I'll set the version when I merge. And I saw your question on #761 about 4.20 V against the bootloader's 4.35 V; I'll answer it there with the limits.
|
@derekross thanks, all three fixed in 2e05a3e.
Also added the SPDX line to the unit and the test waits 10 s now. On |
|
Confirming what I said I leaned towards: keeping the phone awake on the cable is the 8 Pro's answer for now. The three changes above still stand before it merges. |
…cable, inert Ships the charger's two option lines from the Pixel 7 Pro and the Pixel 7 (omarchy-mobile#827): default_ilim_ua=500000 temp_guard=1, with the gauge loaded first. The charger stays blacklisted in omamobile-max77759.conf, so on the published kernel the lines only apply to a modprobe by hand. Also a sleep blocker for the cable: a block inhibitor while max77759-charger is online, since the temperature guard is delayed work that s2idle stops. udev starts it when the charger's power supply appears; it is not enabled at boot, so with the charger blacklisted it never runs. Tested: package test/all, including the blocker against a fake sysfs file and a stub systemd-inhibit; the test fails without the charger or tcpci_maxim blacklist, without temp_guard, without the softdep, or with a second options line. Not tested: anything on a phone. The version is a placeholder for the maintainer to set.
… the charger's husky limits The lock goes only on a 0 or when the online file is gone; an empty or failed read keeps holding, and test/all checks both. The charger's modprobe file and the README say what a load by hand gets on husky today (the gs201 table, a 22.0 C temperature, the node's 4.20 V) and what lifts each. SPDX line on the new unit, and 10 s waits in the test.
2e05a3e to
8fd7a05
Compare
This is the husky package piece @derekross asked for on linux-omarchy-mobile#267, before any float work. It follows #827 for the Pixel 7, with one difference below.
It adds
omamobile-charger.confwith the same two lines as the Pixel 7:options max77759_charger default_ilim_ua=500000 temp_guard=1andsoftdep max77759_charger pre: max17042_battery. Unlike #827 I keptblacklist max77759_chargerinomamobile-max77759.conf, because on husky the kernel already has the pmic@66 node (linux-omarchy-mobile#163, merged), so dropping the blacklist would load the charger at boot. With the blacklist in place the options only apply when a runbook loads it by hand. The other three blacklists stay as they are.For sleep on the cable there's a small blocker,
omamobile-plugged-inhibit: it holds a logind sleep block whilemax77759-chargeris online, since the guard is delayed work and s2idle stops it while the chip keeps charging. It isn't enabled at boot, a udev rule starts it when the charger's power supply shows up, so with the charger blacklisted it never runs. It exits when the charger goes away. It doesn't cover plugging in while the phone is already asleep, and it polls once a second. This is the "keep the phone awake on the cable" option from @derekross's point 4 on linux-omarchy-mobile#266. He hasn't picked one yet, so it's easy to swap for another or drop from this PR.I left out
charge_defender=1(that comes from the kernel PRs still in review) and aninstall tcpci_maxim /bin/falseline I have on my phone, since #827 has neither. Happy to add them later.The version is 0.1.18 because #860 and #880 hold 0.1.16 and 0.1.17, so the number is yours to set, @derekross.
Tested:
packages/omamobile-device-husky/test/allandtools/pr-check origin/mainpass. The test runs the blocker against a fake sysfs file with a stub systemd-inhibit, and I checked it fails when I remove the charger or tcpci_maxim blacklist, drop temp_guard, drop the softdep, or add a second options line.Not tested: anything on the phone with this package build. The same blocker logic ran on my 8 Pro as a local unit (held the lock on plug, let go on unplug), but that version was enabled at boot, not started by udev.