aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/eeh_pe.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2015-03-17 01:15:08 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2015-03-23 22:15:53 -0400
commitc6406d8fbb014bebdfb5bf3c244548958aec7379 (patch)
treed472e1f82ffcaec3d9dd03bd34f11fdea21fdb96 /arch/powerpc/kernel/eeh_pe.c
parent0bd785873c6a6c9bd50d2ae19862f69ee5759fb9 (diff)
powerpc/eeh: Remove device_node dependency
The patch removes struct eeh_dev::dn and the corresponding helper functions: eeh_dev_to_of_node() and of_node_to_eeh_dev(). Instead, eeh_dev_to_pdn() and pdn_to_eeh_dev() should be used to get the pdn, which might contain device_node on PowerNV platform. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/eeh_pe.c')
-rw-r--r--arch/powerpc/kernel/eeh_pe.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
index 209cd753bf46..f33ceccf6876 100644
--- a/arch/powerpc/kernel/eeh_pe.c
+++ b/arch/powerpc/kernel/eeh_pe.c
@@ -348,9 +348,12 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
348 348
349 /* Put the edev to PE */ 349 /* Put the edev to PE */
350 list_add_tail(&edev->list, &pe->edevs); 350 list_add_tail(&edev->list, &pe->edevs);
351 pr_debug("EEH: Add %s to Bus PE#%x\n", 351 pr_debug("EEH: Add %04x:%02x:%02x.%01x to Bus PE#%x\n",
352 edev->dn->full_name, pe->addr); 352 edev->phb->global_number,
353 353 edev->config_addr >> 8,
354 PCI_SLOT(edev->config_addr & 0xFF),
355 PCI_FUNC(edev->config_addr & 0xFF),
356 pe->addr);
354 return 0; 357 return 0;
355 } else if (pe && (pe->type & EEH_PE_INVALID)) { 358 } else if (pe && (pe->type & EEH_PE_INVALID)) {
356 list_add_tail(&edev->list, &pe->edevs); 359 list_add_tail(&edev->list, &pe->edevs);
@@ -366,9 +369,14 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
366 parent->type &= ~(EEH_PE_INVALID | EEH_PE_KEEP); 369 parent->type &= ~(EEH_PE_INVALID | EEH_PE_KEEP);
367 parent = parent->parent; 370 parent = parent->parent;
368 } 371 }
369 pr_debug("EEH: Add %s to Device PE#%x, Parent PE#%x\n",
370 edev->dn->full_name, pe->addr, pe->parent->addr);
371 372
373 pr_debug("EEH: Add %04x:%02x:%02x.%01x to Device "
374 "PE#%x, Parent PE#%x\n",
375 edev->phb->global_number,
376 edev->config_addr >> 8,
377 PCI_SLOT(edev->config_addr & 0xFF),
378 PCI_FUNC(edev->config_addr & 0xFF),
379 pe->addr, pe->parent->addr);
372 return 0; 380 return 0;
373 } 381 }
374 382
@@ -407,8 +415,13 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
407 list_add_tail(&pe->child, &parent->child_list); 415 list_add_tail(&pe->child, &parent->child_list);
408 list_add_tail(&edev->list, &pe->edevs); 416 list_add_tail(&edev->list, &pe->edevs);
409 edev->pe = pe; 417 edev->pe = pe;
410 pr_debug("EEH: Add %s to Device PE#%x, Parent PE#%x\n", 418 pr_debug("EEH: Add %04x:%02x:%02x.%01x to "
411 edev->dn->full_name, pe->addr, pe->parent->addr); 419 "Device PE#%x, Parent PE#%x\n",
420 edev->phb->global_number,
421 edev->config_addr >> 8,
422 PCI_SLOT(edev->config_addr & 0xFF),
423 PCI_FUNC(edev->config_addr & 0xFF),
424 pe->addr, pe->parent->addr);
412 425
413 return 0; 426 return 0;
414} 427}
@@ -428,8 +441,11 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev)
428 int cnt; 441 int cnt;
429 442
430 if (!edev->pe) { 443 if (!edev->pe) {
431 pr_debug("%s: No PE found for EEH device %s\n", 444 pr_debug("%s: No PE found for device %04x:%02x:%02x.%01x\n",
432 __func__, edev->dn->full_name); 445 __func__, edev->phb->global_number,
446 edev->config_addr >> 8,
447 PCI_SLOT(edev->config_addr & 0xFF),
448 PCI_FUNC(edev->config_addr & 0xFF));
433 return -EEXIST; 449 return -EEXIST;
434 } 450 }
435 451