* [PATCH net-next v7 0/2] net: pse-pd: add poll path and LED trigger support
@ 2026-12-05 13:37 Carlo Szelinsky
2026-12-05 13:37 ` [PATCH net-next v7 1/2] net: pse-pd: add devm_pse_poll_helper() Carlo Szelinsky
2026-12-05 13:37 ` [PATCH net-next v7 2/2] net: pse-pd: add LED triggers for each PI Carlo Szelinsky
0 siblings, 2 replies; 3+ messages in thread
From: Carlo Szelinsky @ 2026-12-05 13:37 UTC (permalink / raw)
To: Oleksij Rempel, Kory Maincent
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lee Jones, Pavel Machek, Jonas Jelonek, Ross Cawston,
netdev, linux-leds, linux-kernel
Some PSE controllers have no IRQ line, and boards want to show the PoE
state of each port on an LED. This series adds both.
Patch 1 adds devm_pse_poll_helper(). The core calls the driver's
map_event() about every 500 ms and handles the events like the IRQ
path does.
Patch 2 adds two LED triggers per PI, "delivering" and "enabled". Both
work on every controller. As most drivers report no event when the
power comes on, the core reads "delivering" every second while an LED
uses it.
The poll helper has no in-tree user yet. The users I know of are out
of tree: the IP804AR driver in OpenWrt and an HS104 driver (S600WP
switch). Patch 2 is also useful without them: both triggers work with
every in-tree driver.
Lee, Pavel: the triggers are per PI, as phy_led_triggers.c does it per
PHY. That is up to 96 triggers on a 48-port controller, and
"delivering" is read every second while an LED uses it. Is that fine,
or would you prefer one trigger with a per-LED port setting, like
ledtrig-netdev?
Under software power control, a polled driver also needs Kory's fix
"net: pse-pd: fix bogus budget evaluation strategy check in IRQ
handler". A poll often reports a detection together with a
classification. Without the fix, the core then ignores all events of
that PI in this poll, so it does not power the PD. It is not a build
dependency:
https://lore.kernel.org/netdev/20261126143012.1595919-1-kory.maincent@bootlin.com/
Testing: on an S600WP switch with the HS104 PSE chip, polled, with LEDs
on both triggers, plugging and unplugging PDs, and unbinding and binding
the driver. Also in QEMU arm64 with fake PSE controllers (polling every
1 ms in a test build, bind/unbind loops, fake LEDs, power changes
without events), with KASAN, kmemleak and lockdep. Kory's fix was
applied for the tests. Lockdep reports one inversion between pcdev->lock
and the regulator supply lock. It is in net-next without this series
too. The IP804AR driver is build-tested only.
Changes in v7:
- Rebased on net-next.
- Poll helper:
- The poll state is now in struct pse_poll, which only the core
knows (Kory).
- Removed poll_interval_ms. The interval is fixed at 500 ms, as no
driver needs another one yet (Kory).
- Renamed back to devm_pse_poll_helper(), as it now allocates the
poll state with devm.
- Shorter comments (Kory).
- The map_event() doc says that irq is 0 when polling (Kory), and
that it must report only new events (sashiko).
- devm_pse_poll_helper() and devm_pse_irq_helper() now reject a
second event source (sashiko).
- Comments that named only pse_isr() now say "the event handler"
(sashiko).
- LED triggers:
- Both triggers are registered for every PI, in one place (Kory).
- New Kconfig option PSE_LED_TRIGGERS, like LED_TRIGGER_PHY.
- "delivering" now works on every controller: while an LED uses it,
the core reads the power state every second (sashiko). On a slow
controller, the pause after a round is at least as long as the
round took (sashiko).
- One failed read no longer stops the other trigger of a PI.
- The "enabled" LEDs are updated once the power domains exist, and
when the IRQ starts software power control (sashiko).
- Trigger names use "pi" instead of "port", like the PI regulators.
- A trigger that fails to register only gives a warning, and only
its PI is affected.
- Binding an LED after a failed read shows off, not an old state,
when no other LED uses the trigger.
- The triggers are now in struct pse_pi, as a pointer to a struct
that only the core knows (Kory).
- "enabled" is now also updated when a PHY first gets a PI that is
already on, under software power control (sashiko).
- No inline in the .c file (Kory).
- pi[].pw_d is now set under pcdev->lock, as an LED can be bound
before the power domains exist (sashiko).
- Commit messages focus on the why (Kory).
v6: https://lore.kernel.org/all/20261128121525.3909836-1-github@szelinsky.de/
Carlo Szelinsky (2):
net: pse-pd: add devm_pse_poll_helper()
net: pse-pd: add LED triggers for each PI
drivers/net/pse-pd/Kconfig | 10 +
drivers/net/pse-pd/pse_core.c | 606 +++++++++++++++++++++++++++++++---
include/linux/pse-pd/pse.h | 29 +-
3 files changed, 598 insertions(+), 47 deletions(-)
base-commit: c1165beb053a652299b1503b2dd7674ced0b1596
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net-next v7 1/2] net: pse-pd: add devm_pse_poll_helper()
2026-12-05 13:37 [PATCH net-next v7 0/2] net: pse-pd: add poll path and LED trigger support Carlo Szelinsky
@ 2026-12-05 13:37 ` Carlo Szelinsky
2026-12-05 13:37 ` [PATCH net-next v7 2/2] net: pse-pd: add LED triggers for each PI Carlo Szelinsky
1 sibling, 0 replies; 3+ messages in thread
From: Carlo Szelinsky @ 2026-12-05 13:37 UTC (permalink / raw)
To: Oleksij Rempel, Kory Maincent
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lee Jones, Pavel Machek, Jonas Jelonek, Ross Cawston,
netdev, linux-leds, linux-kernel
Some PSE controllers have no interrupt line, or the board does not wire
it. The PSE core then never learns when a PD is plugged in or removed.
Userspace gets no ethtool notifications, and the static budget strategy
does not work: it only powers a port after the IRQ handler has reported
a PD.
Let these controllers report the same events by polling. The driver
passes the same pse_irq_desc as for devm_pse_irq_helper(). The core
calls its map_event() about every 500 ms and handles the events like
the IRQ handler does. The interval is fixed, as no driver needs another
one yet.
With the "disabled" budget strategy, a polled controller keeps the
power control in hardware, like a controller without events does today.
The core only takes it over for an IRQ controller, which it expects to
report a PD while the port is off.
Update the comments that say events need an IRQ.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
---
drivers/net/pse-pd/pse_core.c | 209 ++++++++++++++++++++++++++++------
include/linux/pse-pd/pse.h | 18 ++-
2 files changed, 185 insertions(+), 42 deletions(-)
diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c
index 0477cf6787bd..07cbc585a898 100644
--- a/drivers/net/pse-pd/pse_core.c
+++ b/drivers/net/pse-pd/pse_core.c
@@ -14,10 +14,33 @@
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/rtnetlink.h>
+#include <linux/workqueue.h>
#include <net/net_trackers.h>
#define PSE_PW_D_LIMIT INT_MAX
+/* Fast enough for PD events, low load on the I2C bus */
+#define PSE_POLL_INTERVAL_MS 500
+
+/**
+ * struct pse_poll - poll state of a PSE controller
+ * @pcdev: the polled PSE controller
+ * @work: delayed work that polls the controller
+ * @desc: copy of the driver's event description
+ * @notifs: per-PI events of the current poll
+ * @notifs_mask: PIs with events in the current poll
+ * @err: 0 if the last poll worked, else the first error since then, to
+ * log only changes
+ */
+struct pse_poll {
+ struct pse_controller_dev *pcdev;
+ struct delayed_work work;
+ struct pse_irq_desc desc;
+ unsigned long *notifs;
+ unsigned long *notifs_mask;
+ int err;
+};
+
static DEFINE_MUTEX(pse_list_mutex);
static LIST_HEAD(pse_controller_list);
static DEFINE_XARRAY_ALLOC(pse_pw_d_map);
@@ -392,8 +415,8 @@ static void pse_pw_d_retry_power_delivery(struct pse_controller_dev *pcdev,
* @pw_d: a pointer to the PSE power domain
*
* This function determines whether the power control for a specific power
- * domain is managed by software in the interrupt handler rather than directly
- * by hardware.
+ * domain is managed by software in the event handler (IRQ or poll) rather
+ * than directly by hardware.
*
* Software power control is active in the following cases:
* - When the budget evaluation strategy is set to static
@@ -623,9 +646,9 @@ static int _pse_pi_delivery_power_sw_pw_ctrl(struct pse_controller_dev *pcdev,
struct pse_pi *pi = &pcdev->pi[id];
int ret, pw_req;
- /* pse_isr(), a priority change and the retry after a disable all
- * power a PI through here, so stop them here once unregistering
- * has started.
+ /* The event handler, a priority change and the retry after a
+ * disable all power a PI through here, so stop them here once
+ * unregistering has started.
*/
if (pcdev->unregistering)
return -ENODEV;
@@ -907,7 +930,7 @@ static void pse_pw_d_release(struct kref *kref)
}
/* Clear pi[id].pw_d before the domain's reference is dropped. The PI
- * regulator ops and pse_isr() hold pcdev->lock while they use it.
+ * regulator ops and the event handler hold pcdev->lock while they use it.
*/
static struct pse_power_domain *
pse_pi_take_pw_d(struct pse_controller_dev *pcdev, int id)
@@ -1119,6 +1142,20 @@ int pse_controller_register(struct pse_controller_dev *pcdev)
goto free_kfifo;
}
+ if (pcdev->poll) {
+ struct pse_poll *poll = pcdev->poll;
+
+ poll->notifs = devm_kzalloc_objs(pcdev->dev, *poll->notifs,
+ pcdev->nr_lines);
+ poll->notifs_mask = devm_bitmap_zalloc(pcdev->dev,
+ pcdev->nr_lines,
+ GFP_KERNEL);
+ if (!poll->notifs || !poll->notifs_mask) {
+ ret = -ENOMEM;
+ goto free_kfifo;
+ }
+ }
+
ret = of_load_pse_pis(pcdev);
if (ret)
goto free_kfifo;
@@ -1171,6 +1208,11 @@ int pse_controller_register(struct pse_controller_dev *pcdev)
list_add(&pcdev->list, &pse_controller_list);
mutex_unlock(&pse_list_mutex);
+ if (pcdev->poll)
+ queue_delayed_work(system_freezable_power_efficient_wq,
+ &pcdev->poll->work,
+ msecs_to_jiffies(PSE_POLL_INTERVAL_MS));
+
return 0;
free_kfifo:
@@ -1193,12 +1235,11 @@ void pse_controller_unregister(struct pse_controller_dev *pcdev)
pcdev->unregistering = true;
mutex_unlock(&pcdev->lock);
- /* Stop the IRQ and the notification worker first: pse_isr() uses
- * pcdev->pi and the power domains that pse_flush_pw_ds() drops,
- * and the worker reads the kfifo that is freed below.
- */
+ /* Stop all event handling first, it uses what is freed below */
if (pcdev->irq)
disable_irq(pcdev->irq);
+ if (pcdev->poll)
+ cancel_delayed_work_sync(&pcdev->poll->work);
/* Unlink before the PI array is freed: of_pse_control_get() walks
* the list and reads pcdev->pi[].
*/
@@ -1326,48 +1367,38 @@ static int pse_set_config_isr(struct pse_controller_dev *pcdev, int id,
}
/**
- * pse_isr - IRQ handler for PSE
- * @irq: irq number
- * @data: pointer to user interrupt structure
+ * pse_handle_events - Handle the events of the PIs in @notifs_mask
+ * @pcdev: a pointer to the PSE controller device
+ * @pi_notifs: per-PI notification array
+ * @notifs_mask: bitmap of PIs with events (sized for pcdev->nr_lines)
*
- * Return: irqreturn_t - status of IRQ
+ * Shared by the IRQ and the poll path. Caller must hold pcdev->lock.
*/
-static irqreturn_t pse_isr(int irq, void *data)
+static void pse_handle_events(struct pse_controller_dev *pcdev,
+ unsigned long *pi_notifs,
+ unsigned long *notifs_mask)
{
- struct pse_controller_dev *pcdev;
- struct pse_irq_desc *desc;
- struct pse_irq *h = data;
- int ret, i;
+ int i;
- desc = &h->desc;
- pcdev = h->pcdev;
+ lockdep_assert_held(&pcdev->lock);
- /* Clear notifs mask */
- memset(h->notifs, 0, pcdev->nr_lines * sizeof(*h->notifs));
- bitmap_zero(h->notifs_mask, pcdev->nr_lines);
- mutex_lock(&pcdev->lock);
- ret = desc->map_event(irq, pcdev, h->notifs, h->notifs_mask);
- if (ret || bitmap_empty(h->notifs_mask, pcdev->nr_lines)) {
- mutex_unlock(&pcdev->lock);
- return IRQ_NONE;
- }
-
- for_each_set_bit(i, h->notifs_mask, pcdev->nr_lines) {
+ for_each_set_bit(i, notifs_mask, pcdev->nr_lines) {
unsigned long notifs, rnotifs;
struct pse_ntf ntf = {};
+ int ret;
/* Do nothing PI not described */
if (!pcdev->pi[i].rdev)
continue;
- notifs = h->notifs[i];
+ notifs = pi_notifs[i];
if (pse_pw_d_is_sw_pw_control(pcdev, pcdev->pi[i].pw_d)) {
ret = pse_set_config_isr(pcdev, i, notifs);
if (ret)
notifs |= ETHTOOL_PSE_EVENT_SW_PW_CONTROL_ERROR;
}
- dev_dbg(h->pcdev->dev,
+ dev_dbg(pcdev->dev,
"Sending PSE notification EVT 0x%lx\n", notifs);
ntf.notifs = notifs;
@@ -1380,12 +1411,67 @@ static irqreturn_t pse_isr(int irq, void *data)
regulator_notifier_call_chain(pcdev->pi[i].rdev, rnotifs,
NULL);
}
+}
+
+/**
+ * pse_isr - IRQ handler for PSE
+ * @irq: irq number
+ * @data: pointer to user interrupt structure
+ *
+ * Return: irqreturn_t - status of IRQ
+ */
+static irqreturn_t pse_isr(int irq, void *data)
+{
+ struct pse_controller_dev *pcdev;
+ struct pse_irq *h = data;
+ int ret;
+
+ pcdev = h->pcdev;
+
+ /* Clear notifs mask */
+ memset(h->notifs, 0, pcdev->nr_lines * sizeof(*h->notifs));
+ bitmap_zero(h->notifs_mask, pcdev->nr_lines);
+ mutex_lock(&pcdev->lock);
+ ret = h->desc.map_event(irq, pcdev, h->notifs, h->notifs_mask);
+ if (ret || bitmap_empty(h->notifs_mask, pcdev->nr_lines)) {
+ mutex_unlock(&pcdev->lock);
+ return IRQ_NONE;
+ }
+ pse_handle_events(pcdev, h->notifs, h->notifs_mask);
mutex_unlock(&pcdev->lock);
return IRQ_HANDLED;
}
+static void pse_poll_worker(struct work_struct *work)
+{
+ struct pse_poll *poll = container_of(work, struct pse_poll,
+ work.work);
+ struct pse_controller_dev *pcdev = poll->pcdev;
+ int ret;
+
+ memset(poll->notifs, 0, pcdev->nr_lines * sizeof(*poll->notifs));
+ bitmap_zero(poll->notifs_mask, pcdev->nr_lines);
+ mutex_lock(&pcdev->lock);
+ ret = poll->desc.map_event(0, pcdev, poll->notifs, poll->notifs_mask);
+ /* Log only changes, not an error at every poll */
+ if (!ret != !poll->err) {
+ if (ret)
+ dev_err(pcdev->dev, "Failed to poll events: %pe\n",
+ ERR_PTR(ret));
+ else
+ dev_info(pcdev->dev, "Event polling works again\n");
+ poll->err = ret;
+ }
+ if (!ret && !bitmap_empty(poll->notifs_mask, pcdev->nr_lines))
+ pse_handle_events(pcdev, poll->notifs, poll->notifs_mask);
+ mutex_unlock(&pcdev->lock);
+
+ queue_delayed_work(system_freezable_power_efficient_wq, &poll->work,
+ msecs_to_jiffies(PSE_POLL_INTERVAL_MS));
+}
+
/**
* devm_pse_irq_helper - Register IRQ based PSE event notifier
* @pcdev: a pointer to the PSE
@@ -1393,7 +1479,8 @@ static irqreturn_t pse_isr(int irq, void *data)
* @irq_flags: the flags to be passed to request_irq
* @d: PSE interrupt description
*
- * Return: 0 on success and errno on failure
+ * Return: 0 on success, -EBUSY if the controller already has an event
+ * source, or another errno on failure
*/
int devm_pse_irq_helper(struct pse_controller_dev *pcdev, int irq,
int irq_flags, const struct pse_irq_desc *d)
@@ -1407,6 +1494,10 @@ int devm_pse_irq_helper(struct pse_controller_dev *pcdev, int irq,
if (!d || !d->map_event || !d->name)
return -EINVAL;
+ /* Only one event source per controller */
+ if (WARN_ON(pcdev->poll || pcdev->irq))
+ return -EBUSY;
+
h = devm_kzalloc_obj(dev, *h);
if (!h)
return -ENOMEM;
@@ -1448,6 +1539,50 @@ int devm_pse_irq_helper(struct pse_controller_dev *pcdev, int irq,
}
EXPORT_SYMBOL_GPL(devm_pse_irq_helper);
+/**
+ * devm_pse_poll_helper - Report PSE events by polling
+ * @pcdev: a pointer to the PSE controller device
+ * @d: PSE event description, the same as for devm_pse_irq_helper().
+ * d->name is not used.
+ *
+ * For PSE controllers without a usable IRQ. 500 ms after each poll, the
+ * core calls d->map_event() again and handles the events like pse_isr()
+ * does. Polling pauses during suspend.
+ *
+ * With the "disabled" budget strategy, the hardware keeps the power
+ * control, see pse_pw_d_is_sw_pw_control().
+ *
+ * Call it after setting pcdev->dev and before
+ * devm_pse_controller_register(), which starts the polling.
+ *
+ * Return: 0 on success, -EBUSY if the controller is already registered
+ * or already has an event source, or another errno on failure
+ */
+int devm_pse_poll_helper(struct pse_controller_dev *pcdev,
+ const struct pse_irq_desc *d)
+{
+ struct pse_poll *poll;
+
+ if (!d || !d->map_event)
+ return -EINVAL;
+
+ /* Call this once, and before registering, which sets pcdev->pi */
+ if (WARN_ON(pcdev->pi || pcdev->poll || pcdev->irq))
+ return -EBUSY;
+
+ poll = devm_kzalloc(pcdev->dev, sizeof(*poll), GFP_KERNEL);
+ if (!poll)
+ return -ENOMEM;
+
+ poll->pcdev = pcdev;
+ poll->desc = *d;
+ INIT_DELAYED_WORK(&poll->work, pse_poll_worker);
+ pcdev->poll = poll;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(devm_pse_poll_helper);
+
/* PSE control section */
static void __pse_control_release(struct kref *kref)
@@ -1917,8 +2052,8 @@ static int pse_pi_update_pw_budget(struct pse_controller_dev *pcdev, int id,
*/
mutex_lock(&pcdev->lock);
/* Only a PI under software power control that is enabled and has a
- * PD detected gets a budget. Check this here, as pse_isr() changes
- * it under the same lock.
+ * PD detected gets a budget. Check this here, as the event handler
+ * changes it under the same lock.
*/
if (!pse_pw_d_is_sw_pw_control(pcdev, pi->pw_d) ||
!pi->admin_state_enabled || !pi->isr_pd_detected)
diff --git a/include/linux/pse-pd/pse.h b/include/linux/pse-pd/pse.h
index 17738ffcd224..008e16b7f72d 100644
--- a/include/linux/pse-pd/pse.h
+++ b/include/linux/pse-pd/pse.h
@@ -43,10 +43,13 @@ struct ethtool_c33_pse_pw_limit_range {
};
/**
- * struct pse_irq_desc - notification sender description for IRQ based events.
+ * struct pse_irq_desc - notification sender description for IRQ or poll
+ * based events.
*
- * @name: the visible name for the IRQ
+ * @name: the visible name for the IRQ, not used for polling
* @map_event: driver callback to map IRQ status into PSE devices with events.
+ * When polling, irq is 0, and the callback must report only
+ * the events since the last call, not the current state.
*/
struct pse_irq_desc {
const char *name;
@@ -186,8 +189,8 @@ struct ethtool_pse_control_status {
* @pi_get_prio: Get the PSE PI priority.
* @pi_set_prio: Configure the PSE PI priority.
* @pi_get_pw_req: Get the power requested by a PD before enabling the PSE PI.
- * This is only relevant when an interrupt is registered using
- * devm_pse_irq_helper helper.
+ * This is only relevant when events are reported by
+ * devm_pse_irq_helper() or devm_pse_poll_helper().
*/
struct pse_controller_ops {
int (*setup_pi_matrix)(struct pse_controller_dev *pcdev);
@@ -218,6 +221,7 @@ struct module;
struct device_node;
struct of_phandle_args;
struct pse_control;
+struct pse_poll;
struct ethtool_pse_control_status;
/* PSE PI pairset pinout can either be Alternative A or Alternative B */
@@ -249,7 +253,7 @@ struct pse_pi_pairset {
* @pw_d: Power domain of the PSE PI
* @pw_d_node: entry in the list of PIs that use @pw_d
* @prio: Priority of the PSE PI. Used in static budget evaluation strategy
- * @isr_pd_detected: PSE PI detection status managed by the interruption
+ * @isr_pd_detected: PSE PI detection status managed by the event
* handler. This variable is relevant when the power enabled
* management is managed in software like the static
* budget evaluation strategy.
@@ -294,6 +298,7 @@ struct pse_ntf {
* @pi: table of PSE PIs described in this controller device
* @no_of_pse_pi: flag set if the pse_pis devicetree node is not used
* @irq: PSE interrupt
+ * @poll: poll state, set by devm_pse_poll_helper(), only used by the core
* @pis_prio_max: Maximum value allowed for the PSE PIs priority
* @supp_budget_eval_strategies: budget evaluation strategies supported
* by the PSE
@@ -316,6 +321,7 @@ struct pse_controller_dev {
struct pse_pi *pi;
bool no_of_pse_pi;
int irq;
+ struct pse_poll *poll;
unsigned int pis_prio_max;
u32 supp_budget_eval_strategies;
struct work_struct ntf_work;
@@ -350,6 +356,8 @@ int devm_pse_controller_register(struct device *dev,
struct pse_controller_dev *pcdev);
int devm_pse_irq_helper(struct pse_controller_dev *pcdev, int irq,
int irq_flags, const struct pse_irq_desc *d);
+int devm_pse_poll_helper(struct pse_controller_dev *pcdev,
+ const struct pse_irq_desc *d);
struct pse_control *of_pse_control_get(struct device_node *node,
struct phy_device *phydev);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH net-next v7 2/2] net: pse-pd: add LED triggers for each PI
2026-12-05 13:37 [PATCH net-next v7 0/2] net: pse-pd: add poll path and LED trigger support Carlo Szelinsky
2026-12-05 13:37 ` [PATCH net-next v7 1/2] net: pse-pd: add devm_pse_poll_helper() Carlo Szelinsky
@ 2026-12-05 13:37 ` Carlo Szelinsky
1 sibling, 0 replies; 3+ messages in thread
From: Carlo Szelinsky @ 2026-12-05 13:37 UTC (permalink / raw)
To: Oleksij Rempel, Kory Maincent
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lee Jones, Pavel Machek, Jonas Jelonek, Ross Cawston,
netdev, linux-leds, linux-kernel
PoE switches often have one LED per port to show its PoE state. The
PSE core has no way to drive such an LED today.
Add two LED triggers per PI. "delivering" is on while the PI powers a
PD, "enabled" while the PI is admin enabled. The triggers are named
"pse-<dev_name>:pi<N>:delivering" and "...:enabled". Userspace binds an
LED to them in sysfs, or a board with linux,default-trigger, like the
PHY LED triggers.
The triggers need the new option PSE_LED_TRIGGERS, like LED_TRIGGER_PHY
for the PHY LED triggers.
Most PSE drivers report no event when the power of a PI comes on, and
some report no events at all. So while an LED uses "delivering", the
core reads the power state every second. Drivers that report the
power-on still update it at once.
Under software power control, the core keeps a PI off in hardware
until a PD is detected. "enabled" then shows the admin state that the
core keeps, as ethtool does. When a PHY first gets a PI, the core sets
this state. It now does this under pcdev->lock and updates the
"enabled" LED, so the LED is right for a PI that was already on.
Reading the PI state can be slow, pd692x0 for example needs 30 ms or
more per command. So the core only reads it while an LED uses the
trigger.
If a trigger fails to register, the core only warns. LEDs are optional
and must not stop PoE.
The triggers are registered before the PI regulators. The regulator
ops update the LEDs, so devres must remove the triggers only after the
regulators. pse_register_pw_ds() now sets pi[].pw_d under pcdev->lock,
as an LED can be bound before the power domains exist.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
---
drivers/net/pse-pd/Kconfig | 10 +
drivers/net/pse-pd/pse_core.c | 397 +++++++++++++++++++++++++++++++++-
include/linux/pse-pd/pse.h | 11 +-
3 files changed, 413 insertions(+), 5 deletions(-)
diff --git a/drivers/net/pse-pd/Kconfig b/drivers/net/pse-pd/Kconfig
index a0f2ae668c67..a78dfa3155e8 100644
--- a/drivers/net/pse-pd/Kconfig
+++ b/drivers/net/pse-pd/Kconfig
@@ -13,6 +13,16 @@ menuconfig PSE_CONTROLLER
if PSE_CONTROLLER
+config PSE_LED_TRIGGERS
+ bool "LED triggers for PSE PIs"
+ depends on LEDS_TRIGGERS
+ help
+ Adds two LED triggers for each PSE PI: "delivering" is on while
+ the PI powers a PD, "enabled" while the PI is admin enabled.
+ Userspace binds an LED to them in sysfs.
+
+ If unsure, say no.
+
config PSE_REALTEK_MCU
tristate
help
diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c
index 07cbc585a898..f350e3c567d6 100644
--- a/drivers/net/pse-pd/pse_core.c
+++ b/drivers/net/pse-pd/pse_core.c
@@ -8,6 +8,7 @@
#include <linux/device.h>
#include <linux/ethtool.h>
#include <linux/ethtool_netlink.h>
+#include <linux/leds.h>
#include <linux/of.h>
#include <linux/phy.h>
#include <linux/pse-pd/pse.h>
@@ -22,6 +23,9 @@
/* Fast enough for PD events, low load on the I2C bus */
#define PSE_POLL_INTERVAL_MS 500
+/* Fast enough for a person looking at an LED */
+#define PSE_LED_REFRESH_MS 1000
+
/**
* struct pse_poll - poll state of a PSE controller
* @pcdev: the polled PSE controller
@@ -369,6 +373,7 @@ pse_pi_is_admin_enable_pending(struct pse_controller_dev *pcdev, int id)
static int _pse_pi_delivery_power_sw_pw_ctrl(struct pse_controller_dev *pcdev,
int id,
struct netlink_ext_ack *extack);
+static void pse_led_update(struct pse_controller_dev *pcdev, int id);
/**
* pse_pw_d_retry_power_delivery - Retry power delivery for pending ports in a
@@ -406,6 +411,9 @@ static void pse_pw_d_retry_power_delivery(struct pse_controller_dev *pcdev,
ret = _pse_pi_delivery_power_sw_pw_ctrl(pcdev, i, &extack);
if (ret == -ERANGE)
prio_max = pcdev->pi[i].prio;
+ /* No event comes for this, so update the LEDs here */
+ if (!ret)
+ pse_led_update(pcdev, i);
}
}
@@ -520,6 +528,7 @@ static int pse_disable_pi_pol(struct pse_controller_dev *pcdev, int id)
ret = _pse_pi_disable(pcdev, id);
if (ret)
notifs |= ETHTOOL_PSE_EVENT_SW_PW_CONTROL_ERROR;
+ pse_led_update(pcdev, id);
ntf.notifs = notifs;
ntf.id = id;
@@ -697,6 +706,340 @@ static int _pse_pi_delivery_power_sw_pw_ctrl(struct pse_controller_dev *pcdev,
return 0;
}
+/**
+ * struct pse_pi_led_triggers - LED triggers of a PSE PI
+ *
+ * @delivering: LED trigger for the power delivering state
+ * @enabled: LED trigger for the admin enabled state
+ * @pcdev: the PSE controller of the PI
+ * @id: PI index
+ * @nr_delivering: number of LEDs bound to @delivering
+ * @nr_enabled: number of LEDs bound to @enabled
+ * @last_delivering: last delivering state, for change detection
+ * @last_enabled: last enabled state, for change detection
+ *
+ * The counters and the last states are changed under pcdev->lock.
+ */
+struct pse_pi_led_triggers {
+ struct led_trigger delivering;
+ struct led_trigger enabled;
+ struct pse_controller_dev *pcdev;
+ int id;
+ unsigned int nr_delivering;
+ unsigned int nr_enabled;
+ bool last_delivering;
+ bool last_enabled;
+};
+
+#if IS_ENABLED(CONFIG_PSE_LED_TRIGGERS)
+/**
+ * pse_pi_get_states - Read the delivering and enabled state of a PI
+ * @pcdev: PSE controller device
+ * @id: PI index
+ * @delivering: out, true if the PI delivers power. NULL to not read it.
+ * @enabled: out, true if the PI is admin enabled, as ethtool reports it.
+ * NULL to not read it.
+ *
+ * Reading a state can be slow, so read only the ones asked for.
+ *
+ * Return: 0 on success, negative errno on failure.
+ */
+static int pse_pi_get_states(struct pse_controller_dev *pcdev, int id,
+ bool *delivering, bool *enabled)
+{
+ struct pse_admin_state admin_state = {};
+ struct pse_pw_status pw_status = {};
+ int ret;
+
+ lockdep_assert_held(&pcdev->lock);
+
+ if (delivering) {
+ ret = pcdev->ops->pi_get_pw_status(pcdev, id, &pw_status);
+ if (ret)
+ return ret;
+
+ *delivering = pw_status.c33_pw_status ==
+ ETHTOOL_C33_PSE_PW_D_STATUS_DELIVERING ||
+ pw_status.podl_pw_status ==
+ ETHTOOL_PODL_PSE_PW_D_STATUS_DELIVERING;
+ }
+
+ if (!enabled)
+ return 0;
+
+ /* Under software power control, the hardware is off until a PD
+ * is detected, so use the admin state the core keeps.
+ */
+ if (pse_pw_d_is_sw_pw_control(pcdev, pcdev->pi[id].pw_d)) {
+ *enabled = pcdev->pi[id].admin_state_enabled;
+ return 0;
+ }
+
+ ret = pcdev->ops->pi_get_admin_state(pcdev, id, &admin_state);
+ if (ret)
+ return ret;
+
+ *enabled = admin_state.c33_admin_state ==
+ ETHTOOL_C33_PSE_ADMIN_STATE_ENABLED ||
+ admin_state.podl_admin_state ==
+ ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED;
+
+ return 0;
+}
+
+/* Fire @trig if @state changed */
+static void pse_led_set(struct led_trigger *trig, bool *last, bool state)
+{
+ if (*last == state)
+ return;
+
+ *last = state;
+ led_trigger_event(trig, state ? LED_FULL : LED_OFF);
+}
+
+/**
+ * pse_led_update - Update the LED triggers of a PI
+ * @pcdev: PSE controller device
+ * @id: PI index
+ *
+ * Reads the state of each trigger that has an LED bound, and fires the
+ * trigger if the state changed. Each state is read on its own, so one
+ * failed read does not stop the other trigger. pse_led_activate() reads
+ * the state when an LED is bound.
+ */
+static void pse_led_update(struct pse_controller_dev *pcdev, int id)
+{
+ struct pse_pi_led_triggers *trigs = pcdev->pi[id].led_trigs;
+ bool state;
+
+ lockdep_assert_held(&pcdev->lock);
+
+ /* No triggers for a PI that is not described */
+ if (!trigs)
+ return;
+
+ if (trigs->nr_delivering &&
+ !pse_pi_get_states(pcdev, id, &state, NULL))
+ pse_led_set(&trigs->delivering, &trigs->last_delivering,
+ state);
+
+ if (trigs->nr_enabled &&
+ !pse_pi_get_states(pcdev, id, NULL, &state))
+ pse_led_set(&trigs->enabled, &trigs->last_enabled, state);
+}
+
+/* An LED was just bound to @trig. Show its state now, pse_led_update()
+ * skipped it while no LED was bound. Read only this state, as reads can
+ * be slow. For "delivering", also start the refresh.
+ */
+static void pse_led_activate(struct pse_pi_led_triggers *trigs,
+ struct led_trigger *trig, unsigned int *nr,
+ bool *last, struct led_classdev *led_cdev)
+{
+ struct pse_controller_dev *pcdev = trigs->pcdev;
+ bool is_delivering = trig == &trigs->delivering;
+ bool state = false;
+ int ret;
+
+ mutex_lock(&pcdev->lock);
+ (*nr)++;
+ ret = pse_pi_get_states(pcdev, trigs->id,
+ is_delivering ? &state : NULL,
+ is_delivering ? NULL : &state);
+ /* The last state is old if no other LED was bound */
+ if (ret && *nr == 1)
+ *last = false;
+ if (!ret && *last != state) {
+ *last = state;
+ led_trigger_event(trig, state ? LED_FULL : LED_OFF);
+ } else {
+ led_set_brightness(led_cdev, *last ? LED_FULL : LED_OFF);
+ }
+ if (is_delivering && !pcdev->unregistering)
+ queue_delayed_work(system_freezable_power_efficient_wq,
+ &pcdev->led_work,
+ msecs_to_jiffies(PSE_LED_REFRESH_MS));
+ mutex_unlock(&pcdev->lock);
+}
+
+/* Most drivers report no event when the power of a PI comes on. So while
+ * an LED uses "delivering", read it again every second. Take the lock per
+ * PI, as reads can be slow.
+ */
+static void pse_led_refresh_worker(struct work_struct *work)
+{
+ struct pse_controller_dev *pcdev =
+ container_of(work, struct pse_controller_dev, led_work.work);
+ unsigned long start = jiffies;
+ bool bound = false;
+ int i;
+
+ for (i = 0; i < pcdev->nr_lines; i++) {
+ struct pse_pi_led_triggers *trigs;
+ bool delivering;
+
+ mutex_lock(&pcdev->lock);
+ trigs = pcdev->pi[i].led_trigs;
+ if (trigs && trigs->nr_delivering && !pcdev->unregistering) {
+ bound = true;
+ if (!pse_pi_get_states(pcdev, i, &delivering, NULL))
+ pse_led_set(&trigs->delivering,
+ &trigs->last_delivering,
+ delivering);
+ }
+ mutex_unlock(&pcdev->lock);
+ }
+
+ /* Stop when no LED uses "delivering". Binding one starts it again. */
+ if (!bound)
+ return;
+
+ /* Wait at least as long as this round took. So on a slow
+ * controller with many PIs, at most half of the time goes to the
+ * LEDs.
+ */
+ queue_delayed_work(system_freezable_power_efficient_wq,
+ &pcdev->led_work,
+ max(msecs_to_jiffies(PSE_LED_REFRESH_MS),
+ jiffies - start));
+}
+
+static int pse_led_delivering_activate(struct led_classdev *led_cdev)
+{
+ struct pse_pi_led_triggers *trigs =
+ container_of(led_cdev->trigger, struct pse_pi_led_triggers,
+ delivering);
+
+ pse_led_activate(trigs, &trigs->delivering, &trigs->nr_delivering,
+ &trigs->last_delivering, led_cdev);
+ return 0;
+}
+
+static void pse_led_delivering_deactivate(struct led_classdev *led_cdev)
+{
+ struct pse_pi_led_triggers *trigs =
+ container_of(led_cdev->trigger, struct pse_pi_led_triggers,
+ delivering);
+
+ mutex_lock(&trigs->pcdev->lock);
+ trigs->nr_delivering--;
+ mutex_unlock(&trigs->pcdev->lock);
+}
+
+static int pse_led_enabled_activate(struct led_classdev *led_cdev)
+{
+ struct pse_pi_led_triggers *trigs =
+ container_of(led_cdev->trigger, struct pse_pi_led_triggers,
+ enabled);
+
+ pse_led_activate(trigs, &trigs->enabled, &trigs->nr_enabled,
+ &trigs->last_enabled, led_cdev);
+ return 0;
+}
+
+static void pse_led_enabled_deactivate(struct led_classdev *led_cdev)
+{
+ struct pse_pi_led_triggers *trigs =
+ container_of(led_cdev->trigger, struct pse_pi_led_triggers,
+ enabled);
+
+ mutex_lock(&trigs->pcdev->lock);
+ trigs->nr_enabled--;
+ mutex_unlock(&trigs->pcdev->lock);
+}
+
+static int pse_led_trigger_register(struct device *dev,
+ struct led_trigger *trig, int id,
+ const char *state,
+ int (*activate)(struct led_classdev *),
+ void (*deactivate)(struct led_classdev *))
+{
+ trig->name = devm_kasprintf(dev, GFP_KERNEL, "pse-%s:pi%d:%s",
+ dev_name(dev), id, state);
+ if (!trig->name)
+ return -ENOMEM;
+ trig->activate = activate;
+ trig->deactivate = deactivate;
+
+ return devm_led_trigger_register(dev, trig);
+}
+
+static int pse_led_pi_triggers_register(struct pse_controller_dev *pcdev,
+ int id)
+{
+ struct pse_pi_led_triggers *trigs;
+ struct device *dev = pcdev->dev;
+ int ret;
+
+ trigs = devm_kzalloc(dev, sizeof(*trigs), GFP_KERNEL);
+ if (!trigs)
+ return -ENOMEM;
+
+ trigs->pcdev = pcdev;
+ trigs->id = id;
+ /* Set it before registering, so "delivering" still works if
+ * "enabled" fails. Take the lock, the refresh may already run.
+ */
+ mutex_lock(&pcdev->lock);
+ pcdev->pi[id].led_trigs = trigs;
+ mutex_unlock(&pcdev->lock);
+
+ ret = pse_led_trigger_register(dev, &trigs->delivering, id,
+ "delivering",
+ pse_led_delivering_activate,
+ pse_led_delivering_deactivate);
+ if (ret)
+ return ret;
+
+ return pse_led_trigger_register(dev, &trigs->enabled, id,
+ "enabled",
+ pse_led_enabled_activate,
+ pse_led_enabled_deactivate);
+}
+
+static void pse_led_triggers_register(struct pse_controller_dev *pcdev)
+{
+ int i, ret;
+
+ for (i = 0; i < pcdev->nr_lines; i++) {
+ /* Skip PIs not described in device tree */
+ if (!pcdev->no_of_pse_pi && !pcdev->pi[i].np)
+ continue;
+
+ ret = pse_led_pi_triggers_register(pcdev, i);
+ /* LEDs are optional and must not stop PoE */
+ if (ret)
+ dev_warn(pcdev->dev,
+ "PI %d: LED triggers failed: %pe\n", i,
+ ERR_PTR(ret));
+ }
+}
+
+/* Software power control has just started for some PIs. Their "enabled"
+ * LED must now show the admin state that the core keeps.
+ */
+static void pse_led_sync_sw_pw_control(struct pse_controller_dev *pcdev)
+{
+ int i;
+
+ /* Not registered yet, so no LED is bound */
+ if (!pcdev->pi)
+ return;
+
+ for (i = 0; i < pcdev->nr_lines; i++) {
+ mutex_lock(&pcdev->lock);
+ if (pse_pw_d_is_sw_pw_control(pcdev, pcdev->pi[i].pw_d))
+ pse_led_update(pcdev, i);
+ mutex_unlock(&pcdev->lock);
+ }
+}
+#else
+static void pse_led_update(struct pse_controller_dev *pcdev, int id) {}
+static void pse_led_refresh_worker(struct work_struct *work) {}
+static void pse_led_triggers_register(struct pse_controller_dev *pcdev) {}
+static void pse_led_sync_sw_pw_control(struct pse_controller_dev *pcdev) {}
+#endif /* CONFIG_PSE_LED_TRIGGERS */
+
static int pse_pi_enable(struct regulator_dev *rdev)
{
struct pse_controller_dev *pcdev = rdev_get_drvdata(rdev);
@@ -727,6 +1070,7 @@ static int pse_pi_enable(struct regulator_dev *rdev)
pcdev->pi[id].admin_state_enabled = 1;
ret = 0;
}
+ pse_led_update(pcdev, id);
mutex_unlock(&pcdev->lock);
return ret;
}
@@ -734,6 +1078,7 @@ static int pse_pi_enable(struct regulator_dev *rdev)
ret = ops->pi_enable(pcdev, id);
if (!ret)
pcdev->pi[id].admin_state_enabled = 1;
+ pse_led_update(pcdev, id);
mutex_unlock(&pcdev->lock);
return ret;
@@ -751,6 +1096,7 @@ static int pse_pi_disable(struct regulator_dev *rdev)
ret = _pse_pi_disable(pcdev, id);
if (!ret)
pi->admin_state_enabled = 0;
+ pse_led_update(pcdev, id);
mutex_unlock(&pcdev->lock);
return 0;
@@ -929,6 +1275,17 @@ static void pse_pw_d_release(struct kref *kref)
kfree(pw_d);
}
+/* Set pi[id].pw_d under pcdev->lock. The PI regulator ops and the LED
+ * triggers can already run and read it under this lock.
+ */
+static void pse_pi_set_pw_d(struct pse_controller_dev *pcdev, int id,
+ struct pse_power_domain *pw_d)
+{
+ mutex_lock(&pcdev->lock);
+ pcdev->pi[id].pw_d = pw_d;
+ mutex_unlock(&pcdev->lock);
+}
+
/* Clear pi[id].pw_d before the domain's reference is dropped. The PI
* regulator ops and the event handler hold pcdev->lock while they use it.
*/
@@ -1036,7 +1393,7 @@ static int pse_register_pw_ds(struct pse_controller_dev *pcdev)
if (regulator_is_equal(pi->rdev->supply,
rdev->supply)) {
present = true;
- pcdev->pi[i].pw_d = pw_d;
+ pse_pi_set_pw_d(pcdev, i, pw_d);
break;
}
}
@@ -1059,7 +1416,7 @@ static int pse_register_pw_ds(struct pse_controller_dev *pcdev)
kref_init(&pw_d->refcnt);
INIT_LIST_HEAD(&pw_d->pis);
list_add_tail(&pcdev->pi[i].pw_d_node, &pw_d->pis);
- pcdev->pi[i].pw_d = pw_d;
+ pse_pi_set_pw_d(pcdev, i, pw_d);
}
out:
@@ -1133,6 +1490,7 @@ int pse_controller_register(struct pse_controller_dev *pcdev)
return ret;
}
INIT_WORK(&pcdev->ntf_work, pse_send_ntf_worker);
+ INIT_DELAYED_WORK(&pcdev->led_work, pse_led_refresh_worker);
if (!pcdev->ops->pi_get_admin_state ||
!pcdev->ops->pi_get_pw_status) {
@@ -1173,6 +1531,12 @@ int pse_controller_register(struct pse_controller_dev *pcdev)
goto free_kfifo;
}
+ /* Register the LED triggers before the regulators: the regulator
+ * ops update the LEDs, so devres must remove the triggers after
+ * the regulators.
+ */
+ pse_led_triggers_register(pcdev);
+
/* Each regulator name len is pcdev dev name + 7 char +
* int max digit number (10) + 1
*/
@@ -1204,6 +1568,9 @@ int pse_controller_register(struct pse_controller_dev *pcdev)
if (ret)
goto free_kfifo;
+ /* LEDs bound so far did not know the power domains yet */
+ pse_led_sync_sw_pw_control(pcdev);
+
mutex_lock(&pse_list_mutex);
list_add(&pcdev->list, &pse_controller_list);
mutex_unlock(&pse_list_mutex);
@@ -1216,6 +1583,11 @@ int pse_controller_register(struct pse_controller_dev *pcdev)
return 0;
free_kfifo:
+ /* An LED may be bound already and has started the refresh */
+ mutex_lock(&pcdev->lock);
+ pcdev->unregistering = true;
+ mutex_unlock(&pcdev->lock);
+ cancel_delayed_work_sync(&pcdev->led_work);
cancel_work_sync(&pcdev->ntf_work);
kfifo_free(&pcdev->ntf_fifo);
return ret;
@@ -1240,6 +1612,7 @@ void pse_controller_unregister(struct pse_controller_dev *pcdev)
disable_irq(pcdev->irq);
if (pcdev->poll)
cancel_delayed_work_sync(&pcdev->poll->work);
+ cancel_delayed_work_sync(&pcdev->led_work);
/* Unlink before the PI array is freed: of_pse_control_get() walks
* the list and reads pcdev->pi[].
*/
@@ -1398,6 +1771,9 @@ static void pse_handle_events(struct pse_controller_dev *pcdev,
notifs |= ETHTOOL_PSE_EVENT_SW_PW_CONTROL_ERROR;
}
+ /* After pse_set_config_isr(), which can switch the PI */
+ pse_led_update(pcdev, i);
+
dev_dbg(pcdev->dev,
"Sending PSE notification EVT 0x%lx\n", notifs);
@@ -1535,6 +1911,11 @@ int devm_pse_irq_helper(struct pse_controller_dev *pcdev, int irq,
return ret;
}
+ /* With the "disabled" strategy, the IRQ starts software power
+ * control
+ */
+ pse_led_sync_sw_pw_control(pcdev);
+
return 0;
}
EXPORT_SYMBOL_GPL(devm_pse_irq_helper);
@@ -1661,11 +2042,21 @@ pse_control_get_internal(struct pse_controller_dev *pcdev, unsigned int index,
* aims to have the right value reported in the first is_enabled
* call in case of control managed by software.
*/
+ mutex_lock(&pcdev->lock);
ret = pse_pi_is_hw_enabled(pcdev, index);
+ if (ret >= 0) {
+ pcdev->pi[index].admin_state_enabled = ret;
+ /* The "enabled" LED shows this value only under software
+ * power control. Otherwise it reads the hardware, which did
+ * not change here.
+ */
+ if (pse_pw_d_is_sw_pw_control(pcdev, pcdev->pi[index].pw_d))
+ pse_led_update(pcdev, index);
+ }
+ mutex_unlock(&pcdev->lock);
if (ret < 0)
goto put_module;
- pcdev->pi[index].admin_state_enabled = ret;
psec->ps = regulator_get_exclusive(pcdev->dev,
rdev_get_name(pcdev->pi[index].rdev));
if (IS_ERR(psec->ps)) {
diff --git a/include/linux/pse-pd/pse.h b/include/linux/pse-pd/pse.h
index 008e16b7f72d..b8f30d9eceaf 100644
--- a/include/linux/pse-pd/pse.h
+++ b/include/linux/pse-pd/pse.h
@@ -222,6 +222,7 @@ struct device_node;
struct of_phandle_args;
struct pse_control;
struct pse_poll;
+struct pse_pi_led_triggers;
struct ethtool_pse_control_status;
/* PSE PI pairset pinout can either be Alternative A or Alternative B */
@@ -259,6 +260,7 @@ struct pse_pi_pairset {
* budget evaluation strategy.
* @pw_allocated_mW: Power allocated to a PSE PI to manage power budget in
* static budget evaluation strategy.
+ * @led_trigs: LED triggers of the PI, only used by the PSE core
*/
struct pse_pi {
struct pse_pi_pairset pairset[2];
@@ -270,6 +272,7 @@ struct pse_pi {
int prio;
bool isr_pd_detected;
int pw_allocated_mW;
+ struct pse_pi_led_triggers *led_trigs;
};
/**
@@ -303,10 +306,13 @@ struct pse_ntf {
* @supp_budget_eval_strategies: budget evaluation strategies supported
* by the PSE
* @ntf_work: workqueue for PSE notification management
+ * @led_work: reads "delivering" again while an LED uses it, only used by
+ * the core
* @ntf_fifo: PSE notifications FIFO
* @ntf_fifo_lock: protect @ntf_fifo writer
- * @unregistering: set under @lock when unregistering starts; the PSE
- * core switches no PI on after that
+ * @unregistering: set under @lock when unregistering starts or
+ * registering fails; the PSE core then switches no PI on
+ * and stops the LED refresh
*/
struct pse_controller_dev {
const struct pse_controller_ops *ops;
@@ -325,6 +331,7 @@ struct pse_controller_dev {
unsigned int pis_prio_max;
u32 supp_budget_eval_strategies;
struct work_struct ntf_work;
+ struct delayed_work led_work;
DECLARE_KFIFO_PTR(ntf_fifo, struct pse_ntf);
spinlock_t ntf_fifo_lock; /* Protect @ntf_fifo writer */
bool unregistering;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-05 13:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 13:37 [PATCH net-next v7 0/2] net: pse-pd: add poll path and LED trigger support Carlo Szelinsky
2026-12-05 13:37 ` [PATCH net-next v7 1/2] net: pse-pd: add devm_pse_poll_helper() Carlo Szelinsky
2026-12-05 13:37 ` [PATCH net-next v7 2/2] net: pse-pd: add LED triggers for each PI Carlo Szelinsky
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.