Lines Matching defs:xc

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