mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	Merge remote-tracking branch 'origin/irq/gic-retrigger' into irq/irqchip-next
Signed-off-by: Marc Zyngier <maz@kernel.org>
This commit is contained in:
		
						commit
						eff65bd439
					
				
					 4 changed files with 41 additions and 4 deletions
				
			
		| 
						 | 
					@ -1720,6 +1720,11 @@ static int its_irq_set_irqchip_state(struct irq_data *d,
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int its_irq_retrigger(struct irq_data *d)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return !its_irq_set_irqchip_state(d, IRQCHIP_STATE_PENDING, true);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Two favourable cases:
 | 
					 * Two favourable cases:
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
| 
						 | 
					@ -1971,6 +1976,7 @@ static struct irq_chip its_irq_chip = {
 | 
				
			||||||
	.irq_set_affinity	= its_set_affinity,
 | 
						.irq_set_affinity	= its_set_affinity,
 | 
				
			||||||
	.irq_compose_msi_msg	= its_irq_compose_msi_msg,
 | 
						.irq_compose_msi_msg	= its_irq_compose_msi_msg,
 | 
				
			||||||
	.irq_set_irqchip_state	= its_irq_set_irqchip_state,
 | 
						.irq_set_irqchip_state	= its_irq_set_irqchip_state,
 | 
				
			||||||
 | 
						.irq_retrigger		= its_irq_retrigger,
 | 
				
			||||||
	.irq_set_vcpu_affinity	= its_irq_set_vcpu_affinity,
 | 
						.irq_set_vcpu_affinity	= its_irq_set_vcpu_affinity,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1221,6 +1221,11 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 | 
				
			||||||
#define gic_smp_init()		do { } while(0)
 | 
					#define gic_smp_init()		do { } while(0)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int gic_retrigger(struct irq_data *data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return !gic_irq_set_irqchip_state(data, IRQCHIP_STATE_PENDING, true);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_CPU_PM
 | 
					#ifdef CONFIG_CPU_PM
 | 
				
			||||||
static int gic_cpu_pm_notifier(struct notifier_block *self,
 | 
					static int gic_cpu_pm_notifier(struct notifier_block *self,
 | 
				
			||||||
			       unsigned long cmd, void *v)
 | 
								       unsigned long cmd, void *v)
 | 
				
			||||||
| 
						 | 
					@ -1256,6 +1261,7 @@ static struct irq_chip gic_chip = {
 | 
				
			||||||
	.irq_eoi		= gic_eoi_irq,
 | 
						.irq_eoi		= gic_eoi_irq,
 | 
				
			||||||
	.irq_set_type		= gic_set_type,
 | 
						.irq_set_type		= gic_set_type,
 | 
				
			||||||
	.irq_set_affinity	= gic_set_affinity,
 | 
						.irq_set_affinity	= gic_set_affinity,
 | 
				
			||||||
 | 
						.irq_retrigger          = gic_retrigger,
 | 
				
			||||||
	.irq_get_irqchip_state	= gic_irq_get_irqchip_state,
 | 
						.irq_get_irqchip_state	= gic_irq_get_irqchip_state,
 | 
				
			||||||
	.irq_set_irqchip_state	= gic_irq_set_irqchip_state,
 | 
						.irq_set_irqchip_state	= gic_irq_set_irqchip_state,
 | 
				
			||||||
	.irq_nmi_setup		= gic_irq_nmi_setup,
 | 
						.irq_nmi_setup		= gic_irq_nmi_setup,
 | 
				
			||||||
| 
						 | 
					@ -1273,6 +1279,7 @@ static struct irq_chip gic_eoimode1_chip = {
 | 
				
			||||||
	.irq_eoi		= gic_eoimode1_eoi_irq,
 | 
						.irq_eoi		= gic_eoimode1_eoi_irq,
 | 
				
			||||||
	.irq_set_type		= gic_set_type,
 | 
						.irq_set_type		= gic_set_type,
 | 
				
			||||||
	.irq_set_affinity	= gic_set_affinity,
 | 
						.irq_set_affinity	= gic_set_affinity,
 | 
				
			||||||
 | 
						.irq_retrigger          = gic_retrigger,
 | 
				
			||||||
	.irq_get_irqchip_state	= gic_irq_get_irqchip_state,
 | 
						.irq_get_irqchip_state	= gic_irq_get_irqchip_state,
 | 
				
			||||||
	.irq_set_irqchip_state	= gic_irq_set_irqchip_state,
 | 
						.irq_set_irqchip_state	= gic_irq_set_irqchip_state,
 | 
				
			||||||
	.irq_set_vcpu_affinity	= gic_irq_set_vcpu_affinity,
 | 
						.irq_set_vcpu_affinity	= gic_irq_set_vcpu_affinity,
 | 
				
			||||||
| 
						 | 
					@ -1288,6 +1295,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
 | 
				
			||||||
			      irq_hw_number_t hw)
 | 
								      irq_hw_number_t hw)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct irq_chip *chip = &gic_chip;
 | 
						struct irq_chip *chip = &gic_chip;
 | 
				
			||||||
 | 
						struct irq_data *irqd = irq_desc_get_irq_data(irq_to_desc(irq));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (static_branch_likely(&supports_deactivate_key))
 | 
						if (static_branch_likely(&supports_deactivate_key))
 | 
				
			||||||
		chip = &gic_eoimode1_chip;
 | 
							chip = &gic_eoimode1_chip;
 | 
				
			||||||
| 
						 | 
					@ -1312,7 +1320,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
 | 
				
			||||||
		irq_domain_set_info(d, irq, hw, chip, d->host_data,
 | 
							irq_domain_set_info(d, irq, hw, chip, d->host_data,
 | 
				
			||||||
				    handle_fasteoi_irq, NULL, NULL);
 | 
									    handle_fasteoi_irq, NULL, NULL);
 | 
				
			||||||
		irq_set_probe(irq);
 | 
							irq_set_probe(irq);
 | 
				
			||||||
		irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(irq)));
 | 
							irqd_set_single_target(irqd);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	case LPI_RANGE:
 | 
						case LPI_RANGE:
 | 
				
			||||||
| 
						 | 
					@ -1326,6 +1334,8 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
 | 
				
			||||||
		return -EPERM;
 | 
							return -EPERM;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Prevents SW retriggers which mess up the ACK/EOI ordering */
 | 
				
			||||||
 | 
						irqd_set_handle_enforce_irqctx(irqd);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -326,6 +326,11 @@ static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu)
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int gic_retrigger(struct irq_data *data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return !gic_irq_set_irqchip_state(data, IRQCHIP_STATE_PENDING, true);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
 | 
					static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	u32 irqstat, irqnr;
 | 
						u32 irqstat, irqnr;
 | 
				
			||||||
| 
						 | 
					@ -398,6 +403,7 @@ static const struct irq_chip gic_chip = {
 | 
				
			||||||
	.irq_unmask		= gic_unmask_irq,
 | 
						.irq_unmask		= gic_unmask_irq,
 | 
				
			||||||
	.irq_eoi		= gic_eoi_irq,
 | 
						.irq_eoi		= gic_eoi_irq,
 | 
				
			||||||
	.irq_set_type		= gic_set_type,
 | 
						.irq_set_type		= gic_set_type,
 | 
				
			||||||
 | 
						.irq_retrigger          = gic_retrigger,
 | 
				
			||||||
	.irq_get_irqchip_state	= gic_irq_get_irqchip_state,
 | 
						.irq_get_irqchip_state	= gic_irq_get_irqchip_state,
 | 
				
			||||||
	.irq_set_irqchip_state	= gic_irq_set_irqchip_state,
 | 
						.irq_set_irqchip_state	= gic_irq_set_irqchip_state,
 | 
				
			||||||
	.flags			= IRQCHIP_SET_TYPE_MASKED |
 | 
						.flags			= IRQCHIP_SET_TYPE_MASKED |
 | 
				
			||||||
| 
						 | 
					@ -996,6 +1002,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
 | 
				
			||||||
				irq_hw_number_t hw)
 | 
									irq_hw_number_t hw)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct gic_chip_data *gic = d->host_data;
 | 
						struct gic_chip_data *gic = d->host_data;
 | 
				
			||||||
 | 
						struct irq_data *irqd = irq_desc_get_irq_data(irq_to_desc(irq));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch (hw) {
 | 
						switch (hw) {
 | 
				
			||||||
	case 0 ... 15:
 | 
						case 0 ... 15:
 | 
				
			||||||
| 
						 | 
					@ -1013,9 +1020,12 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
 | 
				
			||||||
		irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data,
 | 
							irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data,
 | 
				
			||||||
				    handle_fasteoi_irq, NULL, NULL);
 | 
									    handle_fasteoi_irq, NULL, NULL);
 | 
				
			||||||
		irq_set_probe(irq);
 | 
							irq_set_probe(irq);
 | 
				
			||||||
		irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(irq)));
 | 
							irqd_set_single_target(irqd);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Prevents SW retriggers which mess up the ACK/EOI ordering */
 | 
				
			||||||
 | 
						irqd_set_handle_enforce_irqctx(irqd);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -86,6 +86,18 @@ static int irq_sw_resend(struct irq_desc *desc)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int try_retrigger(struct irq_desc *desc)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (desc->irq_data.chip->irq_retrigger)
 | 
				
			||||||
 | 
							return desc->irq_data.chip->irq_retrigger(&desc->irq_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
 | 
				
			||||||
 | 
						return irq_chip_retrigger_hierarchy(&desc->irq_data);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * IRQ resend
 | 
					 * IRQ resend
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
| 
						 | 
					@ -113,8 +125,7 @@ int check_irq_resend(struct irq_desc *desc, bool inject)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	desc->istate &= ~IRQS_PENDING;
 | 
						desc->istate &= ~IRQS_PENDING;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!desc->irq_data.chip->irq_retrigger ||
 | 
						if (!try_retrigger(desc))
 | 
				
			||||||
	    !desc->irq_data.chip->irq_retrigger(&desc->irq_data))
 | 
					 | 
				
			||||||
		err = irq_sw_resend(desc);
 | 
							err = irq_sw_resend(desc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* If the retrigger was successfull, mark it with the REPLAY bit */
 | 
						/* If the retrigger was successfull, mark it with the REPLAY bit */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue