aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn/kernel
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2008-12-16 04:07:01 -0500
committerLen Brown <len.brown@intel.com>2008-12-31 01:12:26 -0500
commita8ce4471fe74cf749bcfef7e557a7b94f725c494 (patch)
treed693e5118e550a921ac7a14d6236856f16b346f7 /arch/ia64/sn/kernel
parent46422814f988b32d595dd2ce6d43f4c6d3623d41 (diff)
ACPI: io_acpi_init.c: call acpi_get_name to get node fullname
acpi_ns_print_node_pathname is internal used only use acpi_get_name instead to get node fullname Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/ia64/sn/kernel')
-rw-r--r--arch/ia64/sn/kernel/io_acpi_init.c102
1 files changed, 56 insertions, 46 deletions
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
index bc610a6c7851..4c8bc8eee5ad 100644
--- a/arch/ia64/sn/kernel/io_acpi_init.c
+++ b/arch/ia64/sn/kernel/io_acpi_init.c
@@ -64,6 +64,7 @@ static acpi_status __init
64sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret) 64sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
65{ 65{
66 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 66 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
67 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
67 u64 addr; 68 u64 addr;
68 struct hubdev_info *hubdev; 69 struct hubdev_info *hubdev;
69 struct hubdev_info *hubdev_ptr; 70 struct hubdev_info *hubdev_ptr;
@@ -77,11 +78,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
77 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, 78 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
78 &sn_uuid, &buffer); 79 &sn_uuid, &buffer);
79 if (ACPI_FAILURE(status)) { 80 if (ACPI_FAILURE(status)) {
81 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
80 printk(KERN_ERR 82 printk(KERN_ERR
81 "sn_acpi_hubdev_init: acpi_get_vendor_resource() " 83 "sn_acpi_hubdev_init: acpi_get_vendor_resource() "
82 "(0x%x) failed for: ", status); 84 "(0x%x) failed for: %s\n", status,
83 acpi_ns_print_node_pathname(handle, NULL); 85 (char *)name_buffer.pointer);
84 printk("\n"); 86 kfree(name_buffer.pointer);
85 return AE_OK; /* Continue walking namespace */ 87 return AE_OK; /* Continue walking namespace */
86 } 88 }
87 89
@@ -89,11 +91,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
89 vendor = &resource->data.vendor_typed; 91 vendor = &resource->data.vendor_typed;
90 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) != 92 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
91 sizeof(struct hubdev_info *)) { 93 sizeof(struct hubdev_info *)) {
94 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
92 printk(KERN_ERR 95 printk(KERN_ERR
93 "sn_acpi_hubdev_init: Invalid vendor data length: %d for: ", 96 "sn_acpi_hubdev_init: Invalid vendor data length: "
94 vendor->byte_length); 97 "%d for: %s\n",
95 acpi_ns_print_node_pathname(handle, NULL); 98 vendor->byte_length, (char *)name_buffer.pointer);
96 printk("\n"); 99 kfree(name_buffer.pointer);
97 goto exit; 100 goto exit;
98 } 101 }
99 102
@@ -120,6 +123,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
120{ 123{
121 u64 addr; 124 u64 addr;
122 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 125 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
126 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
123 acpi_handle handle; 127 acpi_handle handle;
124 struct pcibus_bussoft *prom_bussoft_ptr; 128 struct pcibus_bussoft *prom_bussoft_ptr;
125 struct acpi_resource *resource; 129 struct acpi_resource *resource;
@@ -131,11 +135,11 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
131 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, 135 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
132 &sn_uuid, &buffer); 136 &sn_uuid, &buffer);
133 if (ACPI_FAILURE(status)) { 137 if (ACPI_FAILURE(status)) {
138 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
134 printk(KERN_ERR "%s: " 139 printk(KERN_ERR "%s: "
135 "acpi_get_vendor_resource() failed (0x%x) for: ", 140 "acpi_get_vendor_resource() failed (0x%x) for: %s\n",
136 __func__, status); 141 __func__, status, (char *)name_buffer.pointer);
137 acpi_ns_print_node_pathname(handle, NULL); 142 kfree(name_buffer.pointer);
138 printk("\n");
139 return NULL; 143 return NULL;
140 } 144 }
141 resource = buffer.pointer; 145 resource = buffer.pointer;
@@ -168,6 +172,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
168{ 172{
169 u64 addr; 173 u64 addr;
170 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 174 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
175 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
171 struct sn_irq_info *irq_info, *irq_info_prom; 176 struct sn_irq_info *irq_info, *irq_info_prom;
172 struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr; 177 struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr;
173 struct acpi_resource *resource; 178 struct acpi_resource *resource;
@@ -182,11 +187,11 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
182 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, 187 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
183 &sn_uuid, &buffer); 188 &sn_uuid, &buffer);
184 if (ACPI_FAILURE(status)) { 189 if (ACPI_FAILURE(status)) {
190 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
185 printk(KERN_ERR 191 printk(KERN_ERR
186 "%s: acpi_get_vendor_resource() failed (0x%x) for: ", 192 "%s: acpi_get_vendor_resource() failed (0x%x) for: %s\n",
187 __func__, status); 193 __func__, status, (char *)name_buffer.pointer);
188 acpi_ns_print_node_pathname(handle, NULL); 194 kfree(name_buffer.pointer);
189 printk("\n");
190 return 1; 195 return 1;
191 } 196 }
192 197
@@ -194,11 +199,12 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
194 vendor = &resource->data.vendor_typed; 199 vendor = &resource->data.vendor_typed;
195 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) != 200 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
196 sizeof(struct pci_devdev_info *)) { 201 sizeof(struct pci_devdev_info *)) {
202 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
197 printk(KERN_ERR 203 printk(KERN_ERR
198 "%s: Invalid vendor data length: %d for: ", 204 "%s: Invalid vendor data length: %d for: %s\n",
199 __func__, vendor->byte_length); 205 __func__, vendor->byte_length,
200 acpi_ns_print_node_pathname(handle, NULL); 206 (char *)name_buffer.pointer);
201 printk("\n"); 207 kfree(name_buffer.pointer);
202 ret = 1; 208 ret = 1;
203 goto exit; 209 goto exit;
204 } 210 }
@@ -239,6 +245,9 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
239 acpi_handle parent; 245 acpi_handle parent;
240 int slot; 246 int slot;
241 acpi_status status; 247 acpi_status status;
248 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
249
250 acpi_get_name(device_handle, ACPI_FULL_PATHNAME, &name_buffer);
242 251
243 /* 252 /*
244 * Do an upward search to find the root bus device, and 253 * Do an upward search to find the root bus device, and
@@ -249,9 +258,8 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
249 status = acpi_get_parent(child, &parent); 258 status = acpi_get_parent(child, &parent);
250 if (ACPI_FAILURE(status)) { 259 if (ACPI_FAILURE(status)) {
251 printk(KERN_ERR "%s: acpi_get_parent() failed " 260 printk(KERN_ERR "%s: acpi_get_parent() failed "
252 "(0x%x) for: ", __func__, status); 261 "(0x%x) for: %s\n", __func__, status,
253 acpi_ns_print_node_pathname(child, NULL); 262 (char *)name_buffer.pointer);
254 printk("\n");
255 panic("%s: Unable to find host devfn\n", __func__); 263 panic("%s: Unable to find host devfn\n", __func__);
256 } 264 }
257 if (parent == rootbus_handle) 265 if (parent == rootbus_handle)
@@ -259,22 +267,20 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
259 child = parent; 267 child = parent;
260 } 268 }
261 if (!child) { 269 if (!child) {
262 printk(KERN_ERR "%s: Unable to find root bus for: ", 270 printk(KERN_ERR "%s: Unable to find root bus for: %s\n",
263 __func__); 271 __func__, (char *)name_buffer.pointer);
264 acpi_ns_print_node_pathname(device_handle, NULL);
265 printk("\n");
266 BUG(); 272 BUG();
267 } 273 }
268 274
269 status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr); 275 status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr);
270 if (ACPI_FAILURE(status)) { 276 if (ACPI_FAILURE(status)) {
271 printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: ", 277 printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: %s\n",
272 __func__, status); 278 __func__, status, (char *)name_buffer.pointer);
273 acpi_ns_print_node_pathname(child, NULL);
274 printk("\n");
275 panic("%s: Unable to find host devfn\n", __func__); 279 panic("%s: Unable to find host devfn\n", __func__);
276 } 280 }
277 281
282 kfree(name_buffer.pointer);
283
278 slot = (adr >> 16) & 0xffff; 284 slot = (adr >> 16) & 0xffff;
279 function = adr & 0xffff; 285 function = adr & 0xffff;
280 devfn = PCI_DEVFN(slot, function); 286 devfn = PCI_DEVFN(slot, function);
@@ -300,27 +306,28 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)
300 int function; 306 int function;
301 int slot; 307 int slot;
302 struct sn_pcidev_match *info = context; 308 struct sn_pcidev_match *info = context;
309 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
303 310
304 status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, 311 status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
305 &adr); 312 &adr);
306 if (ACPI_SUCCESS(status)) { 313 if (ACPI_SUCCESS(status)) {
307 status = acpi_get_parent(handle, &parent); 314 status = acpi_get_parent(handle, &parent);
308 if (ACPI_FAILURE(status)) { 315 if (ACPI_FAILURE(status)) {
316 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
309 printk(KERN_ERR 317 printk(KERN_ERR
310 "%s: acpi_get_parent() failed (0x%x) for: ", 318 "%s: acpi_get_parent() failed (0x%x) for: %s\n",
311 __func__, status); 319 __func__, status, (char *)name_buffer.pointer);
312 acpi_ns_print_node_pathname(handle, NULL); 320 kfree(name_buffer.pointer);
313 printk("\n");
314 return AE_OK; 321 return AE_OK;
315 } 322 }
316 status = acpi_evaluate_integer(parent, METHOD_NAME__BBN, 323 status = acpi_evaluate_integer(parent, METHOD_NAME__BBN,
317 NULL, &bbn); 324 NULL, &bbn);
318 if (ACPI_FAILURE(status)) { 325 if (ACPI_FAILURE(status)) {
326 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
319 printk(KERN_ERR 327 printk(KERN_ERR
320 "%s: Failed to find _BBN in parent of: ", 328 "%s: Failed to find _BBN in parent of: %s\n",
321 __func__); 329 __func__, (char *)name_buffer.pointer);
322 acpi_ns_print_node_pathname(handle, NULL); 330 kfree(name_buffer.pointer);
323 printk("\n");
324 return AE_OK; 331 return AE_OK;
325 } 332 }
326 333
@@ -350,24 +357,27 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
350 acpi_handle rootbus_handle; 357 acpi_handle rootbus_handle;
351 unsigned long long segment; 358 unsigned long long segment;
352 acpi_status status; 359 acpi_status status;
360 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
353 361
354 rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle; 362 rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle;
355 status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL, 363 status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
356 &segment); 364 &segment);
357 if (ACPI_SUCCESS(status)) { 365 if (ACPI_SUCCESS(status)) {
358 if (segment != pci_domain_nr(dev)) { 366 if (segment != pci_domain_nr(dev)) {
367 acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME,
368 &name_buffer);
359 printk(KERN_ERR 369 printk(KERN_ERR
360 "%s: Segment number mismatch, 0x%llx vs 0x%x for: ", 370 "%s: Segment number mismatch, 0x%llx vs 0x%x for: %s\n",
361 __func__, segment, pci_domain_nr(dev)); 371 __func__, segment, pci_domain_nr(dev),
362 acpi_ns_print_node_pathname(rootbus_handle, NULL); 372 (char *)name_buffer.pointer);
363 printk("\n"); 373 kfree(name_buffer.pointer);
364 return 1; 374 return 1;
365 } 375 }
366 } else { 376 } else {
367 printk(KERN_ERR "%s: Unable to get __SEG from: ", 377 acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME, &name_buffer);
368 __func__); 378 printk(KERN_ERR "%s: Unable to get __SEG from: %s\n",
369 acpi_ns_print_node_pathname(rootbus_handle, NULL); 379 __func__, (char *)name_buffer.pointer);
370 printk("\n"); 380 kfree(name_buffer.pointer);
371 return 1; 381 return 1;
372 } 382 }
373 383