Merge commit 'kumar/next' into next
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 31 May 2010 00:01:50 +0000 (10:01 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 31 May 2010 00:01:50 +0000 (10:01 +1000)
Conflicts:
arch/powerpc/sysdev/fsl_msi.c

1  2 
arch/powerpc/Kconfig
arch/powerpc/kernel/traps.c
arch/powerpc/sysdev/fsl_msi.c

Simple merge
Simple merge
@@@ -245,11 -293,11 +293,11 @@@ static int __devinit fsl_of_msi_probe(s
        msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL);
        if (!msi) {
                dev_err(&dev->dev, "No memory for MSI structure\n");
-               err = -ENOMEM;
-               goto error_out;
+               return -ENOMEM;
        }
+       dev->dev.platform_data = msi;
  
 -      msi->irqhost = irq_alloc_host(dev->node, IRQ_HOST_MAP_LINEAR,
 +      msi->irqhost = irq_alloc_host(dev->dev.of_node, IRQ_HOST_MAP_LINEAR,
                                      NR_MSI_IRQS, &fsl_msi_host_ops, 0);
  
        if (msi->irqhost == NULL) {
                err = -EINVAL;
                goto error_out;
        }
+       offset = 0;
+       p = of_get_property(dev->node, "msi-available-ranges", &len);
+       if (p)
+               offset = *p / IRQS_PER_MSI_REG;
  
        count /= sizeof(u32);
-       for (i = 0; i < count / 2; i++) {
-               if (i > NR_MSI_REG)
-                       break;
+       for (i = 0; i < min(count / 2, NR_MSI_REG); i++) {
 -              virt_msir = irq_of_parse_and_map(dev->node, i);
 +              virt_msir = irq_of_parse_and_map(dev->dev.of_node, i);
                if (virt_msir != NO_IRQ) {
-                       set_irq_data(virt_msir, (void *)i);
+                       cascade_data = kzalloc(
+                                       sizeof(struct fsl_msi_cascade_data),
+                                       GFP_KERNEL);
+                       if (!cascade_data) {
+                               dev_err(&dev->dev,
+                                       "No memory for MSI cascade data\n");
+                               err = -ENOMEM;
+                               goto error_out;
+                       }
+                       msi->msi_virqs[i] = virt_msir;
+                       cascade_data->index = i + offset;
+                       cascade_data->msi_data = msi;
+                       set_irq_data(virt_msir, (void *)cascade_data);
                        set_irq_chained_handler(virt_msir, fsl_msi_cascade);
                }
        }
@@@ -345,12 -413,10 +413,13 @@@ static const struct of_device_id fsl_of
  };
  
  static struct of_platform_driver fsl_of_msi_driver = {
 -      .name = "fsl-msi",
 -      .match_table = fsl_of_msi_ids,
 +      .driver = {
 +              .name = "fsl-msi",
 +              .owner = THIS_MODULE,
 +              .of_match_table = fsl_of_msi_ids,
 +      },
        .probe = fsl_of_msi_probe,
+       .remove = fsl_of_msi_remove,
  };
  
  static __init int fsl_of_msi_init(void)