Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] net: airoha: malformed placeholder Fixes trailer in commit message Pre-existing issues: - [Medium] airoha_npu_send_msg() maps the caller's buffer with dma_map_single(..., DMA_BIDIRECTIONAL) and writes its bus address to… -- net: airoha: fix NPU mailbox notification ordering This patch changes the write order in airoha_npu_send_msg(). The function information is now written to CTRL(3) before the CTRL(2) message counter is incremented. Incrementing that counter is what tells the NPU a new message is ready, so the NPU now sees the function information before the notification.
> diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c > index edec6b1118956..7f7cdc2553ad4 100644 > --- a/drivers/net/ethernet/airoha/airoha_npu.c > +++ b/drivers/net/ethernet/airoha/airoha_npu.c > @@ -178,10 +178,10 @@ static int airoha_npu_send_msg(struct airoha_npu *npu, int func_id, > > regmap_write(npu->regmap, REG_CR_MBQ0_CTRL(0) + offset, dma_addr); > regmap_write(npu->regmap, REG_CR_MBQ0_CTRL(1) + offset, size); > - regmap_read(npu->regmap, REG_CR_MBQ0_CTRL(2) + offset, &val); > - regmap_write(npu->regmap, REG_CR_MBQ0_CTRL(2) + offset, val + 1); > val = FIELD_PREP(MBOX_MSG_FUNC_ID, func_id) | MBOX_MSG_WAIT_RSP; > regmap_write(npu->regmap, REG_CR_MBQ0_CTRL(3) + offset, val); > + regmap_read(npu->regmap, REG_CR_MBQ0_CTRL(2) + offset, &val); > + regmap_write(npu->regmap, REG_CR_MBQ0_CTRL(2) + offset, val + 1); > > ret = regmap_read_poll_timeout_atomic(npu->regmap, > REG_CR_MBQ0_CTRL(3) + offset,
[Severity: Low] The Fixes tag in the commit message still contains the template placeholder: Fixes: REAL_LINUX_SHA ("EXACT_ORIGINAL_COMMIT_SUBJECT") That is not a valid trailer. checkpatch will flag it. The stable tooling also has no commit to match against, so this fix may not be picked up for the kernels that carry the original ordering. The history suggests that airoha_npu_send_msg() and the original CTRL(2)-then-CTRL(3) write sequence came in with the initial NPU support. If so, the tag should read: Fixes: 23290c7bc190 ("net: airoha: Introduce Airoha NPU support") Could you confirm that this is the commit that introduced the problem and update the trailer in v2? [Severity: Medium] This is a pre-existing issue, not one introduced by this patch. What happens to the DMA buffer when this poll times out? After the CTRL(2) increment, the poll waits for MBOX_MSG_DONE with a timeout of 100 * MSEC_PER_SEC us, which is 100 ms. On -ETIMEDOUT the rest of airoha_npu_send_msg() runs as normal: spin_unlock_bh(&npu->cores[core].lock); dma_unmap_single(npu->dev, dma_addr, size, DMA_BIDIRECTIONAL); return ret; On this path nothing tells the NPU to drop the message. CTRL(0) and CTRL(1) still hold the buffer address and size, and the counter is not rolled back. Every caller then frees the buffer, whatever the return value. For example, in airoha_npu_wlan_msg_send(): err = airoha_npu_send_msg(npu, NPU_FUNC_WIFI, wlan_data, len); kfree(wlan_data); The same holds for airoha_npu_wlan_msg_get(), airoha_npu_ppe_init(), airoha_npu_ppe_deinit(), airoha_npu_ppe_flush_sram_entries(), airoha_npu_foe_commit_entry() and airoha_npu_ppe_stats_setup(). The NPU writes responses back into this buffer. Could it then DMA into memory that is already unmapped and freed, if the firmware finishes a timed-out request late? A later airoha_npu_send_msg() call would also overwrite CTRL(0), CTRL(1) and CTRL(3) while the earlier request might still be in progress. Whether the firmware actually completes a request after the host gives up cannot be confirmed from the kernel source alone. The follow-up patch in this series, "net: airoha: retry WLAN initialization commands", resends WLAN init commands after a failure, including -ETIMEDOUT, without any abort step. Does that make the timeout-then-reuse sequence more likely? Would it help to have an abort or ownership handshake with the NPU before unmapping and freeing the buffer on timeout?
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40airoha.com