public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pcibios_scan_acpi()
@ 2003-06-23 18:59 Matthew Wilcox
       [not found] ` <20030623185901.GN2620-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2003-06-23 18:59 UTC (permalink / raw)
  To: linux-ia64-u79uwXL29TY76Z2rM5mHXA,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Greg KH


This patch removes an ifdef from the ia64 acpi patch by defining a new
function which takes an acpi_device and a segment/domain as well as the
bus number.

I think pcibios_scan_acpi() is an atrocious name.  Can someone come up
with a better one?

Index: arch/i386/pci/acpi.c
===================================================================
RCS file: /var/cvs/linux-2.5/arch/i386/pci/acpi.c,v
retrieving revision 1.3
diff -u -p -r1.3 acpi.c
--- arch/i386/pci/acpi.c	8 Oct 2002 22:46:09 -0000	1.3
+++ arch/i386/pci/acpi.c	23 Jun 2003 15:49:28 -0000
@@ -3,6 +3,16 @@
 #include <linux/init.h>
 #include "pci.h"
 
+struct pci_bus * __devinit pcibios_scan_acpi(struct acpi_device *device, int domain, int busnum)
+{
+	if (domain != 0) {
+		printk(KERN_WARNING "PCI: Multiple domains not supported\n");
+		return NULL;
+	}
+
+	return pcibios_scan_root(busnum);
+}
+
 static int __init pci_acpi_init(void)
 {
 	if (pcibios_scanned)
Index: arch/ia64/pci/pci.c
===================================================================
RCS file: /var/cvs/linux-2.5/arch/ia64/pci/pci.c,v
retrieving revision 1.9
diff -u -p -r1.9 pci.c
--- arch/ia64/pci/pci.c	23 Jun 2003 03:30:02 -0000	1.9
+++ arch/ia64/pci/pci.c	23 Jun 2003 12:57:34 -0000
@@ -284,21 +253,21 @@ add_window (struct acpi_resource *res, v
 }
 
 struct pci_bus *
-pcibios_scan_root (void *handle, int seg, int bus)
+pcibios_scan_acpi (struct acpi_device *device, int domain, int bus)
 {
 	struct pci_root_info info;
 	struct pci_controller *controller;
 	unsigned int windows = 0;
 	char *name;
 
-	printk("PCI: Probing PCI hardware on bus (%02x:%02x)\n", seg, bus);
-	controller = alloc_pci_controller(seg);
+	printk("PCI: Probing PCI hardware on bus (%04x:%02x)\n", domain, bus);
+	controller = alloc_pci_controller(domain);
 	if (!controller)
 		goto out1;
 
-	controller->acpi_handle = handle;
+	controller->acpi_handle = device->handle;
 
-	acpi_walk_resources(handle, METHOD_NAME__CRS, count_window, &windows);
+	acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window, &windows);
 	controller->window = kmalloc(sizeof(*controller->window) * windows, GFP_KERNEL);
 	if (!controller->window)
 		goto out2;
@@ -307,10 +276,10 @@ pcibios_scan_root (void *handle, int seg
 	if (!name)
 		goto out3;
 
-	sprintf(name, "PCI Bus %02x:%02x", seg, bus);
+	sprintf(name, "PCI Bus %04x:%02x", domain, bus);
 	info.controller = controller;
 	info.name = name;
-	acpi_walk_resources(handle, METHOD_NAME__CRS, add_window, &info);
+	acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window, &info);
 
 	return scan_root_bus(bus, &pci_root_ops, controller);
 
Index: drivers/acpi/pci_root.c
===================================================================
RCS file: /var/cvs/linux-2.5/drivers/acpi/pci_root.c,v
retrieving revision 1.8
diff -u -p -r1.8 pci_root.c
--- drivers/acpi/pci_root.c	23 Jun 2003 03:30:15 -0000	1.8
+++ drivers/acpi/pci_root.c	23 Jun 2003 12:37:30 -0000
@@ -246,8 +246,6 @@ acpi_pci_root_add (
 	switch (status) {
 	case AE_OK:
 		root->id.segment = (u16) value;
-		printk("_SEG exists! Unsupported. Abort.\n");
-		BUG();
 		break;
 	case AE_NOT_FOUND:
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
@@ -309,7 +307,7 @@ acpi_pci_root_add (
 	 * PCI namespace does not get created until this call is made (and 
 	 * thus the root bridge's pci_dev does not exist).
 	 */
-	root->bus = pcibios_scan_root(root->id.bus);
+	root->bus = pcibios_scan_acpi(device, root->id.segment, root->id.bus);
 	if (!root->bus) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
 			"Bus %02x:%02x not present in PCI namespace\n", 
Index: include/acpi/acpi_drivers.h
===================================================================
RCS file: /var/cvs/linux-2.5/include/acpi/acpi_drivers.h,v
retrieving revision 1.3
diff -u -p -r1.3 acpi_drivers.h
--- include/acpi/acpi_drivers.h	15 Feb 2003 03:48:35 -0000	1.3
+++ include/acpi/acpi_drivers.h	23 Jun 2003 13:57:09 -0000
@@ -73,6 +73,10 @@ struct pci_bus;
 int acpi_pci_bind (struct acpi_device *device);
 int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus);
 
+/* Arch-defined function to add a bus to the system */
+
+struct pci_bus *pcibios_scan_acpi(struct acpi_device *device, int domain, int bus);
+
 #endif /*CONFIG_ACPI_PCI*/
 
 
Index: include/asm-ia64/pci.h
===================================================================
RCS file: /var/cvs/linux-2.5/include/asm-ia64/pci.h,v
retrieving revision 1.9
diff -u -p -r1.9 pci.h
--- include/asm-ia64/pci.h	23 Jun 2003 03:30:47 -0000	1.9
+++ include/asm-ia64/pci.h	23 Jun 2003 12:51:08 -0000
@@ -21,7 +21,6 @@
 #define PCIBIOS_MIN_MEM		0x10000000
 
 void pcibios_config_init(void);
-struct pci_bus * pcibios_scan_root(void *acpi_handle, int segment, int bus);
 
 struct pci_dev;
 

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] pcibios_scan_acpi()
       [not found] ` <20030623185901.GN2620-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
@ 2003-06-23 19:14   ` David Mosberger
       [not found]     ` <16119.20872.104128.965777-o/PNRNCSakrWxDs0y9d3MAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: David Mosberger @ 2003-06-23 19:14 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: linux-ia64-u79uwXL29TY76Z2rM5mHXA,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Greg KH

>>>>> On Mon, 23 Jun 2003 19:59:01 +0100, Matthew Wilcox <willy-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org> said:

  Matthew> This patch removes an ifdef from the ia64 acpi patch by
  Matthew> defining a new function which takes an acpi_device and a
  Matthew> segment/domain as well as the bus number.

  Matthew> I think pcibios_scan_acpi() is an atrocious name.  Can
  Matthew> someone come up with a better one?

How about acpi_scan_pci_bus_root()?

	--david


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] pcibios_scan_acpi()
       [not found]     ` <16119.20872.104128.965777-o/PNRNCSakrWxDs0y9d3MAC/G2K4zDHf@public.gmane.org>
@ 2003-06-23 21:39       ` Greg KH
       [not found]         ` <20030623213905.GA10992-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2003-06-23 21:39 UTC (permalink / raw)
  To: davidm-sDzT885Ts8HQT0dZR+AlfA
  Cc: Matthew Wilcox, linux-ia64-u79uwXL29TY76Z2rM5mHXA,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Mon, Jun 23, 2003 at 12:14:16PM -0700, David Mosberger wrote:
> >>>>> On Mon, 23 Jun 2003 19:59:01 +0100, Matthew Wilcox <willy-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org> said:
> 
>   Matthew> This patch removes an ifdef from the ia64 acpi patch by
>   Matthew> defining a new function which takes an acpi_device and a
>   Matthew> segment/domain as well as the bus number.
> 
>   Matthew> I think pcibios_scan_acpi() is an atrocious name.  Can
>   Matthew> someone come up with a better one?
> 
> How about acpi_scan_pci_bus_root()?

I agree, that sounds better.

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] pcibios_scan_acpi()
       [not found]         ` <20030623213905.GA10992-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
@ 2003-06-24 21:31           ` Matthew Wilcox
       [not found]             ` <20030624213119.GN451-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2003-06-24 21:31 UTC (permalink / raw)
  To: Greg KH
  Cc: davidm-sDzT885Ts8HQT0dZR+AlfA, Matthew Wilcox,
	linux-ia64-u79uwXL29TY76Z2rM5mHXA,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Mon, Jun 23, 2003 at 02:39:05PM -0700, Greg KH wrote:
> > How about acpi_scan_pci_bus_root()?
> 
> I agree, that sounds better.

I think it's too long ... so unless anyone has a better idea, I'm going with
pci_acpi_scan_root().  Here's the patch, presented in patch -p1 format to
make greg's scripts happy ;-)

ia64 needs to be passed the pci domain and the acpi handle corresponding
to each root bus.  Rather than change pcibios_scan_root to take additional
arguments, this patch introduces pci_acpi_scan_root().

Index: arch/i386/pci/acpi.c
===================================================================
RCS file: /var/cvs/linux-2.5/arch/i386/pci/acpi.c,v
retrieving revision 1.3
diff -u -p -r1.3 acpi.c
--- a/arch/i386/pci/acpi.c	8 Oct 2002 22:46:09 -0000	1.3
+++ b/arch/i386/pci/acpi.c	24 Jun 2003 21:16:47 -0000
@@ -3,6 +3,16 @@
 #include <linux/init.h>
 #include "pci.h"
 
+struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum)
+{
+	if (domain != 0) {
+		printk(KERN_WARNING "PCI: Multiple domains not supported\n");
+		return NULL;
+	}
+
+	return pcibios_scan_root(busnum);
+}
+
 static int __init pci_acpi_init(void)
 {
 	if (pcibios_scanned)
Index: arch/ia64/pci/pci.c
===================================================================
RCS file: /var/cvs/linux-2.5/arch/ia64/pci/pci.c,v
retrieving revision 1.9
diff -u -p -r1.9 pci.c
--- a/arch/ia64/pci/pci.c	23 Jun 2003 03:30:02 -0000	1.9
+++ b/arch/ia64/pci/pci.c	24 Jun 2003 21:16:48 -0000
@@ -284,21 +284,21 @@ add_window (struct acpi_resource *res, v
 }
 
 struct pci_bus *
-pcibios_scan_root (void *handle, int seg, int bus)
+pci_acpi_scan_root (struct acpi_device *device, int domain, int bus)
 {
 	struct pci_root_info info;
 	struct pci_controller *controller;
 	unsigned int windows = 0;
 	char *name;
 
-	printk("PCI: Probing PCI hardware on bus (%02x:%02x)\n", seg, bus);
-	controller = alloc_pci_controller(seg);
+	printk("PCI: Probing PCI hardware on bus (%04x:%02x)\n", domain, bus);
+	controller = alloc_pci_controller(domain);
 	if (!controller)
 		goto out1;
 
-	controller->acpi_handle = handle;
+	controller->acpi_handle = device->handle;
 
-	acpi_walk_resources(handle, METHOD_NAME__CRS, count_window, &windows);
+	acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window, &windows);
 	controller->window = kmalloc(sizeof(*controller->window) * windows, GFP_KERNEL);
 	if (!controller->window)
 		goto out2;
@@ -307,10 +307,10 @@ pcibios_scan_root (void *handle, int seg
 	if (!name)
 		goto out3;
 
-	sprintf(name, "PCI Bus %02x:%02x", seg, bus);
+	sprintf(name, "PCI Bus %04x:%02x", domain, bus);
 	info.controller = controller;
 	info.name = name;
-	acpi_walk_resources(handle, METHOD_NAME__CRS, add_window, &info);
+	acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window, &info);
 
 	return scan_root_bus(bus, &pci_root_ops, controller);
 
Index: drivers/acpi/pci_root.c
===================================================================
RCS file: /var/cvs/linux-2.5/drivers/acpi/pci_root.c,v
retrieving revision 1.8
diff -u -p -r1.8 pci_root.c
--- a/drivers/acpi/pci_root.c	23 Jun 2003 03:30:15 -0000	1.8
+++ b/drivers/acpi/pci_root.c	24 Jun 2003 21:16:50 -0000
@@ -246,8 +246,6 @@ acpi_pci_root_add (
 	switch (status) {
 	case AE_OK:
 		root->id.segment = (u16) value;
-		printk("_SEG exists! Unsupported. Abort.\n");
-		BUG();
 		break;
 	case AE_NOT_FOUND:
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
@@ -309,7 +306,7 @@ acpi_pci_root_add (
 	 * PCI namespace does not get created until this call is made (and 
 	 * thus the root bridge's pci_dev does not exist).
 	 */
-	root->bus = pcibios_scan_root(root->id.bus);
+	root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus);
 	if (!root->bus) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
 			"Bus %02x:%02x not present in PCI namespace\n", 
Index: include/acpi/acpi_drivers.h
===================================================================
RCS file: /var/cvs/linux-2.5/include/acpi/acpi_drivers.h,v
retrieving revision 1.3
diff -u -p -r1.3 acpi_drivers.h
--- a/include/acpi/acpi_drivers.h	15 Feb 2003 03:48:35 -0000	1.3
+++ b/include/acpi/acpi_drivers.h	24 Jun 2003 21:16:55 -0000
@@ -73,6 +73,10 @@ struct pci_bus;
 int acpi_pci_bind (struct acpi_device *device);
 int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus);
 
+/* Arch-defined function to add a bus to the system */
+
+struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, int bus);
+
 #endif /*CONFIG_ACPI_PCI*/
 
 
Index: include/asm-ia64/pci.h
===================================================================
RCS file: /var/cvs/linux-2.5/include/asm-ia64/pci.h,v
retrieving revision 1.9
diff -u -p -r1.9 pci.h
--- a/include/asm-ia64/pci.h	23 Jun 2003 03:30:47 -0000	1.9
+++ b/include/asm-ia64/pci.h	24 Jun 2003 21:16:56 -0000
@@ -21,7 +21,6 @@
 #define PCIBIOS_MIN_MEM		0x10000000
 
 void pcibios_config_init(void);
-struct pci_bus * pcibios_scan_root(void *acpi_handle, int segment, int bus);
 
 struct pci_dev;
 

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

* Re: [PATCH] pcibios_scan_acpi()
       [not found]             ` <20030624213119.GN451-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
@ 2003-06-24 22:10               ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2003-06-24 22:10 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: davidm-sDzT885Ts8HQT0dZR+AlfA, linux-ia64-u79uwXL29TY76Z2rM5mHXA,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Tue, Jun 24, 2003 at 10:31:19PM +0100, Matthew Wilcox wrote:
> On Mon, Jun 23, 2003 at 02:39:05PM -0700, Greg KH wrote:
> > > How about acpi_scan_pci_bus_root()?
> > 
> > I agree, that sounds better.
> 
> I think it's too long ... so unless anyone has a better idea, I'm going with
> pci_acpi_scan_root().  Here's the patch, presented in patch -p1 format to
> make greg's scripts happy ;-)

Thanks you :)

> ia64 needs to be passed the pci domain and the acpi handle corresponding
> to each root bus.  Rather than change pcibios_scan_root to take additional
> arguments, this patch introduces pci_acpi_scan_root().

Looks good, I've applied it.

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php

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

end of thread, other threads:[~2003-06-24 22:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-23 18:59 [PATCH] pcibios_scan_acpi() Matthew Wilcox
     [not found] ` <20030623185901.GN2620-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2003-06-23 19:14   ` David Mosberger
     [not found]     ` <16119.20872.104128.965777-o/PNRNCSakrWxDs0y9d3MAC/G2K4zDHf@public.gmane.org>
2003-06-23 21:39       ` Greg KH
     [not found]         ` <20030623213905.GA10992-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2003-06-24 21:31           ` Matthew Wilcox
     [not found]             ` <20030624213119.GN451-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2003-06-24 22:10               ` Greg KH

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