aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/events
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2014-04-07 08:52:12 -0400
committerDavid Vrabel <david.vrabel@citrix.com>2014-04-07 08:52:12 -0400
commit2c5cb2770392fb9c5d8518688c8bc61986d70dc6 (patch)
treeb19210e709de6ee0d22b67ef605a569500cf1a18 /drivers/xen/events
parentcd979883b9ede90643e019f33cb317933eb867b4 (diff)
parent683b6c6f82a60fabf47012581c2cfbf1b037ab95 (diff)
Merge commit '683b6c6f82a60fabf47012581c2cfbf1b037ab95' into stable/for-linus-3.15
This merge of the irq-core-for-linus branch broke the ARM build when Xen is enabled. Conflicts: drivers/xen/events/events_base.c
Diffstat (limited to 'drivers/xen/events')
-rw-r--r--drivers/xen/events/events_2l.c15
-rw-r--r--drivers/xen/events/events_base.c25
-rw-r--r--drivers/xen/events/events_fifo.c8
3 files changed, 11 insertions, 37 deletions
diff --git a/drivers/xen/events/events_2l.c b/drivers/xen/events/events_2l.c
index d7ff91757307..5db43fc100a4 100644
--- a/drivers/xen/events/events_2l.c
+++ b/drivers/xen/events/events_2l.c
@@ -166,7 +166,6 @@ static void evtchn_2l_handle_events(unsigned cpu)
166 int start_word_idx, start_bit_idx; 166 int start_word_idx, start_bit_idx;
167 int word_idx, bit_idx; 167 int word_idx, bit_idx;
168 int i; 168 int i;
169 struct irq_desc *desc;
170 struct shared_info *s = HYPERVISOR_shared_info; 169 struct shared_info *s = HYPERVISOR_shared_info;
171 struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); 170 struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);
172 171
@@ -176,11 +175,8 @@ static void evtchn_2l_handle_events(unsigned cpu)
176 unsigned int evtchn = evtchn_from_irq(irq); 175 unsigned int evtchn = evtchn_from_irq(irq);
177 word_idx = evtchn / BITS_PER_LONG; 176 word_idx = evtchn / BITS_PER_LONG;
178 bit_idx = evtchn % BITS_PER_LONG; 177 bit_idx = evtchn % BITS_PER_LONG;
179 if (active_evtchns(cpu, s, word_idx) & (1ULL << bit_idx)) { 178 if (active_evtchns(cpu, s, word_idx) & (1ULL << bit_idx))
180 desc = irq_to_desc(irq); 179 generic_handle_irq(irq);
181 if (desc)
182 generic_handle_irq_desc(irq, desc);
183 }
184 } 180 }
185 181
186 /* 182 /*
@@ -245,11 +241,8 @@ static void evtchn_2l_handle_events(unsigned cpu)
245 port = (word_idx * BITS_PER_EVTCHN_WORD) + bit_idx; 241 port = (word_idx * BITS_PER_EVTCHN_WORD) + bit_idx;
246 irq = get_evtchn_to_irq(port); 242 irq = get_evtchn_to_irq(port);
247 243
248 if (irq != -1) { 244 if (irq != -1)
249 desc = irq_to_desc(irq); 245 generic_handle_irq(irq);
250 if (desc)
251 generic_handle_irq_desc(irq, desc);
252 }
253 246
254 bit_idx = (bit_idx + 1) % BITS_PER_EVTCHN_WORD; 247 bit_idx = (bit_idx + 1) % BITS_PER_EVTCHN_WORD;
255 248
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 793053065629..d5a3de88ac59 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -336,9 +336,8 @@ static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
336 336
337 BUG_ON(irq == -1); 337 BUG_ON(irq == -1);
338#ifdef CONFIG_SMP 338#ifdef CONFIG_SMP
339 cpumask_copy(irq_to_desc(irq)->irq_data.affinity, cpumask_of(cpu)); 339 cpumask_copy(irq_get_irq_data(irq)->affinity, cpumask_of(cpu));
340#endif 340#endif
341
342 xen_evtchn_port_bind_to_cpu(info, cpu); 341 xen_evtchn_port_bind_to_cpu(info, cpu);
343 342
344 info->cpu = cpu; 343 info->cpu = cpu;
@@ -373,10 +372,8 @@ static void xen_irq_init(unsigned irq)
373{ 372{
374 struct irq_info *info; 373 struct irq_info *info;
375#ifdef CONFIG_SMP 374#ifdef CONFIG_SMP
376 struct irq_desc *desc = irq_to_desc(irq);
377
378 /* By default all event channels notify CPU#0. */ 375 /* By default all event channels notify CPU#0. */
379 cpumask_copy(desc->irq_data.affinity, cpumask_of(0)); 376 cpumask_copy(irq_get_irq_data(irq)->affinity, cpumask_of(0));
380#endif 377#endif
381 378
382 info = kzalloc(sizeof(*info), GFP_KERNEL); 379 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -495,13 +492,6 @@ static void pirq_query_unmask(int irq)
495 info->u.pirq.flags |= PIRQ_NEEDS_EOI; 492 info->u.pirq.flags |= PIRQ_NEEDS_EOI;
496} 493}
497 494
498static bool probing_irq(int irq)
499{
500 struct irq_desc *desc = irq_to_desc(irq);
501
502 return desc && desc->action == NULL;
503}
504
505static void eoi_pirq(struct irq_data *data) 495static void eoi_pirq(struct irq_data *data)
506{ 496{
507 int evtchn = evtchn_from_irq(data->irq); 497 int evtchn = evtchn_from_irq(data->irq);
@@ -543,8 +533,7 @@ static unsigned int __startup_pirq(unsigned int irq)
543 BIND_PIRQ__WILL_SHARE : 0; 533 BIND_PIRQ__WILL_SHARE : 0;
544 rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq); 534 rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq);
545 if (rc != 0) { 535 if (rc != 0) {
546 if (!probing_irq(irq)) 536 pr_warn("Failed to obtain physical IRQ %d\n", irq);
547 pr_info("Failed to obtain physical IRQ %d\n", irq);
548 return 0; 537 return 0;
549 } 538 }
550 evtchn = bind_pirq.port; 539 evtchn = bind_pirq.port;
@@ -781,17 +770,12 @@ error_irq:
781 770
782int xen_destroy_irq(int irq) 771int xen_destroy_irq(int irq)
783{ 772{
784 struct irq_desc *desc;
785 struct physdev_unmap_pirq unmap_irq; 773 struct physdev_unmap_pirq unmap_irq;
786 struct irq_info *info = info_for_irq(irq); 774 struct irq_info *info = info_for_irq(irq);
787 int rc = -ENOENT; 775 int rc = -ENOENT;
788 776
789 mutex_lock(&irq_mapping_update_lock); 777 mutex_lock(&irq_mapping_update_lock);
790 778
791 desc = irq_to_desc(irq);
792 if (!desc)
793 goto out;
794
795 /* 779 /*
796 * If trying to remove a vector in a MSI group different 780 * If trying to remove a vector in a MSI group different
797 * than the first one skip the PIRQ unmap unless this vector 781 * than the first one skip the PIRQ unmap unless this vector
@@ -1265,6 +1249,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
1265#ifdef CONFIG_X86 1249#ifdef CONFIG_X86
1266 exit_idle(); 1250 exit_idle();
1267#endif 1251#endif
1252 inc_irq_stat(irq_hv_callback_count);
1268 1253
1269 __xen_evtchn_do_upcall(); 1254 __xen_evtchn_do_upcall();
1270 1255
@@ -1353,7 +1338,7 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
1353static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest, 1338static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest,
1354 bool force) 1339 bool force)
1355{ 1340{
1356 unsigned tcpu = cpumask_first(dest); 1341 unsigned tcpu = cpumask_first_and(dest, cpu_online_mask);
1357 1342
1358 return rebind_irq_to_cpu(data->irq, tcpu); 1343 return rebind_irq_to_cpu(data->irq, tcpu);
1359} 1344}
diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
index 1de2a191b395..96109a9972b6 100644
--- a/drivers/xen/events/events_fifo.c
+++ b/drivers/xen/events/events_fifo.c
@@ -235,14 +235,10 @@ static uint32_t clear_linked(volatile event_word_t *word)
235static void handle_irq_for_port(unsigned port) 235static void handle_irq_for_port(unsigned port)
236{ 236{
237 int irq; 237 int irq;
238 struct irq_desc *desc;
239 238
240 irq = get_evtchn_to_irq(port); 239 irq = get_evtchn_to_irq(port);
241 if (irq != -1) { 240 if (irq != -1)
242 desc = irq_to_desc(irq); 241 generic_handle_irq(irq);
243 if (desc)
244 generic_handle_irq_desc(irq, desc);
245 }
246} 242}
247 243
248static void consume_one_event(unsigned cpu, 244static void consume_one_event(unsigned cpu,