[PATCH 3/3] s390/pci: Add function handle to RPCIT insn trace
From: Gerd Bayer
Date: Wed Oct 07 2026 - 08:02:56 EST
In certain debug situations it would be helpful, if the insn trace for a
failing RPCIT would reveal the PCI function on which this was attempted.
Introduce a variant of zpci_err_insn_req() called zpci_err_insn_rpcit()
that accepts an IO virtual address and a range parameter together with
the req conveying the function handle. Switch zpci_refresh_trans() to
use that new error trace.
Signed-off-by: Gerd Bayer <gbayer@xxxxxxxxxxxxx>
Reviewed-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx>
---
arch/s390/pci/pci_insn.c | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/arch/s390/pci/pci_insn.c b/arch/s390/pci/pci_insn.c
index 053afb3e7a99..ae9ed4aa2ec9 100644
--- a/arch/s390/pci/pci_insn.c
+++ b/arch/s390/pci/pci_insn.c
@@ -29,18 +29,40 @@ struct zpci_err_insn_data {
union {
struct {
u64 req;
- u64 offset;
+ union {
+ /* PCILG/PCISTG/MPCIFC */
+ struct {
+ u64 offset;
+ u64: 64;
+ };
+ /* RPCIT */
+ struct {
+ u64 iova;
+ u64 range;
+ };
+ };
};
+ /* PCILGI/PCISTGI */
struct {
u64 addr;
u64 len;
+ u64: 64;
};
};
- u64: 64;
};
static_assert(sizeof(struct zpci_err_insn_data) <= ZPCI_ERR_INSN_DATA_SIZE);
+static inline void zpci_err_insn_rpcit(int lvl, u8 insn, u8 cc, u8 status,
+ u64 req, u64 iova, u64 range)
+{
+ struct zpci_err_insn_data data = {
+ .insn = insn, .cc = cc, .status = status,
+ .req = req, .iova = iova, .range = range};
+
+ zpci_err_hex_level(lvl, &data, sizeof(data));
+}
+
static inline void zpci_err_insn_req(int lvl, u8 insn, u8 cc, u8 status,
u64 req, u64 offset)
{
@@ -128,16 +150,16 @@ int zpci_refresh_trans(u32 fh, u64 addr, u64 range)
if (cc == 2) {
udelay(ZPCI_INSN_BUSY_DELAY);
if (!retried) {
- zpci_err_insn_addr(1, 'R', cc, status, addr, range);
+ zpci_err_insn_rpcit(1, 'R', cc, status, req, addr, range);
retried = true;
}
}
} while (cc == 2);
if (cc)
- zpci_err_insn_addr(0, 'R', cc, status, addr, range);
+ zpci_err_insn_rpcit(0, 'R', cc, status, req, addr, range);
else if (retried)
- zpci_err_insn_addr(1, 'R', cc, status, addr, range);
+ zpci_err_insn_rpcit(1, 'R', cc, status, req, addr, range);
if (cc == 1 && (status == 4 || status == 16))
return -ENOMEM;
--
2.53.0