From: Sam Bobroff <sbobroff@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: aik@ozlabs.ru, oohall@gmail.com, tyreld@linux.vnet.ibm.com
Subject: [PATCH v3 7/9] powerpc/eeh: Add bdfn field to eeh_dev
Date: Tue, 23 Jul 2019 13:44:18 +1000 [thread overview]
Message-ID: <1cd007696df2db87a0b1e5677520806d4d9b3e24.1563853440.git.sbobroff@linux.ibm.com> (raw)
In-Reply-To: <cover.1563853440.git.sbobroff@linux.ibm.com>
From: Oliver O'Halloran <oohall@gmail.com>
Preparation for removing pci_dn from the powernv EEH code. The only
thing we really use pci_dn for is to get the bdfn of the device for
config space accesses, so adding that information to eeh_dev reduces
the need to carry around the pci_dn.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[SB: Re-wrapped commit message, fixed whitespace damage.]
Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
---
v3 * New in this version.
arch/powerpc/include/asm/eeh.h | 2 ++
arch/powerpc/include/asm/ppc-pci.h | 2 ++
arch/powerpc/kernel/eeh_dev.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index 7f9404a0c3bb..bbe0798f6624 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -121,6 +121,8 @@ static inline bool eeh_pe_passed(struct eeh_pe *pe)
struct eeh_dev {
int mode; /* EEH mode */
int class_code; /* Class code of the device */
+ int bdfn; /* bdfn of device (for cfg ops) */
+ struct pci_controller *controller;
int pe_config_addr; /* PE config address */
u32 config_space[16]; /* Saved PCI config space */
int pcix_cap; /* Saved PCIx capability */
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index cec2d6409515..72860de205a0 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -74,6 +74,8 @@ static inline const char *eeh_driver_name(struct pci_dev *pdev)
#endif /* CONFIG_EEH */
+#define PCI_BUSNO(bdfn) ((bdfn >> 8) & 0xff)
+
#else /* CONFIG_PCI */
static inline void init_pci_config_tokens(void) { }
#endif /* !CONFIG_PCI */
diff --git a/arch/powerpc/kernel/eeh_dev.c b/arch/powerpc/kernel/eeh_dev.c
index c4317c452d98..7370185c7a05 100644
--- a/arch/powerpc/kernel/eeh_dev.c
+++ b/arch/powerpc/kernel/eeh_dev.c
@@ -47,6 +47,8 @@ struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)
/* Associate EEH device with OF node */
pdn->edev = edev;
edev->pdn = pdn;
+ edev->bdfn = (pdn->busno << 8) | pdn->devfn;
+ edev->controller = pdn->phb;
return edev;
}
--
2.22.0.216.g00a2a96fc9
next prev parent reply other threads:[~2019-07-24 3:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-23 3:44 [PATCH v3 0/9] Sam Bobroff
2019-07-23 3:44 ` [PATCH v3 1/9] powerpc/64: Adjust order in pcibios_init() Sam Bobroff
2019-07-23 3:44 ` [PATCH v3 2/9] powerpc/eeh: Clear stale EEH_DEV_NO_HANDLER flag Sam Bobroff
2019-07-23 3:44 ` [PATCH v3 3/9] powerpc/eeh: Improve debug messages around device addition Sam Bobroff
2019-07-23 3:44 ` [PATCH v3 4/9] powerpc/eeh: Initialize EEH address cache earlier Sam Bobroff
2019-07-23 3:44 ` [PATCH v3 5/9] powerpc/eeh: EEH for pSeries hot plug Sam Bobroff
2019-07-23 3:44 ` [PATCH v3 6/9] powerpc/eeh: Refactor around eeh_probe_devices() Sam Bobroff
2019-07-23 3:44 ` Sam Bobroff [this message]
2019-07-23 3:44 ` [PATCH v3 8/9] powerpc/eeh: Introduce EEH edev logging macros Sam Bobroff
2019-07-23 3:44 ` [PATCH v3 9/9] powerpc/eeh: Convert log messages to eeh_edev_* macros Sam Bobroff
2019-07-24 9:23 ` kbuild test robot
2019-07-24 9:47 ` Oliver O'Halloran
2019-07-25 3:33 ` Sam Bobroff
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=1cd007696df2db87a0b1e5677520806d4d9b3e24.1563853440.git.sbobroff@linux.ibm.com \
--to=sbobroff@linux.ibm.com \
--cc=aik@ozlabs.ru \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oohall@gmail.com \
--cc=tyreld@linux.vnet.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).