diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-02-23 16:40:20 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-03-04 11:37:53 -0500 |
commit | 02893afdd310fab8f41f6afbe5233c6609ec19ed (patch) | |
tree | a5e9c586e3b48b0489527483e28ac2e140d54255 /drivers/xen | |
parent | 589d03e93f6cd595f68891e48f0804f2c8f38aae (diff) |
xen: Get rid of the last irq_desc abuse
Warn if any PIRQ cannot be bound to an event channel. Remove the check
for irq_desc->action. This hypercall never fails in practice so we can
emit a warning unconditionally.
Remove a check for a valid irq desc. The only caller of
xen_destroy_irq() will only do so if the irq was previously fully
setup, which means the descriptor has been allocated as well.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Xen <xen-devel@lists.xenproject.org>
Cc: David Vrabel <david.vrabel@citrix.com>
Link: http://lkml.kernel.org/r/20140223212738.579581220@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/events/events_base.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 7fea02c143ba..5dd2ddf634fb 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c | |||
@@ -487,13 +487,6 @@ static void pirq_query_unmask(int irq) | |||
487 | info->u.pirq.flags |= PIRQ_NEEDS_EOI; | 487 | info->u.pirq.flags |= PIRQ_NEEDS_EOI; |
488 | } | 488 | } |
489 | 489 | ||
490 | static bool probing_irq(int irq) | ||
491 | { | ||
492 | struct irq_desc *desc = irq_to_desc(irq); | ||
493 | |||
494 | return desc && desc->action == NULL; | ||
495 | } | ||
496 | |||
497 | static void eoi_pirq(struct irq_data *data) | 490 | static void eoi_pirq(struct irq_data *data) |
498 | { | 491 | { |
499 | int evtchn = evtchn_from_irq(data->irq); | 492 | int evtchn = evtchn_from_irq(data->irq); |
@@ -535,8 +528,7 @@ static unsigned int __startup_pirq(unsigned int irq) | |||
535 | BIND_PIRQ__WILL_SHARE : 0; | 528 | BIND_PIRQ__WILL_SHARE : 0; |
536 | rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq); | 529 | rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq); |
537 | if (rc != 0) { | 530 | if (rc != 0) { |
538 | if (!probing_irq(irq)) | 531 | pr_warn("Failed to obtain physical IRQ %d\n", irq); |
539 | pr_info("Failed to obtain physical IRQ %d\n", irq); | ||
540 | return 0; | 532 | return 0; |
541 | } | 533 | } |
542 | evtchn = bind_pirq.port; | 534 | evtchn = bind_pirq.port; |
@@ -769,17 +761,12 @@ error_irq: | |||
769 | 761 | ||
770 | int xen_destroy_irq(int irq) | 762 | int xen_destroy_irq(int irq) |
771 | { | 763 | { |
772 | struct irq_desc *desc; | ||
773 | struct physdev_unmap_pirq unmap_irq; | 764 | struct physdev_unmap_pirq unmap_irq; |
774 | struct irq_info *info = info_for_irq(irq); | 765 | struct irq_info *info = info_for_irq(irq); |
775 | int rc = -ENOENT; | 766 | int rc = -ENOENT; |
776 | 767 | ||
777 | mutex_lock(&irq_mapping_update_lock); | 768 | mutex_lock(&irq_mapping_update_lock); |
778 | 769 | ||
779 | desc = irq_to_desc(irq); | ||
780 | if (!desc) | ||
781 | goto out; | ||
782 | |||
783 | if (xen_initial_domain()) { | 770 | if (xen_initial_domain()) { |
784 | unmap_irq.pirq = info->u.pirq.pirq; | 771 | unmap_irq.pirq = info->u.pirq.pirq; |
785 | unmap_irq.domid = info->u.pirq.domid; | 772 | unmap_irq.domid = info->u.pirq.domid; |