Lines Matching refs:mq

90 xpc_get_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq, int cpu, char *irq_name)
92 int mmr_pnode = uv_blade_to_pnode(mq->mmr_blade);
94 mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset,
96 if (mq->irq < 0)
97 return mq->irq;
99 mq->mmr_value = uv_read_global_mmr64(mmr_pnode, mq->mmr_offset);
105 xpc_release_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq)
107 uv_teardown_irq(mq->irq);
111 xpc_gru_mq_watchlist_alloc_uv(struct xpc_gru_mq_uv *mq)
115 ret = uv_bios_mq_watchlist_alloc(uv_gpa(mq->address),
116 mq->order, &mq->mmr_offset);
123 mq->watchlist_num = ret;
128 xpc_gru_mq_watchlist_free_uv(struct xpc_gru_mq_uv *mq)
131 int mmr_pnode = uv_blade_to_pnode(mq->mmr_blade);
133 ret = uv_bios_mq_watchlist_free(mmr_pnode, mq->watchlist_num);
147 struct xpc_gru_mq_uv *mq;
150 mq = kmalloc(sizeof(struct xpc_gru_mq_uv), GFP_KERNEL);
151 if (mq == NULL) {
158 mq->gru_mq_desc = kzalloc(sizeof(struct gru_message_queue_desc),
160 if (mq->gru_mq_desc == NULL) {
168 mq->order = pg_order + PAGE_SHIFT;
169 mq_size = 1UL << mq->order;
171 mq->mmr_blade = uv_cpu_to_blade_id(cpu);
179 "bytes of memory on nid=%d for GRU mq\n", mq_size, nid);
183 mq->address = page_address(page);
185 /* enable generation of irq when GRU mq operation occurs to this mq */
186 ret = xpc_gru_mq_watchlist_alloc_uv(mq);
190 ret = xpc_get_gru_mq_irq_uv(mq, cpu, irq_name);
194 ret = request_irq(mq->irq, irq_handler, 0, irq_name, NULL);
197 mq->irq, -ret);
203 mmr_value = (struct uv_IO_APIC_route_entry *)&mq->mmr_value;
204 ret = gru_create_message_queue(mq->gru_mq_desc, mq->address, mq_size,
213 /* allow other partitions to access this GRU mq */
214 xp_ret = xp_expand_memprotect(xp_pa(mq->address), mq_size);
220 return mq;
224 free_irq(mq->irq, NULL);
226 xpc_release_gru_mq_irq_uv(mq);
228 xpc_gru_mq_watchlist_free_uv(mq);
230 free_pages((unsigned long)mq->address, pg_order);
232 kfree(mq->gru_mq_desc);
234 kfree(mq);
240 xpc_destroy_gru_mq_uv(struct xpc_gru_mq_uv *mq)
246 /* disallow other partitions to access GRU mq */
247 mq_size = 1UL << mq->order;
248 ret = xp_restrict_memprotect(xp_pa(mq->address), mq_size);
251 /* unregister irq handler and release mq irq/vector mapping */
252 free_irq(mq->irq, NULL);
253 xpc_release_gru_mq_irq_uv(mq);
255 /* disable generation of irq when GRU mq op occurs to this mq */
256 xpc_gru_mq_watchlist_free_uv(mq);
258 pg_order = mq->order - PAGE_SHIFT;
259 free_pages((unsigned long)mq->address, pg_order);
261 kfree(mq);
599 gru_mq_desc->mq = NULL;
698 * !!! mq message our way by doing what the activate IRQ handler would