diff options
author | Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> | 2017-11-07 18:23:51 -0800 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-11-12 09:03:09 +1100 |
commit | ece4e51291485bb4a71ff554964948b02ab89823 (patch) | |
tree | f722ec64af37c7c40a3a565869a565975e23b5c2 /arch/powerpc/platforms/powernv/vas.h | |
parent | d4ef61b5e8955fb913e2e1a6c1533414859a839d (diff) | |
download | linux-ece4e51291485bb4a71ff554964948b02ab89823.tar.gz |
powerpc/vas: Export HVWC to debugfs
Export the VAS Window context information to debugfs.
We need to hold a mutex when closing the window to prevent a race
with the debugfs read(). Rather than introduce a per-instance mutex,
we use the global vas_mutex for now, since it is not heavily contended.
The window->cop field is only relevant to a receive window so we were
not setting it for a send window (which is is paired to a receive window
anyway). But to simplify reporting in debugfs, set the 'cop' field for the
send window also.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/vas.h')
-rw-r--r-- | arch/powerpc/platforms/powernv/vas.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/vas.h b/arch/powerpc/platforms/powernv/vas.h index 02d8a31d9051..756cbc5335bc 100644 --- a/arch/powerpc/platforms/powernv/vas.h +++ b/arch/powerpc/platforms/powernv/vas.h @@ -13,6 +13,8 @@ #include <linux/idr.h> #include <asm/vas.h> #include <linux/io.h> +#include <linux/dcache.h> +#include <linux/mutex.h> /* * Overview of Virtual Accelerator Switchboard (VAS). @@ -317,6 +319,9 @@ struct vas_instance { struct mutex mutex; struct vas_window *rxwin[VAS_COP_TYPE_MAX]; struct vas_window *windows[VAS_WINDOWS_PER_CHIP]; + + char *dbgname; + struct dentry *dbgdir; }; /* @@ -334,6 +339,9 @@ struct vas_window { pid_t pid; /* Linux process id of owner */ int wcreds_max; /* Window credits */ + char *dbgname; + struct dentry *dbgdir; + /* Fields applicable only to send windows */ void *paste_kaddr; char *paste_addr_name; @@ -394,7 +402,13 @@ struct vas_winctx { enum vas_notify_after_count notify_after_count; }; +extern struct mutex vas_mutex; + extern struct vas_instance *find_vas_instance(int vasid); +extern void vas_init_dbgdir(void); +extern void vas_instance_init_dbgdir(struct vas_instance *vinst); +extern void vas_window_init_dbgdir(struct vas_window *win); +extern void vas_window_free_dbgdir(struct vas_window *win); static inline void vas_log_write(struct vas_window *win, char *name, void *regptr, u64 val) |