devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <weiyang@linux.vnet.ibm.com>
To: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Wei Yang <weiyang@linux.vnet.ibm.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Will Deacon <Will.Deacon@arm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Russell King <linux@arm.linux.org.uk>,
	Tanmay Inamdar <tinamdar@apm.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Sinan Kaya <okaya@codeaurora.org>,
	Jingoo Han <jg1.han@samsung.com>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Suravee Suthikulanit <suravee.suthikulpanit@amd.com>,
	linux-pci <linux-pci@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Device Tree ML <devicetree@vger.kernel.org>,
	LAKML <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v9 02/12] PCI: OF: Parse and map the IRQ when adding the PCI device.
Date: Mon, 18 Aug 2014 09:44:04 +0800	[thread overview]
Message-ID: <20140818014404.GA11354@richard> (raw)
In-Reply-To: <20140815103052.GD27553@e106497-lin.cambridge.arm.com>

On Fri, Aug 15, 2014 at 11:30:52AM +0100, Liviu Dudau wrote:
>On Fri, Aug 15, 2014 at 09:56:32AM +0100, Wei Yang wrote:
>> On Thu, Aug 14, 2014 at 04:49:59PM +0100, Liviu Dudau wrote:
>> >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@google.com>
>> >> >Cc: Grant Likely <grant.likely@linaro.org>
>> >> >Cc: Rob Herring <robh+dt@kernel.org>
>> >> >Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
>> >> >---
>> >> > 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?
>> 
>> My suggestion is to define the pcibios_add_device() for arm arch, like the one
>> in arch/powerpc/kernel/pci-common.c. If my understanding is correct, this
>> patch set address the pci bus setup mostly on arm arch.
>
>And also arm64 at the least.
>
>> 
>> For those archs not support OF, this function is empty and has no effect. I
>> agree on this one.
>> 
>> For those archs rely on OF, we still have two cases:
>>     1. they would have implement this function like powerpc
>
>Actually, powerpc seems to be the only OF platform reimplementing this function.
>s390 and x86 are not OF platforms.
>
>>     2. have other way to fix it up,  otherwise how it works now?
>
>Don't forget that my patchset aims to replace existing house-made code with a more
>generic version. When architectures and platforms switch to my code they will have
>to add this back in their code if it's needed.
>
>> If my assumption is correct, this change will either have no effect, or fix up
>> the irq line the second time. Not harmful, but not necessary.
>
>Well, it will become necessary as old code gets dismantled and converted towards
>this patchset. To give you an example that I'm familiar with, for arch/arm the
>host bridge drivers have moved into drivers/pci/host, but they still depend/use
>the bios32 infrastructure that takes care of setting up the irq. When they switch
>to my version they would have to go and debug the "irq not being assigned" issue
>and it is quite likely that some of the people doing the conversion will complain
>about my code rather than understanding the issue. What I'm trying to do is to
>make switching to my patchset as painless as possible, with a cleanup to remove
>redundant operations coming after the switchover.
>

This means this is a temporary version for the switchover period and will be
reverted after switchover?

>Does that sound like a reasonable plan?
>
>Best regards,
>Liviu
>
>> 
>> I am not familiar with other arch, so the second case is my deduction. If this
>> is not correct, please let me know.
>> 
>> >
>> >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@vger.kernel.org
>> >> >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@vger.kernel.org
>> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> >> 
>> >
>> 
>> -- 
>> Richard Yang
>> Help you, Help me
>> 
>> 
>
>-- 
>====================
>| I would like to |
>| fix the world,  |
>| but they're not |
>| giving me the   |
> \ source code!  /
>  ---------------
>    ¯\_(ツ)_/¯

-- 
Richard Yang
Help you, Help me

  reply	other threads:[~2014-08-18  1:44 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 16:25 [PATCH v9 00/12] Support for creating generic PCI host bridges from DT Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 01/12] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 02/12] PCI: OF: Parse and map the IRQ when adding the PCI device Liviu Dudau
2014-08-14 14:58   ` Wei Yang
2014-08-14 15:49     ` Liviu Dudau
2014-08-15  8:56       ` Wei Yang
2014-08-15 10:30         ` Liviu Dudau
2014-08-18  1:44           ` Wei Yang [this message]
2014-08-18 21:26             ` Liviu Dudau
2014-08-18 14:25           ` Catalin Marinas
2014-08-18 21:30             ` Liviu Dudau
2014-08-18 22:09               ` Catalin Marinas
2014-08-19 12:39                 ` Arnd Bergmann
2014-08-19  1:44             ` Wei Yang
2014-08-19 12:05               ` Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 03/12] PCI: Introduce helper functions to deal with PCI I/O ranges Liviu Dudau
     [not found]   ` <1407860725-25202-4-git-send-email-Liviu.Dudau-5wv7dgnIgG8@public.gmane.org>
2014-08-18 14:26     ` Catalin Marinas
2014-08-18 21:34       ` Liviu Dudau
2014-08-18 21:52         ` Catalin Marinas
2014-08-22  4:59     ` Rob Herring
2014-09-02  3:43   ` Yijing Wang
2014-08-12 16:25 ` [PATCH v9 04/12] PCI: OF: Fix the conversion of IO ranges into IO resources Liviu Dudau
     [not found]   ` <1407860725-25202-5-git-send-email-Liviu.Dudau-5wv7dgnIgG8@public.gmane.org>
2014-08-22  4:08     ` Rob Herring
2014-08-22 13:06       ` Liviu Dudau
2014-08-24 23:27         ` Rob Herring
2014-09-05 22:11           ` Bjorn Helgaas
2014-08-12 16:25 ` [PATCH v9 05/12] ARM: Define PCI_IOBASE as the base of virtual PCI IO space Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 06/12] ARM: integrator: Correct usage of of_pci_range_to_resource() Liviu Dudau
2014-09-05 22:08   ` Bjorn Helgaas
2014-09-08 12:25     ` Liviu Dudau
2014-09-22 12:47   ` Linus Walleij
2014-09-22 13:36     ` Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 07/12] PCI: Create pci_host_bridge before its associated bus in pci_create_root_bus Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 08/12] PCI: Introduce generic domain handling for PCI busses Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 09/12] OF: Introduce helper function for getting PCI domain_nr Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 10/12] OF: PCI: Add support for creating a generic host_bridge from DT Liviu Dudau
2014-08-12 16:25 ` [PATCH v9 11/12] arm64: Add pgprot_device() interface for device mappings Liviu Dudau
2014-08-13  9:59   ` Catalin Marinas
2014-08-12 16:25 ` [PATCH v9 12/12] PCI: Introduce pci_remap_iospace() for remapping PCI I/O bus resources into CPU space Liviu Dudau
2014-08-13 10:01   ` Catalin Marinas
2014-08-13 10:33     ` Liviu Dudau
2014-08-13 10:53       ` Catalin Marinas
     [not found]   ` <1407860725-25202-13-git-send-email-Liviu.Dudau-5wv7dgnIgG8@public.gmane.org>
2014-08-22  4:16     ` Rob Herring
2014-08-22 12:43       ` Liviu Dudau
     [not found]         ` <20140822124326.GL13147-hOhETlTuV5niMG9XS5x8Mg@public.gmane.org>
2014-08-23 16:57           ` Rob Herring
2014-08-18 14:26 ` [PATCH v9 00/12] Support for creating generic PCI host bridges from DT Catalin Marinas
2014-08-18 21:35   ` Liviu Dudau
     [not found] ` <1407860725-25202-1-git-send-email-Liviu.Dudau-5wv7dgnIgG8@public.gmane.org>
2014-08-27 16:24   ` Robert Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140818014404.GA11354@richard \
    --to=weiyang@linux.vnet.ibm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jg1.han@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=okaya@codeaurora.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tinamdar@apm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).