From: Matt Turner <mattst88@gmail.com>
To: Richard Henderson <richard.henderson@linaro.org>,
Magnus Lindholm <linmag7@gmail.com>,
Guenter Roeck <linux@roeck-us.net>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
Matt Turner <mattst88@gmail.com>
Subject: [PATCH v3 4/7] alpha: marvel: notify environmental events
Date: Tue, 17 Nov 2026 13:13:31 -0500 [thread overview]
Message-ID: <20261117-marvel-env-v3-4-0edc370fdca9@gmail.com> (raw)
In-Reply-To: <20261117-marvel-env-v3-0-0edc370fdca9@gmail.com>
A change in the state of a sensor arrives as a system event logout
frame. Call an atomic notifier chain on each one, so that a sensor
driver can reread its sensors and tell userspace without polling.
Reviewed-by: Magnus Lindholm <linmag7@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
arch/alpha/include/asm/marvel_env.h | 5 +++++
arch/alpha/kernel/err_marvel.c | 9 ++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/alpha/include/asm/marvel_env.h b/arch/alpha/include/asm/marvel_env.h
index 16ccd2002a11..dbbf827a18ad 100644
--- a/arch/alpha/include/asm/marvel_env.h
+++ b/arch/alpha/include/asm/marvel_env.h
@@ -2,6 +2,8 @@
#ifndef __ALPHA_MARVEL_ENV_H
#define __ALPHA_MARVEL_ENV_H
+#include <linux/notifier.h>
+
/*
* Ask the console to refresh the environmental readings of the GCT node at
* @offset from the start of the GCT. Returns the console status, which is 1
@@ -9,4 +11,7 @@
*/
long marvel_cfgtree_partial_update(unsigned long offset);
+/* Called from machine check context on each environmental system event. */
+extern struct atomic_notifier_head marvel_env_notifier;
+
#endif /* __ALPHA_MARVEL_ENV_H */
diff --git a/arch/alpha/kernel/err_marvel.c b/arch/alpha/kernel/err_marvel.c
index 46c521cea9a0..6e0b0aabdaca 100644
--- a/arch/alpha/kernel/err_marvel.c
+++ b/arch/alpha/kernel/err_marvel.c
@@ -17,10 +17,14 @@
#include <asm/smp.h>
#include <asm/err_common.h>
#include <asm/err_ev7.h>
+#include <asm/marvel_env.h>
#include "err_impl.h"
#include "proto.h"
+ATOMIC_NOTIFIER_HEAD(marvel_env_notifier);
+EXPORT_SYMBOL_GPL(marvel_env_notifier);
+
static const char *
marvel_env_state(u16 state)
{
@@ -82,8 +86,11 @@ marvel_process_680_frame(struct ev7_lf_subpackets *lf_subpackets, int print)
status = MCHK_DISPOSITION_REPORT;
}
- if (print)
+ /* The frame is processed twice; notify on the printing pass only. */
+ if (print) {
marvel_print_680_frame(lf_subpackets);
+ atomic_notifier_call_chain(&marvel_env_notifier, 0, NULL);
+ }
return status;
}
--
2.56.1
next prev parent reply other threads:[~2026-11-17 18:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 18:13 [PATCH v3 0/7] alpha: marvel: environmental sensors Matt Turner
2026-11-17 18:13 ` [PATCH v3 1/7] alpha: marvel: fix the environmental subpacket layout Matt Turner
2026-11-17 18:17 ` sashiko-bot
2026-11-17 20:11 ` Magnus Lindholm
2026-11-17 18:13 ` [PATCH v3 2/7] alpha: marvel: report environmental events without VERBOSE_MCHECK Matt Turner
2026-11-17 18:18 ` sashiko-bot
2026-11-17 18:13 ` [PATCH v3 3/7] alpha: marvel: refresh environmental readings through the console Matt Turner
2026-11-17 18:20 ` sashiko-bot
2026-11-17 20:12 ` Magnus Lindholm
2026-11-17 18:13 ` Matt Turner [this message]
2026-11-17 18:18 ` [PATCH v3 4/7] alpha: marvel: notify environmental events sashiko-bot
2026-11-17 18:13 ` [PATCH v3 5/7] alpha: marvel: register a platform device for the environmental sensors Matt Turner
2026-11-17 18:18 ` sashiko-bot
2026-11-17 18:13 ` [PATCH v3 6/7] hwmon: Add driver for Marvel AlphaServer " Matt Turner
2026-11-17 18:26 ` sashiko-bot
2026-11-17 21:00 ` Magnus Lindholm
2026-11-17 18:13 ` [PATCH v3 7/7] hwmon: (marvel-env) Notify userspace of environmental events Matt Turner
2026-11-17 18:26 ` sashiko-bot
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=20261117-marvel-env-v3-4-0edc370fdca9@gmail.com \
--to=mattst88@gmail.com \
--cc=linmag7@gmail.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=richard.henderson@linaro.org \
/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.