Lines Matching full:irq

35 	struct afu_irq *irq;  in ocxl_irq_set_handler()  local
39 irq = idr_find(&ctx->irq_idr, irq_id); in ocxl_irq_set_handler()
40 if (!irq) { in ocxl_irq_set_handler()
45 irq->handler = handler; in ocxl_irq_set_handler()
46 irq->private = private; in ocxl_irq_set_handler()
47 irq->free_private = free_private; in ocxl_irq_set_handler()
60 struct afu_irq *irq = data; in afu_irq_handler() local
64 if (irq->handler) in afu_irq_handler()
65 return irq->handler(irq->private); in afu_irq_handler()
70 static int setup_afu_irq(struct ocxl_context *ctx, struct afu_irq *irq) in setup_afu_irq() argument
74 irq->virq = irq_create_mapping(NULL, irq->hw_irq); in setup_afu_irq()
75 if (!irq->virq) { in setup_afu_irq()
79 pr_debug("hw_irq %d mapped to virq %u\n", irq->hw_irq, irq->virq); in setup_afu_irq()
81 irq->name = kasprintf(GFP_KERNEL, "ocxl-afu-%u", irq->virq); in setup_afu_irq()
82 if (!irq->name) { in setup_afu_irq()
83 irq_dispose_mapping(irq->virq); in setup_afu_irq()
87 rc = request_irq(irq->virq, afu_irq_handler, 0, irq->name, irq); in setup_afu_irq()
89 kfree(irq->name); in setup_afu_irq()
90 irq->name = NULL; in setup_afu_irq()
91 irq_dispose_mapping(irq->virq); in setup_afu_irq()
98 static void release_afu_irq(struct afu_irq *irq) in release_afu_irq() argument
100 free_irq(irq->virq, irq); in release_afu_irq()
101 irq_dispose_mapping(irq->virq); in release_afu_irq()
102 kfree(irq->name); in release_afu_irq()
107 struct afu_irq *irq; in ocxl_afu_irq_alloc() local
110 irq = kzalloc(sizeof(struct afu_irq), GFP_KERNEL); in ocxl_afu_irq_alloc()
111 if (!irq) in ocxl_afu_irq_alloc()
121 irq->id = idr_alloc(&ctx->irq_idr, irq, 0, MAX_IRQ_PER_CONTEXT, in ocxl_afu_irq_alloc()
123 if (irq->id < 0) { in ocxl_afu_irq_alloc()
128 rc = ocxl_link_irq_alloc(ctx->afu->fn->link, &irq->hw_irq); in ocxl_afu_irq_alloc()
132 rc = setup_afu_irq(ctx, irq); in ocxl_afu_irq_alloc()
136 trace_ocxl_afu_irq_alloc(ctx->pasid, irq->id, irq->virq, irq->hw_irq); in ocxl_afu_irq_alloc()
139 *irq_id = irq->id; in ocxl_afu_irq_alloc()
144 ocxl_link_free_irq(ctx->afu->fn->link, irq->hw_irq); in ocxl_afu_irq_alloc()
146 idr_remove(&ctx->irq_idr, irq->id); in ocxl_afu_irq_alloc()
149 kfree(irq); in ocxl_afu_irq_alloc()
154 static void afu_irq_free(struct afu_irq *irq, struct ocxl_context *ctx) in afu_irq_free() argument
156 trace_ocxl_afu_irq_free(ctx->pasid, irq->id); in afu_irq_free()
159 ocxl_irq_id_to_offset(ctx, irq->id), in afu_irq_free()
161 release_afu_irq(irq); in afu_irq_free()
162 if (irq->free_private) in afu_irq_free()
163 irq->free_private(irq->private); in afu_irq_free()
164 ocxl_link_free_irq(ctx->afu->fn->link, irq->hw_irq); in afu_irq_free()
165 kfree(irq); in afu_irq_free()
170 struct afu_irq *irq; in ocxl_afu_irq_free() local
174 irq = idr_find(&ctx->irq_idr, irq_id); in ocxl_afu_irq_free()
175 if (!irq) { in ocxl_afu_irq_free()
179 idr_remove(&ctx->irq_idr, irq->id); in ocxl_afu_irq_free()
180 afu_irq_free(irq, ctx); in ocxl_afu_irq_free()
188 struct afu_irq *irq; in ocxl_afu_irq_free_all() local
192 idr_for_each_entry(&ctx->irq_idr, irq, id) in ocxl_afu_irq_free_all()
193 afu_irq_free(irq, ctx); in ocxl_afu_irq_free_all()
200 struct afu_irq *irq; in ocxl_afu_irq_get_addr() local
204 irq = idr_find(&ctx->irq_idr, irq_id); in ocxl_afu_irq_get_addr()
205 if (irq) { in ocxl_afu_irq_get_addr()
206 xd = irq_get_handler_data(irq->virq); in ocxl_afu_irq_get_addr()