Lines Matching full:handler

108 static void plic_toggle(struct plic_handler *handler, int hwirq, int enable)  in plic_toggle()  argument
112 raw_spin_lock_irqsave(&handler->enable_lock, flags); in plic_toggle()
113 __plic_toggle(handler->enable_base, hwirq, enable); in plic_toggle()
114 raw_spin_unlock_irqrestore(&handler->enable_lock, flags); in plic_toggle()
123 struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); in plic_irq_toggle() local
125 plic_toggle(handler, d->hwirq, enable); in plic_irq_toggle()
156 struct plic_handler *handler = this_cpu_ptr(&plic_handlers); in plic_irq_eoi() local
159 plic_toggle(handler, d->hwirq, 1); in plic_irq_eoi()
160 writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM); in plic_irq_eoi()
161 plic_toggle(handler, d->hwirq, 0); in plic_irq_eoi()
163 writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM); in plic_irq_eoi()
262 struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); in plic_irq_suspend() local
264 if (!handler->present) in plic_irq_suspend()
267 raw_spin_lock_irqsave(&handler->enable_lock, flags); in plic_irq_suspend()
269 reg = handler->enable_base + i * sizeof(u32); in plic_irq_suspend()
270 handler->enable_save[i] = readl(reg); in plic_irq_suspend()
272 raw_spin_unlock_irqrestore(&handler->enable_lock, flags); in plic_irq_suspend()
294 struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); in plic_irq_resume() local
296 if (!handler->present) in plic_irq_resume()
299 raw_spin_lock_irqsave(&handler->enable_lock, flags); in plic_irq_resume()
301 reg = handler->enable_base + i * sizeof(u32); in plic_irq_resume()
302 writel(handler->enable_save[i], reg); in plic_irq_resume()
304 raw_spin_unlock_irqrestore(&handler->enable_lock, flags); in plic_irq_resume()
377 struct plic_handler *handler = this_cpu_ptr(&plic_handlers); in plic_handle_irq() local
379 void __iomem *claim = handler->hart_base + CONTEXT_CLAIM; in plic_handle_irq()
382 WARN_ON_ONCE(!handler->present); in plic_handle_irq()
387 int err = generic_handle_domain_irq(handler->priv->irqdomain, in plic_handle_irq()
391 handler->priv->fwnode, hwirq); in plic_handle_irq()
398 static void plic_set_threshold(struct plic_handler *handler, u32 threshold) in plic_set_threshold() argument
401 writel(threshold, handler->hart_base + CONTEXT_THRESHOLD); in plic_set_threshold()
414 struct plic_handler *handler = this_cpu_ptr(&plic_handlers); in plic_starting_cpu() local
421 handler->priv->fwnode, cpu); in plic_starting_cpu()
422 plic_set_threshold(handler, PLIC_ENABLE_THRESHOLD); in plic_starting_cpu()
520 struct plic_handler *handler; in plic_probe() local
608 * When running in M-mode we need to ignore the S-mode handler. in plic_probe()
612 handler = per_cpu_ptr(&plic_handlers, cpu); in plic_probe()
613 if (handler->present) { in plic_probe()
614 pr_warn("%pfwP: handler already present for context %d.\n", fwnode, i); in plic_probe()
615 plic_set_threshold(handler, PLIC_DISABLE_THRESHOLD); in plic_probe()
620 handler->present = true; in plic_probe()
621 handler->hart_base = priv->regs + CONTEXT_BASE + in plic_probe()
623 raw_spin_lock_init(&handler->enable_lock); in plic_probe()
624 handler->enable_base = priv->regs + CONTEXT_ENABLE_BASE + in plic_probe()
626 handler->priv = priv; in plic_probe()
628 handler->enable_save = kcalloc(DIV_ROUND_UP(nr_irqs, 32), in plic_probe()
629 sizeof(*handler->enable_save), GFP_KERNEL); in plic_probe()
630 if (!handler->enable_save) { in plic_probe()
636 plic_toggle(handler, hwirq, 0); in plic_probe()
660 handler = per_cpu_ptr(&plic_handlers, cpu); in plic_probe()
661 if (!handler->present) { in plic_probe()
668 /* Find parent domain and register chained handler */ in plic_probe()
699 handler = per_cpu_ptr(&plic_handlers, cpu); in plic_probe()
700 handler->present = false; in plic_probe()
701 handler->hart_base = NULL; in plic_probe()
702 handler->enable_base = NULL; in plic_probe()
703 kfree(handler->enable_save); in plic_probe()
704 handler->enable_save = NULL; in plic_probe()
705 handler->priv = NULL; in plic_probe()