Lines Matching refs:mq
66 xpc_get_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq, int cpu, char *irq_name) in xpc_get_gru_mq_irq_uv() argument
69 mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset); in xpc_get_gru_mq_irq_uv()
70 if (mq->irq < 0) { in xpc_get_gru_mq_irq_uv()
72 mq->irq); in xpc_get_gru_mq_irq_uv()
80 mq->irq = SGI_XPC_ACTIVATE; in xpc_get_gru_mq_irq_uv()
82 mq->irq = SGI_XPC_NOTIFY; in xpc_get_gru_mq_irq_uv()
86 mmr_pnode = uv_blade_to_pnode(mq->mmr_blade); in xpc_get_gru_mq_irq_uv()
87 mmr_value = (unsigned long)cpu_physical_id(cpu) << 32 | mq->irq; in xpc_get_gru_mq_irq_uv()
89 uv_write_global_mmr64(mmr_pnode, mq->mmr_offset, mmr_value); in xpc_get_gru_mq_irq_uv()
98 xpc_release_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq) in xpc_release_gru_mq_irq_uv() argument
101 uv_teardown_irq(mq->irq, mq->mmr_blade, mq->mmr_offset); in xpc_release_gru_mq_irq_uv()
107 mmr_pnode = uv_blade_to_pnode(mq->mmr_blade); in xpc_release_gru_mq_irq_uv()
110 uv_write_global_mmr64(mmr_pnode, mq->mmr_offset, mmr_value); in xpc_release_gru_mq_irq_uv()
117 xpc_gru_mq_watchlist_alloc_uv(struct xpc_gru_mq_uv *mq) in xpc_gru_mq_watchlist_alloc_uv() argument
122 ret = uv_bios_mq_watchlist_alloc(mq->mmr_blade, uv_gpa(mq->address), in xpc_gru_mq_watchlist_alloc_uv()
123 mq->order, &mq->mmr_offset); in xpc_gru_mq_watchlist_alloc_uv()
130 ret = sn_mq_watchlist_alloc(mq->mmr_blade, uv_gpa(mq->address), in xpc_gru_mq_watchlist_alloc_uv()
131 mq->order, &mq->mmr_offset); in xpc_gru_mq_watchlist_alloc_uv()
141 mq->watchlist_num = ret; in xpc_gru_mq_watchlist_alloc_uv()
146 xpc_gru_mq_watchlist_free_uv(struct xpc_gru_mq_uv *mq) in xpc_gru_mq_watchlist_free_uv() argument
151 ret = uv_bios_mq_watchlist_free(mq->mmr_blade, mq->watchlist_num); in xpc_gru_mq_watchlist_free_uv()
154 ret = sn_mq_watchlist_free(mq->mmr_blade, mq->watchlist_num); in xpc_gru_mq_watchlist_free_uv()
170 struct xpc_gru_mq_uv *mq; in xpc_create_gru_mq_uv() local
172 mq = kmalloc(sizeof(struct xpc_gru_mq_uv), GFP_KERNEL); in xpc_create_gru_mq_uv()
173 if (mq == NULL) { in xpc_create_gru_mq_uv()
181 mq->order = pg_order + PAGE_SHIFT; in xpc_create_gru_mq_uv()
182 mq_size = 1UL << mq->order; in xpc_create_gru_mq_uv()
184 mq->mmr_blade = uv_cpu_to_blade_id(cpu); in xpc_create_gru_mq_uv()
195 mq->address = page_address(page); in xpc_create_gru_mq_uv()
197 ret = gru_create_message_queue(mq->address, mq_size); in xpc_create_gru_mq_uv()
206 ret = xpc_gru_mq_watchlist_alloc_uv(mq); in xpc_create_gru_mq_uv()
210 ret = xpc_get_gru_mq_irq_uv(mq, cpu, irq_name); in xpc_create_gru_mq_uv()
214 ret = request_irq(mq->irq, irq_handler, 0, irq_name, NULL); in xpc_create_gru_mq_uv()
217 mq->irq, ret); in xpc_create_gru_mq_uv()
222 xp_ret = xp_expand_memprotect(xp_pa(mq->address), mq_size); in xpc_create_gru_mq_uv()
228 return mq; in xpc_create_gru_mq_uv()
232 free_irq(mq->irq, NULL); in xpc_create_gru_mq_uv()
234 xpc_release_gru_mq_irq_uv(mq); in xpc_create_gru_mq_uv()
236 xpc_gru_mq_watchlist_free_uv(mq); in xpc_create_gru_mq_uv()
238 free_pages((unsigned long)mq->address, pg_order); in xpc_create_gru_mq_uv()
240 kfree(mq); in xpc_create_gru_mq_uv()
246 xpc_destroy_gru_mq_uv(struct xpc_gru_mq_uv *mq) in xpc_destroy_gru_mq_uv() argument
253 mq_size = 1UL << mq->order; in xpc_destroy_gru_mq_uv()
254 ret = xp_restrict_memprotect(xp_pa(mq->address), mq_size); in xpc_destroy_gru_mq_uv()
258 free_irq(mq->irq, NULL); in xpc_destroy_gru_mq_uv()
259 xpc_release_gru_mq_irq_uv(mq); in xpc_destroy_gru_mq_uv()
262 xpc_gru_mq_watchlist_free_uv(mq); in xpc_destroy_gru_mq_uv()
264 pg_order = mq->order - PAGE_SHIFT; in xpc_destroy_gru_mq_uv()
265 free_pages((unsigned long)mq->address, pg_order); in xpc_destroy_gru_mq_uv()
267 kfree(mq); in xpc_destroy_gru_mq_uv()