Re: [PATCH v9 02/12] PCI: OF: Parse and map the IRQ when adding the PCI device.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 14, 2014 at 03:58:04PM +0100, Wei Yang wrote:
> On Tue, Aug 12, 2014 at 05:25:15PM +0100, Liviu Dudau wrote:
> >Enhance the default implementation of pcibios_add_device() to
> >parse and map the IRQ of the device if a DT binding is available.
> >
> >Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> >Cc: Grant Likely <grant.likely@xxxxxxxxxx>
> >Cc: Rob Herring <robh+dt@xxxxxxxxxx>
> >Signed-off-by: Liviu Dudau <Liviu.Dudau@xxxxxxx>
> >---
> > drivers/pci/pci.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> >diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> >index 1c8592b..29d1775 100644
> >--- a/drivers/pci/pci.c
> >+++ b/drivers/pci/pci.c
> >@@ -17,6 +17,7 @@
> > #include <linux/spinlock.h>
> > #include <linux/string.h>
> > #include <linux/log2.h>
> >+#include <linux/of_pci.h>
> > #include <linux/pci-aspm.h>
> > #include <linux/pm_wakeup.h>
> > #include <linux/interrupt.h>
> >@@ -1453,6 +1454,8 @@ EXPORT_SYMBOL(pcim_pin_device);
> >  */
> > int __weak pcibios_add_device(struct pci_dev *dev)
> > {
> >+	dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
> >+
> > 	return 0;
> > }
> 
> Liviu,
> 
> For this, my suggestion is to add arch dependent function to setup the irq
> line for pci devices. I can't find an obvious reason this won't work on other
> archs, but maybe this will hurt some of them?

Hi Wei,

I'm not sure I understand your point. Architectures that support OF will obviously
benefit from this common approach, and for the other ones the function is empty
so it will not change existing behaviour. If you are suggesting that I should
create a new API that each architecture could go and implement for setting up the
IRQ line then I would agree that it would be nice to have that, but the question
is how many architectures are outside OF that need this?

If I understood you correctly, it is a nice idea but slightly outside the scope
of my current patchset.

Best regards,
Liviu

> 
> >
> >-- 
> >2.0.4
> >
> >--
> >To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> >the body of a message to majordomo@xxxxxxxxxxxxxxx
> >More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> -- 
> Richard Yang
> Help you, Help me
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux