From: Avi Weiss <thnkslprpt@gmail.com>
To: Jon Mason <jdmason@kudzu.us>
Cc: Dave Jiang <dave.jiang@intel.com>,
Allen Hubbe <allenbh@gmail.com>, Koichiro Den <den@valinux.co.jp>,
Frank Li <Frank.Li@nxp.com>,
ntb@lists.linux.dev, linux-kernel@vger.kernel.org,
Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] NTB: epf: propagate memory window command errors
Date: Tue, 27 Oct 2026 17:49:53 +0200 [thread overview]
Message-ID: <20261027154952.250683-2-thnkslprpt@gmail.com> (raw)
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@gmail.com>
---
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
next reply other threads:[~2026-10-27 15:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 15:49 Avi Weiss [this message]
2026-10-28 5:47 ` Koichiro Den
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=20261027154952.250683-2-thnkslprpt@gmail.com \
--to=thnkslprpt@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=allenbh@gmail.com \
--cc=dave.jiang@intel.com \
--cc=den@valinux.co.jp \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=ntb@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
all inboxes | Powered by JetHome®