GPIO[2/2]: langwell-gpio causing panic when NR_CPUS=2
authorFei Yang <fei.yang@intel.com>
Fri, 3 Feb 2012 18:04:59 +0000 (10:04 -0800)
committerbuildbot <buildbot@intel.com>
Thu, 16 Feb 2012 00:31:49 +0000 (16:31 -0800)
BZ: 11245

After enabling SPARSE_IRQ to make allocation of irqdesc a dynamic
one, kernel fail to boot because the langwell-gpio driver doesn't
request_irq for the gpio pins, thus irqdesc is not allocated for
them. Add irq_alloc_descs call in the probe function to allocate
irqsec.

Change-Id: I26ab2882c2be7114976fd55068de34e6b6cadf32
Signed-off-by: Fei Yang <fei.yang@intel.com>
Reviewed-on: http://android.intel.com:8080/34159
Reviewed-by: Monroy, German <german.monroy@intel.com>
Reviewed-by: Kuppuswamy, Sathyanarayanan <sathyanarayanan.kuppuswamy@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/gpio/langwell_gpio.c

index 4ee0d75..6ddf3bd 100644 (file)
@@ -405,6 +405,13 @@ static int __devinit lnw_gpio_probe(struct pci_dev *pdev,
                dev_err(&pdev->dev, "langwell gpiochip_add error %d\n", retval);
                goto err5;
        }
+       lnw->irq_base = irq_alloc_descs(-1, lnw->irq_base, lnw->chip.ngpio,
+                                       NUMA_NO_NODE);
+       if (lnw->irq_base < 0) {
+               dev_err(&pdev->dev, "langwell irq_alloc_desc failed %d\n",
+                       lnw->irq_base);
+               goto err5;
+       }
        irq_set_handler_data(pdev->irq, lnw);
        irq_set_chained_handler(pdev->irq, lnw_irq_handler);
        for (i = 0; i < lnw->chip.ngpio; i++) {