@@ -97,7 +97,7 @@ static inline void plic_irq_toggle(const struct cpumask *mask,
97
97
}
98
98
}
99
99
100
- static void plic_irq_enable (struct irq_data * d )
100
+ static void plic_irq_unmask (struct irq_data * d )
101
101
{
102
102
unsigned int cpu = cpumask_any_and (irq_data_get_affinity_mask (d ),
103
103
cpu_online_mask );
@@ -106,7 +106,7 @@ static void plic_irq_enable(struct irq_data *d)
106
106
plic_irq_toggle (cpumask_of (cpu ), d -> hwirq , 1 );
107
107
}
108
108
109
- static void plic_irq_disable (struct irq_data * d )
109
+ static void plic_irq_mask (struct irq_data * d )
110
110
{
111
111
plic_irq_toggle (cpu_possible_mask , d -> hwirq , 0 );
112
112
}
@@ -125,25 +125,27 @@ static int plic_set_affinity(struct irq_data *d,
125
125
if (cpu >= nr_cpu_ids )
126
126
return - EINVAL ;
127
127
128
- if (!irqd_irq_disabled (d )) {
129
- plic_irq_toggle (cpu_possible_mask , d -> hwirq , 0 );
130
- plic_irq_toggle (cpumask_of (cpu ), d -> hwirq , 1 );
131
- }
128
+ plic_irq_toggle (cpu_possible_mask , d -> hwirq , 0 );
129
+ plic_irq_toggle (cpumask_of (cpu ), d -> hwirq , 1 );
132
130
133
131
irq_data_update_effective_affinity (d , cpumask_of (cpu ));
134
132
135
133
return IRQ_SET_MASK_OK_DONE ;
136
134
}
137
135
#endif
138
136
137
+ static void plic_irq_eoi (struct irq_data * d )
138
+ {
139
+ struct plic_handler * handler = this_cpu_ptr (& plic_handlers );
140
+
141
+ writel (d -> hwirq , handler -> hart_base + CONTEXT_CLAIM );
142
+ }
143
+
139
144
static struct irq_chip plic_chip = {
140
145
.name = "SiFive PLIC" ,
141
- /*
142
- * There is no need to mask/unmask PLIC interrupts. They are "masked"
143
- * by reading claim and "unmasked" when writing it back.
144
- */
145
- .irq_enable = plic_irq_enable ,
146
- .irq_disable = plic_irq_disable ,
146
+ .irq_mask = plic_irq_mask ,
147
+ .irq_unmask = plic_irq_unmask ,
148
+ .irq_eoi = plic_irq_eoi ,
147
149
#ifdef CONFIG_SMP
148
150
.irq_set_affinity = plic_set_affinity ,
149
151
#endif
@@ -152,7 +154,7 @@ static struct irq_chip plic_chip = {
152
154
static int plic_irqdomain_map (struct irq_domain * d , unsigned int irq ,
153
155
irq_hw_number_t hwirq )
154
156
{
155
- irq_set_chip_and_handler (irq , & plic_chip , handle_simple_irq );
157
+ irq_set_chip_and_handler (irq , & plic_chip , handle_fasteoi_irq );
156
158
irq_set_chip_data (irq , NULL );
157
159
irq_set_noprobe (irq );
158
160
return 0 ;
@@ -188,7 +190,6 @@ static void plic_handle_irq(struct pt_regs *regs)
188
190
hwirq );
189
191
else
190
192
generic_handle_irq (irq );
191
- writel (hwirq , claim );
192
193
}
193
194
csr_set (sie , SIE_SEIE );
194
195
}
0 commit comments