From: sashiko-bot@kernel.org
To: "Adam Young" <admiyo@os.amperecomputing.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v02] mailbox: pcc: report errors for PCC clients
Date: Mon, 18 May 2026 20:35:32 +0000 [thread overview]
Message-ID: <20260518203533.56E46C2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260518193006.27425-1-admiyo@os.amperecomputing.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Clients relying on `rx_callback` for completion will timeout on error because `mbox_chan_received_data` is skipped.
- [High] Slave subspace (Type 4) messages from the platform are silently dropped and acknowledged on error.
- [Medium] Positive ACPI status codes are leaked into the mailbox framework as error codes.
--
commit 02ebdabd8b273de3b908d80f12b3a4d373284736
Author: Adam Young <admiyo@os.amperecomputing.com>
mailbox: pcc: report errors for PCC clients
The commit modifies the PCC mailbox IRQ handler to read the error status
and pass it to the tx_done callback. It also skips the receive callback if
an error occurred.
> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> index 636879ae1db76..16b9ce087b9ec 100644
> --- a/drivers/mailbox/pcc.c
> +++ b/drivers/mailbox/pcc.c
[ ... ]
> @@ -327,8 +328,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
> if (!pcc_mbox_cmd_complete_check(pchan))
> return IRQ_NONE;
>
> - if (pcc_mbox_error_check_and_clear(pchan))
> - return IRQ_NONE;
> + rc = pcc_mbox_error_check_and_clear(pchan);
Can pcc_mbox_error_check_and_clear() return a positive acpi_status value
(like AE_ERROR) if pcc_chan_reg_read() fails?
If so, this positive value would be passed to mbox_chan_txdone(), which
might cause issues for clients that check if the returned error is less
than zero.
>
> /*
> * Clear this flag after updating interrupt ack register and just
> @@ -337,8 +337,9 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
> * required to avoid any possible race in updatation of this flag.
> */
> pchan->chan_in_use = false;
> - mbox_chan_received_data(chan, NULL);
> - mbox_chan_txdone(chan, 0);
> + if (!rc)
> + mbox_chan_received_data(chan, NULL);
Since clients like drivers/acpi/cppc_acpi.c and
drivers/soc/hisilicon/kunpeng_hccs.c rely on rx_callback (invoked by
mbox_chan_received_data()) to signal their completions, will skipping it
here cause them to block until their timeout expires instead of processing
the error?
For ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE channels used by the platform to
send notifications to the OS, does skipping mbox_chan_received_data() cause
the OS to silently drop the platform's notification?
> + mbox_chan_txdone(chan, rc);
>
> pcc_chan_acknowledge(pchan);
If a slave subspace notification is dropped due to an error, does calling
pcc_chan_acknowledge() falsely indicate to the platform that the
notification was successfully handled?
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260518193006.27425-1-admiyo@os.amperecomputing.com?part=1
next prev parent reply other threads:[~2026-05-18 20:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 19:30 [PATCH v02] mailbox: pcc: report errors for PCC clients Adam Young
2026-05-18 20:35 ` sashiko-bot [this message]
2026-05-19 3:26 ` Adam Young
2026-05-19 13:23 ` Sudeep Holla
2026-06-02 18:44 ` Adam Young
2026-06-03 15:15 ` Adam Young
2026-06-05 17:19 ` Adam Young
2026-05-19 13:54 ` lihuisong (C)
2026-05-19 16:25 ` Sudeep Holla
2026-05-20 11:53 ` lihuisong (C)
2026-05-20 13:32 ` Sudeep Holla
2026-05-21 12:26 ` lihuisong (C)
2026-05-22 16:52 ` Adam Young
2026-05-26 3:53 ` lihuisong (C)
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=20260518203533.56E46C2BCB7@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=admiyo@os.amperecomputing.com \
--cc=linux-hwmon@vger.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 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.