aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/irq.h59
1 files changed, 55 insertions, 4 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 5d876c9b3a3d..b3741c83774c 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -135,7 +135,7 @@ struct msi_desc;
135 * struct irq_data - per irq and irq chip data passed down to chip functions 135 * struct irq_data - per irq and irq chip data passed down to chip functions
136 * @irq: interrupt number 136 * @irq: interrupt number
137 * @node: node index useful for balancing 137 * @node: node index useful for balancing
138 * @state_use_accessor: status information for irq chip functions. 138 * @state_use_accessors: status information for irq chip functions.
139 * Use accessor functions to deal with it 139 * Use accessor functions to deal with it
140 * @chip: low level interrupt hardware access 140 * @chip: low level interrupt hardware access
141 * @handler_data: per-IRQ data for the irq_chip methods 141 * @handler_data: per-IRQ data for the irq_chip methods
@@ -174,6 +174,9 @@ struct irq_data {
174 * from suspend 174 * from suspend
175 * IRDQ_MOVE_PCNTXT - Interrupt can be moved in process 175 * IRDQ_MOVE_PCNTXT - Interrupt can be moved in process
176 * context 176 * context
177 * IRQD_IRQ_DISABLED - Disabled state of the interrupt
178 * IRQD_IRQ_MASKED - Masked state of the interrupt
179 * IRQD_IRQ_INPROGRESS - In progress state of the interrupt
177 */ 180 */
178enum { 181enum {
179 IRQD_TRIGGER_MASK = 0xf, 182 IRQD_TRIGGER_MASK = 0xf,
@@ -184,6 +187,9 @@ enum {
184 IRQD_LEVEL = (1 << 13), 187 IRQD_LEVEL = (1 << 13),
185 IRQD_WAKEUP_STATE = (1 << 14), 188 IRQD_WAKEUP_STATE = (1 << 14),
186 IRQD_MOVE_PCNTXT = (1 << 15), 189 IRQD_MOVE_PCNTXT = (1 << 15),
190 IRQD_IRQ_DISABLED = (1 << 16),
191 IRQD_IRQ_MASKED = (1 << 17),
192 IRQD_IRQ_INPROGRESS = (1 << 18),
187}; 193};
188 194
189static inline bool irqd_is_setaffinity_pending(struct irq_data *d) 195static inline bool irqd_is_setaffinity_pending(struct irq_data *d)
@@ -206,6 +212,11 @@ static inline bool irqd_affinity_was_set(struct irq_data *d)
206 return d->state_use_accessors & IRQD_AFFINITY_SET; 212 return d->state_use_accessors & IRQD_AFFINITY_SET;
207} 213}
208 214
215static inline void irqd_mark_affinity_was_set(struct irq_data *d)
216{
217 d->state_use_accessors |= IRQD_AFFINITY_SET;
218}
219
209static inline u32 irqd_get_trigger_type(struct irq_data *d) 220static inline u32 irqd_get_trigger_type(struct irq_data *d)
210{ 221{
211 return d->state_use_accessors & IRQD_TRIGGER_MASK; 222 return d->state_use_accessors & IRQD_TRIGGER_MASK;
@@ -235,6 +246,36 @@ static inline bool irqd_can_move_in_process_context(struct irq_data *d)
235 return d->state_use_accessors & IRQD_MOVE_PCNTXT; 246 return d->state_use_accessors & IRQD_MOVE_PCNTXT;
236} 247}
237 248
249static inline bool irqd_irq_disabled(struct irq_data *d)
250{
251 return d->state_use_accessors & IRQD_IRQ_DISABLED;
252}
253
254static inline bool irqd_irq_masked(struct irq_data *d)
255{
256 return d->state_use_accessors & IRQD_IRQ_MASKED;
257}
258
259static inline bool irqd_irq_inprogress(struct irq_data *d)
260{
261 return d->state_use_accessors & IRQD_IRQ_INPROGRESS;
262}
263
264/*
265 * Functions for chained handlers which can be enabled/disabled by the
266 * standard disable_irq/enable_irq calls. Must be called with
267 * irq_desc->lock held.
268 */
269static inline void irqd_set_chained_irq_inprogress(struct irq_data *d)
270{
271 d->state_use_accessors |= IRQD_IRQ_INPROGRESS;
272}
273
274static inline void irqd_clr_chained_irq_inprogress(struct irq_data *d)
275{
276 d->state_use_accessors &= ~IRQD_IRQ_INPROGRESS;
277}
278
238/** 279/**
239 * struct irq_chip - hardware interrupt chip descriptor 280 * struct irq_chip - hardware interrupt chip descriptor
240 * 281 *
@@ -271,6 +312,8 @@ static inline bool irqd_can_move_in_process_context(struct irq_data *d)
271 * @irq_set_wake: enable/disable power-management wake-on of an IRQ 312 * @irq_set_wake: enable/disable power-management wake-on of an IRQ
272 * @irq_bus_lock: function to lock access to slow bus (i2c) chips 313 * @irq_bus_lock: function to lock access to slow bus (i2c) chips
273 * @irq_bus_sync_unlock:function to sync and unlock slow bus (i2c) chips 314 * @irq_bus_sync_unlock:function to sync and unlock slow bus (i2c) chips
315 * @irq_cpu_online: configure an interrupt source for a secondary CPU
316 * @irq_cpu_offline: un-configure an interrupt source for a secondary CPU
274 * @irq_print_chip: optional to print special chip info in show_interrupts 317 * @irq_print_chip: optional to print special chip info in show_interrupts
275 * @flags: chip specific flags 318 * @flags: chip specific flags
276 * 319 *
@@ -319,6 +362,9 @@ struct irq_chip {
319 void (*irq_bus_lock)(struct irq_data *data); 362 void (*irq_bus_lock)(struct irq_data *data);
320 void (*irq_bus_sync_unlock)(struct irq_data *data); 363 void (*irq_bus_sync_unlock)(struct irq_data *data);
321 364
365 void (*irq_cpu_online)(struct irq_data *data);
366 void (*irq_cpu_offline)(struct irq_data *data);
367
322 void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); 368 void (*irq_print_chip)(struct irq_data *data, struct seq_file *p);
323 369
324 unsigned long flags; 370 unsigned long flags;
@@ -335,11 +381,14 @@ struct irq_chip {
335 * IRQCHIP_SET_TYPE_MASKED: Mask before calling chip.irq_set_type() 381 * IRQCHIP_SET_TYPE_MASKED: Mask before calling chip.irq_set_type()
336 * IRQCHIP_EOI_IF_HANDLED: Only issue irq_eoi() when irq was handled 382 * IRQCHIP_EOI_IF_HANDLED: Only issue irq_eoi() when irq was handled
337 * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path 383 * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path
384 * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks
385 * when irq enabled
338 */ 386 */
339enum { 387enum {
340 IRQCHIP_SET_TYPE_MASKED = (1 << 0), 388 IRQCHIP_SET_TYPE_MASKED = (1 << 0),
341 IRQCHIP_EOI_IF_HANDLED = (1 << 1), 389 IRQCHIP_EOI_IF_HANDLED = (1 << 1),
342 IRQCHIP_MASK_ON_SUSPEND = (1 << 2), 390 IRQCHIP_MASK_ON_SUSPEND = (1 << 2),
391 IRQCHIP_ONOFFLINE_ENABLED = (1 << 3),
343}; 392};
344 393
345/* This include will go away once we isolated irq_desc usage to core code */ 394/* This include will go away once we isolated irq_desc usage to core code */
@@ -364,6 +413,10 @@ struct irqaction;
364extern int setup_irq(unsigned int irq, struct irqaction *new); 413extern int setup_irq(unsigned int irq, struct irqaction *new);
365extern void remove_irq(unsigned int irq, struct irqaction *act); 414extern void remove_irq(unsigned int irq, struct irqaction *act);
366 415
416extern void irq_cpu_online(void);
417extern void irq_cpu_offline(void);
418extern int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *cpumask);
419
367#ifdef CONFIG_GENERIC_HARDIRQS 420#ifdef CONFIG_GENERIC_HARDIRQS
368 421
369#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ) 422#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ)
@@ -380,9 +433,6 @@ static inline void irq_move_masked_irq(struct irq_data *data) { }
380 433
381extern int no_irq_affinity; 434extern int no_irq_affinity;
382 435
383/* Handle irq action chains: */
384extern irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action);
385
386/* 436/*
387 * Built-in IRQ handlers for various IRQ types, 437 * Built-in IRQ handlers for various IRQ types,
388 * callable via desc->handle_irq() 438 * callable via desc->handle_irq()
@@ -390,6 +440,7 @@ extern irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action);
390extern void handle_level_irq(unsigned int irq, struct irq_desc *desc); 440extern void handle_level_irq(unsigned int irq, struct irq_desc *desc);
391extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); 441extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);
392extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc); 442extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
443extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc);
393extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc); 444extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
394extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc); 445extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
395extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); 446extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);