Lines Matching +full:num +full:- +full:irqs

1 // SPDX-License-Identifier: GPL-2.0-or-later
28 * Pseudo-filesystem to allocate inodes.
38 return init_pseudo(fc, OCXLFLASH_FS_MAGIC) ? 0 : -ENOMEM; in ocxlflash_fs_init_fs_context()
49 * ocxlflash_release_mapping() - release the memory mapping
54 if (ctx->mapping) in ocxlflash_release_mapping()
56 ctx->mapping = NULL; in ocxlflash_release_mapping()
60 * ocxlflash_getfile() - allocate pseudo filesystem, inode, and the file
77 if (fops->owner && !try_module_get(fops->owner)) { in ocxlflash_getfile()
79 rc = -ENOENT; in ocxlflash_getfile()
91 inode = alloc_anon_inode(ocxlflash_vfs_mount->mnt_sb); in ocxlflash_getfile()
108 file->private_data = priv; in ocxlflash_getfile()
116 module_put(fops->owner); in ocxlflash_getfile()
123 * ocxlflash_psa_map() - map the process specific MMIO space
131 struct device *dev = ctx->hw_afu->dev; in ocxlflash_psa_map()
133 mutex_lock(&ctx->state_mutex); in ocxlflash_psa_map()
134 if (ctx->state != STARTED) { in ocxlflash_psa_map()
136 ctx->state); in ocxlflash_psa_map()
137 mutex_unlock(&ctx->state_mutex); in ocxlflash_psa_map()
140 mutex_unlock(&ctx->state_mutex); in ocxlflash_psa_map()
142 return ioremap(ctx->psn_phys, ctx->psn_size); in ocxlflash_psa_map()
146 * ocxlflash_psa_unmap() - unmap the process specific MMIO space
155 * ocxlflash_process_element() - get process element of the adapter context
164 return ctx->pe; in ocxlflash_process_element()
168 * afu_map_irq() - map the interrupt of the adapter context
171 * @num: Per-context AFU interrupt number.
176 * Return: 0 on success, -errno on failure
178 static int afu_map_irq(u64 flags, struct ocxlflash_context *ctx, int num, in afu_map_irq() argument
181 struct ocxl_hw_afu *afu = ctx->hw_afu; in afu_map_irq()
182 struct device *dev = afu->dev; in afu_map_irq()
188 if (num < 0 || num >= ctx->num_irqs) { in afu_map_irq()
189 dev_err(dev, "%s: Interrupt %d not allocated\n", __func__, num); in afu_map_irq()
190 rc = -ENOENT; in afu_map_irq()
194 irq = &ctx->irqs[num]; in afu_map_irq()
195 virq = irq_create_mapping(NULL, irq->hwirq); in afu_map_irq()
198 rc = -ENOMEM; in afu_map_irq()
211 rc = -ENXIO; in afu_map_irq()
215 irq->virq = virq; in afu_map_irq()
216 irq->vtrig = xd->trig_mmio; in afu_map_irq()
227 * ocxlflash_map_afu_irq() - map the interrupt of the adapter context
229 * @num: Per-context AFU interrupt number.
234 * Return: 0 on success, -errno on failure
236 static int ocxlflash_map_afu_irq(void *ctx_cookie, int num, in ocxlflash_map_afu_irq() argument
240 return afu_map_irq(0, ctx_cookie, num, handler, cookie, name); in ocxlflash_map_afu_irq()
244 * afu_unmap_irq() - unmap the interrupt
247 * @num: Per-context AFU interrupt number.
250 static void afu_unmap_irq(u64 flags, struct ocxlflash_context *ctx, int num, in afu_unmap_irq() argument
253 struct ocxl_hw_afu *afu = ctx->hw_afu; in afu_unmap_irq()
254 struct device *dev = afu->dev; in afu_unmap_irq()
257 if (num < 0 || num >= ctx->num_irqs) { in afu_unmap_irq()
258 dev_err(dev, "%s: Interrupt %d not allocated\n", __func__, num); in afu_unmap_irq()
262 irq = &ctx->irqs[num]; in afu_unmap_irq()
264 if (irq_find_mapping(NULL, irq->hwirq)) { in afu_unmap_irq()
265 free_irq(irq->virq, cookie); in afu_unmap_irq()
266 irq_dispose_mapping(irq->virq); in afu_unmap_irq()
273 * ocxlflash_unmap_afu_irq() - unmap the interrupt
275 * @num: Per-context AFU interrupt number.
278 static void ocxlflash_unmap_afu_irq(void *ctx_cookie, int num, void *cookie) in ocxlflash_unmap_afu_irq() argument
280 return afu_unmap_irq(0, ctx_cookie, num, cookie); in ocxlflash_unmap_afu_irq()
284 * ocxlflash_get_irq_objhndl() - get the object handle for an interrupt
294 if (irq < 0 || irq >= ctx->num_irqs) in ocxlflash_get_irq_objhndl()
297 return (__force u64)ctx->irqs[irq].vtrig; in ocxlflash_get_irq_objhndl()
301 * ocxlflash_xsl_fault() - callback when translation error is triggered
310 spin_lock(&ctx->slock); in ocxlflash_xsl_fault()
311 ctx->fault_addr = addr; in ocxlflash_xsl_fault()
312 ctx->fault_dsisr = dsisr; in ocxlflash_xsl_fault()
313 ctx->pending_fault = true; in ocxlflash_xsl_fault()
314 spin_unlock(&ctx->slock); in ocxlflash_xsl_fault()
316 wake_up_all(&ctx->wq); in ocxlflash_xsl_fault()
320 * start_context() - local routine to start a context
325 * Return: 0 on success, -errno on failure
329 struct ocxl_hw_afu *afu = ctx->hw_afu; in start_context()
330 struct ocxl_afu_config *acfg = &afu->acfg; in start_context()
331 void *link_token = afu->link_token; in start_context()
332 struct device *dev = afu->dev; in start_context()
333 bool master = ctx->master; in start_context()
338 mutex_lock(&ctx->state_mutex); in start_context()
339 if (ctx->state != OPENED) { in start_context()
341 __func__, ctx->state); in start_context()
342 rc = -EINVAL; in start_context()
347 ctx->psn_size = acfg->global_mmio_size; in start_context()
348 ctx->psn_phys = afu->gmmio_phys; in start_context()
350 ctx->psn_size = acfg->pp_mmio_stride; in start_context()
351 ctx->psn_phys = afu->ppmmio_phys + (ctx->pe * ctx->psn_size); in start_context()
359 pid = current->mm->context.id; in start_context()
360 mm = current->mm; in start_context()
363 rc = ocxl_link_add_pe(link_token, ctx->pe, pid, 0, 0, mm, in start_context()
371 ctx->state = STARTED; in start_context()
373 mutex_unlock(&ctx->state_mutex); in start_context()
378 * ocxlflash_start_context() - start a kernel context
381 * Return: 0 on success, -errno on failure
391 * ocxlflash_stop_context() - stop a context
394 * Return: 0 on success, -errno on failure
399 struct ocxl_hw_afu *afu = ctx->hw_afu; in ocxlflash_stop_context()
400 struct ocxl_afu_config *acfg = &afu->acfg; in ocxlflash_stop_context()
401 struct pci_dev *pdev = afu->pdev; in ocxlflash_stop_context()
402 struct device *dev = afu->dev; in ocxlflash_stop_context()
406 mutex_lock(&ctx->state_mutex); in ocxlflash_stop_context()
407 state = ctx->state; in ocxlflash_stop_context()
408 ctx->state = CLOSED; in ocxlflash_stop_context()
409 mutex_unlock(&ctx->state_mutex); in ocxlflash_stop_context()
413 rc = ocxl_config_terminate_pasid(pdev, acfg->dvsec_afu_control_pos, in ocxlflash_stop_context()
414 ctx->pe); in ocxlflash_stop_context()
419 if (rc == -EBUSY) in ocxlflash_stop_context()
423 rc = ocxl_link_remove_pe(afu->link_token, ctx->pe); in ocxlflash_stop_context()
434 * ocxlflash_afu_reset() - reset the AFU
440 struct device *dev = ctx->hw_afu->dev; in ocxlflash_afu_reset()
450 * ocxlflash_set_master() - sets the context as master
457 ctx->master = true; in ocxlflash_set_master()
461 * ocxlflash_get_context() - obtains the context associated with the host
471 return afu->ocxl_ctx; in ocxlflash_get_context()
475 * ocxlflash_dev_context_init() - allocate and initialize an adapter context
484 struct device *dev = afu->dev; in ocxlflash_dev_context_init()
491 rc = -ENOMEM; in ocxlflash_dev_context_init()
496 rc = idr_alloc(&afu->idr, ctx, 0, afu->max_pasid, GFP_NOWAIT); in ocxlflash_dev_context_init()
503 spin_lock_init(&ctx->slock); in ocxlflash_dev_context_init()
504 init_waitqueue_head(&ctx->wq); in ocxlflash_dev_context_init()
505 mutex_init(&ctx->state_mutex); in ocxlflash_dev_context_init()
507 ctx->state = OPENED; in ocxlflash_dev_context_init()
508 ctx->pe = rc; in ocxlflash_dev_context_init()
509 ctx->master = false; in ocxlflash_dev_context_init()
510 ctx->mapping = NULL; in ocxlflash_dev_context_init()
511 ctx->hw_afu = afu; in ocxlflash_dev_context_init()
512 ctx->irq_bitmap = 0; in ocxlflash_dev_context_init()
513 ctx->pending_irq = false; in ocxlflash_dev_context_init()
514 ctx->pending_fault = false; in ocxlflash_dev_context_init()
525 * ocxlflash_release_context() - releases an adapter context
528 * Return: 0 on success, -errno on failure
539 dev = ctx->hw_afu->dev; in ocxlflash_release_context()
540 mutex_lock(&ctx->state_mutex); in ocxlflash_release_context()
541 if (ctx->state >= STARTED) { in ocxlflash_release_context()
543 ctx->state); in ocxlflash_release_context()
544 mutex_unlock(&ctx->state_mutex); in ocxlflash_release_context()
545 rc = -EBUSY; in ocxlflash_release_context()
548 mutex_unlock(&ctx->state_mutex); in ocxlflash_release_context()
550 idr_remove(&ctx->hw_afu->idr, ctx->pe); in ocxlflash_release_context()
558 * ocxlflash_perst_reloads_same_image() - sets the image reload policy
566 afu->perst_same_image = image; in ocxlflash_perst_reloads_same_image()
570 * ocxlflash_read_adapter_vpd() - reads the adapter VPD
575 * Return: size of VPD on success, -errno on failure
584 * free_afu_irqs() - internal service to free interrupts
589 struct ocxl_hw_afu *afu = ctx->hw_afu; in free_afu_irqs()
590 struct device *dev = afu->dev; in free_afu_irqs()
593 if (!ctx->irqs) { in free_afu_irqs()
598 for (i = ctx->num_irqs; i >= 0; i--) in free_afu_irqs()
599 ocxl_link_free_irq(afu->link_token, ctx->irqs[i].hwirq); in free_afu_irqs()
601 kfree(ctx->irqs); in free_afu_irqs()
602 ctx->irqs = NULL; in free_afu_irqs()
606 * alloc_afu_irqs() - internal service to allocate interrupts
608 * @num: Number of interrupts requested.
610 * Return: 0 on success, -errno on failure
612 static int alloc_afu_irqs(struct ocxlflash_context *ctx, int num) in alloc_afu_irqs() argument
614 struct ocxl_hw_afu *afu = ctx->hw_afu; in alloc_afu_irqs()
615 struct device *dev = afu->dev; in alloc_afu_irqs()
616 struct ocxlflash_irqs *irqs; in alloc_afu_irqs() local
621 if (ctx->irqs) { in alloc_afu_irqs()
623 rc = -EEXIST; in alloc_afu_irqs()
627 if (num > OCXL_MAX_IRQS) { in alloc_afu_irqs()
628 dev_err(dev, "%s: Too many interrupts num=%d\n", __func__, num); in alloc_afu_irqs()
629 rc = -EINVAL; in alloc_afu_irqs()
633 irqs = kcalloc(num, sizeof(*irqs), GFP_KERNEL); in alloc_afu_irqs()
634 if (unlikely(!irqs)) { in alloc_afu_irqs()
635 dev_err(dev, "%s: Context irqs allocation failed\n", __func__); in alloc_afu_irqs()
636 rc = -ENOMEM; in alloc_afu_irqs()
640 for (i = 0; i < num; i++) { in alloc_afu_irqs()
641 rc = ocxl_link_irq_alloc(afu->link_token, &hwirq); in alloc_afu_irqs()
648 irqs[i].hwirq = hwirq; in alloc_afu_irqs()
651 ctx->irqs = irqs; in alloc_afu_irqs()
652 ctx->num_irqs = num; in alloc_afu_irqs()
656 for (i = i-1; i >= 0; i--) in alloc_afu_irqs()
657 ocxl_link_free_irq(afu->link_token, irqs[i].hwirq); in alloc_afu_irqs()
658 kfree(irqs); in alloc_afu_irqs()
663 * ocxlflash_allocate_afu_irqs() - allocates the requested number of interrupts
665 * @num: Number of interrupts requested.
667 * Return: 0 on success, -errno on failure
669 static int ocxlflash_allocate_afu_irqs(void *ctx_cookie, int num) in ocxlflash_allocate_afu_irqs() argument
671 return alloc_afu_irqs(ctx_cookie, num); in ocxlflash_allocate_afu_irqs()
675 * ocxlflash_free_afu_irqs() - frees the interrupts of an adapter context
684 * ocxlflash_unconfig_afu() - unconfigure the AFU
689 if (afu->gmmio_virt) { in ocxlflash_unconfig_afu()
690 iounmap(afu->gmmio_virt); in ocxlflash_unconfig_afu()
691 afu->gmmio_virt = NULL; in ocxlflash_unconfig_afu()
696 * ocxlflash_destroy_afu() - destroy the AFU structure
707 ocxlflash_release_context(afu->ocxl_ctx); in ocxlflash_destroy_afu()
708 idr_destroy(&afu->idr); in ocxlflash_destroy_afu()
711 pos = afu->acfg.dvsec_afu_control_pos; in ocxlflash_destroy_afu()
712 ocxl_config_set_afu_state(afu->pdev, pos, 0); in ocxlflash_destroy_afu()
719 * ocxlflash_config_fn() - configure the host function
723 * Return: 0 on success, -errno on failure
727 struct ocxl_fn_config *fcfg = &afu->fcfg; in ocxlflash_config_fn()
728 struct device *dev = &pdev->dev; in ocxlflash_config_fn()
741 if (fcfg->max_afu_index >= 0) { in ocxlflash_config_fn()
742 afu->is_present = true; in ocxlflash_config_fn()
743 if (fcfg->max_afu_index != 0) in ocxlflash_config_fn()
745 __func__, fcfg->max_afu_index); in ocxlflash_config_fn()
755 afu->fn_actag_base = base; in ocxlflash_config_fn()
756 afu->fn_actag_enabled = enabled; in ocxlflash_config_fn()
758 ocxl_config_set_actag(pdev, fcfg->dvsec_function_pos, base, enabled); in ocxlflash_config_fn()
762 rc = ocxl_link_setup(pdev, 0, &afu->link_token); in ocxlflash_config_fn()
769 rc = ocxl_config_set_TL(pdev, fcfg->dvsec_tl_pos); in ocxlflash_config_fn()
778 ocxl_link_release(pdev, afu->link_token); in ocxlflash_config_fn()
783 * ocxlflash_unconfig_fn() - unconfigure the host function
789 ocxl_link_release(pdev, afu->link_token); in ocxlflash_unconfig_fn()
793 * ocxlflash_map_mmio() - map the AFU MMIO space
796 * Return: 0 on success, -errno on failure
800 struct ocxl_afu_config *acfg = &afu->acfg; in ocxlflash_map_mmio()
801 struct pci_dev *pdev = afu->pdev; in ocxlflash_map_mmio()
802 struct device *dev = afu->dev; in ocxlflash_map_mmio()
806 rc = pci_request_region(pdev, acfg->global_mmio_bar, "ocxlflash"); in ocxlflash_map_mmio()
812 gmmio = pci_resource_start(pdev, acfg->global_mmio_bar); in ocxlflash_map_mmio()
813 gmmio += acfg->global_mmio_offset; in ocxlflash_map_mmio()
815 rc = pci_request_region(pdev, acfg->pp_mmio_bar, "ocxlflash"); in ocxlflash_map_mmio()
821 ppmmio = pci_resource_start(pdev, acfg->pp_mmio_bar); in ocxlflash_map_mmio()
822 ppmmio += acfg->pp_mmio_offset; in ocxlflash_map_mmio()
824 afu->gmmio_virt = ioremap(gmmio, acfg->global_mmio_size); in ocxlflash_map_mmio()
825 if (unlikely(!afu->gmmio_virt)) { in ocxlflash_map_mmio()
827 rc = -ENOMEM; in ocxlflash_map_mmio()
831 afu->gmmio_phys = gmmio; in ocxlflash_map_mmio()
832 afu->ppmmio_phys = ppmmio; in ocxlflash_map_mmio()
836 pci_release_region(pdev, acfg->pp_mmio_bar); in ocxlflash_map_mmio()
838 pci_release_region(pdev, acfg->global_mmio_bar); in ocxlflash_map_mmio()
843 * ocxlflash_config_afu() - configure the host AFU
849 * Return: 0 on success, -errno on failure
853 struct ocxl_afu_config *acfg = &afu->acfg; in ocxlflash_config_afu()
854 struct ocxl_fn_config *fcfg = &afu->fcfg; in ocxlflash_config_afu()
855 struct device *dev = &pdev->dev; in ocxlflash_config_afu()
862 if (!afu->is_present) in ocxlflash_config_afu()
874 base = afu->fn_actag_base; in ocxlflash_config_afu()
875 count = min_t(int, acfg->actag_supported, afu->fn_actag_enabled); in ocxlflash_config_afu()
876 pos = acfg->dvsec_afu_control_pos; in ocxlflash_config_afu()
880 afu->afu_actag_base = base; in ocxlflash_config_afu()
881 afu->afu_actag_enabled = count; in ocxlflash_config_afu()
882 afu->max_pasid = 1 << acfg->pasid_supported_log; in ocxlflash_config_afu()
884 ocxl_config_set_afu_pasid(pdev, pos, 0, acfg->pasid_supported_log); in ocxlflash_config_afu()
894 ocxl_config_set_afu_state(pdev, acfg->dvsec_afu_control_pos, 1); in ocxlflash_config_afu()
900 * ocxlflash_create_afu() - create the AFU for OCXL
907 struct device *dev = &pdev->dev; in ocxlflash_create_afu()
918 afu->pdev = pdev; in ocxlflash_create_afu()
919 afu->dev = dev; in ocxlflash_create_afu()
920 idr_init(&afu->idr); in ocxlflash_create_afu()
944 afu->ocxl_ctx = ctx; in ocxlflash_create_afu()
952 idr_destroy(&afu->idr); in ocxlflash_create_afu()
959 * ctx_event_pending() - check for any event pending on the context
966 if (ctx->pending_irq || ctx->pending_fault) in ctx_event_pending()
973 * afu_poll() - poll the AFU for events on the context
981 struct ocxlflash_context *ctx = file->private_data; in afu_poll()
982 struct device *dev = ctx->hw_afu->dev; in afu_poll()
986 poll_wait(file, &ctx->wq, poll); in afu_poll()
988 spin_lock_irqsave(&ctx->slock, lock_flags); in afu_poll()
991 else if (ctx->state == CLOSED) in afu_poll()
993 spin_unlock_irqrestore(&ctx->slock, lock_flags); in afu_poll()
996 __func__, ctx->pe, mask); in afu_poll()
1002 * afu_read() - perform a read on the context for any event
1008 * Return: size of the data read on success, -errno on failure
1013 struct ocxlflash_context *ctx = file->private_data; in afu_read()
1014 struct device *dev = ctx->hw_afu->dev; in afu_read()
1023 dev_err(dev, "%s: Non-zero offset not supported, off=%lld\n", in afu_read()
1025 rc = -EINVAL; in afu_read()
1029 spin_lock_irqsave(&ctx->slock, lock_flags); in afu_read()
1032 prepare_to_wait(&ctx->wq, &event_wait, TASK_INTERRUPTIBLE); in afu_read()
1034 if (ctx_event_pending(ctx) || (ctx->state == CLOSED)) in afu_read()
1037 if (file->f_flags & O_NONBLOCK) { in afu_read()
1040 rc = -EAGAIN; in afu_read()
1047 rc = -ERESTARTSYS; in afu_read()
1051 spin_unlock_irqrestore(&ctx->slock, lock_flags); in afu_read()
1053 spin_lock_irqsave(&ctx->slock, lock_flags); in afu_read()
1056 finish_wait(&ctx->wq, &event_wait); in afu_read()
1059 event.header.process_element = ctx->pe; in afu_read()
1061 if (ctx->pending_irq) { in afu_read()
1066 bit = find_first_bit(&ctx->irq_bitmap, ctx->num_irqs); in afu_read()
1067 clear_bit(bit, &ctx->irq_bitmap); in afu_read()
1069 if (bitmap_empty(&ctx->irq_bitmap, ctx->num_irqs)) in afu_read()
1070 ctx->pending_irq = false; in afu_read()
1071 } else if (ctx->pending_fault) { in afu_read()
1074 event.fault.addr = ctx->fault_addr; in afu_read()
1075 event.fault.dsisr = ctx->fault_dsisr; in afu_read()
1076 ctx->pending_fault = false; in afu_read()
1079 spin_unlock_irqrestore(&ctx->slock, lock_flags); in afu_read()
1083 rc = -EFAULT; in afu_read()
1091 finish_wait(&ctx->wq, &event_wait); in afu_read()
1092 spin_unlock_irqrestore(&ctx->slock, lock_flags); in afu_read()
1097 * afu_release() - release and free the context
1101 * Return: 0 on success, -errno on failure
1105 struct ocxlflash_context *ctx = file->private_data; in afu_release()
1109 for (i = ctx->num_irqs; i >= 0; i--) in afu_release()
1117 * ocxlflash_mmap_fault() - mmap fault handler
1120 * Return: 0 on success, -errno on failure
1124 struct vm_area_struct *vma = vmf->vma; in ocxlflash_mmap_fault()
1125 struct ocxlflash_context *ctx = vma->vm_file->private_data; in ocxlflash_mmap_fault()
1126 struct device *dev = ctx->hw_afu->dev; in ocxlflash_mmap_fault()
1129 offset = vmf->pgoff << PAGE_SHIFT; in ocxlflash_mmap_fault()
1130 if (offset >= ctx->psn_size) in ocxlflash_mmap_fault()
1133 mutex_lock(&ctx->state_mutex); in ocxlflash_mmap_fault()
1134 if (ctx->state != STARTED) { in ocxlflash_mmap_fault()
1136 __func__, ctx->state); in ocxlflash_mmap_fault()
1137 mutex_unlock(&ctx->state_mutex); in ocxlflash_mmap_fault()
1140 mutex_unlock(&ctx->state_mutex); in ocxlflash_mmap_fault()
1142 mmio_area = ctx->psn_phys; in ocxlflash_mmap_fault()
1145 return vmf_insert_pfn(vma, vmf->address, mmio_area >> PAGE_SHIFT); in ocxlflash_mmap_fault()
1153 * afu_mmap() - map the fault handler operations
1157 * Return: 0 on success, -errno on failure
1161 struct ocxlflash_context *ctx = file->private_data; in afu_mmap()
1163 if ((vma_pages(vma) + vma->vm_pgoff) > in afu_mmap()
1164 (ctx->psn_size >> PAGE_SHIFT)) in afu_mmap()
1165 return -EINVAL; in afu_mmap()
1167 vma->vm_flags |= VM_IO | VM_PFNMAP; in afu_mmap()
1168 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); in afu_mmap()
1169 vma->vm_ops = &ocxlflash_vmops; in afu_mmap()
1182 do { if (!fops->NAME) fops->NAME = ocxl_afu_fops.NAME; } while (0)
1185 * ocxlflash_get_fd() - get file descriptor for an adapter context
1196 struct device *dev = ctx->hw_afu->dev; in ocxlflash_get_fd()
1203 if (ctx->mapping) { in ocxlflash_get_fd()
1206 rc = -EEXIST; in ocxlflash_get_fd()
1230 name = kasprintf(GFP_KERNEL, "ocxlflash:%d", ctx->pe); in ocxlflash_get_fd()
1240 ctx->mapping = file->f_mapping; in ocxlflash_get_fd()
1252 * ocxlflash_fops_get_context() - get the context associated with the file
1259 return file->private_data; in ocxlflash_fops_get_context()
1263 * ocxlflash_afu_irq() - interrupt handler for user contexts
1272 struct device *dev = ctx->hw_afu->dev; in ocxlflash_afu_irq()
1276 __func__, ctx->pe, irq); in ocxlflash_afu_irq()
1278 for (i = 0; i < ctx->num_irqs; i++) { in ocxlflash_afu_irq()
1279 if (ctx->irqs[i].virq == irq) in ocxlflash_afu_irq()
1282 if (unlikely(i >= ctx->num_irqs)) { in ocxlflash_afu_irq()
1287 spin_lock(&ctx->slock); in ocxlflash_afu_irq()
1288 set_bit(i - 1, &ctx->irq_bitmap); in ocxlflash_afu_irq()
1289 ctx->pending_irq = true; in ocxlflash_afu_irq()
1290 spin_unlock(&ctx->slock); in ocxlflash_afu_irq()
1292 wake_up_all(&ctx->wq); in ocxlflash_afu_irq()
1298 * ocxlflash_start_work() - start a user context
1302 * Return: 0 on success, -errno on failure
1307 struct ocxl_hw_afu *afu = ctx->hw_afu; in ocxlflash_start_work()
1308 struct device *dev = afu->dev; in ocxlflash_start_work()
1320 name = kasprintf(GFP_KERNEL, "ocxlflash-%s-pe%i-%i", in ocxlflash_start_work()
1321 dev_name(dev), ctx->pe, i); in ocxlflash_start_work()
1339 for (i = i-1; i >= 0; i--) in ocxlflash_start_work()
1346 * ocxlflash_fd_mmap() - mmap handler for adapter file descriptor
1350 * Return: 0 on success, -errno on failure
1358 * ocxlflash_fd_release() - release the context associated with the file
1362 * Return: 0 on success, -errno on failure