summaryrefslogtreecommitdiff
path: root/drivers/misc/ocxl/link.c
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.vnet.ibm.com>2018-01-23 12:31:43 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2018-01-24 11:42:59 +1100
commit280b983ce2b8759722d911ea4b5af66e95d84e09 (patch)
treed3f3ffe5ee5acd780749b690921e97c09aa76845 /drivers/misc/ocxl/link.c
parentaeddad1760aeb206d912b27b230269407efd5b06 (diff)
ocxl: Add a kernel API for other opencapi drivers
Some of the functions done by the generic driver should also be needed by other opencapi drivers: attaching a context to an adapter, translation fault handling, AFU interrupt allocation... So to avoid code duplication, the driver provides a kernel API that other drivers can use, similar to calling a in-kernel library. It is still a bit theoretical, for lack of real hardware, and will likely need adjustements down the road. But we used the cxlflash driver as a guinea pig. Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/ocxl/link.c')
-rw-r--r--drivers/misc/ocxl/link.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/ocxl/link.c b/drivers/misc/ocxl/link.c
index 8bdcef9c3cba..fbca3feec592 100644
--- a/drivers/misc/ocxl/link.c
+++ b/drivers/misc/ocxl/link.c
@@ -5,6 +5,7 @@
#include <linux/mmu_context.h>
#include <asm/copro.h>
#include <asm/pnv-ocxl.h>
+#include <misc/ocxl.h>
#include "ocxl_internal.h"
@@ -420,6 +421,7 @@ unlock:
mutex_unlock(&links_list_lock);
return rc;
}
+EXPORT_SYMBOL_GPL(ocxl_link_setup);
static void release_xsl(struct kref *ref)
{
@@ -439,6 +441,7 @@ void ocxl_link_release(struct pci_dev *dev, void *link_handle)
kref_put(&link->ref, release_xsl);
mutex_unlock(&links_list_lock);
}
+EXPORT_SYMBOL_GPL(ocxl_link_release);
static u64 calculate_cfg_state(bool kernel)
{
@@ -533,6 +536,7 @@ unlock:
mutex_unlock(&spa->spa_lock);
return rc;
}
+EXPORT_SYMBOL_GPL(ocxl_link_add_pe);
int ocxl_link_remove_pe(void *link_handle, int pasid)
{
@@ -601,6 +605,7 @@ unlock:
mutex_unlock(&spa->spa_lock);
return rc;
}
+EXPORT_SYMBOL_GPL(ocxl_link_remove_pe);
int ocxl_link_irq_alloc(void *link_handle, int *hw_irq, u64 *trigger_addr)
{
@@ -621,6 +626,7 @@ int ocxl_link_irq_alloc(void *link_handle, int *hw_irq, u64 *trigger_addr)
*trigger_addr = addr;
return 0;
}
+EXPORT_SYMBOL_GPL(ocxl_link_irq_alloc);
void ocxl_link_free_irq(void *link_handle, int hw_irq)
{
@@ -629,3 +635,4 @@ void ocxl_link_free_irq(void *link_handle, int hw_irq)
pnv_ocxl_free_xive_irq(hw_irq);
atomic_inc(&link->irq_available);
}
+EXPORT_SYMBOL_GPL(ocxl_link_free_irq);