From: mtk34418 <dhatrisri.anumula@mediatek.com>
To: <matthias.bgg@gmail.com>, <angelogioacchino.delregno@collabora.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
Shunxi Zhang <ot_shunxi.zhang@mediatek.com>
Subject: [PATCH v3 0/4] rtc: mt6397: Enhance RTC driver with BBPU alarm status handling
Date: Mon, 25 May 2026 17:14:47 +0800 [thread overview]
Message-ID: <20260525091449.1546965-1-dhatrisri.anumula@mediatek.com> (raw)
From: Shunxi Zhang <ot_shunxi.zhang@mediatek.com>
This patch series enhances the MediaTek MT6397 RTC driver to properly
handle BBPU (Battery-Backed Power Unit) alarm status, addressing critical
power management issues where:
1. The RTC BBPU alarm state remains active after an alarm event occurs,
causing the IRQ handler to be triggered repeatedly
2. Systems unexpectedly power on after shutdown because the RTC alarm
state was not cleared during the shutdown sequence
The series adds necessary bit definitions to the RTC header, implements
alarm status reset functionality in the interrupt handler, and adds a
shutdown handler to ensure clean power-down behavior.
Changes in v3:
- Removed standalone cosmetic formatting patch per maintainer feedback
- Removed devicetree property "mediatek,alarm-sta-supported" approach
- Removed alarm_sta_supported flag and conditional checks
- Execute mtk_rtc_reset_bbpu_alarm_status() unconditionally (PMIC-driven)
- Fixed commit messages to use imperative mood throughout
- Validated all patches with checkpatch.pl --strict
- Validated DTS changes with 'make dtbs_check W=1'
- Addressed all review comments from Krzysztof Kozlowski,
AngeloGioacchino Del Regno, and Alexandre Belloni
Changes in v2:
- Initial public submission to LKML
- Added DT property for alarm status support (approach rejected)
- Added cosmetic formatting changes (rejected)
Testing:
- Tested on MT6359 PMIC with MT8189 platform (ChromeOS)
- Verified RTC alarm triggering and proper status clearing
- Verified system shutdown behavior with pending alarm
- Validated against mainline v6.16-rc1
- Passed dtbs_check and dt_binding_check
Background:
The MT6397 family of PMICs (including MT6358, MT6359) share the same
RTC IP block. The BBPU register contains an alarm status bit (bit 3)
that must be explicitly cleared after an alarm event. Without this
handling, systems can experience spurious wakeups or fail to power
down cleanly.
Shunxi Zhang (4):
dt-bindings: rtc: mediatek: Document MT6397 RTC alarm handling
mfd: mt6397: Add BBPU bit definitions for alarm status control
rtc: mt6397: Add BBPU alarm status reset and shutdown handling
arm64: dts: mediatek: mt6359: Enable RTC alarm status reset
.../bindings/rtc/mediatek,mt6397-rtc.yaml | 12 ++++++++
arch/arm64/boot/dts/mediatek/mt6359.dtsi | 1 +
drivers/rtc/rtc-mt6397.c | 30 +++++++++++++++++++
include/linux/mfd/mt6397/rtc.h | 2 ++
4 files changed, 45 insertions(+)
---
Maintainers CC list (use scripts/get_maintainer.pl):
- Alessandro Zummo <a.zummo@towertech.it> (RTC maintainer)
- Alexandre Belloni <alexandre.belloni@bootlin.com> (RTC maintainer)
- Lee Jones <lee@kernel.org> (MFD maintainer)
- Matthias Brugger <matthias.bgg@gmail.com> (MediaTek maintainer)
- AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> (MediaTek reviewer)
- linux-rtc@vger.kernel.org
- linux-mediatek@lists.infradead.org
- linux-arm-kernel@lists.infradead.org
- linux-kernel@vger.kernel.org
base-commit: <your-base-commit-hash>
--
2.45.2
next reply other threads:[~2026-05-25 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 9:14 mtk34418 [this message]
2026-05-25 9:14 ` [PATCH] rtc: mt6397: Add BBPU alarm status reset and shutdown handling mtk34418
2026-05-25 9:14 ` [PATCH] mfd: mt6397: Add new bit definitions for RTC_BBPU register mtk34418
2026-05-26 7:42 [PATCH v3 0/4] rtc: mt6397: Enhance RTC driver with BBPU alarm status handling Dhatrisri Anumula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260525091449.1546965-1-dhatrisri.anumula@mediatek.com \
--to=dhatrisri.anumula@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=ot_shunxi.zhang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®