Commit 9c4ae064 authored by Alastair D'Silva's avatar Alastair D'Silva Committed by Michael Ellerman

ocxl: Rename struct link to ocxl_link

The term 'link' is ambiguous (especially when the struct is used for a
list), so rename it for clarity.
Signed-off-by: default avatarAlastair D'Silva <alastair@d-silva.org>
Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
Acked-by: default avatarFrederic Barrat <fbarrat@linux.ibm.com>
Acked-by: default avatarAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 012ae244
...@@ -151,10 +151,9 @@ static long afu_ioctl_enable_p9_wait(struct ocxl_context *ctx, ...@@ -151,10 +151,9 @@ static long afu_ioctl_enable_p9_wait(struct ocxl_context *ctx,
mutex_unlock(&ctx->status_mutex); mutex_unlock(&ctx->status_mutex);
if (status == ATTACHED) { if (status == ATTACHED) {
int rc; int rc = ocxl_link_update_pe(ctx->afu->fn->link,
struct link *link = ctx->afu->fn->link; ctx->pasid, ctx->tidr);
rc = ocxl_link_update_pe(link, ctx->pasid, ctx->tidr);
if (rc) if (rc)
return rc; return rc;
} }
......
...@@ -76,7 +76,7 @@ struct spa { ...@@ -76,7 +76,7 @@ struct spa {
* limited number of opencapi slots on a system and lookup is only * limited number of opencapi slots on a system and lookup is only
* done when the device is probed * done when the device is probed
*/ */
struct link { struct ocxl_link {
struct list_head list; struct list_head list;
struct kref ref; struct kref ref;
int domain; int domain;
...@@ -179,7 +179,7 @@ static void xsl_fault_handler_bh(struct work_struct *fault_work) ...@@ -179,7 +179,7 @@ static void xsl_fault_handler_bh(struct work_struct *fault_work)
static irqreturn_t xsl_fault_handler(int irq, void *data) static irqreturn_t xsl_fault_handler(int irq, void *data)
{ {
struct link *link = (struct link *) data; struct ocxl_link *link = (struct ocxl_link *) data;
struct spa *spa = link->spa; struct spa *spa = link->spa;
u64 dsisr, dar, pe_handle; u64 dsisr, dar, pe_handle;
struct pe_data *pe_data; struct pe_data *pe_data;
...@@ -254,7 +254,7 @@ static int map_irq_registers(struct pci_dev *dev, struct spa *spa) ...@@ -254,7 +254,7 @@ static int map_irq_registers(struct pci_dev *dev, struct spa *spa)
&spa->reg_tfc, &spa->reg_pe_handle); &spa->reg_tfc, &spa->reg_pe_handle);
} }
static int setup_xsl_irq(struct pci_dev *dev, struct link *link) static int setup_xsl_irq(struct pci_dev *dev, struct ocxl_link *link)
{ {
struct spa *spa = link->spa; struct spa *spa = link->spa;
int rc; int rc;
...@@ -309,7 +309,7 @@ static int setup_xsl_irq(struct pci_dev *dev, struct link *link) ...@@ -309,7 +309,7 @@ static int setup_xsl_irq(struct pci_dev *dev, struct link *link)
return rc; return rc;
} }
static void release_xsl_irq(struct link *link) static void release_xsl_irq(struct ocxl_link *link)
{ {
struct spa *spa = link->spa; struct spa *spa = link->spa;
...@@ -321,7 +321,7 @@ static void release_xsl_irq(struct link *link) ...@@ -321,7 +321,7 @@ static void release_xsl_irq(struct link *link)
unmap_irq_registers(spa); unmap_irq_registers(spa);
} }
static int alloc_spa(struct pci_dev *dev, struct link *link) static int alloc_spa(struct pci_dev *dev, struct ocxl_link *link)
{ {
struct spa *spa; struct spa *spa;
...@@ -348,7 +348,7 @@ static int alloc_spa(struct pci_dev *dev, struct link *link) ...@@ -348,7 +348,7 @@ static int alloc_spa(struct pci_dev *dev, struct link *link)
return 0; return 0;
} }
static void free_spa(struct link *link) static void free_spa(struct ocxl_link *link)
{ {
struct spa *spa = link->spa; struct spa *spa = link->spa;
...@@ -362,12 +362,12 @@ static void free_spa(struct link *link) ...@@ -362,12 +362,12 @@ static void free_spa(struct link *link)
} }
} }
static int alloc_link(struct pci_dev *dev, int PE_mask, struct link **out_link) static int alloc_link(struct pci_dev *dev, int PE_mask, struct ocxl_link **out_link)
{ {
struct link *link; struct ocxl_link *link;
int rc; int rc;
link = kzalloc(sizeof(struct link), GFP_KERNEL); link = kzalloc(sizeof(struct ocxl_link), GFP_KERNEL);
if (!link) if (!link)
return -ENOMEM; return -ENOMEM;
...@@ -403,7 +403,7 @@ static int alloc_link(struct pci_dev *dev, int PE_mask, struct link **out_link) ...@@ -403,7 +403,7 @@ static int alloc_link(struct pci_dev *dev, int PE_mask, struct link **out_link)
return rc; return rc;
} }
static void free_link(struct link *link) static void free_link(struct ocxl_link *link)
{ {
release_xsl_irq(link); release_xsl_irq(link);
free_spa(link); free_spa(link);
...@@ -413,7 +413,7 @@ static void free_link(struct link *link) ...@@ -413,7 +413,7 @@ static void free_link(struct link *link)
int ocxl_link_setup(struct pci_dev *dev, int PE_mask, void **link_handle) int ocxl_link_setup(struct pci_dev *dev, int PE_mask, void **link_handle)
{ {
int rc = 0; int rc = 0;
struct link *link; struct ocxl_link *link;
mutex_lock(&links_list_lock); mutex_lock(&links_list_lock);
list_for_each_entry(link, &links_list, list) { list_for_each_entry(link, &links_list, list) {
...@@ -440,7 +440,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_setup); ...@@ -440,7 +440,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_setup);
static void release_xsl(struct kref *ref) static void release_xsl(struct kref *ref)
{ {
struct link *link = container_of(ref, struct link, ref); struct ocxl_link *link = container_of(ref, struct ocxl_link, ref);
list_del(&link->list); list_del(&link->list);
/* call platform code before releasing data */ /* call platform code before releasing data */
...@@ -450,7 +450,7 @@ static void release_xsl(struct kref *ref) ...@@ -450,7 +450,7 @@ static void release_xsl(struct kref *ref)
void ocxl_link_release(struct pci_dev *dev, void *link_handle) void ocxl_link_release(struct pci_dev *dev, void *link_handle)
{ {
struct link *link = (struct link *) link_handle; struct ocxl_link *link = (struct ocxl_link *) link_handle;
mutex_lock(&links_list_lock); mutex_lock(&links_list_lock);
kref_put(&link->ref, release_xsl); kref_put(&link->ref, release_xsl);
...@@ -486,7 +486,7 @@ int ocxl_link_add_pe(void *link_handle, int pasid, u32 pidr, u32 tidr, ...@@ -486,7 +486,7 @@ int ocxl_link_add_pe(void *link_handle, int pasid, u32 pidr, u32 tidr,
void (*xsl_err_cb)(void *data, u64 addr, u64 dsisr), void (*xsl_err_cb)(void *data, u64 addr, u64 dsisr),
void *xsl_err_data) void *xsl_err_data)
{ {
struct link *link = (struct link *) link_handle; struct ocxl_link *link = (struct ocxl_link *) link_handle;
struct spa *spa = link->spa; struct spa *spa = link->spa;
struct ocxl_process_element *pe; struct ocxl_process_element *pe;
int pe_handle, rc = 0; int pe_handle, rc = 0;
...@@ -556,7 +556,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_add_pe); ...@@ -556,7 +556,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_add_pe);
int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid) int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid)
{ {
struct link *link = (struct link *) link_handle; struct ocxl_link *link = (struct ocxl_link *) link_handle;
struct spa *spa = link->spa; struct spa *spa = link->spa;
struct ocxl_process_element *pe; struct ocxl_process_element *pe;
int pe_handle, rc; int pe_handle, rc;
...@@ -592,7 +592,7 @@ int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid) ...@@ -592,7 +592,7 @@ int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid)
int ocxl_link_remove_pe(void *link_handle, int pasid) int ocxl_link_remove_pe(void *link_handle, int pasid)
{ {
struct link *link = (struct link *) link_handle; struct ocxl_link *link = (struct ocxl_link *) link_handle;
struct spa *spa = link->spa; struct spa *spa = link->spa;
struct ocxl_process_element *pe; struct ocxl_process_element *pe;
struct pe_data *pe_data; struct pe_data *pe_data;
...@@ -664,7 +664,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_remove_pe); ...@@ -664,7 +664,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_remove_pe);
int ocxl_link_irq_alloc(void *link_handle, int *hw_irq, u64 *trigger_addr) int ocxl_link_irq_alloc(void *link_handle, int *hw_irq, u64 *trigger_addr)
{ {
struct link *link = (struct link *) link_handle; struct ocxl_link *link = (struct ocxl_link *) link_handle;
int rc, irq; int rc, irq;
u64 addr; u64 addr;
...@@ -685,7 +685,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_irq_alloc); ...@@ -685,7 +685,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_irq_alloc);
void ocxl_link_free_irq(void *link_handle, int hw_irq) void ocxl_link_free_irq(void *link_handle, int hw_irq)
{ {
struct link *link = (struct link *) link_handle; struct ocxl_link *link = (struct ocxl_link *) link_handle;
pnv_ocxl_free_xive_irq(hw_irq); pnv_ocxl_free_xive_irq(hw_irq);
atomic_inc(&link->irq_available); atomic_inc(&link->irq_available);
......
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