Repository navigation
Conversation
|
@gitColinX thanks for opening it. I built this exact head (4a2d34d, on omamobile d49d68c) with the usual husky config and ran it on my 8 Pro last night, release Cable in: Cable out: poweroff at 23:38, ping and ssh to it every 20 s for 16 min, 42 tries and no answer. I also left it off overnight on the same build, cable out: shut down at 00:02, next boot this morning at 07:19 when I pressed power, nothing in between. So the same result as my local copy of the change on #578. I didn't run the tip without the commit as a control on this build, the before case is the one from #578. |
|
@Somnius, thank you for building the exact head ( My unit is still on |
|
Thank you, Colin, and thank you @Somnius for building the exact head and running it three times, the overnight one included. I checked the change against Google's One thing before I merge. On the S2MPG14 the RTC regmap has a write table, and it doesn't list these two registers.
It doesn't change anything the husky runs exercised, so no new run is needed. A For the Pixel 8a and Pixel 9a owners reading along: this changes power off on your phones as well, and it hasn't run there. When a kernel with it reaches you, please do the first Colin, a run on your own unit isn't needed for this. |
4a2d34d to
488283b
Compare
|
@derekross, done, as two commits on the same base (
One thing I left alone: |
|
Thank you, Colin. The mfd commit is what I asked for: the write range now ends at WTSR, the comment says what rtc-s5m does there, and its message explains why the write got through before. On your question about |
rtc-s5m is about to clear SMPL_EN, WTSR_EN and COLDRST_EN on the S2MPG14 at power off, as it does on the S2MPG12, so that a power off does not restart the phone. The bits are in the RTC block's SMPL (0x02) and WTSR (0x03) registers, and the S2MPG14's write table leaves both out. The write would reach the PMIC anyway: this regmap has no cache, so every register it can read is volatile, and _regmap_update_bits() hands an update of a volatile register straight to the bus's reg_update_bits() without looking at the write table. The fix should not depend on that, and the table and its comment should say what the drivers do. So extend the first write range to WTSR, and say in the comment why. CAP_SEL and OSC_CTRL stay read-only. sec-common.c said of the S2MPG14's cells "no GPIO or protection writes". SMPL and WTSR are those protections, so say what the RTC writes there now. Assisted-by: LLM Signed-off-by: Colin Lundholm <265166644+gitColinX@users.noreply.github.com>
On the Pixel 8 Pro (zuma, S2MPG14), power off restarts the phone, as it did on the Pixel 7 Pro before 2db2bc3 ("rtc: s5m: disarm the S2MPG12's WTSR and SMPL restarts at power off"). The RTC block read on a running Pixel 8 Pro shows the same values the 7 Pro had: 0x02 (SMPL) = 0x0e: SMPL_EN 0 0x03 (WTSR) = 0x0f: WTSR_EN 1, WTSRT 7, COLDRST_EN 0 Google's S2MPG14 RTC driver clears SMPL_EN, WTSR_EN and COLDRST_EN in its shutdown callback before every power off, as its S2MPG12 driver does (rtc-s2mpg14.c, s2m_rtc_shutdown() and s2m_rtc_disable_wtsr_smpl()), and its rtc-s2mpg14.h puts SMPL at 0x2 and WTSR at 0x3 with the same bits, which are S2MPG10's here. So take the S2MPG14 into the same power-off path. Restarts are left as they are. This changes power off on the S2MPG14 boards: husky, akita and tegu. Only husky has been tested with it. Link: derekross/omarchy-mobile#578 Assisted-by: LLM Signed-off-by: Colin Lundholm <265166644+gitColinX@users.noreply.github.com>
488283b to
5161d3b
Compare
|
@derekross, reworded in the mfd commit as you suggested: /*
* The qualified LDOs and the RTC with its alarm; no GPIO. The RTC's only
* protection writes clear SMPL_EN, WTSR_EN and COLDRST_EN at power off.
*/Nothing else changed, and |
On the Pixel 8 Pro,
systemctl poweroffrestarts the phone, and every restart spends a slot B retry (derekross/omarchy-mobile#578). This extends #233's power-off disarm, written for the S2MPG12 (gs201), to the S2MPG14 (zuma, zumapro).Why: the RTC block of a running 8 Pro, read through the RTC regmap in debugfs on two units (mine and @Somnius's, published
omamobileat82f31d3a7), shows the same values the 7 Pro had before #233:With WTSR armed, the PMIC answers the AP's power-off by powering it up again. Google's S2MPG14 driver clears
SMPL_EN,WTSR_ENandCOLDRST_ENbefore every power off (android-gs-shusky-6.1-android16,drivers/rtc/rtc-s2mpg14.c:s2m_rtc_shutdown()ands2m_rtc_disable_wtsr_smpl()), and itsrtc-s2mpg14.hhas SMPL at 0x2 and WTSR at 0x3 with the bits that are S2MPG10's here.The change:
s5m_rtc_shutdown()returns early unless the device is S2MPG12 or S2MPG14, plus the comment. Restarts are left alone. Because the check is by chip, it changes power off on all three S2MPG14 boards: husky, akita and tegu.A first commit (
mfd: sec: s2mpg14) adds SMPL and WTSR to the S2MPG14 RTC regmap's write table and updates its comment, so the write no longer depends on regmap skipping the table. The rtc-s5m code is unchanged from4a2d34d69.Tested on husky (@Somnius's unit, published
82f31d3a7plus this change; his reports on #578):systemctl poweroff: stayed off for about 15 minutes, no answer to ping for 200 s, started only by the power key;systemctl poweroff: stayed off for about 7 minutes, nothing on the screen or the USB bus, started by the power key;systemctl rebootstill restarts. The boot reason readsrebootafter it, andreboot,uvlo,pmic,ifafter a power-key start from off.Not covered:
tools/kernel-pr-check: sign-off, prefix, checkpatch--strictand policy all ok. Built for husky on82f31d3a7(7.3.0-rc6-omamobile-push1-gaea6b8a082bb) and rebased unchanged onto today'somamobile.