Lines Matching refs: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()
261 struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); in plic_irq_suspend() local
263 if (!handler->present) in plic_irq_suspend()
266 raw_spin_lock_irqsave(&handler->enable_lock, flags); in plic_irq_suspend()
268 reg = handler->enable_base + i * sizeof(u32); in plic_irq_suspend()
269 handler->enable_save[i] = readl(reg); in plic_irq_suspend()
271 raw_spin_unlock_irqrestore(&handler->enable_lock, flags); in plic_irq_suspend()
293 struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); in plic_irq_resume() local
295 if (!handler->present) in plic_irq_resume()
298 raw_spin_lock_irqsave(&handler->enable_lock, flags); in plic_irq_resume()
300 reg = handler->enable_base + i * sizeof(u32); in plic_irq_resume()
301 writel(handler->enable_save[i], reg); in plic_irq_resume()
303 raw_spin_unlock_irqrestore(&handler->enable_lock, flags); in plic_irq_resume()
376 struct plic_handler *handler = this_cpu_ptr(&plic_handlers); in plic_handle_irq() local
378 void __iomem *claim = handler->hart_base + CONTEXT_CLAIM; in plic_handle_irq()
381 WARN_ON_ONCE(!handler->present); in plic_handle_irq()
386 int err = generic_handle_domain_irq(handler->priv->irqdomain, in plic_handle_irq()
390 handler->priv->fwnode, hwirq); in plic_handle_irq()
397 static void plic_set_threshold(struct plic_handler *handler, u32 threshold) in plic_set_threshold() argument
400 writel(threshold, handler->hart_base + CONTEXT_THRESHOLD); in plic_set_threshold()
413 struct plic_handler *handler = this_cpu_ptr(&plic_handlers); in plic_starting_cpu() local
420 handler->priv->fwnode, cpu); in plic_starting_cpu()
421 plic_set_threshold(handler, PLIC_ENABLE_THRESHOLD); in plic_starting_cpu()
519 struct plic_handler *handler; in plic_probe() local
611 handler = per_cpu_ptr(&plic_handlers, cpu); in plic_probe()
612 if (handler->present) { in plic_probe()
614 plic_set_threshold(handler, PLIC_DISABLE_THRESHOLD); in plic_probe()
619 handler->present = true; in plic_probe()
620 handler->hart_base = priv->regs + CONTEXT_BASE + in plic_probe()
622 raw_spin_lock_init(&handler->enable_lock); in plic_probe()
623 handler->enable_base = priv->regs + CONTEXT_ENABLE_BASE + in plic_probe()
625 handler->priv = priv; in plic_probe()
627 handler->enable_save = kcalloc(DIV_ROUND_UP(nr_irqs, 32), in plic_probe()
628 sizeof(*handler->enable_save), GFP_KERNEL); in plic_probe()
629 if (!handler->enable_save) { in plic_probe()
635 plic_toggle(handler, hwirq, 0); in plic_probe()
659 handler = per_cpu_ptr(&plic_handlers, cpu); in plic_probe()
660 if (!handler->present) { in plic_probe()
698 handler = per_cpu_ptr(&plic_handlers, cpu); in plic_probe()
699 handler->present = false; in plic_probe()
700 handler->hart_base = NULL; in plic_probe()
701 handler->enable_base = NULL; in plic_probe()
702 kfree(handler->enable_save); in plic_probe()
703 handler->enable_save = NULL; in plic_probe()
704 handler->priv = NULL; in plic_probe()