Lines Matching refs:vinst
29 static int vas_irq_fault_window_setup(struct vas_instance *vinst) in vas_irq_fault_window_setup() argument
33 rc = request_threaded_irq(vinst->virq, vas_fault_handler, in vas_irq_fault_window_setup()
34 vas_fault_thread_fn, 0, vinst->name, vinst); in vas_irq_fault_window_setup()
38 vinst->vas_id, vinst->virq, rc); in vas_irq_fault_window_setup()
42 rc = vas_setup_fault_window(vinst); in vas_irq_fault_window_setup()
44 free_irq(vinst->virq, vinst); in vas_irq_fault_window_setup()
53 struct vas_instance *vinst; in init_vas_instance() local
77 vinst = kzalloc(sizeof(*vinst), GFP_KERNEL); in init_vas_instance()
78 if (!vinst) in init_vas_instance()
81 vinst->name = kasprintf(GFP_KERNEL, "vas-%d", vasid); in init_vas_instance()
82 if (!vinst->name) { in init_vas_instance()
83 kfree(vinst); in init_vas_instance()
87 INIT_LIST_HEAD(&vinst->node); in init_vas_instance()
88 ida_init(&vinst->ida); in init_vas_instance()
89 mutex_init(&vinst->mutex); in init_vas_instance()
90 vinst->vas_id = vasid; in init_vas_instance()
91 vinst->pdev = pdev; in init_vas_instance()
94 vinst->hvwc_bar_start = res->start; in init_vas_instance()
97 vinst->uwc_bar_start = res->start; in init_vas_instance()
100 vinst->paste_base_addr = res->start; in init_vas_instance()
108 vinst->paste_win_id_shift = 63 - res->end; in init_vas_instance()
113 vinst->vas_id, chipid); in init_vas_instance()
117 vinst->virq = irq_create_mapping(NULL, hwirq); in init_vas_instance()
118 if (!vinst->virq) { in init_vas_instance()
120 vinst->vas_id, hwirq); in init_vas_instance()
124 xd = irq_get_handler_data(vinst->virq); in init_vas_instance()
127 vinst->vas_id, vinst->virq); in init_vas_instance()
131 vinst->irq_port = xd->trig_page; in init_vas_instance()
133 pdev->name, vasid, vinst->paste_base_addr, in init_vas_instance()
134 vinst->paste_win_id_shift, vinst->virq, in init_vas_instance()
135 vinst->irq_port); in init_vas_instance()
143 list_add(&vinst->node, &vas_instances); in init_vas_instance()
146 spin_lock_init(&vinst->fault_lock); in init_vas_instance()
151 if (vinst->virq) { in init_vas_instance()
152 rc = vas_irq_fault_window_setup(vinst); in init_vas_instance()
159 vinst->virq = 0; in init_vas_instance()
162 vas_instance_init_dbgdir(vinst); in init_vas_instance()
164 dev_set_drvdata(&pdev->dev, vinst); in init_vas_instance()
169 kfree(vinst->name); in init_vas_instance()
170 kfree(vinst); in init_vas_instance()
182 struct vas_instance *vinst; in find_vas_instance() local
190 vinst = list_entry(ent, struct vas_instance, node); in find_vas_instance()
191 if (vinst->vas_id == vasid) { in find_vas_instance()
193 return vinst; in find_vas_instance()