Linux IA64 platform development
 help / color / mirror / Atom feed
* [PATCH 12/24] PCI, ia64: Register busn_res for root buses
       [not found] <1330466863-28469-1-git-send-email-yinghai@kernel.org>
@ 2012-02-28 22:07 ` Yinghai Lu
  2012-02-29  0:01   ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Yinghai Lu @ 2012-02-28 22:07 UTC (permalink / raw)
  To: Jesse Barnes, Benjamin Herrenschmidt, Tony Luck, David Miller,
	x86
  Cc: Bjorn Helgaas, Dominik Brodowski, Andrew Morton, Linus Torvalds,
	Greg Kroah-Hartman, linux-pci, linux-kernel, linux-arch,
	Yinghai Lu, Fenghua Yu, linux-ia64

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
---
 arch/ia64/include/asm/pci.h |    1 +
 arch/ia64/pci/pci.c         |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index b22e5f5..6e54220 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -94,6 +94,7 @@ struct pci_controller {
 
 	unsigned int windows;
 	struct pci_window *window;
+	struct resource busn;
 
 	void *platform_data;
 };
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index d1ce320..b250f0f 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -332,6 +332,7 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
 	struct acpi_device *device = root->device;
 	int domain = root->segment;
 	int bus = root->secondary.start;
+	int busmax = root->secondary.end;
 	struct pci_controller *controller;
 	unsigned int windows = 0;
 	struct pci_root_info info;
@@ -372,6 +373,10 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
 		acpi_walk_resources(device->handle, METHOD_NAME__CRS,
 			add_window, &info);
 	}
+	controller->busn.start = bus;
+	controller->busn.end = busmax;
+	conttoller->busn.flags = IORESOURCE_BUS;
+	pci_add_resource(&info.resources, &controller->busn);
 	/*
 	 * See arch/x86/pci/acpi.c.
 	 * The desired pci bus might already be scanned in a quirk. We
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 12/24] PCI, ia64: Register busn_res for root buses
  2012-02-28 22:07 ` [PATCH 12/24] PCI, ia64: Register busn_res for root buses Yinghai Lu
@ 2012-02-29  0:01   ` Bjorn Helgaas
  2012-02-29  0:12     ` Yinghai Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2012-02-29  0:01 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Jesse Barnes, Benjamin Herrenschmidt, Tony Luck, David Miller,
	x86, Dominik Brodowski, Andrew Morton, Linus Torvalds,
	Greg Kroah-Hartman, linux-pci, linux-kernel, linux-arch,
	Fenghua Yu, linux-ia64

On Tue, Feb 28, 2012 at 3:07 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> ---
>  arch/ia64/include/asm/pci.h |    1 +
>  arch/ia64/pci/pci.c         |    5 +++++
>  2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
> index b22e5f5..6e54220 100644
> --- a/arch/ia64/include/asm/pci.h
> +++ b/arch/ia64/include/asm/pci.h
> @@ -94,6 +94,7 @@ struct pci_controller {
>
>        unsigned int windows;
>        struct pci_window *window;
> +       struct resource busn;

Why do you add a new struct resource here?  Can't you just use the one
passed in from acpi_pci_root_add()?

>
>        void *platform_data;
>  };
> diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
> index d1ce320..b250f0f 100644
> --- a/arch/ia64/pci/pci.c
> +++ b/arch/ia64/pci/pci.c
> @@ -332,6 +332,7 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
>        struct acpi_device *device = root->device;
>        int domain = root->segment;
>        int bus = root->secondary.start;
> +       int busmax = root->secondary.end;
>        struct pci_controller *controller;
>        unsigned int windows = 0;
>        struct pci_root_info info;
> @@ -372,6 +373,10 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
>                acpi_walk_resources(device->handle, METHOD_NAME__CRS,
>                        add_window, &info);
>        }
> +       controller->busn.start = bus;
> +       controller->busn.end = busmax;
> +       conttoller->busn.flags = IORESOURCE_BUS;

Typo here - "conttoller" should be "controller".

> +       pci_add_resource(&info.resources, &controller->busn);
>        /*
>         * See arch/x86/pci/acpi.c.
>         * The desired pci bus might already be scanned in a quirk. We
> --
> 1.7.7
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 12/24] PCI, ia64: Register busn_res for root buses
  2012-02-29  0:01   ` Bjorn Helgaas
@ 2012-02-29  0:12     ` Yinghai Lu
  2012-02-29  0:22       ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Yinghai Lu @ 2012-02-29  0:12 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Jesse Barnes, Benjamin Herrenschmidt, Tony Luck, David Miller,
	x86, Dominik Brodowski, Andrew Morton, Linus Torvalds,
	Greg Kroah-Hartman, linux-pci, linux-kernel, linux-arch,
	Fenghua Yu, linux-ia64

On Tue, Feb 28, 2012 at 4:01 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Tue, Feb 28, 2012 at 3:07 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>> Cc: Tony Luck <tony.luck@intel.com>
>> Cc: Fenghua Yu <fenghua.yu@intel.com>
>> Cc: linux-ia64@vger.kernel.org
>> ---
>>  arch/ia64/include/asm/pci.h |    1 +
>>  arch/ia64/pci/pci.c         |    5 +++++
>>  2 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
>> index b22e5f5..6e54220 100644
>> --- a/arch/ia64/include/asm/pci.h
>> +++ b/arch/ia64/include/asm/pci.h
>> @@ -94,6 +94,7 @@ struct pci_controller {
>>
>>        unsigned int windows;
>>        struct pci_window *window;
>> +       struct resource busn;
>
> Why do you add a new struct resource here?  Can't you just use the one
> passed in from acpi_pci_root_add()?

not quite sure about the life cycle for that object.

>
>>
>>        void *platform_data;
>>  };
>> diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
>> index d1ce320..b250f0f 100644
>> --- a/arch/ia64/pci/pci.c
>> +++ b/arch/ia64/pci/pci.c
>> @@ -332,6 +332,7 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
>>        struct acpi_device *device = root->device;
>>        int domain = root->segment;
>>        int bus = root->secondary.start;
>> +       int busmax = root->secondary.end;
>>        struct pci_controller *controller;
>>        unsigned int windows = 0;
>>        struct pci_root_info info;
>> @@ -372,6 +373,10 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
>>                acpi_walk_resources(device->handle, METHOD_NAME__CRS,
>>                        add_window, &info);
>>        }
>> +       controller->busn.start = bus;
>> +       controller->busn.end = busmax;
>> +       conttoller->busn.flags = IORESOURCE_BUS;
>
> Typo here - "conttoller" should be "controller".

cool, sharp eyes.

>
>> +       pci_add_resource(&info.resources, &controller->busn);
>>        /*
>>         * See arch/x86/pci/acpi.c.
>>         * The desired pci bus might already be scanned in a quirk. We
>> --
>> 1.7.7
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 12/24] PCI, ia64: Register busn_res for root buses
  2012-02-29  0:12     ` Yinghai Lu
@ 2012-02-29  0:22       ` Bjorn Helgaas
  2012-02-29  4:26         ` Yinghai Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2012-02-29  0:22 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Jesse Barnes, Benjamin Herrenschmidt, Tony Luck, David Miller,
	x86, Dominik Brodowski, Andrew Morton, Linus Torvalds,
	Greg Kroah-Hartman, linux-pci, linux-kernel, linux-arch,
	Fenghua Yu, linux-ia64

On Tue, Feb 28, 2012 at 5:12 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Tue, Feb 28, 2012 at 4:01 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On Tue, Feb 28, 2012 at 3:07 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>> Cc: Tony Luck <tony.luck@intel.com>
>>> Cc: Fenghua Yu <fenghua.yu@intel.com>
>>> Cc: linux-ia64@vger.kernel.org
>>> ---
>>>  arch/ia64/include/asm/pci.h |    1 +
>>>  arch/ia64/pci/pci.c         |    5 +++++
>>>  2 files changed, 6 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
>>> index b22e5f5..6e54220 100644
>>> --- a/arch/ia64/include/asm/pci.h
>>> +++ b/arch/ia64/include/asm/pci.h
>>> @@ -94,6 +94,7 @@ struct pci_controller {
>>>
>>>        unsigned int windows;
>>>        struct pci_window *window;
>>> +       struct resource busn;
>>
>> Why do you add a new struct resource here?  Can't you just use the one
>> passed in from acpi_pci_root_add()?
>
> not quite sure about the life cycle for that object.

The struct acpi_pci_root is allocated in acpi_pci_root_add() and freed
in acpi_pci_root_remove(), so it should be safe for PCI to use.

Same thing applies for x86, of course.

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 12/24] PCI, ia64: Register busn_res for root buses
  2012-02-29  0:22       ` Bjorn Helgaas
@ 2012-02-29  4:26         ` Yinghai Lu
  0 siblings, 0 replies; 5+ messages in thread
From: Yinghai Lu @ 2012-02-29  4:26 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Jesse Barnes, Benjamin Herrenschmidt, Tony Luck, David Miller,
	x86, Dominik Brodowski, Andrew Morton, Linus Torvalds,
	Greg Kroah-Hartman, linux-pci, linux-kernel, linux-arch,
	Fenghua Yu, linux-ia64

On Tue, Feb 28, 2012 at 4:22 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Tue, Feb 28, 2012 at 5:12 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>>>
>>> Why do you add a new struct resource here?  Can't you just use the one
>>> passed in from acpi_pci_root_add()?
>>
>> not quite sure about the life cycle for that object.
>
> The struct acpi_pci_root is allocated in acpi_pci_root_add() and freed
> in acpi_pci_root_remove(), so it should be safe for PCI to use.

ok will change that for ia64.

>
> Same thing applies for x86, of course.

for x86, will have separate addon patch.

Thanks

      Yinghai

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-29  4:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1330466863-28469-1-git-send-email-yinghai@kernel.org>
2012-02-28 22:07 ` [PATCH 12/24] PCI, ia64: Register busn_res for root buses Yinghai Lu
2012-02-29  0:01   ` Bjorn Helgaas
2012-02-29  0:12     ` Yinghai Lu
2012-02-29  0:22       ` Bjorn Helgaas
2012-02-29  4:26         ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox