aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJohn Keller <jpk@sgi.com>2007-02-23 17:24:16 -0500
committerLen Brown <len.brown@intel.com>2007-02-23 23:06:59 -0500
commit690b8d9d54941c90af1d43b0cc24903d20386f5b (patch)
tree9c221321105afe3735430c14604d2c473aefc005 /arch
parent9654640d0af8f2de40ff3807d3695109d3463f54 (diff)
ACPI: Altix: cannot register acpi bus driver before bus scan
SN code to initialize the Hub/TIO infrastructure needs to execute before bus scanning. This was previously done with an early call to acpi_bus_register_driver(). But now that ACPI is using the Linux driver model, a driver cannot be registered that early. Make changes to have the init routines invoked via calls to acpi_get_devices(). Signed-off-by: John Keller <jpk@sgi.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/sn/kernel/io_acpi_init.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
index 8c331ca6e5c9..c6216f454ffb 100644
--- a/arch/ia64/sn/kernel/io_acpi_init.c
+++ b/arch/ia64/sn/kernel/io_acpi_init.c
@@ -53,12 +53,15 @@ sal_ioif_init(u64 *result)
53} 53}
54 54
55/* 55/*
56 * sn_hubdev_add - The 'add' function of the acpi_sn_hubdev_driver. 56 * sn_acpi_hubdev_init() - This function is called by acpi_ns_get_device_callback()
57 * Called for every "SGIHUB" or "SGITIO" device defined 57 * for all SGIHUB and SGITIO acpi devices defined in the
58 * in the ACPI namespace. 58 * DSDT. It obtains the hubdev_info pointer from the
59 * ACPI vendor resource, which the PROM setup, and sets up the
60 * hubdev_info in the pda.
59 */ 61 */
60static int __init 62
61sn_hubdev_add(struct acpi_device *device) 63static acpi_status __init
64sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
62{ 65{
63 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 66 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
64 u64 addr; 67 u64 addr;
@@ -67,18 +70,19 @@ sn_hubdev_add(struct acpi_device *device)
67 int i; 70 int i;
68 u64 nasid; 71 u64 nasid;
69 struct acpi_resource *resource; 72 struct acpi_resource *resource;
70 int ret = 0;
71 acpi_status status; 73 acpi_status status;
72 struct acpi_resource_vendor_typed *vendor; 74 struct acpi_resource_vendor_typed *vendor;
73 extern void sn_common_hubdev_init(struct hubdev_info *); 75 extern void sn_common_hubdev_init(struct hubdev_info *);
74 76
75 status = acpi_get_vendor_resource(device->handle, METHOD_NAME__CRS, 77 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
76 &sn_uuid, &buffer); 78 &sn_uuid, &buffer);
77 if (ACPI_FAILURE(status)) { 79 if (ACPI_FAILURE(status)) {
78 printk(KERN_ERR 80 printk(KERN_ERR
79 "sn_hubdev_add: acpi_get_vendor_resource() failed: %d\n", 81 "sn_acpi_hubdev_init: acpi_get_vendor_resource() "
80 status); 82 "(0x%x) failed for: ", status);
81 return 1; 83 acpi_ns_print_node_pathname(handle, NULL);
84 printk("\n");
85 return AE_OK; /* Continue walking namespace */
82 } 86 }
83 87
84 resource = buffer.pointer; 88 resource = buffer.pointer;
@@ -86,9 +90,10 @@ sn_hubdev_add(struct acpi_device *device)
86 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) != 90 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
87 sizeof(struct hubdev_info *)) { 91 sizeof(struct hubdev_info *)) {
88 printk(KERN_ERR 92 printk(KERN_ERR
89 "sn_hubdev_add: Invalid vendor data length: %d\n", 93 "sn_acpi_hubdev_init: Invalid vendor data length: %d for: ",
90 vendor->byte_length); 94 vendor->byte_length);
91 ret = 1; 95 acpi_ns_print_node_pathname(handle, NULL);
96 printk("\n");
92 goto exit; 97 goto exit;
93 } 98 }
94 99
@@ -103,7 +108,7 @@ sn_hubdev_add(struct acpi_device *device)
103 108
104exit: 109exit:
105 kfree(buffer.pointer); 110 kfree(buffer.pointer);
106 return ret; 111 return AE_OK; /* Continue walking namespace */
107} 112}
108 113
109/* 114/*
@@ -441,14 +446,6 @@ sn_acpi_slot_fixup(struct pci_dev *dev)
441 446
442EXPORT_SYMBOL(sn_acpi_slot_fixup); 447EXPORT_SYMBOL(sn_acpi_slot_fixup);
443 448
444static struct acpi_driver acpi_sn_hubdev_driver = {
445 .name = "SGI HUBDEV Driver",
446 .ids = "SGIHUB,SGITIO",
447 .ops = {
448 .add = sn_hubdev_add,
449 },
450};
451
452 449
453/* 450/*
454 * sn_acpi_bus_fixup - Perform SN specific setup of software structs 451 * sn_acpi_bus_fixup - Perform SN specific setup of software structs
@@ -492,7 +489,10 @@ sn_io_acpi_init(void)
492 /* SN Altix does not follow the IOSAPIC IRQ routing model */ 489 /* SN Altix does not follow the IOSAPIC IRQ routing model */
493 acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM; 490 acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM;
494 491
495 acpi_bus_register_driver(&acpi_sn_hubdev_driver); 492 /* Setup hubdev_info for all SGIHUB/SGITIO devices */
493 acpi_get_devices("SGIHUB", sn_acpi_hubdev_init, NULL, NULL);
494 acpi_get_devices("SGITIO", sn_acpi_hubdev_init, NULL, NULL);
495
496 status = sal_ioif_init(&result); 496 status = sal_ioif_init(&result);
497 if (status || result) 497 if (status || result)
498 panic("sal_ioif_init failed: [%lx] %s\n", 498 panic("sal_ioif_init failed: [%lx] %s\n",