Commit cf33e1e9 authored by Haren Myneni's avatar Haren Myneni Committed by Michael Ellerman

powerpc/vas: Print CRB and FIFO values

Dump FIFO entries if could not find send window and print CRB
for debugging.
Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: default avatarHaren Myneni <haren@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1587017099.2275.1067.camel@hbabu-laptop
parent 461862ef
...@@ -26,6 +26,28 @@ ...@@ -26,6 +26,28 @@
*/ */
#define VAS_FAULT_WIN_FIFO_SIZE (4 << 20) #define VAS_FAULT_WIN_FIFO_SIZE (4 << 20)
static void dump_crb(struct coprocessor_request_block *crb)
{
struct data_descriptor_entry *dde;
struct nx_fault_stamp *nx;
dde = &crb->source;
pr_devel("SrcDDE: addr 0x%llx, len %d, count %d, idx %d, flags %d\n",
be64_to_cpu(dde->address), be32_to_cpu(dde->length),
dde->count, dde->index, dde->flags);
dde = &crb->target;
pr_devel("TgtDDE: addr 0x%llx, len %d, count %d, idx %d, flags %d\n",
be64_to_cpu(dde->address), be32_to_cpu(dde->length),
dde->count, dde->index, dde->flags);
nx = &crb->stamp.nx;
pr_devel("NX Stamp: PSWID 0x%x, FSA 0x%llx, flags 0x%x, FS 0x%x\n",
be32_to_cpu(nx->pswid),
be64_to_cpu(crb->stamp.nx.fault_storage_addr),
nx->flags, nx->fault_status);
}
/* /*
* Update the CSB to indicate a translation error. * Update the CSB to indicate a translation error.
* *
...@@ -148,6 +170,23 @@ static void update_csb(struct vas_window *window, ...@@ -148,6 +170,23 @@ static void update_csb(struct vas_window *window,
pid_vnr(pid), rc); pid_vnr(pid), rc);
} }
static void dump_fifo(struct vas_instance *vinst, void *entry)
{
unsigned long *end = vinst->fault_fifo + vinst->fault_fifo_size;
unsigned long *fifo = entry;
int i;
pr_err("Fault fifo size %d, Max crbs %d\n", vinst->fault_fifo_size,
vinst->fault_fifo_size / CRB_SIZE);
/* Dump 10 CRB entries or until end of FIFO */
pr_err("Fault FIFO Dump:\n");
for (i = 0; i < 10*(CRB_SIZE/8) && fifo < end; i += 4, fifo += 4) {
pr_err("[%.3d, %p]: 0x%.16lx 0x%.16lx 0x%.16lx 0x%.16lx\n",
i, fifo, *fifo, *(fifo+1), *(fifo+2), *(fifo+3));
}
}
/* /*
* Process valid CRBs in fault FIFO. * Process valid CRBs in fault FIFO.
* NX process user space requests, return credit and update the status * NX process user space requests, return credit and update the status
...@@ -233,6 +272,7 @@ irqreturn_t vas_fault_thread_fn(int irq, void *data) ...@@ -233,6 +272,7 @@ irqreturn_t vas_fault_thread_fn(int irq, void *data)
vinst->vas_id, vinst->fault_fifo, fifo, vinst->vas_id, vinst->fault_fifo, fifo,
vinst->fault_crbs); vinst->fault_crbs);
dump_crb(crb);
window = vas_pswid_to_window(vinst, window = vas_pswid_to_window(vinst,
be32_to_cpu(crb->stamp.nx.pswid)); be32_to_cpu(crb->stamp.nx.pswid));
...@@ -245,6 +285,7 @@ irqreturn_t vas_fault_thread_fn(int irq, void *data) ...@@ -245,6 +285,7 @@ irqreturn_t vas_fault_thread_fn(int irq, void *data)
* But we should not get here. * But we should not get here.
* TODO: Disable IRQ. * TODO: Disable IRQ.
*/ */
dump_fifo(vinst, (void *)entry);
pr_err("VAS[%d] fault_fifo %p, fifo %p, pswid 0x%x, fault_crbs %d bad CRB?\n", pr_err("VAS[%d] fault_fifo %p, fifo %p, pswid 0x%x, fault_crbs %d bad CRB?\n",
vinst->vas_id, vinst->fault_fifo, fifo, vinst->vas_id, vinst->fault_fifo, fifo,
be32_to_cpu(crb->stamp.nx.pswid), be32_to_cpu(crb->stamp.nx.pswid),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment