diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2015-03-17 01:15:04 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-03-23 22:15:50 -0400 |
commit | c035ff1d2eaa03ab40839041e955a86a8e412eb4 (patch) | |
tree | 1e32cee1e7f44856d4c475c36bc552386ec87cd2 /arch/powerpc/kernel | |
parent | 3532a741f80c3b9ca975006f93a4a477e07e2cb3 (diff) |
powerpc/pci: Trace more information from pci_dn
Originally, EEH probes on device_node or pci_dev and populates the
corresponding eeh_dev. In the subsequent patches, EEH will probes
on pci_dn and populates the corresponding eeh_dev. So we have to
cache some information in pci_dn, either from device_node or SRIOV
PF's enablement platform hook, to populate the eeh_dev properly.
The motivation to probe pci_dn, instead of device node or pci_dev,
to populate eeh_dev is SRIOV VFs are dynamically created and we
don't have the corresponding device nodes for them.
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')
-rw-r--r-- | arch/powerpc/kernel/pci_dn.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 0ab2dadaf842..d139f72ff9d5 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c | |||
@@ -166,6 +166,15 @@ void *update_dn_pci_info(struct device_node *dn, void *data) | |||
166 | pdn->devfn = (addr >> 8) & 0xff; | 166 | pdn->devfn = (addr >> 8) & 0xff; |
167 | } | 167 | } |
168 | 168 | ||
169 | /* vendor/device IDs and class code */ | ||
170 | regs = of_get_property(dn, "vendor-id", NULL); | ||
171 | pdn->vendor_id = regs ? of_read_number(regs, 1) : 0; | ||
172 | regs = of_get_property(dn, "device-id", NULL); | ||
173 | pdn->device_id = regs ? of_read_number(regs, 1) : 0; | ||
174 | regs = of_get_property(dn, "class-code", NULL); | ||
175 | pdn->class_code = regs ? of_read_number(regs, 1) : 0; | ||
176 | |||
177 | /* Extended config space */ | ||
169 | pdn->pci_ext_config_space = (type && of_read_number(type, 1) == 1); | 178 | pdn->pci_ext_config_space = (type && of_read_number(type, 1) == 1); |
170 | 179 | ||
171 | /* Attach to parent node */ | 180 | /* Attach to parent node */ |
@@ -255,6 +264,7 @@ void pci_devs_phb_init_dynamic(struct pci_controller *phb) | |||
255 | pdn = dn->data; | 264 | pdn = dn->data; |
256 | if (pdn) { | 265 | if (pdn) { |
257 | pdn->devfn = pdn->busno = -1; | 266 | pdn->devfn = pdn->busno = -1; |
267 | pdn->vendor_id = pdn->device_id = pdn->class_code = 0; | ||
258 | pdn->phb = phb; | 268 | pdn->phb = phb; |
259 | phb->pci_data = pdn; | 269 | phb->pci_data = pdn; |
260 | } | 270 | } |