In eeh_pe_loc_get(), the PE location code is retrieved from the
"ibm,loc-code" property of the device node for the bridge of the
PE's primary bus. It's not correct because the property indicates
the parent PE's location code.
This reads the correct PE location code from "ibm,io-base-loc-code"
or "ibm,slot-location-code" property of PE parent bus's device node.
Signed-off-by: Gavin Shan <redacted>
---
arch/powerpc/kernel/eeh_pe.c | 33 +++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)
@@ -883,32 +883,29 @@ void eeh_pe_restore_bars(struct eeh_pe *pe)constchar*eeh_pe_loc_get(structeeh_pe*pe){structpci_bus*bus=eeh_pe_bus_get(pe);-structdevice_node*dn=pci_bus_to_OF_node(bus);+structdevice_node*dn;constchar*loc=NULL;-if(!dn)-gotoout;+while(bus){+dn=pci_bus_to_OF_node(bus);+if(!dn){+bus=bus->parent;+continue;+}-/* PHB PE or root PE ? */-if(pci_is_root_bus(bus)){-loc=of_get_property(dn,"ibm,loc-code",NULL);-if(!loc)+if(pci_is_root_bus(bus))loc=of_get_property(dn,"ibm,io-base-loc-code",NULL);+else+loc=of_get_property(dn,"ibm,slot-location-code",+NULL);+if(loc)-gotoout;+returnloc;-/* Check the root port */-dn=dn->child;-if(!dn)-gotoout;+bus=bus->parent;}-loc=of_get_property(dn,"ibm,loc-code",NULL);-if(!loc)-loc=of_get_property(dn,"ibm,slot-location-code",NULL);--out:-returnloc?loc:"N/A";+return"N/A";}/**
From: Joel Stanley <joel@jms.id.au> Date: 2016-01-19 22:41:28
Hello Gavin,
On Wed, Dec 2, 2015 at 3:55 PM, Gavin Shan [off-list ref] wrote:
In eeh_pe_loc_get(), the PE location code is retrieved from the
"ibm,loc-code" property of the device node for the bridge of the
PE's primary bus. It's not correct because the property indicates
the parent PE's location code.
This reads the correct PE location code from "ibm,io-base-loc-code"
or "ibm,slot-location-code" property of PE parent bus's device node.
I think we want this fix included in stable releases. Is that correct?
Cheers,
Joel
@@ -883,32 +883,29 @@ void eeh_pe_restore_bars(struct eeh_pe *pe)constchar*eeh_pe_loc_get(structeeh_pe*pe){structpci_bus*bus=eeh_pe_bus_get(pe);-structdevice_node*dn=pci_bus_to_OF_node(bus);+structdevice_node*dn;constchar*loc=NULL;-if(!dn)-gotoout;+while(bus){+dn=pci_bus_to_OF_node(bus);+if(!dn){+bus=bus->parent;+continue;+}-/* PHB PE or root PE ? */-if(pci_is_root_bus(bus)){-loc=of_get_property(dn,"ibm,loc-code",NULL);-if(!loc)+if(pci_is_root_bus(bus))loc=of_get_property(dn,"ibm,io-base-loc-code",NULL);+else+loc=of_get_property(dn,"ibm,slot-location-code",+NULL);+if(loc)-gotoout;+returnloc;-/* Check the root port */-dn=dn->child;-if(!dn)-gotoout;+bus=bus->parent;}-loc=of_get_property(dn,"ibm,loc-code",NULL);-if(!loc)-loc=of_get_property(dn,"ibm,slot-location-code",NULL);--out:-returnloc?loc:"N/A";+return"N/A";}/**--
From: Russell Currey <hidden> Date: 2016-01-20 03:56:19
On Wed, 2015-12-02 at 16:25 +1100, Gavin Shan wrote:
In eeh_pe_loc_get(), the PE location code is retrieved from the
"ibm,loc-code" property of the device node for the bridge of the
PE's primary bus. It's not correct because the property indicates
the parent PE's location code.
This reads the correct PE location code from "ibm,io-base-loc-code"
or "ibm,slot-location-code" property of PE parent bus's device node.
Signed-off-by: Gavin Shan <redacted>
---
From: Sam Mendoza-Jonas <sam@mendozajonas.com> Date: 2016-01-21 00:09:46
On Wed, Jan 20, 2016 at 02:56:13PM +1100, Russell Currey wrote:
On Wed, 2015-12-02 at 16:25 +1100, Gavin Shan wrote:
quoted
In eeh_pe_loc_get(), the PE location code is retrieved from the
"ibm,loc-code" property of the device node for the bridge of the
PE's primary bus. It's not correct because the property indicates
the parent PE's location code.
This reads the correct PE location code from "ibm,io-base-loc-code"
or "ibm,slot-location-code" property of PE parent bus's device node.
Signed-off-by: Gavin Shan <redacted>
---
Tested-by: Russell Currey <redacted>
Thanks Russell!
W.R.T including this in stable, I don't believe anything actively breaks
without the patch, but in the event of an EEH freeze the wrong slot for
the device will be identified, making troubleshooting more difficult.
From: Stewart Smith <hidden> Date: 2016-01-21 05:59:35
Sam Mendoza-Jonas [off-list ref] writes:
On Wed, Jan 20, 2016 at 02:56:13PM +1100, Russell Currey wrote:
quoted
On Wed, 2015-12-02 at 16:25 +1100, Gavin Shan wrote:
quoted
In eeh_pe_loc_get(), the PE location code is retrieved from the
"ibm,loc-code" property of the device node for the bridge of the
PE's primary bus. It's not correct because the property indicates
the parent PE's location code.
This reads the correct PE location code from "ibm,io-base-loc-code"
or "ibm,slot-location-code" property of PE parent bus's device node.
Signed-off-by: Gavin Shan <redacted>
---
Tested-by: Russell Currey <redacted>
Thanks Russell!
W.R.T including this in stable, I don't believe anything actively breaks
without the patch, but in the event of an EEH freeze the wrong slot for
the device will be identified, making troubleshooting more difficult.
As someone who's likely going to have to deal with the bug reports for
such things, I like the idea of this going to stable as *maybe* I'll get
fewer of them that I have to close pointing to this commit...
--
Stewart Smith
OPAL Architect, IBM.
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-01-29 01:58:40
On Wed, 2015-02-12 at 05:25:32 UTC, Gavin Shan wrote:
In eeh_pe_loc_get(), the PE location code is retrieved from the
"ibm,loc-code" property of the device node for the bridge of the
PE's primary bus. It's not correct because the property indicates
the parent PE's location code.
This reads the correct PE location code from "ibm,io-base-loc-code"
or "ibm,slot-location-code" property of PE parent bus's device node.
Signed-off-by: Gavin Shan <redacted>
Tested-by: Russell Currey <redacted>