public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] acpiphp: allocate resources for adapters with bridges
@ 2005-10-07 17:45 Kristen Accardi
  2005-10-07 17:59 ` Greg KH
  2005-10-11  1:50 ` [Pcihpd-discuss] " MUNEDA Takahiro
  0 siblings, 2 replies; 6+ messages in thread
From: Kristen Accardi @ 2005-10-07 17:45 UTC (permalink / raw)
  To: pcihpd-discuss, linux-kernel, acpi-devel; +Cc: rajesh.shah, greg, len.brown

Allocate resources for adapters with p2p bridges.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>

diff -uprN -X linux-2.6.14-rc2/Documentation/dontdiff linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c
--- linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c	2005-08-28 16:41:01.000000000 -0700
+++ linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c	2005-09-28 10:43:15.000000000 -0700
@@ -58,6 +58,9 @@ static LIST_HEAD(bridge_list);
 
 static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
 static void handle_hotplug_event_func (acpi_handle, u32, void *);
+static void acpiphp_sanitize_bus(struct pci_bus *bus);
+static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus);
+
 
 /*
  * initialization & terminatation routines
@@ -207,6 +210,9 @@ register_slot(acpi_handle handle, u32 lv
 		slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
 	}
 
+	/* store the handle in the slot for later. */
+	slot->handle = handle;
+
 	/* install notify handler */
 	status = acpi_install_notify_handler(handle,
 					     ACPI_SYSTEM_NOTIFY,
@@ -796,7 +802,12 @@ static int enable_device(struct acpiphp_
 		}
 	}
 
+	pci_bus_size_bridges(bus);
 	pci_bus_assign_resources(bus);
+	acpiphp_sanitize_bus(bus);
+	acpiphp_set_hpp_values(slot->handle, bus);
+	pci_enable_bridges(bus);
+	acpiphp_configure_ioapics(slot->handle);
 	pci_bus_add_devices(bus);
 
 	/* associate pci_dev to our representation */
diff -uprN -X linux-2.6.14-rc2/Documentation/dontdiff linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp.h linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp.h
--- linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp.h	2005-08-28 16:41:01.000000000 -0700
+++ linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp.h	2005-09-28 10:43:15.000000000 -0700
@@ -119,6 +119,7 @@ struct acpiphp_slot {
 	struct list_head funcs;		/* one slot may have different
 					   objects (i.e. for each function) */
 	struct semaphore crit_sect;
+	acpi_handle handle;
 
 	u32		id;		/* slot id (serial #) for hotplug core */
 	u8		device;		/* pci device# */


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

* Re: [patch 1/2] acpiphp: allocate resources for adapters with bridges
  2005-10-07 17:45 [patch 1/2] acpiphp: allocate resources for adapters with bridges Kristen Accardi
@ 2005-10-07 17:59 ` Greg KH
  2005-10-07 18:05   ` Kristen Accardi
  2005-10-11  1:50 ` [Pcihpd-discuss] " MUNEDA Takahiro
  1 sibling, 1 reply; 6+ messages in thread
From: Greg KH @ 2005-10-07 17:59 UTC (permalink / raw)
  To: Kristen Accardi
  Cc: pcihpd-discuss, linux-kernel, acpi-devel, rajesh.shah, len.brown

On Fri, Oct 07, 2005 at 10:45:46AM -0700, Kristen Accardi wrote:
> Allocate resources for adapters with p2p bridges.
> 
> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
> 
> diff -uprN -X linux-2.6.14-rc2/Documentation/dontdiff linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c
> --- linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c	2005-08-28 16:41:01.000000000 -0700
> +++ linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c	2005-09-28 10:43:15.000000000 -0700
> @@ -58,6 +58,9 @@ static LIST_HEAD(bridge_list);
>  
>  static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
>  static void handle_hotplug_event_func (acpi_handle, u32, void *);
> +static void acpiphp_sanitize_bus(struct pci_bus *bus);
> +static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus);

These are not static functions, but functions somewhere else in the
kernel.  Please put their function prototypes in a header file
somewhere.  You also need to EXPORT_SYMBOL_GPL() them so that the
hotplug driver can use them when it is loaded as a module.

thanks,

greg k-h

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

* Re: [patch 1/2] acpiphp: allocate resources for adapters with bridges
  2005-10-07 17:59 ` Greg KH
@ 2005-10-07 18:05   ` Kristen Accardi
  2005-10-07 18:18     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Kristen Accardi @ 2005-10-07 18:05 UTC (permalink / raw)
  To: Greg KH; +Cc: pcihpd-discuss, linux-kernel, acpi-devel, rajesh.shah, len.brown

On Fri, 2005-10-07 at 10:59 -0700, Greg KH wrote:
> On Fri, Oct 07, 2005 at 10:45:46AM -0700, Kristen Accardi wrote:
> > Allocate resources for adapters with p2p bridges.
> > 
> > Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
> > 
> > diff -uprN -X linux-2.6.14-rc2/Documentation/dontdiff linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c
> > --- linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c	2005-08-28 16:41:01.000000000 -0700
> > +++ linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c	2005-09-28 10:43:15.000000000 -0700
> > @@ -58,6 +58,9 @@ static LIST_HEAD(bridge_list);
> >  
> >  static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
> >  static void handle_hotplug_event_func (acpi_handle, u32, void *);
> > +static void acpiphp_sanitize_bus(struct pci_bus *bus);
> > +static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus);
> 
> These are not static functions, but functions somewhere else in the
> kernel.  Please put their function prototypes in a header file
> somewhere.  You also need to EXPORT_SYMBOL_GPL() them so that the
> hotplug driver can use them when it is loaded as a module.
> 
> thanks,
> 
> greg k-h

Actually, these functions are present as static functions in
acpiphp_glue.c, and only used in acpiphp_glue.c, so I don't believe I
need to export them or make them non static (they are static currently).


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

* Re: [patch 1/2] acpiphp: allocate resources for adapters with bridges
  2005-10-07 18:05   ` Kristen Accardi
@ 2005-10-07 18:18     ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-10-07 18:18 UTC (permalink / raw)
  To: Kristen Accardi
  Cc: pcihpd-discuss, linux-kernel, acpi-devel, rajesh.shah, len.brown

On Fri, Oct 07, 2005 at 11:05:44AM -0700, Kristen Accardi wrote:
> On Fri, 2005-10-07 at 10:59 -0700, Greg KH wrote:
> > On Fri, Oct 07, 2005 at 10:45:46AM -0700, Kristen Accardi wrote:
> > > Allocate resources for adapters with p2p bridges.
> > > 
> > > Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
> > > 
> > > diff -uprN -X linux-2.6.14-rc2/Documentation/dontdiff linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c
> > > --- linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c	2005-08-28 16:41:01.000000000 -0700
> > > +++ linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c	2005-09-28 10:43:15.000000000 -0700
> > > @@ -58,6 +58,9 @@ static LIST_HEAD(bridge_list);
> > >  
> > >  static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
> > >  static void handle_hotplug_event_func (acpi_handle, u32, void *);
> > > +static void acpiphp_sanitize_bus(struct pci_bus *bus);
> > > +static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus);
> > 
> > These are not static functions, but functions somewhere else in the
> > kernel.  Please put their function prototypes in a header file
> > somewhere.  You also need to EXPORT_SYMBOL_GPL() them so that the
> > hotplug driver can use them when it is loaded as a module.
> > 
> > thanks,
> > 
> > greg k-h
> 
> Actually, these functions are present as static functions in
> acpiphp_glue.c, and only used in acpiphp_glue.c, so I don't believe I
> need to export them or make them non static (they are static currently).

oops, sorry, you are right, I got those confused with the other acpi
function you added.

greg k-h

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

* Re: [Pcihpd-discuss] [patch 1/2] acpiphp: allocate resources for adapters with bridges
  2005-10-07 17:45 [patch 1/2] acpiphp: allocate resources for adapters with bridges Kristen Accardi
  2005-10-07 17:59 ` Greg KH
@ 2005-10-11  1:50 ` MUNEDA Takahiro
  2005-10-11 23:53   ` Kristen Accardi
  1 sibling, 1 reply; 6+ messages in thread
From: MUNEDA Takahiro @ 2005-10-11  1:50 UTC (permalink / raw)
  To: Kristen Accardi
  Cc: pcihpd-discuss, linux-kernel, acpi-devel, rajesh.shah, greg,
	len.brown, muneda.takahiro

Hi Kristen,

At Fri, 07 Oct 2005 10:45:46 -0700,
Kristen Accardi <kristen.c.accardi@intel.com> wrote:
> 
> Allocate resources for adapters with p2p bridges.
> 
> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
> 
> diff -uprN -X linux-2.6.14-rc2/Documentation/dontdiff linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c
> --- linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp_glue.c	2005-08-28 16:41:01.000000000 -0700
> +++ linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp_glue.c	2005-09-28 10:43:15.000000000 -0700
> @@ -58,6 +58,9 @@ static LIST_HEAD(bridge_list);
>  
>  static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
>  static void handle_hotplug_event_func (acpi_handle, u32, void *);
> +static void acpiphp_sanitize_bus(struct pci_bus *bus);
> +static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus);
> +
>  
>  /*
>   * initialization & terminatation routines
> @@ -207,6 +210,9 @@ register_slot(acpi_handle handle, u32 lv
>  		slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
>  	}
>  
> +	/* store the handle in the slot for later. */
> +	slot->handle = handle;
> +
>  	/* install notify handler */
>  	status = acpi_install_notify_handler(handle,
>  					     ACPI_SYSTEM_NOTIFY,
> @@ -796,7 +802,12 @@ static int enable_device(struct acpiphp_
>  		}
>  	}
>  
> +	pci_bus_size_bridges(bus);
>  	pci_bus_assign_resources(bus);
> +	acpiphp_sanitize_bus(bus);
> +	acpiphp_set_hpp_values(slot->handle, bus);
> +	pci_enable_bridges(bus);
> +	acpiphp_configure_ioapics(slot->handle);
>  	pci_bus_add_devices(bus);
>  
>  	/* associate pci_dev to our representation */
> diff -uprN -X linux-2.6.14-rc2/Documentation/dontdiff linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp.h linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp.h
> --- linux-2.6.14-rc2/drivers/pci/hotplug/acpiphp.h	2005-08-28 16:41:01.000000000 -0700
> +++ linux-2.6.14-rc2-kca1/drivers/pci/hotplug/acpiphp.h	2005-09-28 10:43:15.000000000 -0700
> @@ -119,6 +119,7 @@ struct acpiphp_slot {
>  	struct list_head funcs;		/* one slot may have different
>  					   objects (i.e. for each function) */
>  	struct semaphore crit_sect;
> +	acpi_handle handle;
>  
>  	u32		id;		/* slot id (serial #) for hotplug core */
>  	u8		device;		/* pci device# */


If the p2p bridge is one of the multi-function devices,
the slot->handle would be over-written by the last found
device's handle.
Is your adaptor is *non*-multifunctional?

I'm also working for p2p hotplug with acpiphp, and your code
is almost same to mine. I could find some bugs in my patch
by your patch. I'll update my patch.

Thanks,
MUNE

-- 
MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>


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

* Re: [Pcihpd-discuss] [patch 1/2] acpiphp: allocate resources for adapters with bridges
  2005-10-11  1:50 ` [Pcihpd-discuss] " MUNEDA Takahiro
@ 2005-10-11 23:53   ` Kristen Accardi
  0 siblings, 0 replies; 6+ messages in thread
From: Kristen Accardi @ 2005-10-11 23:53 UTC (permalink / raw)
  To: MUNEDA Takahiro
  Cc: pcihpd-discuss, linux-kernel, acpi-devel, rajesh.shah, greg,
	len.brown

Allocate resources for adapters with bridges on them.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
---
I changed the patch to not store the acpi_handle in the acpiphp_slot
structure, but grab it out of the device structure instead.  However, I
don't have an adapter that will really test to see if this works
properly, so if your adapter will work, then please give it a try and
let me know if it fails.

diff -uprN -X linux-2.6.14-rc3/Documentation/dontdiff linux-2.6.14-rc3.orig/drivers/pci/hotplug/acpiphp_glue.c linux-2.6.14-rc3/drivers/pci/hotplug/acpiphp_glue.c
--- linux-2.6.14-rc3.orig/drivers/pci/hotplug/acpiphp_glue.c	2005-08-28 16:41:01.000000000 -0700
+++ linux-2.6.14-rc3/drivers/pci/hotplug/acpiphp_glue.c	2005-10-11 16:30:58.000000000 -0700
@@ -58,6 +58,9 @@ static LIST_HEAD(bridge_list);
 
 static void handle_hotplug_event_bridge (acpi_handle, u32, void *);
 static void handle_hotplug_event_func (acpi_handle, u32, void *);
+static void acpiphp_sanitize_bus(struct pci_bus *bus);
+static void acpiphp_set_hpp_values(acpi_handle handle, struct pci_bus *bus);
+
 
 /*
  * initialization & terminatation routines
@@ -796,9 +799,14 @@ static int enable_device(struct acpiphp_
 		}
 	}
 
+	pci_bus_size_bridges(bus);
 	pci_bus_assign_resources(bus);
+	acpiphp_sanitize_bus(bus);
+	pci_enable_bridges(bus);
 	pci_bus_add_devices(bus);
-
+	acpiphp_set_hpp_values(DEVICE_ACPI_HANDLE(&bus->self->dev), bus);
+	acpiphp_configure_ioapics(DEVICE_ACPI_HANDLE(&bus->self->dev));
+		
 	/* associate pci_dev to our representation */
 	list_for_each (l, &slot->funcs) {
 		func = list_entry(l, struct acpiphp_func, sibling);


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

end of thread, other threads:[~2005-10-11 23:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-07 17:45 [patch 1/2] acpiphp: allocate resources for adapters with bridges Kristen Accardi
2005-10-07 17:59 ` Greg KH
2005-10-07 18:05   ` Kristen Accardi
2005-10-07 18:18     ` Greg KH
2005-10-11  1:50 ` [Pcihpd-discuss] " MUNEDA Takahiro
2005-10-11 23:53   ` Kristen Accardi

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