From: sashiko-bot@kernel.org
To: "Ryan Brue" <ryanbrue.dev@gmail.com>
Cc: linux-rtc@vger.kernel.org, mfd@lists.linux.dev,
conor+dt@kernel.org, lee@kernel.org, robh@kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] rtc: mt6397: expose the spare bytes of the alarm registers as nvmem
Date: Fri, 18 Sep 2026 05:04:14 +0000 [thread overview]
Message-ID: <20260918050414.E183F1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260917-rbrue-suez-upstreaming-mt6397-rtc-nvmem-v1-2-558b8f95cfbc@gmail.com>
> Each alarm field lives in the low bits of its register and the driver
> masks its writes accordingly, so the high byte of four of them is storage
> the RTC never touches. MediaTek names these RTC_NEW_SPARE0 to
> RTC_NEW_SPARE3 and gives the first to a fuel gauge, which is how its PMIC
> battery drivers carry a state of charge over a reboot.
>
> Offer all four as a battery-backed nvmem provider, so that a consumer does
> not have to reach into this block behind the driver's back. Doing it here
> is what makes it safe: a write lands under the same lock the alarm paths
> take, so it can neither be lost inside mtk_rtc_set_alarm()'s
> read-modify-write nor fire the write trigger in the middle of one.
>
> The nvmem core does not range check a cell against the provider size, so
> the callbacks check the offset themselves.
>
> Tested on an MT6397; MediaTek's spare map for mt6323 matches, and the
> alarm field masks are common to every compatible this driver binds.
>
> Assisted-by: LLM
> Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-rbrue-suez-upstreaming-mt6397-rtc-nvmem-v1-0-558b8f95cfbc@gmail.com?part=2
next prev parent reply other threads:[~2026-09-18 5:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 4:57 [PATCH 0/2] rtc: mt6397: expose the RTC's spare bytes as nvmem Ryan Brue
2026-09-18 4:57 ` [PATCH 1/2] dt-bindings: mfd: mediatek: mt6397: describe the RTC's nvmem layout Ryan Brue
2026-09-18 5:04 ` sashiko-bot
2026-09-21 10:37 ` AngeloGioacchino Del Regno
2026-09-28 18:34 ` Rob Herring (Arm)
2026-09-18 4:57 ` [PATCH 2/2] rtc: mt6397: expose the spare bytes of the alarm registers as nvmem Ryan Brue
2026-09-18 5:04 ` sashiko-bot [this message]
2026-09-21 10:37 ` AngeloGioacchino Del Regno
2026-09-30 14:41 ` [PATCH 0/2] rtc: mt6397: expose the RTC's spare bytes " Alexandre Belloni
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=20260918050414.E183F1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lee@kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=robh@kernel.org \
--cc=ryanbrue.dev@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.