pcmcia: irq probe can be done without risking an IRQ storm
[firefly-linux-kernel-4.4.55.git] / drivers / pcmcia / pcmcia_resource.c
index c8f77b889d42ffe6887cbe812a55e0482592eaeb..78af59415930ea93830372e78585f4fcf6bb61a4 100644 (file)
@@ -812,6 +812,15 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
                type = IRQF_SHARED;
 
 #ifdef CONFIG_PCMCIA_PROBE
+
+#ifdef IRQ_NOAUTOEN
+       /* if the underlying IRQ infrastructure allows for it, only allocate
+        * the IRQ, but do not enable it
+        */
+       if (!(req->Attributes & IRQ_HANDLE_PRESENT))
+               type |= IRQ_NOAUTOEN;
+#endif /* IRQ_NOAUTOEN */
+
        if (s->irq.AssignedIRQ != 0) {
                /* If the interrupt is already assigned, it must be the same */
                irq = s->irq.AssignedIRQ;