[PATCH] NTB: epf: propagate memory window command errors
From: Avi Weiss
Date: Tue Oct 27 2026 - 12:04:50 EST
ntb_epf_mw_set_trans() and ntb_epf_mw_clear_trans() discard the result
of ntb_epf_send_command() and return success even when the endpoint
reports a command failure or fails to respond. This prevents NTB
clients from detecting a failed memory window operation.
Return the command status from both callbacks. Preserve the existing
teardown error diagnostic.
Fixes: 812ce2f8d14e ("NTB: Add support for EPF PCI Non-Transparent Bridge")
Signed-off-by: Avi Weiss <thnkslprpt@xxxxxxxxx>
---
drivers/ntb/hw/epf/ntb_hw_epf.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/ntb/hw/epf/ntb_hw_epf.c b/drivers/ntb/hw/epf/ntb_hw_epf.c
index c47607d4f8a7f..dd10c30bdbec4 100644
--- a/drivers/ntb/hw/epf/ntb_hw_epf.c
+++ b/drivers/ntb/hw/epf/ntb_hw_epf.c
@@ -498,18 +498,16 @@ static int ntb_epf_mw_set_trans(struct ntb_dev *ntb, int pidx, int idx,
writel(upper_32_bits(addr), ndev->ctrl_reg + NTB_EPF_UPPER_ADDR);
writel(lower_32_bits(size), ndev->ctrl_reg + NTB_EPF_LOWER_SIZE);
writel(upper_32_bits(size), ndev->ctrl_reg + NTB_EPF_UPPER_SIZE);
- ntb_epf_send_command(ndev, CMD_CONFIGURE_MW, idx);
-
- return 0;
+ return ntb_epf_send_command(ndev, CMD_CONFIGURE_MW, idx);
}
static int ntb_epf_mw_clear_trans(struct ntb_dev *ntb, int pidx, int idx)
{
struct ntb_epf_dev *ndev = ntb_ndev(ntb);
struct device *dev = ndev->dev;
- int ret = 0;
+ int ret;
- ntb_epf_send_command(ndev, CMD_TEARDOWN_MW, idx);
+ ret = ntb_epf_send_command(ndev, CMD_TEARDOWN_MW, idx);
if (ret)
dev_err(dev, "Failed to teardown memory window\n");
base-commit: d135ab453a7400a34930bdda1ef4bdc8acfac80e
--
2.43.0