- cross-posted to:
- [email protected]
- [email protected]
45
- cross-posted to:
- [email protected]
- [email protected]
Hector Martin (@[email protected])
social.treehouse.systemsSo there's a bunch of noise going around a sneaky forced Google Pixel 4a update that seems to cripple batteries... and this is quite interesting.
Old kernel:
```
Linux version 4.14.302-g6ff6ddc33f7d-ab10092322 (android-build@abfarm-2004-4012) (Android (7284624, based on r416183b) clang version 12.0.5 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee), LLD 12.0.5 (/buildbot/src/android/llvm-toolchain/out/llvm-project/lld c935d99d7cf2016289302412d708641d52d2f7ee)) #1 SMP PREEMPT Tue May 9 09:35:06 UTC 2023
```
New kernel:
```
Linux version 4.14.302-g92e0d94b6cba ([email protected]) (Android (7284624, based on r416183b) clang version 12.0.5 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee), LLD 12.0.5 (/buildbot/src/android/llvm-toolchain/out/llvm-project/lld c935d99d7cf2016289302412d708641d52d2f7ee)) #1 repo:t-dev-msm-pixel-4.14-tm-qpr3 SMP PREEMPT Tue Nov 12 11:1
```
Compare these paths:
```
/buildbot/src/partner-android/t-dev-msm-pixel-4.14-tm-qpr3/private/msm-google/arch/arm64/kernel/entry.S
/usr/local/google/home/hsiufangho/android-msm-pixel-4.14-tm-qpr3/private/msm-google/arch/arm64/kernel/entry.S
```
So... this was built by a random engineer on their personal machine, not the proper buildsystem. In fact, the [commit](https://android.googlesource.com/device/google/sunfish-kernel/+/f0e5311ad616d4c3c7a7d4580d330bb33a958cd4) of the binary kernel includes only the top-level artifacts, not any of the debug builds (kasan etc) or metadata.
Of course, there's no source, so this is a GPL violation, but we knew that already.
But it's even sadder than that. There's lots of strings changes in the kernel that look like they updated some vendor subtrees, but there's more.
Modules in the old kernel mention ".lto" depends, while in the new one they don't. And the new kernel has more strings which were omitted from the old kernel. Did they compile the old kernel with LTO and the new one without?
There's also a ton of lock names like these that got added:
```
+&c->mutex
+&c_conn->lock
+&c_conn->mode_info_lock
```
As far as I know that's lockdep... but I sure hope they didn't compile the new kernel with lockdep enabled?
This is looking like a real hackjob.
The base device tree is unchanged, but the overlays change, and this is interesting:
```
qcom,4255777_Google_S5_SWD_LSN_3080mAH_PM7150 {
- qcom,max-voltage-uv = <0x43e6d0>;
- qcom,fg-cc-cv-threshold-uv = <0x43bfc0>;
+ qcom,max-voltage-uv = <0x3c45b0>;
+ qcom,fg-cc-cv-threshold-uv = <0x3c45b0>;
qcom,fastchg-current-ma = <0x5dc>;
qcom,batt-id-kohm = <0x0a>;
qcom,battery-beta = <0xd70>;
[...]
+ google,enable-switch-chg-profile;
linux,phandle = <0xc1>;
phandle = <0xc1>;
+
+ google_debug_chg_profile {
+ google,chg-battery-capacity = <0x604>;
+ google,chg-temp-limits = <0x00 0x64 0xc8 0x1a4 0x1cc 0x1e0 0x226>;
+ google,chg-cv-limits = <0x387520 0x39fbc0 0x3c45b0>;
+ google,chg-cc-limits = <0x1e 0x0a 0x00 0x32 0x1e 0x1e 0x64 0x46 0x32 0x50 0x32 0x32 0x32 0x32 0x00 0x1e 0x00 0x00>;
+ google,chg-topoff-limits = <0xfa 0xfa 0xfa 0x1f4 0x1f4 0x1f4>;
+ google,fv-uv-resolution = <0x2710>;
+ google,fv-uv-margin-dpct = <0x3fc>;
+ google,cv-range-accuracy = <0x13880>;
+ google,cv-otv-margin = <0x15f90>;
+ google,cv-debounce-cnt = <0x03>;
+ google,cv-tier-ov-cnt = <0x01>;
+ google,cv-tier-switch-cnt = <0x03>;
+ google,chg-last-tier-vpack-tolerance = <0x1a13>;
+ google,chg-last-tier-dec-current = <0xc350>;
+ google,chg-last-tier-term-current = <0x324b0>;
+ };
```
So they lowered the max charge voltage from 4.44 V to 3.95 V. No duh the battery capacity went down the drain!
https://guide-images.cdn.ifixit.com/igi/f2OM6kEyPrhaWyuj.huge
According to a quick search, 3.87V nominal li-poly batteries have a max voltage of 4.45V or thereabouts, so the original setting was not wrong. But now they're suddenly being *very* conservative.
There are three battery profiles, one for "unknown". Excluding that one, they are:
4197910_Google_S5_SWD_ATL_3080mAH_PM7150
4255777_Google_S5_SWD_LSN_3080mAH_PM7150
Only the "LSN" profile got the downgrade. "SWD" is "Sunwoda" (the manufacturer printed on the label). ATL is probably [this ATL](https://en.wikipedia.org/wiki/ATL_(company)), and LSN is probably [Lishen](https://en.lishen.com.cn/), which are the manufacturers of the actual cells.
And then there's that battery "debug" profile. Battery capacity goes down from 3080mAh to 1539mAh! Half! It says "debug" but I'm pretty sure it's not just "debug", it's the crippled profile.
I don't know what the distribution of Pixel 4a batteries is, but if it's two sources and anywhere near 50/50, it's possible half of the phones in the wild got crippled.
You can tell which battery you have physically by the number next to the QR code. 8230015901 is ATL (good) and 8230020501 is LSN (bad). If you're replacing your battery, make sure it's ATL.
I have been buying second hand Pixels 4a’s for my family. To me, they’re the perfect phones. I put LineageOS with MicroG on them and use them without Google. I logged in my throwaway Google account to check if some of the IMEI qualify for a battery swap, but it gives me an error when I enter any IMEI.
Do you guys have an idea why this might happen? I’d love to get new batteries for free in them and use them another 6 years or so.