From: sashiko-bot@kernel.org
To: "Jonas Jelonek" <jelonek.jonas@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH net-next v14 2/4] net: pse-pd: add Realtek PSE MCU core
Date: Fri, 14 Aug 2026 22:21:09 +0000 [thread overview]
Message-ID: <20260814222110.615E41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813222036.873930-3-jelonek.jonas@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] rtpse_mcu_resp_is_final() excludes RTPSE_MCU_OPCODE_NOT_READY, which breaks the bounded retry mechanism.
--
--- Patch [2]: [PATCH net-next v14 2/4] net: pse-pd: add Realtek PSE MCU core ---
commit 4ec3b6f7573cbef331580bfd04e92ce4ccdb71d2
Author: Jonas Jelonek <jelonek.jonas@gmail.com>
net: pse-pd: add Realtek PSE MCU core
This commit introduces the core driver module for the microcontroller
fronting PSE silicon on Realtek-based PoE switches. It implements the
message-based protocol, parsing for Gen1 and Gen2 dialects, and exposes
a registration interface for transport drivers.
> --- /dev/null
> +++ b/drivers/net/pse-pd/realtek-pse-mcu.h
> @@ -0,0 +1,94 @@
[ ... ]
> +/*
> + * A polling transport can stop here: the reply to this request (opcode and
> + * seq_num) or a terminal error. The seq_num rejects a stale normal reply; the
> + * terminal errors match unconditionally, as a request the MCU couldn't parse
> + * carries no seq_num to correlate against.
> + */
> +static inline bool rtpse_mcu_resp_is_final(const struct rtpse_mcu_msg *req,
> + const struct rtpse_mcu_msg *resp)
> +{
> + return (resp->opcode == req->opcode && resp->seq_num == req->seq_num) ||
> + resp->opcode == RTPSE_MCU_OPCODE_INCOMPLETE ||
> + resp->opcode == RTPSE_MCU_OPCODE_BAD_CSUM;
> +}
[Severity: Medium]
Does rtpse_mcu_resp_is_final() need to include RTPSE_MCU_OPCODE_NOT_READY?
If a polling transport relies on this helper to wait for the MCU response, it
will ignore NOT_READY messages and continue polling until it times out.
This would prevent the core driver from handling the transient busy state, as
the transport would return a timeout error instead of passing the NOT_READY
reply back to rtpse_mcu_do_xfer() for its bounded retry loop:
drivers/net/pse-pd/realtek-pse-mcu-core.c:rtpse_mcu_do_xfer() {
...
ret = pse->transport->recv(pse, req, resp);
if (ret)
return ret;
...
/* NOT_READY: MCU busy, wants the command resent; bounded retry. */
if (resp->opcode != RTPSE_MCU_OPCODE_NOT_READY ||
tries >= RTPSE_MCU_NOT_READY_RETRIES)
break;
msleep(RTPSE_MCU_RESPONSE_MS);
...
}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813222036.873930-1-jelonek.jonas@gmail.com?part=2
next prev parent reply other threads:[~2026-08-14 22:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 22:20 [PATCH net-next v14 0/4] net: pse-pd: add Realtek PSE MCU support Jonas Jelonek
2026-08-13 22:20 ` [PATCH net-next v14 1/4] dt-bindings: net: pse-pd: add bindings for Realtek PSE MCU Jonas Jelonek
2026-08-13 22:20 ` [PATCH net-next v14 2/4] net: pse-pd: add Realtek PSE MCU core Jonas Jelonek
2026-08-14 22:21 ` sashiko-bot [this message]
2026-08-13 22:20 ` [PATCH net-next v14 3/4] net: pse-pd: realtek-pse-mcu: add I2C transport Jonas Jelonek
2026-08-13 22:20 ` [PATCH net-next v14 4/4] net: pse-pd: realtek-pse-mcu: add UART transport Jonas Jelonek
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=20260814222110.615E41F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jelonek.jonas@gmail.com \
--cc=robh@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox