linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Oliver O'Halloran <oohall@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Oliver O'Halloran <oohall@gmail.com>, mahesh@linux.ibm.com
Subject: [PATCH 13/14] powerpc/eeh: Drop pdn use in eeh_pe_tree_insert()
Date: Mon,  6 Jul 2020 11:36:18 +1000	[thread overview]
Message-ID: <20200706013619.459420-14-oohall@gmail.com> (raw)
In-Reply-To: <20200706013619.459420-1-oohall@gmail.com>

This is mostly just to make the subsequent diffs less noisy. No functional
changes.

One thing that needs calling out is the removal of the "config_addr"
variable and replacing it with edev->bdfn. The contents of edev->bdfn are
the same, however it's worth pointing out that what RTAS calls a
"config_addr" isn't the same as the bdfn. The config_addr is supposed to
be: <bus><devfn><reg> with each field being an 8 bit number. Various parts
of the EEH code use BDFN and "config_addr" as interchangeable quantities
even though they aren't really.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 arch/powerpc/kernel/eeh_pe.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
index 97bf09db2ecd..898205829a8f 100644
--- a/arch/powerpc/kernel/eeh_pe.c
+++ b/arch/powerpc/kernel/eeh_pe.c
@@ -366,9 +366,8 @@ static struct eeh_pe *eeh_pe_get_parent(struct eeh_dev *edev)
  */
 int eeh_pe_tree_insert(struct eeh_dev *edev)
 {
+	struct pci_controller *hose = edev->controller;
 	struct eeh_pe *pe, *parent;
-	struct pci_dn *pdn = eeh_dev_to_pdn(edev);
-	int config_addr = (pdn->busno << 8) | (pdn->devfn);
 
 	/* Check if the PE number is valid */
 	if (!eeh_has_flag(EEH_VALID_PE_ZERO) && !edev->pe_config_addr) {
@@ -382,7 +381,7 @@ int eeh_pe_tree_insert(struct eeh_dev *edev)
 	 * PE should be composed of PCI bus and its subordinate
 	 * components.
 	 */
-	pe = eeh_pe_get(pdn->phb, edev->pe_config_addr, config_addr);
+	pe = eeh_pe_get(hose, edev->pe_config_addr, edev->bdfn);
 	if (pe) {
 		if (pe->type & EEH_PE_INVALID) {
 			list_add_tail(&edev->entry, &pe->edevs);
@@ -416,15 +415,15 @@ int eeh_pe_tree_insert(struct eeh_dev *edev)
 
 	/* Create a new EEH PE */
 	if (edev->physfn)
-		pe = eeh_pe_alloc(pdn->phb, EEH_PE_VF);
+		pe = eeh_pe_alloc(hose, EEH_PE_VF);
 	else
-		pe = eeh_pe_alloc(pdn->phb, EEH_PE_DEVICE);
+		pe = eeh_pe_alloc(hose, EEH_PE_DEVICE);
 	if (!pe) {
 		pr_err("%s: out of memory!\n", __func__);
 		return -ENOMEM;
 	}
 	pe->addr	= edev->pe_config_addr;
-	pe->config_addr	= config_addr;
+	pe->config_addr	= edev->bdfn;
 
 	/*
 	 * Put the new EEH PE into hierarchy tree. If the parent
@@ -434,10 +433,10 @@ int eeh_pe_tree_insert(struct eeh_dev *edev)
 	 */
 	parent = eeh_pe_get_parent(edev);
 	if (!parent) {
-		parent = eeh_phb_pe_get(pdn->phb);
+		parent = eeh_phb_pe_get(hose);
 		if (!parent) {
 			pr_err("%s: No PHB PE is found (PHB Domain=%d)\n",
-				__func__, pdn->phb->global_number);
+				__func__, hose->global_number);
 			edev->pe = NULL;
 			kfree(pe);
 			return -EEXIST;
-- 
2.26.2


  parent reply	other threads:[~2020-07-06  2:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06  1:36 EEH core pci_dn de-lousing Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 01/14] powerpc/eeh: Remove eeh_dev_phb_init_dynamic() Oliver O'Halloran
2020-07-06  9:12   ` kernel test robot
2020-07-06  1:36 ` [PATCH 02/14] powerpc/eeh: Remove eeh_dev.c Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 03/14] powerpc/eeh: Move vf_index out of pci_dn and into eeh_dev Oliver O'Halloran
2020-07-13  8:55   ` Alexey Kardashevskiy
2020-07-13  9:02     ` Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 04/14] powerpc/pseries: Stop using pdn->pe_number Oliver O'Halloran
2020-07-13  8:59   ` Alexey Kardashevskiy
2020-07-06  1:36 ` [PATCH 05/14] powerpc/eeh: Kill off eeh_ops->get_pe_addr() Oliver O'Halloran
2020-07-13  9:54   ` Alexey Kardashevskiy
2020-07-13 11:11     ` Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 06/14] powerpc/eeh: Remove VF config space restoration Oliver O'Halloran
2020-07-13 10:32   ` Alexey Kardashevskiy
2020-07-13 10:55     ` Oliver O'Halloran
2020-07-13 11:39       ` Alexey Kardashevskiy
2020-07-06  1:36 ` [PATCH 07/14] powerpc/eeh: Pass eeh_dev to eeh_ops->restore_config() Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 08/14] powerpc/eeh: Pass eeh_dev to eeh_ops->resume_notify() Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 09/14] powerpc/eeh: Pass eeh_dev to eeh_ops->{read|write}_config() Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 10/14] powerpc/eeh: Remove spurious use of pci_dn in eeh_dump_dev_log Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 11/14] powerpc/eeh: Remove class code field from edev Oliver O'Halloran
2020-07-06  1:36 ` [PATCH 12/14] powerpc/eeh: Rename eeh_{add_to|remove_from}_parent_pe() Oliver O'Halloran
2020-07-06  1:36 ` Oliver O'Halloran [this message]
2020-07-06  1:36 ` [PATCH 14/14] powerpc/eeh: Move PE tree setup into the platform Oliver O'Halloran
2020-07-14  1:50   ` Alexey Kardashevskiy
2020-07-14  3:08     ` Oliver O'Halloran
2020-07-14  9:10       ` Alexey Kardashevskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200706013619.459420-14-oohall@gmail.com \
    --to=oohall@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mahesh@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).