2626int irq_set_chip (unsigned int irq , struct irq_chip * chip )
2727{
2828 unsigned long flags ;
29- struct irq_desc * desc = irq_get_desc_lock (irq , & flags );
29+ struct irq_desc * desc = irq_get_desc_lock (irq , & flags , 0 );
3030
3131 if (!desc )
3232 return - EINVAL ;
@@ -54,7 +54,7 @@ EXPORT_SYMBOL(irq_set_chip);
5454int irq_set_irq_type (unsigned int irq , unsigned int type )
5555{
5656 unsigned long flags ;
57- struct irq_desc * desc = irq_get_desc_buslock (irq , & flags );
57+ struct irq_desc * desc = irq_get_desc_buslock (irq , & flags , IRQ_GET_DESC_CHECK_GLOBAL );
5858 int ret = 0 ;
5959
6060 if (!desc )
@@ -78,7 +78,7 @@ EXPORT_SYMBOL(irq_set_irq_type);
7878int irq_set_handler_data (unsigned int irq , void * data )
7979{
8080 unsigned long flags ;
81- struct irq_desc * desc = irq_get_desc_lock (irq , & flags );
81+ struct irq_desc * desc = irq_get_desc_lock (irq , & flags , 0 );
8282
8383 if (!desc )
8484 return - EINVAL ;
@@ -98,7 +98,7 @@ EXPORT_SYMBOL(irq_set_handler_data);
9898int irq_set_msi_desc (unsigned int irq , struct msi_desc * entry )
9999{
100100 unsigned long flags ;
101- struct irq_desc * desc = irq_get_desc_lock (irq , & flags );
101+ struct irq_desc * desc = irq_get_desc_lock (irq , & flags , IRQ_GET_DESC_CHECK_GLOBAL );
102102
103103 if (!desc )
104104 return - EINVAL ;
@@ -119,7 +119,7 @@ int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry)
119119int irq_set_chip_data (unsigned int irq , void * data )
120120{
121121 unsigned long flags ;
122- struct irq_desc * desc = irq_get_desc_lock (irq , & flags );
122+ struct irq_desc * desc = irq_get_desc_lock (irq , & flags , 0 );
123123
124124 if (!desc )
125125 return - EINVAL ;
@@ -204,6 +204,24 @@ void irq_disable(struct irq_desc *desc)
204204 }
205205}
206206
207+ void irq_percpu_enable (struct irq_desc * desc , unsigned int cpu )
208+ {
209+ if (desc -> irq_data .chip -> irq_enable )
210+ desc -> irq_data .chip -> irq_enable (& desc -> irq_data );
211+ else
212+ desc -> irq_data .chip -> irq_unmask (& desc -> irq_data );
213+ cpumask_set_cpu (cpu , desc -> percpu_enabled );
214+ }
215+
216+ void irq_percpu_disable (struct irq_desc * desc , unsigned int cpu )
217+ {
218+ if (desc -> irq_data .chip -> irq_disable )
219+ desc -> irq_data .chip -> irq_disable (& desc -> irq_data );
220+ else
221+ desc -> irq_data .chip -> irq_mask (& desc -> irq_data );
222+ cpumask_clear_cpu (cpu , desc -> percpu_enabled );
223+ }
224+
207225static inline void mask_ack_irq (struct irq_desc * desc )
208226{
209227 if (desc -> irq_data .chip -> irq_mask_ack )
@@ -544,12 +562,44 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
544562 chip -> irq_eoi (& desc -> irq_data );
545563}
546564
565+ /**
566+ * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids
567+ * @irq: the interrupt number
568+ * @desc: the interrupt description structure for this irq
569+ *
570+ * Per CPU interrupts on SMP machines without locking requirements. Same as
571+ * handle_percpu_irq() above but with the following extras:
572+ *
573+ * action->percpu_dev_id is a pointer to percpu variables which
574+ * contain the real device id for the cpu on which this handler is
575+ * called
576+ */
577+ void handle_percpu_devid_irq (unsigned int irq , struct irq_desc * desc )
578+ {
579+ struct irq_chip * chip = irq_desc_get_chip (desc );
580+ struct irqaction * action = desc -> action ;
581+ void * dev_id = __this_cpu_ptr (action -> percpu_dev_id );
582+ irqreturn_t res ;
583+
584+ kstat_incr_irqs_this_cpu (irq , desc );
585+
586+ if (chip -> irq_ack )
587+ chip -> irq_ack (& desc -> irq_data );
588+
589+ trace_irq_handler_entry (irq , action );
590+ res = action -> handler (irq , dev_id );
591+ trace_irq_handler_exit (irq , action , res );
592+
593+ if (chip -> irq_eoi )
594+ chip -> irq_eoi (& desc -> irq_data );
595+ }
596+
547597void
548598__irq_set_handler (unsigned int irq , irq_flow_handler_t handle , int is_chained ,
549599 const char * name )
550600{
551601 unsigned long flags ;
552- struct irq_desc * desc = irq_get_desc_buslock (irq , & flags );
602+ struct irq_desc * desc = irq_get_desc_buslock (irq , & flags , 0 );
553603
554604 if (!desc )
555605 return ;
@@ -593,7 +643,7 @@ irq_set_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
593643void irq_modify_status (unsigned int irq , unsigned long clr , unsigned long set )
594644{
595645 unsigned long flags ;
596- struct irq_desc * desc = irq_get_desc_lock (irq , & flags );
646+ struct irq_desc * desc = irq_get_desc_lock (irq , & flags , 0 );
597647
598648 if (!desc )
599649 return ;
0 commit comments