irqchip/gic-v3-its: Allow doorbell interrupts to be injected/cleared

While the doorbell interrupts are usually driven by the HW itself,
having a way to trigger them independently has proved to be a
really useful debug feature. As it is actually very little code,
let's add it to the VPE irqchip operations.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

+31
+31
drivers/irqchip/irq-gic-v3-its.c
··· 2504 2504 its_vpe_send_inv(d); 2505 2505 } 2506 2506 2507 + static int its_vpe_set_irqchip_state(struct irq_data *d, 2508 + enum irqchip_irq_state which, 2509 + bool state) 2510 + { 2511 + struct its_vpe *vpe = irq_data_get_irq_chip_data(d); 2512 + 2513 + if (which != IRQCHIP_STATE_PENDING) 2514 + return -EINVAL; 2515 + 2516 + if (gic_rdists->has_direct_lpi) { 2517 + void __iomem *rdbase; 2518 + 2519 + rdbase = per_cpu_ptr(gic_rdists->rdist, vpe->col_idx)->rd_base; 2520 + if (state) { 2521 + gic_write_lpir(vpe->vpe_db_lpi, rdbase + GICR_SETLPIR); 2522 + } else { 2523 + gic_write_lpir(vpe->vpe_db_lpi, rdbase + GICR_CLRLPIR); 2524 + while (gic_read_lpir(rdbase + GICR_SYNCR) & 1) 2525 + cpu_relax(); 2526 + } 2527 + } else { 2528 + if (state) 2529 + its_vpe_send_cmd(vpe, its_send_int); 2530 + else 2531 + its_vpe_send_cmd(vpe, its_send_clear); 2532 + } 2533 + 2534 + return 0; 2535 + } 2536 + 2507 2537 static struct irq_chip its_vpe_irq_chip = { 2508 2538 .name = "GICv4-vpe", 2509 2539 .irq_mask = its_vpe_mask_irq, 2510 2540 .irq_unmask = its_vpe_unmask_irq, 2511 2541 .irq_eoi = irq_chip_eoi_parent, 2512 2542 .irq_set_affinity = its_vpe_set_affinity, 2543 + .irq_set_irqchip_state = its_vpe_set_irqchip_state, 2513 2544 .irq_set_vcpu_affinity = its_vpe_set_vcpu_affinity, 2514 2545 }; 2515 2546