Lines Matching refs:xc
151 static u32 xive_scan_interrupts(struct xive_cpu *xc, bool just_peek) in xive_scan_interrupts() argument
157 while (xc->pending_prio != 0) { in xive_scan_interrupts()
160 prio = ffs(xc->pending_prio) - 1; in xive_scan_interrupts()
164 irq = xive_read_eq(&xc->queue[prio], just_peek); in xive_scan_interrupts()
182 xc->pending_prio &= ~(1 << prio); in xive_scan_interrupts()
189 q = &xc->queue[prio]; in xive_scan_interrupts()
204 if (prio != xc->cppr) { in xive_scan_interrupts()
206 xc->cppr = prio; in xive_scan_interrupts()
272 struct xive_cpu *xc = per_cpu(xive_cpu, cpu); in xmon_xive_do_dump() local
275 if (xc) { in xmon_xive_do_dump()
276 xmon_printf("pp=%02x CPPR=%02x ", xc->pending_prio, xc->cppr); in xmon_xive_do_dump()
282 xive_irq_data_dump(&xc->ipi_data, buffer, sizeof(buffer)); in xmon_xive_do_dump()
283 xmon_printf("IPI=0x%08x %s", xc->hw_ipi, buffer); in xmon_xive_do_dump()
286 xive_dump_eq("EQ", &xc->queue[xive_irq_priority]); in xmon_xive_do_dump()
346 struct xive_cpu *xc = __this_cpu_read(xive_cpu); in xive_get_irq() local
363 xive_ops->update_pending(xc); in xive_get_irq()
365 DBG_VERBOSE("get_irq: pending=%02x\n", xc->pending_prio); in xive_get_irq()
368 irq = xive_scan_interrupts(xc, false); in xive_get_irq()
371 irq, xc->pending_prio); in xive_get_irq()
389 static void xive_do_queue_eoi(struct xive_cpu *xc) in xive_do_queue_eoi() argument
391 if (xive_scan_interrupts(xc, true) != 0) { in xive_do_queue_eoi()
392 DBG_VERBOSE("eoi: pending=0x%02x\n", xc->pending_prio); in xive_do_queue_eoi()
441 struct xive_cpu *xc = __this_cpu_read(xive_cpu); in xive_irq_eoi() local
444 d->irq, irqd_to_hwirq(d), xc->pending_prio); in xive_irq_eoi()
463 xive_do_queue_eoi(xc); in xive_irq_eoi()
505 struct xive_cpu *xc = per_cpu(xive_cpu, cpu); in xive_try_pick_target() local
506 struct xive_q *q = &xc->queue[xive_irq_priority]; in xive_try_pick_target()
529 struct xive_cpu *xc = per_cpu(xive_cpu, cpu); in xive_dec_target_count() local
530 struct xive_q *q = &xc->queue[xive_irq_priority]; in xive_dec_target_count()
532 if (WARN_ON(cpu < 0 || !xc)) { in xive_dec_target_count()
533 pr_err("%s: cpu=%d xc=%p\n", __func__, cpu, xc); in xive_dec_target_count()
610 struct xive_cpu *xc = per_cpu(xive_cpu, cpu); in xive_pick_irq_target() local
611 if (xc->chip_id == xd->src_chip) in xive_pick_irq_target()
1058 struct xive_cpu *xc; in xive_cause_ipi() local
1061 xc = per_cpu(xive_cpu, cpu); in xive_cause_ipi()
1064 smp_processor_id(), cpu, xc->hw_ipi); in xive_cause_ipi()
1066 xd = &xc->ipi_data; in xive_cause_ipi()
1079 struct xive_cpu *xc = __this_cpu_read(xive_cpu); in xive_ipi_eoi() local
1082 if (!xc) in xive_ipi_eoi()
1086 d->irq, irqd_to_hwirq(d), xc->hw_ipi, xc->pending_prio); in xive_ipi_eoi()
1088 xive_do_source_eoi(&xc->ipi_data); in xive_ipi_eoi()
1089 xive_do_queue_eoi(xc); in xive_ipi_eoi()
1201 struct xive_cpu *xc; in xive_setup_cpu_ipi() local
1206 xc = per_cpu(xive_cpu, cpu); in xive_setup_cpu_ipi()
1209 if (xc->hw_ipi != XIVE_BAD_IRQ) in xive_setup_cpu_ipi()
1216 if (xive_ops->get_ipi(cpu, xc)) in xive_setup_cpu_ipi()
1223 rc = xive_ops->populate_irq_data(xc->hw_ipi, &xc->ipi_data); in xive_setup_cpu_ipi()
1228 rc = xive_ops->configure_irq(xc->hw_ipi, in xive_setup_cpu_ipi()
1236 xc->hw_ipi, xive_ipi_irq, xc->ipi_data.trig_mmio); in xive_setup_cpu_ipi()
1239 xive_do_source_set_mask(&xc->ipi_data, false); in xive_setup_cpu_ipi()
1244 noinstr static void xive_cleanup_cpu_ipi(unsigned int cpu, struct xive_cpu *xc) in xive_cleanup_cpu_ipi() argument
1251 if (xc->hw_ipi == XIVE_BAD_IRQ) in xive_cleanup_cpu_ipi()
1257 xive_do_source_set_mask(&xc->ipi_data, true); in xive_cleanup_cpu_ipi()
1266 xive_ops->configure_irq(xc->hw_ipi, hard_smp_processor_id(), in xive_cleanup_cpu_ipi()
1270 xive_ops->put_ipi(cpu, xc); in xive_cleanup_cpu_ipi()
1473 static void xive_cleanup_cpu_queues(unsigned int cpu, struct xive_cpu *xc) in xive_cleanup_cpu_queues() argument
1475 if (xc->queue[xive_irq_priority].qpage) in xive_cleanup_cpu_queues()
1476 xive_ops->cleanup_queue(cpu, xc, xive_irq_priority); in xive_cleanup_cpu_queues()
1479 static int xive_setup_cpu_queues(unsigned int cpu, struct xive_cpu *xc) in xive_setup_cpu_queues() argument
1484 if (!xc->queue[xive_irq_priority].qpage) in xive_setup_cpu_queues()
1485 rc = xive_ops->setup_queue(cpu, xc, xive_irq_priority); in xive_setup_cpu_queues()
1492 struct xive_cpu *xc; in xive_prepare_cpu() local
1494 xc = per_cpu(xive_cpu, cpu); in xive_prepare_cpu()
1495 if (!xc) { in xive_prepare_cpu()
1496 xc = kzalloc_node(sizeof(struct xive_cpu), in xive_prepare_cpu()
1498 if (!xc) in xive_prepare_cpu()
1500 xc->hw_ipi = XIVE_BAD_IRQ; in xive_prepare_cpu()
1501 xc->chip_id = XIVE_INVALID_CHIP_ID; in xive_prepare_cpu()
1503 xive_ops->prepare_cpu(cpu, xc); in xive_prepare_cpu()
1505 per_cpu(xive_cpu, cpu) = xc; in xive_prepare_cpu()
1509 return xive_setup_cpu_queues(cpu, xc); in xive_prepare_cpu()
1514 struct xive_cpu *xc = __this_cpu_read(xive_cpu); in xive_setup_cpu() local
1518 xive_ops->setup_cpu(smp_processor_id(), xc); in xive_setup_cpu()
1521 xc->cppr = 0xff; in xive_setup_cpu()
1550 static void xive_flush_cpu_queue(unsigned int cpu, struct xive_cpu *xc) in xive_flush_cpu_queue() argument
1558 while ((irq = xive_scan_interrupts(xc, false)) != 0) { in xive_flush_cpu_queue()
1606 struct xive_cpu *xc = __this_cpu_read(xive_cpu); in xive_smp_disable_cpu() local
1613 xc->cppr = 0; in xive_smp_disable_cpu()
1617 xive_flush_cpu_queue(cpu, xc); in xive_smp_disable_cpu()
1620 xc->cppr = 0xff; in xive_smp_disable_cpu()
1626 struct xive_cpu *xc = __this_cpu_read(xive_cpu); in xive_flush_interrupt() local
1630 xive_flush_cpu_queue(cpu, xc); in xive_flush_interrupt()
1639 struct xive_cpu *xc = __this_cpu_read(xive_cpu); in xive_teardown_cpu() local
1643 xc->cppr = 0; in xive_teardown_cpu()
1647 xive_ops->teardown_cpu(cpu, xc); in xive_teardown_cpu()
1651 xive_cleanup_cpu_ipi(cpu, xc); in xive_teardown_cpu()
1655 xive_cleanup_cpu_queues(cpu, xc); in xive_teardown_cpu()
1731 struct xive_cpu *xc = per_cpu(xive_cpu, cpu); in xive_debug_show_ipi() local
1734 if (xc) { in xive_debug_show_ipi()
1735 seq_printf(m, "pp=%02x CPPR=%02x ", xc->pending_prio, xc->cppr); in xive_debug_show_ipi()
1741 xive_irq_data_dump(&xc->ipi_data, buffer, sizeof(buffer)); in xive_debug_show_ipi()
1742 seq_printf(m, "IPI=0x%08x %s", xc->hw_ipi, buffer); in xive_debug_show_ipi()
1819 struct xive_cpu *xc = per_cpu(xive_cpu, cpu); in xive_eq_debug_show() local
1821 if (xc) in xive_eq_debug_show()
1822 xive_eq_debug_show_one(m, &xc->queue[xive_irq_priority], in xive_eq_debug_show()