From: Carlo Szelinsky <github@szelinsky.de>
To: andrew@lunn.ch
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
github@szelinsky.de, kory.maincent@bootlin.com, kuba@kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
o.rempel@pengutronix.de, pabeni@redhat.com,
linux-leds@vger.kernel.org
Subject: Re: [PATCH] net: pse-pd: add LED trigger support
Date: Sat, 21 Mar 2026 18:55:46 +0100 [thread overview]
Message-ID: <20260321175546.282181-1-github@szelinsky.de> (raw)
In-Reply-To: <b42fb036-89da-48cd-9525-d05a065096d5@lunn.ch>
Hey Kory, Hey Oleksij,
Thanks again for taking the time to give detailed feedback. I am not really experienced with working on the kernel, so I took some time to process and get a clear picture. I will try to implement and test it asap... My action points would be the following:
1. Replace the LED specific polling with some generic devm_pse_poll_helper() that is based on the existing pse_isr() logic but in a timer instead of an IRQ - pushing events through ntf_fifo / pse_send_ntf_worker() like other IRQ-based controllers already do.
2. Fire LED triggers from the notification path, not from a separate poll loop: LEDs react to state changes e.g. they don't drive their own polling.
3. Fix pse_pw_d_is_sw_pw_control() - it currently requires pcdev->irq to be set in the PSE_BUDGET_EVAL_STRAT_DISABLED path, so poll-only controllers like hs104 would never enter software power control. Needs to also check for an active poll worker.
4. Add #define for the default poll interval (e.g. 500ms) with a comment explainin why.
Did I understand you correctly to not waste any time?
Unclear is for me still:
* Poll helper design: new devm_pse_poll_helper() vs extending devm_pse_irq_helper() with IRQ=0 fallback? I suggest a separate devm_pse_poll_helper() - it keeps the IRQ and poll paths clean and symmetric, and avoids overloading devm_pse_irq_helper() with conditional logic.
* Who decides to poll? The driver explicitly calls the poll helper, or the core auto-detects missing IRQ? I suggest the driver decides explicitly - the driver knows its hardware best, and an explicit call is easier to review and reason about than auto-detection magic.
* DT property: rename led-poll-interval-ms to poll-interval-ms since polling is now generic? I suggest yes - the polling is no longer LED-specific, so the property name should reflect that.
* Kory mentioned two distinct cases: (a) controller has no IRQ support at all (like the hs104), (b) controller supports IRQ but it's not wired on the board. Should both cases be handled by the same poll helper, or does (b) need different treatment? I suggest the same devm_pse_poll_helper() handles both - from the core's perspective the situation is identical: no IRQ available, need to poll. The driver just calls the poll helper instead of the IRQ helper in either case.
Have a nice weekend,
cheers.
next prev parent reply other threads:[~2026-03-21 17:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 23:59 [PATCH] net: pse-pd: add LED trigger support Carlo Szelinsky
2026-03-15 16:58 ` Oleksij Rempel
2026-03-15 21:12 ` Carlo Szelinsky
2026-03-16 6:12 ` Oleksij Rempel
2026-03-16 14:44 ` Kory Maincent
2026-03-18 20:55 ` Andrew Lunn
2026-03-21 17:55 ` Carlo Szelinsky [this message]
2026-03-23 10:30 ` Kory Maincent
2026-03-23 20:27 ` Carlo Szelinsky
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=20260321175546.282181-1-github@szelinsky.de \
--to=github@szelinsky.de \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.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