From: Imre Kaloz <kaloz@kernel.org>
To: sashiko-bot@kernel.org
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
Lee Jones <lee@kernel.org>,
mfd@lists.linux.dev
Subject: Re: [PATCH v2 2/2] MIPS: SGI-IP30: shut down cleanly on a power button press
Date: Mon, 2 Nov 2026 12:29:29 +0100 [thread overview]
Message-ID: <20261102112930.18911-1-kaloz@kernel.org> (raw)
In-Reply-To: <sashiko-outbox-193229@kernel.org>
>> + local_irq_disable();
>> + if (atomic_xchg(&ip30_power_off_claimed, 1))
>> + for (;;)
>> + cpu_relax();
>
> As reported by Sashiko on v1 [1], can another CPU still race on the
> indirect RTC index/data registers and bank selection while
> ds1685_rtc_poweroff() is running?
On dual-CPU Octanes the second CPU can still move the index or the
bank. v3 will stop the other CPU with smp_send_stop() before touching
HEART or the RTC.
>> ds1685_rtc_poweroff(to_platform_device(dev));
>
> Doesn't ds1685_rtc_poweroff() sleep in msleep(20) before cutting power,
> violating the atomic context established by local_irq_disable() and
> nbcon_cpu_emergency_enter()?
Not with the dependency named in the cover letter. Commit 21a829af60a7
("rtc: ds1685: do not sleep in the power-off handler"), in v7.4-rc1,
replaces that msleep() with mdelay().
>> +#ifdef CONFIG_SGI_IP30
>> + .plat_prepare_poweroff = ip30_prepare_poweroff,
>> +#endif
>
> What happens on a power button press when CONFIG_SGI_IP30=y and
> CONFIG_RTC_DRV_DS1685_FAMILY=m?
The button stops cutting the power, as the built-in
ip30_machine_power_off() cannot reach the module. v3 will set the hook
only when rtc-ds1685 is built in, so a modular driver will power off
on a press as it did before this series, and the second-press branch
will return.
Thanks,
Imre
prev parent reply other threads:[~2026-11-02 11:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 9:41 [PATCH v2 0/2] MIPS: SGI-IP30: power off through the RTC Imre Kaloz
2026-11-02 9:41 ` [PATCH v2 1/2] MIPS: SGI-IP30: power off through the DS1687 RTC Imre Kaloz
2026-11-02 9:41 ` [PATCH v2 2/2] MIPS: SGI-IP30: shut down cleanly on a power button press Imre Kaloz
[not found] ` <sashiko-outbox-193229@kernel.org>
2026-11-02 11:29 ` Imre Kaloz [this message]
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=20261102112930.18911-1-kaloz@kernel.org \
--to=kaloz@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=sashiko-bot@kernel.org \
--cc=tsbogend@alpha.franken.de \
/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®