Lines Matching +full:irqs +full:- +full:map +full:- +full:range

1 // SPDX-License-Identifier: GPL-2.0-or-later
29 * Pseudo-filesystem to allocate inodes.
39 return init_pseudo(fc, OCXLFLASH_FS_MAGIC) ? 0 : -ENOMEM; in ocxlflash_fs_init_fs_context()
50 * ocxlflash_release_mapping() - release the memory mapping
55 if (ctx->mapping) in ocxlflash_release_mapping()
57 ctx->mapping = NULL; in ocxlflash_release_mapping()
61 * ocxlflash_getfile() - allocate pseudo filesystem, inode, and the file
78 if (fops->owner && !try_module_get(fops->owner)) { in ocxlflash_getfile()
80 rc = -ENOENT; in ocxlflash_getfile()
92 inode = alloc_anon_inode(ocxlflash_vfs_mount->mnt_sb); in ocxlflash_getfile()
109 file->private_data = priv; in ocxlflash_getfile()
117 module_put(fops->owner); in ocxlflash_getfile()
124 * ocxlflash_psa_map() - map the process specific MMIO space
132 struct device *dev = ctx->hw_afu->dev; in ocxlflash_psa_map()
134 mutex_lock(&ctx->state_mutex); in ocxlflash_psa_map()
135 if (ctx->state != STARTED) { in ocxlflash_psa_map()
137 ctx->state); in ocxlflash_psa_map()
138 mutex_unlock(&ctx->state_mutex); in ocxlflash_psa_map()
141 mutex_unlock(&ctx->state_mutex); in ocxlflash_psa_map()
143 return ioremap(ctx->psn_phys, ctx->psn_size); in ocxlflash_psa_map()
147 * ocxlflash_psa_unmap() - unmap the process specific MMIO space
156 * ocxlflash_process_element() - get process element of the adapter context
165 return ctx->pe; in ocxlflash_process_element()
169 * afu_map_irq() - map the interrupt of the adapter context
172 * @num: Per-context AFU interrupt number.
177 * Return: 0 on success, -errno on failure
182 struct ocxl_hw_afu *afu = ctx->hw_afu; in afu_map_irq()
183 struct device *dev = afu->dev; in afu_map_irq()
189 if (num < 0 || num >= ctx->num_irqs) { in afu_map_irq()
191 rc = -ENOENT; in afu_map_irq()
195 irq = &ctx->irqs[num]; in afu_map_irq()
196 virq = irq_create_mapping(NULL, irq->hwirq); in afu_map_irq()
199 rc = -ENOMEM; in afu_map_irq()
212 rc = -ENXIO; in afu_map_irq()
216 irq->virq = virq; in afu_map_irq()
217 irq->vtrig = xd->trig_mmio; in afu_map_irq()
228 * ocxlflash_map_afu_irq() - map the interrupt of the adapter context
230 * @num: Per-context AFU interrupt number.
235 * Return: 0 on success, -errno on failure
245 * afu_unmap_irq() - unmap the interrupt
248 * @num: Per-context AFU interrupt number.
254 struct ocxl_hw_afu *afu = ctx->hw_afu; in afu_unmap_irq()
255 struct device *dev = afu->dev; in afu_unmap_irq()
258 if (num < 0 || num >= ctx->num_irqs) { in afu_unmap_irq()
263 irq = &ctx->irqs[num]; in afu_unmap_irq()
265 if (irq_find_mapping(NULL, irq->hwirq)) { in afu_unmap_irq()
266 free_irq(irq->virq, cookie); in afu_unmap_irq()
267 irq_dispose_mapping(irq->virq); in afu_unmap_irq()
274 * ocxlflash_unmap_afu_irq() - unmap the interrupt
276 * @num: Per-context AFU interrupt number.
285 * ocxlflash_get_irq_objhndl() - get the object handle for an interrupt
295 if (irq < 0 || irq >= ctx->num_irqs) in ocxlflash_get_irq_objhndl()
298 return (__force u64)ctx->irqs[irq].vtrig; in ocxlflash_get_irq_objhndl()
302 * ocxlflash_xsl_fault() - callback when translation error is triggered
311 spin_lock(&ctx->slock); in ocxlflash_xsl_fault()
312 ctx->fault_addr = addr; in ocxlflash_xsl_fault()
313 ctx->fault_dsisr = dsisr; in ocxlflash_xsl_fault()
314 ctx->pending_fault = true; in ocxlflash_xsl_fault()
315 spin_unlock(&ctx->slock); in ocxlflash_xsl_fault()
317 wake_up_all(&ctx->wq); in ocxlflash_xsl_fault()
321 * start_context() - local routine to start a context
326 * Return: 0 on success, -errno on failure
330 struct ocxl_hw_afu *afu = ctx->hw_afu; in start_context()
331 struct ocxl_afu_config *acfg = &afu->acfg; in start_context()
332 void *link_token = afu->link_token; in start_context()
333 struct pci_dev *pdev = afu->pdev; in start_context()
334 struct device *dev = afu->dev; in start_context()
335 bool master = ctx->master; in start_context()
340 mutex_lock(&ctx->state_mutex); in start_context()
341 if (ctx->state != OPENED) { in start_context()
343 __func__, ctx->state); in start_context()
344 rc = -EINVAL; in start_context()
349 ctx->psn_size = acfg->global_mmio_size; in start_context()
350 ctx->psn_phys = afu->gmmio_phys; in start_context()
352 ctx->psn_size = acfg->pp_mmio_stride; in start_context()
353 ctx->psn_phys = afu->ppmmio_phys + (ctx->pe * ctx->psn_size); in start_context()
361 pid = current->mm->context.id; in start_context()
362 mm = current->mm; in start_context()
365 rc = ocxl_link_add_pe(link_token, ctx->pe, pid, 0, 0, in start_context()
374 ctx->state = STARTED; in start_context()
376 mutex_unlock(&ctx->state_mutex); in start_context()
381 * ocxlflash_start_context() - start a kernel context
384 * Return: 0 on success, -errno on failure
394 * ocxlflash_stop_context() - stop a context
397 * Return: 0 on success, -errno on failure
402 struct ocxl_hw_afu *afu = ctx->hw_afu; in ocxlflash_stop_context()
403 struct ocxl_afu_config *acfg = &afu->acfg; in ocxlflash_stop_context()
404 struct pci_dev *pdev = afu->pdev; in ocxlflash_stop_context()
405 struct device *dev = afu->dev; in ocxlflash_stop_context()
409 mutex_lock(&ctx->state_mutex); in ocxlflash_stop_context()
410 state = ctx->state; in ocxlflash_stop_context()
411 ctx->state = CLOSED; in ocxlflash_stop_context()
412 mutex_unlock(&ctx->state_mutex); in ocxlflash_stop_context()
416 rc = ocxl_config_terminate_pasid(pdev, acfg->dvsec_afu_control_pos, in ocxlflash_stop_context()
417 ctx->pe); in ocxlflash_stop_context()
422 if (rc == -EBUSY) in ocxlflash_stop_context()
426 rc = ocxl_link_remove_pe(afu->link_token, ctx->pe); in ocxlflash_stop_context()
437 * ocxlflash_afu_reset() - reset the AFU
443 struct device *dev = ctx->hw_afu->dev; in ocxlflash_afu_reset()
453 * ocxlflash_set_master() - sets the context as master
460 ctx->master = true; in ocxlflash_set_master()
464 * ocxlflash_get_context() - obtains the context associated with the host
474 return afu->ocxl_ctx; in ocxlflash_get_context()
478 * ocxlflash_dev_context_init() - allocate and initialize an adapter context
487 struct device *dev = afu->dev; in ocxlflash_dev_context_init()
494 rc = -ENOMEM; in ocxlflash_dev_context_init()
499 rc = idr_alloc(&afu->idr, ctx, 0, afu->max_pasid, GFP_NOWAIT); in ocxlflash_dev_context_init()
506 spin_lock_init(&ctx->slock); in ocxlflash_dev_context_init()
507 init_waitqueue_head(&ctx->wq); in ocxlflash_dev_context_init()
508 mutex_init(&ctx->state_mutex); in ocxlflash_dev_context_init()
510 ctx->state = OPENED; in ocxlflash_dev_context_init()
511 ctx->pe = rc; in ocxlflash_dev_context_init()
512 ctx->master = false; in ocxlflash_dev_context_init()
513 ctx->mapping = NULL; in ocxlflash_dev_context_init()
514 ctx->hw_afu = afu; in ocxlflash_dev_context_init()
515 ctx->irq_bitmap = 0; in ocxlflash_dev_context_init()
516 ctx->pending_irq = false; in ocxlflash_dev_context_init()
517 ctx->pending_fault = false; in ocxlflash_dev_context_init()
528 * ocxlflash_release_context() - releases an adapter context
531 * Return: 0 on success, -errno on failure
542 dev = ctx->hw_afu->dev; in ocxlflash_release_context()
543 mutex_lock(&ctx->state_mutex); in ocxlflash_release_context()
544 if (ctx->state >= STARTED) { in ocxlflash_release_context()
546 ctx->state); in ocxlflash_release_context()
547 mutex_unlock(&ctx->state_mutex); in ocxlflash_release_context()
548 rc = -EBUSY; in ocxlflash_release_context()
551 mutex_unlock(&ctx->state_mutex); in ocxlflash_release_context()
553 idr_remove(&ctx->hw_afu->idr, ctx->pe); in ocxlflash_release_context()
561 * ocxlflash_perst_reloads_same_image() - sets the image reload policy
569 afu->perst_same_image = image; in ocxlflash_perst_reloads_same_image()
573 * ocxlflash_read_adapter_vpd() - reads the adapter VPD
578 * Return: size of VPD on success, -errno on failure
587 * free_afu_irqs() - internal service to free interrupts
592 struct ocxl_hw_afu *afu = ctx->hw_afu; in free_afu_irqs()
593 struct device *dev = afu->dev; in free_afu_irqs()
596 if (!ctx->irqs) { in free_afu_irqs()
601 for (i = ctx->num_irqs; i >= 0; i--) in free_afu_irqs()
602 ocxl_link_free_irq(afu->link_token, ctx->irqs[i].hwirq); in free_afu_irqs()
604 kfree(ctx->irqs); in free_afu_irqs()
605 ctx->irqs = NULL; in free_afu_irqs()
609 * alloc_afu_irqs() - internal service to allocate interrupts
613 * Return: 0 on success, -errno on failure
617 struct ocxl_hw_afu *afu = ctx->hw_afu; in alloc_afu_irqs()
618 struct device *dev = afu->dev; in alloc_afu_irqs()
619 struct ocxlflash_irqs *irqs; in alloc_afu_irqs() local
624 if (ctx->irqs) { in alloc_afu_irqs()
626 rc = -EEXIST; in alloc_afu_irqs()
632 rc = -EINVAL; in alloc_afu_irqs()
636 irqs = kcalloc(num, sizeof(*irqs), GFP_KERNEL); in alloc_afu_irqs()
637 if (unlikely(!irqs)) { in alloc_afu_irqs()
638 dev_err(dev, "%s: Context irqs allocation failed\n", __func__); in alloc_afu_irqs()
639 rc = -ENOMEM; in alloc_afu_irqs()
644 rc = ocxl_link_irq_alloc(afu->link_token, &hwirq); in alloc_afu_irqs()
651 irqs[i].hwirq = hwirq; in alloc_afu_irqs()
654 ctx->irqs = irqs; in alloc_afu_irqs()
655 ctx->num_irqs = num; in alloc_afu_irqs()
659 for (i = i-1; i >= 0; i--) in alloc_afu_irqs()
660 ocxl_link_free_irq(afu->link_token, irqs[i].hwirq); in alloc_afu_irqs()
661 kfree(irqs); in alloc_afu_irqs()
666 * ocxlflash_allocate_afu_irqs() - allocates the requested number of interrupts
670 * Return: 0 on success, -errno on failure
678 * ocxlflash_free_afu_irqs() - frees the interrupts of an adapter context
687 * ocxlflash_unconfig_afu() - unconfigure the AFU
692 if (afu->gmmio_virt) { in ocxlflash_unconfig_afu()
693 iounmap(afu->gmmio_virt); in ocxlflash_unconfig_afu()
694 afu->gmmio_virt = NULL; in ocxlflash_unconfig_afu()
699 * ocxlflash_destroy_afu() - destroy the AFU structure
710 ocxlflash_release_context(afu->ocxl_ctx); in ocxlflash_destroy_afu()
711 idr_destroy(&afu->idr); in ocxlflash_destroy_afu()
714 pos = afu->acfg.dvsec_afu_control_pos; in ocxlflash_destroy_afu()
715 ocxl_config_set_afu_state(afu->pdev, pos, 0); in ocxlflash_destroy_afu()
722 * ocxlflash_config_fn() - configure the host function
726 * Return: 0 on success, -errno on failure
730 struct ocxl_fn_config *fcfg = &afu->fcfg; in ocxlflash_config_fn()
731 struct device *dev = &pdev->dev; in ocxlflash_config_fn()
744 if (fcfg->max_afu_index >= 0) { in ocxlflash_config_fn()
745 afu->is_present = true; in ocxlflash_config_fn()
746 if (fcfg->max_afu_index != 0) in ocxlflash_config_fn()
748 __func__, fcfg->max_afu_index); in ocxlflash_config_fn()
758 afu->fn_actag_base = base; in ocxlflash_config_fn()
759 afu->fn_actag_enabled = enabled; in ocxlflash_config_fn()
761 ocxl_config_set_actag(pdev, fcfg->dvsec_function_pos, base, enabled); in ocxlflash_config_fn()
762 dev_dbg(dev, "%s: Function acTag range base=%u enabled=%u\n", in ocxlflash_config_fn()
765 rc = ocxl_link_setup(pdev, 0, &afu->link_token); in ocxlflash_config_fn()
772 rc = ocxl_config_set_TL(pdev, fcfg->dvsec_tl_pos); in ocxlflash_config_fn()
781 ocxl_link_release(pdev, afu->link_token); in ocxlflash_config_fn()
786 * ocxlflash_unconfig_fn() - unconfigure the host function
792 ocxl_link_release(pdev, afu->link_token); in ocxlflash_unconfig_fn()
796 * ocxlflash_map_mmio() - map the AFU MMIO space
799 * Return: 0 on success, -errno on failure
803 struct ocxl_afu_config *acfg = &afu->acfg; in ocxlflash_map_mmio()
804 struct pci_dev *pdev = afu->pdev; in ocxlflash_map_mmio()
805 struct device *dev = afu->dev; in ocxlflash_map_mmio()
809 rc = pci_request_region(pdev, acfg->global_mmio_bar, "ocxlflash"); in ocxlflash_map_mmio()
815 gmmio = pci_resource_start(pdev, acfg->global_mmio_bar); in ocxlflash_map_mmio()
816 gmmio += acfg->global_mmio_offset; in ocxlflash_map_mmio()
818 rc = pci_request_region(pdev, acfg->pp_mmio_bar, "ocxlflash"); in ocxlflash_map_mmio()
824 ppmmio = pci_resource_start(pdev, acfg->pp_mmio_bar); in ocxlflash_map_mmio()
825 ppmmio += acfg->pp_mmio_offset; in ocxlflash_map_mmio()
827 afu->gmmio_virt = ioremap(gmmio, acfg->global_mmio_size); in ocxlflash_map_mmio()
828 if (unlikely(!afu->gmmio_virt)) { in ocxlflash_map_mmio()
830 rc = -ENOMEM; in ocxlflash_map_mmio()
834 afu->gmmio_phys = gmmio; in ocxlflash_map_mmio()
835 afu->ppmmio_phys = ppmmio; in ocxlflash_map_mmio()
839 pci_release_region(pdev, acfg->pp_mmio_bar); in ocxlflash_map_mmio()
841 pci_release_region(pdev, acfg->global_mmio_bar); in ocxlflash_map_mmio()
846 * ocxlflash_config_afu() - configure the host AFU
852 * Return: 0 on success, -errno on failure
856 struct ocxl_afu_config *acfg = &afu->acfg; in ocxlflash_config_afu()
857 struct ocxl_fn_config *fcfg = &afu->fcfg; in ocxlflash_config_afu()
858 struct device *dev = &pdev->dev; in ocxlflash_config_afu()
865 if (!afu->is_present) in ocxlflash_config_afu()
877 base = afu->fn_actag_base; in ocxlflash_config_afu()
878 count = min_t(int, acfg->actag_supported, afu->fn_actag_enabled); in ocxlflash_config_afu()
879 pos = acfg->dvsec_afu_control_pos; in ocxlflash_config_afu()
883 afu->afu_actag_base = base; in ocxlflash_config_afu()
884 afu->afu_actag_enabled = count; in ocxlflash_config_afu()
885 afu->max_pasid = 1 << acfg->pasid_supported_log; in ocxlflash_config_afu()
887 ocxl_config_set_afu_pasid(pdev, pos, 0, acfg->pasid_supported_log); in ocxlflash_config_afu()
897 ocxl_config_set_afu_state(pdev, acfg->dvsec_afu_control_pos, 1); in ocxlflash_config_afu()
903 * ocxlflash_create_afu() - create the AFU for OCXL
910 struct device *dev = &pdev->dev; in ocxlflash_create_afu()
921 afu->pdev = pdev; in ocxlflash_create_afu()
922 afu->dev = dev; in ocxlflash_create_afu()
923 idr_init(&afu->idr); in ocxlflash_create_afu()
947 afu->ocxl_ctx = ctx; in ocxlflash_create_afu()
955 idr_destroy(&afu->idr); in ocxlflash_create_afu()
962 * ctx_event_pending() - check for any event pending on the context
969 if (ctx->pending_irq || ctx->pending_fault) in ctx_event_pending()
976 * afu_poll() - poll the AFU for events on the context
984 struct ocxlflash_context *ctx = file->private_data; in afu_poll()
985 struct device *dev = ctx->hw_afu->dev; in afu_poll()
989 poll_wait(file, &ctx->wq, poll); in afu_poll()
991 spin_lock_irqsave(&ctx->slock, lock_flags); in afu_poll()
994 else if (ctx->state == CLOSED) in afu_poll()
996 spin_unlock_irqrestore(&ctx->slock, lock_flags); in afu_poll()
999 __func__, ctx->pe, mask); in afu_poll()
1005 * afu_read() - perform a read on the context for any event
1011 * Return: size of the data read on success, -errno on failure
1016 struct ocxlflash_context *ctx = file->private_data; in afu_read()
1017 struct device *dev = ctx->hw_afu->dev; in afu_read()
1026 dev_err(dev, "%s: Non-zero offset not supported, off=%lld\n", in afu_read()
1028 rc = -EINVAL; in afu_read()
1032 spin_lock_irqsave(&ctx->slock, lock_flags); in afu_read()
1035 prepare_to_wait(&ctx->wq, &event_wait, TASK_INTERRUPTIBLE); in afu_read()
1037 if (ctx_event_pending(ctx) || (ctx->state == CLOSED)) in afu_read()
1040 if (file->f_flags & O_NONBLOCK) { in afu_read()
1043 rc = -EAGAIN; in afu_read()
1050 rc = -ERESTARTSYS; in afu_read()
1054 spin_unlock_irqrestore(&ctx->slock, lock_flags); in afu_read()
1056 spin_lock_irqsave(&ctx->slock, lock_flags); in afu_read()
1059 finish_wait(&ctx->wq, &event_wait); in afu_read()
1062 event.header.process_element = ctx->pe; in afu_read()
1064 if (ctx->pending_irq) { in afu_read()
1069 bit = find_first_bit(&ctx->irq_bitmap, ctx->num_irqs); in afu_read()
1070 clear_bit(bit, &ctx->irq_bitmap); in afu_read()
1072 if (bitmap_empty(&ctx->irq_bitmap, ctx->num_irqs)) in afu_read()
1073 ctx->pending_irq = false; in afu_read()
1074 } else if (ctx->pending_fault) { in afu_read()
1077 event.fault.addr = ctx->fault_addr; in afu_read()
1078 event.fault.dsisr = ctx->fault_dsisr; in afu_read()
1079 ctx->pending_fault = false; in afu_read()
1082 spin_unlock_irqrestore(&ctx->slock, lock_flags); in afu_read()
1086 rc = -EFAULT; in afu_read()
1094 finish_wait(&ctx->wq, &event_wait); in afu_read()
1095 spin_unlock_irqrestore(&ctx->slock, lock_flags); in afu_read()
1100 * afu_release() - release and free the context
1104 * Return: 0 on success, -errno on failure
1108 struct ocxlflash_context *ctx = file->private_data; in afu_release()
1112 for (i = ctx->num_irqs; i >= 0; i--) in afu_release()
1120 * ocxlflash_mmap_fault() - mmap fault handler
1123 * Return: 0 on success, -errno on failure
1127 struct vm_area_struct *vma = vmf->vma; in ocxlflash_mmap_fault()
1128 struct ocxlflash_context *ctx = vma->vm_file->private_data; in ocxlflash_mmap_fault()
1129 struct device *dev = ctx->hw_afu->dev; in ocxlflash_mmap_fault()
1132 offset = vmf->pgoff << PAGE_SHIFT; in ocxlflash_mmap_fault()
1133 if (offset >= ctx->psn_size) in ocxlflash_mmap_fault()
1136 mutex_lock(&ctx->state_mutex); in ocxlflash_mmap_fault()
1137 if (ctx->state != STARTED) { in ocxlflash_mmap_fault()
1139 __func__, ctx->state); in ocxlflash_mmap_fault()
1140 mutex_unlock(&ctx->state_mutex); in ocxlflash_mmap_fault()
1143 mutex_unlock(&ctx->state_mutex); in ocxlflash_mmap_fault()
1145 mmio_area = ctx->psn_phys; in ocxlflash_mmap_fault()
1148 return vmf_insert_pfn(vma, vmf->address, mmio_area >> PAGE_SHIFT); in ocxlflash_mmap_fault()
1156 * afu_mmap() - map the fault handler operations
1160 * Return: 0 on success, -errno on failure
1164 struct ocxlflash_context *ctx = file->private_data; in afu_mmap()
1166 if ((vma_pages(vma) + vma->vm_pgoff) > in afu_mmap()
1167 (ctx->psn_size >> PAGE_SHIFT)) in afu_mmap()
1168 return -EINVAL; in afu_mmap()
1171 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); in afu_mmap()
1172 vma->vm_ops = &ocxlflash_vmops; in afu_mmap()
1185 do { if (!fops->NAME) fops->NAME = ocxl_afu_fops.NAME; } while (0)
1188 * ocxlflash_get_fd() - get file descriptor for an adapter context
1199 struct device *dev = ctx->hw_afu->dev; in ocxlflash_get_fd()
1206 if (ctx->mapping) { in ocxlflash_get_fd()
1209 rc = -EEXIST; in ocxlflash_get_fd()
1233 name = kasprintf(GFP_KERNEL, "ocxlflash:%d", ctx->pe); in ocxlflash_get_fd()
1243 ctx->mapping = file->f_mapping; in ocxlflash_get_fd()
1255 * ocxlflash_fops_get_context() - get the context associated with the file
1262 return file->private_data; in ocxlflash_fops_get_context()
1266 * ocxlflash_afu_irq() - interrupt handler for user contexts
1275 struct device *dev = ctx->hw_afu->dev; in ocxlflash_afu_irq()
1279 __func__, ctx->pe, irq); in ocxlflash_afu_irq()
1281 for (i = 0; i < ctx->num_irqs; i++) { in ocxlflash_afu_irq()
1282 if (ctx->irqs[i].virq == irq) in ocxlflash_afu_irq()
1285 if (unlikely(i >= ctx->num_irqs)) { in ocxlflash_afu_irq()
1286 dev_err(dev, "%s: Received AFU IRQ out of range\n", __func__); in ocxlflash_afu_irq()
1290 spin_lock(&ctx->slock); in ocxlflash_afu_irq()
1291 set_bit(i - 1, &ctx->irq_bitmap); in ocxlflash_afu_irq()
1292 ctx->pending_irq = true; in ocxlflash_afu_irq()
1293 spin_unlock(&ctx->slock); in ocxlflash_afu_irq()
1295 wake_up_all(&ctx->wq); in ocxlflash_afu_irq()
1301 * ocxlflash_start_work() - start a user context
1305 * Return: 0 on success, -errno on failure
1310 struct ocxl_hw_afu *afu = ctx->hw_afu; in ocxlflash_start_work()
1311 struct device *dev = afu->dev; in ocxlflash_start_work()
1323 name = kasprintf(GFP_KERNEL, "ocxlflash-%s-pe%i-%i", in ocxlflash_start_work()
1324 dev_name(dev), ctx->pe, i); in ocxlflash_start_work()
1342 for (i = i-1; i >= 0; i--) in ocxlflash_start_work()
1349 * ocxlflash_fd_mmap() - mmap handler for adapter file descriptor
1353 * Return: 0 on success, -errno on failure
1361 * ocxlflash_fd_release() - release the context associated with the file
1365 * Return: 0 on success, -errno on failure