Skip to contentSkip to conversation

PCI Hotplug changes for 2.4.20-pre7

PATCH In review Greg KH 1 participant 6 messages Sep 13, 2002 PCI

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 PCI Hotplug changes for 2.4.20-pre7

Hi,

Here are some fixes and updates for the IBM PCI Hotplug driver from Irene Zubarev that enable the driver to work for older IBM machines, and fixes some problems with large numbers of slots in the newer machines.

	Pull from:  bk://linuxusb.bkbits.net/pci_hp-2.4

Patches will follow.

thanks,

greg k-h

 drivers/hotplug/ibmphp.h      |   39 +-
 drivers/hotplug/ibmphp_core.c |  279 +++++++++++------
 drivers/hotplug/ibmphp_ebda.c |  673 ++++++++++++++++++++++++++++++++++--------
 drivers/hotplug/ibmphp_hpc.c  |  277 ++++++++++++-----
 drivers/hotplug/ibmphp_pci.c  |   53 ++-
 drivers/hotplug/ibmphp_res.c  |  317 ++++++++++++-------
 drivers/pci/pci.c             |    1 
 7 files changed, 1192 insertions(+), 447 deletions(-)

-----

[email protected], 2002-09-13 10:56:28-07:00, [email protected]
IBM PCI Hotplug driver: sync up with the 2.5 version (__init and formatting fixes)

 drivers/hotplug/ibmphp.h      |    1 
 drivers/hotplug/ibmphp_core.c |   46 +++++++++++++++++-------------------------
 drivers/hotplug/ibmphp_ebda.c |   29 +++++++++++++-------------
 drivers/hotplug/ibmphp_hpc.c  |   17 ++++++++-------
 drivers/hotplug/ibmphp_res.c  |   16 ++++++++------
 5 files changed, 52 insertions(+), 57 deletions(-)

------

[email protected], 2002-09-13 10:43:40-07:00, [email protected]
[PATCH] export pci_scan_bus, as the IBM pci hotplug driver needs it.

 drivers/pci/pci.c |    1 +
 1 files changed, 1 insertion(+)

------

[email protected], 2002-09-13 10:43:27-07:00, [email protected]
[PATCH] IBM PCI Hotplug driver update for PCI based controllers

 drivers/hotplug/ibmphp.h      |    1 
 drivers/hotplug/ibmphp_core.c |    5 ++
 drivers/hotplug/ibmphp_ebda.c |   71 ++++++++++++++++++++++++++++++++++++++----
 drivers/hotplug/ibmphp_hpc.c  |   26 +++++++++++++++
 4 files changed, 97 insertions(+), 6 deletions(-)

------

[email protected], 2002-09-13 10:43:08-07:00, [email protected]
[PATCH] IBM PCI Hotplug driver update for ISA based devices

 drivers/hotplug/ibmphp_ebda.c |   13 ++++++++++---
 drivers/hotplug/ibmphp_hpc.c  |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 3 deletions(-)

------

[email protected], 2002-09-13 10:42:55-07:00, [email protected]
[PATCH] IBM PCI Hotplug driver update

- fix polling logic
- add ability to write [chassis/rxe]#slot# instead of just slot#

 drivers/hotplug/ibmphp.h      |   37 ++
 drivers/hotplug/ibmphp_core.c |  228 +++++++++++------
 drivers/hotplug/ibmphp_ebda.c |  560 ++++++++++++++++++++++++++++++++++--------
 drivers/hotplug/ibmphp_hpc.c  |  200 +++++++++------
 drivers/hotplug/ibmphp_pci.c  |   53 ++-
 drivers/hotplug/ibmphp_res.c  |  301 ++++++++++++++--------
 6 files changed, 998 insertions(+), 381 deletions(-)

------

author
#1 lore raw

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.660 -> 1.661
# drivers/hotplug/ibmphp_hpc.c 1.2 -> 1.3
# drivers/hotplug/ibmphp_ebda.c 1.2 -> 1.3
# drivers/hotplug/ibmphp_pci.c 1.1 -> 1.2
# drivers/hotplug/ibmphp.h 1.2 -> 1.3
# drivers/hotplug/ibmphp_res.c 1.1 -> 1.2
# drivers/hotplug/ibmphp_core.c 1.3 -> 1.4
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/13 [email protected] 1.661
# [PATCH] IBM PCI Hotplug driver update
#
# - fix polling logic
# - add ability to write [chassis/rxe]#slot# instead of just slot# # --------------------------------------------
#

drivers/hotplug/ibmphp.h +31 -6
diff -Nru a/drivers/hotplug/ibmphp.h b/drivers/hotplug/ibmphp.h
@@ -39,7 +39,8 @@
 #else
 	#define MY_NAME THIS_MODULE->name
 #endif
-#define debug(fmt, arg...) do { if (ibmphp_debug) printk(KERN_DEBUG "%s: " fmt , MY_NAME , ## arg); } while (0)
+#define debug(fmt, arg...) do { if (ibmphp_debug == 1) printk(KERN_DEBUG "%s: " fmt , MY_NAME , ## arg); } while (0)
+#define debug_pci(fmt, arg...) do { if (ibmphp_debug) printk(KERN_DEBUG "%s: " fmt , MY_NAME , ## arg); } while (0)
 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
 #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
@@ -121,6 +122,7 @@
 	u8 port1_port_connect;
 	u8 port2_node_connect;
 	u8 port2_port_connect;
+	u8 chassis_num;
 //	struct list_head scal_detail_list;
 };
 
@@ -139,9 +141,27 @@
 	u8 port1_port_connect;
 	u8 first_slot_num;
 	u8 status;
-//	struct list_head rio_detail_list;
+	u8 wpindex;
+	u8 chassis_num;
+	struct list_head rio_detail_list;
 };
 
+struct opt_rio {
+	u8 rio_type;
+	u8 chassis_num;
+	u8 first_slot_num;
+	u8 middle_num;
+	struct list_head opt_rio_list;
+};	
+
+struct opt_rio_lo {
+	u8 rio_type;
+	u8 chassis_num;
+	u8 first_slot_num;
+	u8 middle_num;
+	u8 pack_count;
+	struct list_head opt_rio_lo_list;
+};	
 
 /****************************************************************
 *  HPC DESCRIPTOR NODE                                          *
@@ -153,7 +173,6 @@
 	short phys_addr;
 //      struct list_head ebda_hpc_list;
 };
-
 /*****************************************************************
 *   IN HPC DATA STRUCTURE, THE ASSOCIATED SLOT AND BUS           *
 *   STRUCTURE                                                    *
@@ -195,6 +214,9 @@
 	u8 i2c_addr;
 };
 
+#define HPC_DEVICE_ID		0x0246
+#define HPC_SUBSYSTEM_ID	0x0247
+#define HPC_PCI_OFFSET		0x40
 /*************************************************************************
 *   RSTC DESCRIPTOR NODE                                                 *
 *************************************************************************/
@@ -215,8 +237,9 @@
 	u8 rsrc_type;
 	u8 bus_num;
 	u8 dev_fun;
-	ulong start_addr;
-	ulong end_addr;
+	u32 start_addr;
+	u32 end_addr;
+	u8 marked;	/* for NVRAM */
 	struct list_head ebda_pci_rsrc_list;
 };
 
@@ -248,7 +271,7 @@
 ***********************************************************/
 extern struct list_head ibmphp_ebda_pci_rsrc_head;
 extern struct list_head ibmphp_slot_head;
-
+extern struct list_head ibmphp_res_head;
 /***********************************************************
 * FUNCTION PROTOTYPES                                      *
 ***********************************************************/
@@ -263,6 +286,7 @@
 extern struct bus_info *ibmphp_find_same_bus_num (u32);
 extern int ibmphp_get_bus_index (u8);
 extern u16 ibmphp_get_total_controllers (void);
+extern int ibmphp_register_pci (void);
 
 /* passed parameters */
 #define MEM		0
@@ -739,6 +763,7 @@
 extern int ibmphp_update_slot_info (struct slot *);	/* This function is called from HPC, so we need it to not be be static */
 extern int ibmphp_configure_card (struct pci_func *, u8);
 extern int ibmphp_unconfigure_card (struct slot **, int);
+extern void ibmphp_increase_count (void);
 extern struct hotplug_slot_ops ibmphp_hotplug_slot_ops;
 
 static inline void long_delay (int delay)
drivers/hotplug/ibmphp_core.c +155 -73

477 lines not on this page · raw message

drivers/hotplug/ibmphp_ebda.c +457 -103

698 lines not on this page · raw message

drivers/hotplug/ibmphp_hpc.c +125 -75

320 lines not on this page · raw message

drivers/hotplug/ibmphp_pci.c +37 -16

93 lines not on this page · raw message

drivers/hotplug/ibmphp_res.c +193 -108

550 lines not on this page · raw message

author
#2 lore raw

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.661 -> 1.662
# drivers/hotplug/ibmphp_hpc.c 1.3 -> 1.4
# drivers/hotplug/ibmphp_ebda.c 1.3 -> 1.4
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/13 [email protected] 1.662
# [PATCH] IBM PCI Hotplug driver update for ISA based devices
#
# --------------------------------------------
#

drivers/hotplug/ibmphp_ebda.c +10 -3
diff -Nru a/drivers/hotplug/ibmphp_ebda.c b/drivers/hotplug/ibmphp_ebda.c
@@ -814,6 +814,7 @@
 	struct ebda_hpc_slot *slot_ptr;
 	struct bus_info *bus_info_ptr1, *bus_info_ptr2;
 	int rc;
+	int retval;
 	struct slot *slot_cur;
 	struct list_head *list;
 
@@ -932,6 +933,10 @@
 			case 0:
 				hpc_ptr->u.isa_ctlr.io_start = readw (io_mem + addr);
 				hpc_ptr->u.isa_ctlr.io_end = readw (io_mem + addr + 2);
+				retval = check_region (hpc_ptr->u.isa_ctlr.io_start, (hpc_ptr->u.isa_ctlr.io_end - hpc_ptr->u.isa_ctlr.io_start + 1));
+				if (retval)
+					return -ENODEV;
+				request_region (hpc_ptr->u.isa_ctlr.io_start, (hpc_ptr->u.isa_ctlr.io_end - hpc_ptr->u.isa_ctlr.io_start + 1), "ibmphp");
 				hpc_ptr->irq = readb (io_mem + addr + 4);
 				addr += 5;
 				break;
@@ -948,9 +953,9 @@
 				return -ENODEV;
 		}
 
-		/* following 3 line: Now our driver only supports I2c ctlrType */
-		if ((hpc_ptr->ctlr_type != 2) && (hpc_ptr->ctlr_type != 4)) {
-			err ("Please run this driver on ibm xseries440\n ");
+		/* following 3 line: Now our driver only supports I2c/ISA ctlrType */
+		if ((hpc_ptr->ctlr_type != 2) && (hpc_ptr->ctlr_type != 4) && (hpc_ptr->ctlr_type != 0)) {
+			err ("Please run this driver on IBM xSeries440 or xSeries 235\n ");
 			return -ENODEV;
 		}
 
@@ -1210,6 +1215,8 @@
 
 	list_for_each_safe (list, next, &ebda_hpc_head) {
 		controller = list_entry (list, struct controller, ebda_hpc_list);
+		if (controller->ctlr_type == 0)
+			release_region (controller->u.isa_ctlr.io_start, (controller->u.isa_ctlr.io_end - controller->u.isa_ctlr.io_start + 1));
 		free_ebda_hpc (controller);
 	}
 }
drivers/hotplug/ibmphp_hpc.c +34 -0
diff -Nru a/drivers/hotplug/ibmphp_hpc.c b/drivers/hotplug/ibmphp_hpc.c
@@ -350,10 +350,41 @@
 	return (rc);
 }
 
+//------------------------------------------------------------
+//  Read from ISA type HPC 
+//------------------------------------------------------------
+static u8 isa_ctrl_read (struct controller *ctlr_ptr, u8 offset)
+{
+	u16 start_address;
+	u16 end_address;
+	u8 data;
+
+	start_address = ctlr_ptr->u.isa_ctlr.io_start;
+	end_address = ctlr_ptr->u.isa_ctlr.io_end;
+	data = inb (start_address + offset);
+	return data;
+}
+
+//--------------------------------------------------------------
+// Write to ISA type HPC
+//--------------------------------------------------------------
+static void isa_ctrl_write (struct controller *ctlr_ptr, u8 offset, u8 data)
+{
+	u16 start_address;
+	u16 port_address;
+	
+	start_address = ctlr_ptr->u.isa_ctlr.io_start;
+	port_address = start_address + (u16) offset;
+	outb (data, port_address);
+}
+
 static u8 ctrl_read (struct controller *ctlr, void *base, u8 offset)
 {
 	u8 rc;
 	switch (ctlr->ctlr_type) {
+	case 0:
+		rc = isa_ctrl_read (ctlr, offset);
+		break;
 	case 2:
 	case 4:
 		rc = i2c_ctrl_read (ctlr, base, offset);
@@ -368,6 +399,9 @@
 {
 	u8 rc = 0;
 	switch (ctlr->ctlr_type) {
+	case 0:
+		isa_ctrl_write(ctlr, offset, data);
+		break;
 	case 2:
 	case 4:
 		rc = i2c_ctrl_write(ctlr, base, offset, data);
author
#3 lore raw

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.662 -> 1.663
# drivers/hotplug/ibmphp_hpc.c 1.4 -> 1.5
# drivers/hotplug/ibmphp_ebda.c 1.4 -> 1.5
# drivers/hotplug/ibmphp.h 1.3 -> 1.4
# drivers/hotplug/ibmphp_core.c 1.4 -> 1.5
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/13 [email protected] 1.663
# [PATCH] IBM PCI Hotplug driver update for PCI based controllers #
# --------------------------------------------
#

drivers/hotplug/ibmphp.h +1 -0
diff -Nru a/drivers/hotplug/ibmphp.h b/drivers/hotplug/ibmphp.h
@@ -737,6 +737,7 @@
 struct controller {
 	struct ebda_hpc_slot *slots;
 	struct ebda_hpc_bus *buses;
+	struct pci_dev *ctrl_dev; /* in case where controller is PCI */
 	u8 starting_slot_num;	/* starting and ending slot #'s this ctrl controls*/
 	u8 ending_slot_num;
 	u8 revision;
drivers/hotplug/ibmphp_core.c +5 -0
diff -Nru a/drivers/hotplug/ibmphp_core.c b/drivers/hotplug/ibmphp_core.c
@@ -1644,6 +1644,11 @@
 
 	max_slots = get_max_slots ();
 	
+	if ((rc = ibmphp_register_pci ())) {
+		ibmphp_unload ();
+		return rc;
+	}
+
 	if (init_ops ()) {
 		ibmphp_unload ();
 		return -ENODEV;
drivers/hotplug/ibmphp_ebda.c +65 -6

109 lines not on this page · raw message

drivers/hotplug/ibmphp_hpc.c +26 -0
diff -Nru a/drivers/hotplug/ibmphp_hpc.c b/drivers/hotplug/ibmphp_hpc.c
@@ -378,6 +378,26 @@
 	outb (data, port_address);
 }
 
+static u8 pci_ctrl_read (struct controller *ctrl, u8 offset)
+{
+	u8 data = 0x00;
+	debug ("inside pci_ctrl_read\n");
+	if (ctrl->ctrl_dev)
+		pci_read_config_byte (ctrl->ctrl_dev, HPC_PCI_OFFSET + offset, &data);
+	return data;
+}
+
+static u8 pci_ctrl_write (struct controller *ctrl, u8 offset, u8 data)
+{
+	u8 rc = -ENODEV;
+	debug ("inside pci_ctrl_write\n");
+	if (ctrl->ctrl_dev) {
+		pci_write_config_byte (ctrl->ctrl_dev, HPC_PCI_OFFSET + offset, data);
+		rc = 0;
+	}
+	return rc;
+}
+
 static u8 ctrl_read (struct controller *ctlr, void *base, u8 offset)
 {
 	u8 rc;
@@ -385,6 +405,9 @@
 	case 0:
 		rc = isa_ctrl_read (ctlr, offset);
 		break;
+	case 1:
+		rc = pci_ctrl_read (ctlr, offset);
+		break;
 	case 2:
 	case 4:
 		rc = i2c_ctrl_read (ctlr, base, offset);
@@ -401,6 +424,9 @@
 	switch (ctlr->ctlr_type) {
 	case 0:
 		isa_ctrl_write(ctlr, offset, data);
+		break;
+	case 1:
+		rc = pci_ctrl_write (ctlr, offset, data);
 		break;
 	case 2:
 	case 4:
author
#4 lore raw

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.663 -> 1.664
# drivers/pci/pci.c 1.32 -> 1.33
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/13 [email protected] 1.664
# [PATCH] export pci_scan_bus, as the IBM pci hotplug driver needs it. #
# --------------------------------------------
#

drivers/pci/pci.c +1 -0
diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
@@ -2153,6 +2153,7 @@
 EXPORT_SYMBOL(pci_add_new_bus);
 EXPORT_SYMBOL(pci_do_scan_bus);
 EXPORT_SYMBOL(pci_scan_slot);
+EXPORT_SYMBOL(pci_scan_bus);
 #ifdef CONFIG_PROC_FS
 EXPORT_SYMBOL(pci_proc_attach_device);
 EXPORT_SYMBOL(pci_proc_detach_device);
author
#5 lore raw

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.664 -> 1.665
# drivers/hotplug/ibmphp_hpc.c 1.5 -> 1.6
# drivers/hotplug/ibmphp_ebda.c 1.5 -> 1.6
# drivers/hotplug/ibmphp.h 1.4 -> 1.5
# drivers/hotplug/ibmphp_res.c 1.2 -> 1.3
# drivers/hotplug/ibmphp_core.c 1.5 -> 1.6
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/13 [email protected] 1.665
# IBM PCI Hotplug driver: sync up with the 2.5 version (__init and formatting fixes) # --------------------------------------------
#

drivers/hotplug/ibmphp.h +0 -1
diff -Nru a/drivers/hotplug/ibmphp.h b/drivers/hotplug/ibmphp.h
@@ -764,7 +764,6 @@
 extern int ibmphp_update_slot_info (struct slot *);	/* This function is called from HPC, so we need it to not be be static */
 extern int ibmphp_configure_card (struct pci_func *, u8);
 extern int ibmphp_unconfigure_card (struct slot **, int);
-extern void ibmphp_increase_count (void);
 extern struct hotplug_slot_ops ibmphp_hotplug_slot_ops;
 
 static inline void long_delay (int delay)
drivers/hotplug/ibmphp_core.c +19 -27

80 lines not on this page · raw message

drivers/hotplug/ibmphp_ebda.c +15 -14
diff -Nru a/drivers/hotplug/ibmphp_ebda.c b/drivers/hotplug/ibmphp_ebda.c
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/list.h>
+#include <linux/init.h>
 #include "ibmphp.h"
 
 /*
@@ -82,7 +83,7 @@
 	return slot;
 }
 
-static struct ebda_hpc_list *alloc_ebda_hpc_list (void)
+static struct ebda_hpc_list * __init alloc_ebda_hpc_list (void)
 {
 	struct ebda_hpc_list *list;
 
@@ -134,7 +135,7 @@
 	kfree (controller);
 }
 
-static struct ebda_rsrc_list *alloc_ebda_rsrc_list (void)
+static struct ebda_rsrc_list * __init alloc_ebda_rsrc_list (void)
 {
 	struct ebda_rsrc_list *list;
 
@@ -156,7 +157,7 @@
 	return resource;
 }
 
-static void print_bus_info (void)
+static void __init print_bus_info (void)
 {
 	struct bus_info *ptr;
 	struct list_head *ptr1;
@@ -200,7 +201,7 @@
 {
 	struct rio_detail *ptr;
 	struct list_head *ptr1;
-	debug ("print_vg_info --- \n");	
+	debug ("%s --- \n", __FUNCTION__);
 	list_for_each (ptr1, &rio_vg_head) {
 		ptr = list_entry (ptr1, struct rio_detail, rio_detail_list);
 		debug ("%s - rio_node_id = %x\n", __FUNCTION__, ptr->rio_node_id);
@@ -213,7 +214,7 @@
 	}
 }
 
-static void print_ebda_pci_rsrc (void)
+static void __init print_ebda_pci_rsrc (void)
 {
 	struct ebda_pci_rsrc *ptr;
 	struct list_head *ptr1;
@@ -225,7 +226,7 @@
 	}
 }
 
-static void print_ibm_slot (void)
+static void __init print_ibm_slot (void)
 {
 	struct slot *ptr;
 	struct list_head *ptr1;
@@ -236,11 +237,11 @@
 	}
 }
 
-static void print_opt_vg (void)
+static void __init print_opt_vg (void)
 {
 	struct opt_rio *ptr;
 	struct list_head *ptr1;
-	debug ("print_opt_vg --- \n");
+	debug ("%s --- \n", __FUNCTION__);
 	list_for_each (ptr1, &opt_vg_head) {
 		ptr = list_entry (ptr1, struct opt_rio, opt_rio_list);
 		debug ("%s - rio_type %x \n", __FUNCTION__, ptr->rio_type); 
@@ -250,7 +251,7 @@
 	}
 }
 
-static void print_ebda_hpc (void)
+static void __init print_ebda_hpc (void)
 {
 	struct controller *hpc_ptr;
 	struct list_head *ptr1;
@@ -295,7 +296,7 @@
 	}
 }
 
-int ibmphp_access_ebda (void)
+int __init ibmphp_access_ebda (void)
 {
 	u8 format, num_ctlrs, rio_complete, hs_complete;
 	u16 ebda_seg, num_entries, next_offset, offset, blk_id, sub_addr, rc, re, rc_id, re_id, base;
@@ -458,7 +459,7 @@
 /*
  * map info of scalability details and rio details from physical address
  */
-static int ebda_rio_table (void)
+static int __init ebda_rio_table (void)
 {
 	u16 offset;
 	u8 i;
@@ -517,7 +518,7 @@
 	return NULL;
 }
 
-static int combine_wpg_for_chassis (void)
+static int __init combine_wpg_for_chassis (void)
 {
 	struct opt_rio *opt_rio_ptr = NULL;
 	struct rio_detail *rio_detail_ptr = NULL;
@@ -805,7 +806,7 @@
  * each hpc from physical address to a list of hot plug controllers based on
  * hpc descriptors.
  */
-static int ebda_rsrc_controller (void)
+static int __init ebda_rsrc_controller (void)
 {
 	u16 addr, addr_slot, addr_bus;
 	u8 ctlr_id, temp, bus_index;
@@ -1075,7 +1076,7 @@
  * map info (bus, devfun, start addr, end addr..) of i/o, memory,
  * pfm from the physical addr to a list of resource.
  */
-static int ebda_rsrc_rsrc (void)
+static int __init ebda_rsrc_rsrc (void)
 {
 	u16 addr;
 	short rsrc;
drivers/hotplug/ibmphp_hpc.c +9 -8
diff -Nru a/drivers/hotplug/ibmphp_hpc.c b/drivers/hotplug/ibmphp_hpc.c
@@ -32,6 +32,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/smp_lock.h>
+#include <linux/init.h>
 #include "ibmphp.h"
 
 static int to_debug = FALSE;
@@ -126,7 +127,7 @@
 *
 * Action:  initialize semaphores and variables
 *---------------------------------------------------------------------*/
-void ibmphp_hpc_initvars (void)
+void __init ibmphp_hpc_initvars (void)
 {
 	debug ("%s - Entry\n", __FUNCTION__);
 
@@ -1146,19 +1147,19 @@
 *
 * Action:  start polling thread
 *---------------------------------------------------------------------*/
-int ibmphp_hpc_start_poll_thread (void)
+int __init ibmphp_hpc_start_poll_thread (void)
 {
 	int rc = 0;
 
-	debug ("ibmphp_hpc_start_poll_thread - Entry\n");
+	debug ("%s - Entry\n", __FUNCTION__);
 
 	tid_poll = kernel_thread (hpc_poll_thread, 0, 0);
 	if (tid_poll < 0) {
-		err ("ibmphp_hpc_start_poll_thread - Error, thread not started\n");
+		err ("%s - Error, thread not started\n", __FUNCTION__);
 		rc = -1;
 	}
 
-	debug ("ibmphp_hpc_start_poll_thread - Exit tid_poll[%d] rc[%d]\n", tid_poll, rc);
+	debug ("%s - Exit tid_poll[%d] rc[%d]\n", __FUNCTION__, tid_poll, rc);
 	return rc;
 }
 
@@ -1167,9 +1168,9 @@
 *
 * Action:  stop polling thread and cleanup
 *---------------------------------------------------------------------*/
-void ibmphp_hpc_stop_poll_thread (void)
+void __exit ibmphp_hpc_stop_poll_thread (void)
 {
-	debug ("ibmphp_hpc_stop_poll_thread - Entry\n");
+	debug ("%s - Entry\n", __FUNCTION__);
 
 	ibmphp_shutdown = TRUE;
 	debug ("before locking operations \n");
@@ -1190,7 +1191,7 @@
 	up (&sem_exit);
 	debug ("after sem exit up\n");
 
-	debug ("ibmphp_hpc_stop_poll_thread - Exit\n");
+	debug ("%s - Exit\n", __FUNCTION__);
 }
 
 /*----------------------------------------------------------------------
drivers/hotplug/ibmphp_res.c +9 -7
diff -Nru a/drivers/hotplug/ibmphp_res.c b/drivers/hotplug/ibmphp_res.c
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/list.h>
+#include <linux/init.h>
 #include "ibmphp.h"
 
 static int flags = 0;		/* for testing */
@@ -45,7 +46,8 @@
 
 static LIST_HEAD(gbuses);
 LIST_HEAD(ibmphp_res_head);
-static struct bus_node * alloc_error_bus (struct ebda_pci_rsrc * curr, u8 busno, int flag)
+
+static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 busno, int flag)
 {
 	struct bus_node * newbus;
 
@@ -69,7 +71,7 @@
 	return newbus;
 }
 
-static struct resource_node * alloc_resources (struct ebda_pci_rsrc * curr)
+static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * curr)
 {
 	struct resource_node *rs;
 	
@@ -92,7 +94,7 @@
 	return rs;
 }
 
-static int alloc_bus_range (struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus)
+static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus)
 {
 	struct bus_node * newbus;
 	struct range_node *newrange;
@@ -199,7 +201,7 @@
  * Input: ptr to the head of the resource list from EBDA
  * Output: 0, -1 or error codes
  ***************************************************************************/
-int ibmphp_rsrc_init (void)
+int __init ibmphp_rsrc_init (void)
 {
 	struct ebda_pci_rsrc *curr;
 	struct range_node *newrange = NULL;
@@ -1675,7 +1677,7 @@
  * a new Mem node
  * This routine is called right after initialization
  *******************************************************************************/
-static int once_over (void)
+static int __init once_over (void)
 {
 	struct resource_node *pfmem_cur;
 	struct resource_node *pfmem_prev;
@@ -1928,7 +1930,7 @@
  *	 behind them All these are TO DO.
  *	 Also need to add more error checkings... (from fnc returns etc)
  */
-static int update_bridge_ranges (struct bus_node **bus)
+static int __init update_bridge_ranges (struct bus_node **bus)
 {
 	u8 sec_busno, device, function, busno, hdr_type, start_io_address, end_io_address;
 	u16 vendor_id, upper_io_start, upper_io_end, start_mem_address, end_mem_address;
@@ -1944,7 +1946,7 @@
 		return -ENODEV;
 	busno = bus_cur->busno;
 
-	debug ("inside update_bridge_ranges \n");
+	debug ("inside %s \n", __FUNCTION__);
 	debug ("bus_cur->busno = %x\n", bus_cur->busno);
 
 	for (device = 0; device < 32; device++) {