linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	mikey@neuling.org, hbabu@us.ibm.com, nicholas.piggin@gmail.com,
	linuxppc-dev@ozlabs.org, <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 16/18] powerpc/vas: Define vas_win_paste_addr()
Date: Fri,  6 Oct 2017 19:28:16 -0700	[thread overview]
Message-ID: <1507343298-27496-17-git-send-email-sukadev@linux.vnet.ibm.com> (raw)
In-Reply-To: <1507343298-27496-1-git-send-email-sukadev@linux.vnet.ibm.com>

Define an interface that the NX drivers can use to find the physical
paste address of a send window. This interface is expected to be used
with the mmap() operation of the NX driver's device. i.e the user space
process can use driver's mmap() operation to map the send window's paste
address into their address space and then use copy and paste instructions
to submit the CRBs to the NX engine.

Note that kernel drivers will use vas_paste_crb() directly and don't need
this interface.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/vas.h              |  7 +++++++
 arch/powerpc/platforms/powernv/vas-window.c | 10 ++++++++++
 2 files changed, 17 insertions(+)

diff --git a/arch/powerpc/include/asm/vas.h b/arch/powerpc/include/asm/vas.h
index 044748f..f98ade8 100644
--- a/arch/powerpc/include/asm/vas.h
+++ b/arch/powerpc/include/asm/vas.h
@@ -10,6 +10,8 @@
 #ifndef _ASM_POWERPC_VAS_H
 #define _ASM_POWERPC_VAS_H
 
+struct vas_window;
+
 /*
  * Min and max FIFO sizes are based on Version 1.05 Section 3.1.4.25
  * (Local FIFO Size Register) of the VAS workbook.
@@ -165,4 +167,9 @@ int vas_copy_crb(void *crb, int offset);
  */
 int vas_paste_crb(struct vas_window *win, int offset, bool re);
 
+/*
+ * Return the power bus paste address associated with @win so the caller
+ * can map that address into their address space.
+ */
+extern u64 vas_win_paste_addr(struct vas_window *win);
 #endif /* __ASM_POWERPC_VAS_H */
diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c
index 088ce56..e4a9c7b 100644
--- a/arch/powerpc/platforms/powernv/vas-window.c
+++ b/arch/powerpc/platforms/powernv/vas-window.c
@@ -40,6 +40,16 @@ static void compute_paste_address(struct vas_window *window, u64 *addr, int *len
 	pr_debug("Txwin #%d: Paste addr 0x%llx\n", winid, *addr);
 }
 
+u64 vas_win_paste_addr(struct vas_window *win)
+{
+	u64 addr;
+
+	compute_paste_address(win, &addr, NULL);
+
+	return addr;
+}
+EXPORT_SYMBOL(vas_win_paste_addr);
+
 static inline void get_hvwc_mmio_bar(struct vas_window *window,
 			u64 *start, int *len)
 {
-- 
2.7.4

  parent reply	other threads:[~2017-10-07  2:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07  2:28 [PATCH v2 00/18] powerpc/vas: Add support for FTW Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 01/18] powerpc/vas: init missing fields from [rt]xattr Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 02/18] powerpc/vas: Validate window credits Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 03/18] powerpc/vas: Cleanup some debug code Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 04/18] powerpc/vas: Drop poll_window_cast_out() Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 05/18] powerpc/vas: Use helper to unpin/close window Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 06/18] powerpc/vas: Reduce polling interval for busy state Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 07/18] powerpc/vas: Save configured window credits Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 08/18] powerpc/vas: poll for return of " Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 09/18] powerpc/vas: Create cpu to vas id mapping Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 10/18] powerpc/vas, nx-842: Define and use chip_to_vas_id() Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 11/18] powerpc/vas: Export HVWC to debugfs Sukadev Bhattiprolu
2017-11-07 12:19   ` Michael Ellerman
2017-10-07  2:28 ` [PATCH v2 12/18] powerpc: have copy depend on CONFIG_BOOK3S_64 Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 13/18] powerpc: Add support for setting SPRN_TIDR Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 14/18] powerpc: Define set_thread_used_vas() Sukadev Bhattiprolu
2017-11-07  0:49   ` Nicholas Piggin
2017-11-09 11:01   ` Michael Ellerman
2017-10-07  2:28 ` [PATCH v2 15/18] powerpc: Emulate paste instruction Sukadev Bhattiprolu
2017-10-09 10:00   ` Michael Neuling
2017-10-10  5:54     ` Michael Ellerman
2017-10-07  2:28 ` Sukadev Bhattiprolu [this message]
2017-10-07  2:28 ` [PATCH v2 17/18] powerpc/vas: Define vas_win_id() Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 18/18] powerpc/vas: Add support for user receive window Sukadev Bhattiprolu

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=1507343298-27496-17-git-send-email-sukadev@linux.vnet.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=hbabu@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=nicholas.piggin@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).