I'd prefer to drop that completely but there seems to be some mystic
value to the error printout and the allocation check.

Signed-off-by: Thomas Gleixner <t...@linutronix.de>
Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
Cc: Xen <xen-de...@lists.xenproject.org>
---
 drivers/xen/events/events_base.c |   19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

Index: tip/drivers/xen/events/events_base.c
===================================================================
--- tip.orig/drivers/xen/events/events_base.c
+++ tip/drivers/xen/events/events_base.c
@@ -487,13 +487,6 @@ static void pirq_query_unmask(int irq)
                info->u.pirq.flags |= PIRQ_NEEDS_EOI;
 }
 
-static bool probing_irq(int irq)
-{
-       struct irq_desc *desc = irq_to_desc(irq);
-
-       return desc && desc->action == NULL;
-}
-
 static void eoi_pirq(struct irq_data *data)
 {
        int evtchn = evtchn_from_irq(data->irq);
@@ -517,7 +510,7 @@ static void mask_ack_pirq(struct irq_dat
        eoi_pirq(data);
 }
 
-static unsigned int __startup_pirq(unsigned int irq)
+static unsigned int __startup_pirq(struct irq_data *data, unsigned int irq)
 {
        struct evtchn_bind_pirq bind_pirq;
        struct irq_info *info = info_for_irq(irq);
@@ -535,7 +528,7 @@ static unsigned int __startup_pirq(unsig
                                        BIND_PIRQ__WILL_SHARE : 0;
        rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq);
        if (rc != 0) {
-               if (!probing_irq(irq))
+               if (!data || irqd_irq_has_action(data))
                        pr_info("Failed to obtain physical IRQ %d\n", irq);
                return 0;
        }
@@ -562,7 +555,7 @@ out:
 
 static unsigned int startup_pirq(struct irq_data *data)
 {
-       return __startup_pirq(data->irq);
+       return __startup_pirq(data, data->irq);
 }
 
 static void shutdown_pirq(struct irq_data *data)
@@ -769,15 +762,13 @@ error_irq:
 
 int xen_destroy_irq(int irq)
 {
-       struct irq_desc *desc;
        struct physdev_unmap_pirq unmap_irq;
        struct irq_info *info = info_for_irq(irq);
        int rc = -ENOENT;
 
        mutex_lock(&irq_mapping_update_lock);
 
-       desc = irq_to_desc(irq);
-       if (!desc)
+       if (!irq_is_allocated(irq))
                goto out;
 
        if (xen_initial_domain()) {
@@ -1432,7 +1423,7 @@ static void restore_pirqs(void)
 
                printk(KERN_DEBUG "xen: --> irq=%d, pirq=%d\n", irq, 
map_irq.pirq);
 
-               __startup_pirq(irq);
+               __startup_pirq(irq_get_irq_data(irq), irq);
        }
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to