All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver O'Halloran <oohall@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Oliver O'Halloran <oohall@gmail.com>
Subject: [PATCH v3 04/14] powerpc/pseries: Stop using pdn->pe_number
Date: Sat, 25 Jul 2020 18:12:21 +1000	[thread overview]
Message-ID: <20200725081231.39076-4-oohall@gmail.com> (raw)
In-Reply-To: <20200725081231.39076-1-oohall@gmail.com>

The pci_dn->pe_number field is mainly used to track the IODA PE number of a
device on PowerNV. At some point it grew a user in the pseries SR-IOV
support which muddies the waters a bit, so remove it.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
v2: no change
v3: no change
---
 arch/powerpc/platforms/pseries/eeh_pseries.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
index ace117f99d94..18a2522b9b5e 100644
--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
@@ -52,8 +52,6 @@ void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
 	dev_dbg(&pdev->dev, "EEH: Setting up device\n");
 #ifdef CONFIG_PCI_IOV
 	if (pdev->is_virtfn) {
-		struct pci_dn *physfn_pdn;
-
 		pdn->device_id  =  pdev->device;
 		pdn->vendor_id  =  pdev->vendor;
 		pdn->class_code =  pdev->class;
@@ -63,8 +61,6 @@ void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
 		 * completion from platform.
 		 */
 		pdn->last_allow_rc =  0;
-		physfn_pdn      =  pci_get_pdn(pdev->physfn);
-		pdn->pe_number  =  physfn_pdn->pe_num_map[pdn->vf_index];
 	}
 #endif
 	pseries_eeh_init_edev(pdn);
@@ -772,8 +768,8 @@ int pseries_send_allow_unfreeze(struct pci_dn *pdn,
 
 static int pseries_call_allow_unfreeze(struct eeh_dev *edev)
 {
+	int cur_vfs = 0, rc = 0, vf_index, bus, devfn, vf_pe_num;
 	struct pci_dn *pdn, *tmp, *parent, *physfn_pdn;
-	int cur_vfs = 0, rc = 0, vf_index, bus, devfn;
 	u16 *vf_pe_array;
 
 	vf_pe_array = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL);
@@ -806,8 +802,10 @@ static int pseries_call_allow_unfreeze(struct eeh_dev *edev)
 			}
 		} else {
 			pdn = pci_get_pdn(edev->pdev);
-			vf_pe_array[0] = cpu_to_be16(pdn->pe_number);
 			physfn_pdn = pci_get_pdn(edev->physfn);
+
+			vf_pe_num = physfn_pdn->pe_num_map[edev->vf_index];
+			vf_pe_array[0] = cpu_to_be16(vf_pe_num);
 			rc = pseries_send_allow_unfreeze(physfn_pdn,
 							 vf_pe_array, 1);
 			pdn->last_allow_rc = rc;
-- 
2.26.2


  parent reply	other threads:[~2020-07-25  8:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-25  8:12 [PATCH v3 01/14] powerpc/eeh: Remove eeh_dev_phb_init_dynamic() Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 02/14] powerpc/eeh: Remove eeh_dev.c Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 03/14] powerpc/eeh: Move vf_index out of pci_dn and into eeh_dev Oliver O'Halloran
2020-07-25  8:12 ` Oliver O'Halloran [this message]
2020-07-25  8:12 ` [PATCH v3 05/14] powerpc/eeh: Kill off eeh_ops->get_pe_addr() Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 06/14] powerpc/eeh: Remove VF config space restoration Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 07/14] powerpc/eeh: Pass eeh_dev to eeh_ops->restore_config() Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 08/14] powerpc/eeh: Pass eeh_dev to eeh_ops->resume_notify() Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 09/14] powerpc/eeh: Pass eeh_dev to eeh_ops->{read|write}_config() Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 10/14] powerpc/eeh: Remove spurious use of pci_dn in eeh_dump_dev_log Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 11/14] powerpc/eeh: Remove class code field from edev Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 12/14] powerpc/eeh: Rename eeh_{add_to|remove_from}_parent_pe() Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 13/14] powerpc/eeh: Drop pdn use in eeh_pe_tree_insert() Oliver O'Halloran
2020-07-25  8:12 ` [PATCH v3 14/14] powerpc/eeh: Move PE tree setup into the platform Oliver O'Halloran
2020-07-27  7:26 ` [PATCH v3 01/14] powerpc/eeh: Remove eeh_dev_phb_init_dynamic() Michael Ellerman

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=20200725081231.39076-4-oohall@gmail.com \
    --to=oohall@gmail.com \
    --cc=aik@ozlabs.ru \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.