Commit cca87d30 ("powerpc/pci: Refactor pci_dn") introduced pdn
list for SRIOV VFs. It means the pdn is be put into the child list
of its parent pdn when the pdn is created. When doing PCI hot
unplugging on pSeries, the PCI device node as well as its pdn are
released through procfs entry "powerpc/ofdt". Some one else grabs
the memory chunk of the pdn and update it accordingly. At the same
time, the pdn is still tracked in the child list of parent pdn. It
leads to corrupted child list in the parent pdn.
This fixes above issue by removing the pdn from the child list of
its parent pdn when the device node is detached from the system.
Note the pdn is free'd when the device node is released if the
device node is dynamic one. Otherwise, the device node as well
as the pdn won't be released.
Fixes: cca87d30 ("powerpc/pci: Refactor pci_dn")
Reported-by: Santwana Samantray <redacted>
Signed-off-by: Gavin Shan <redacted>
---
arch/powerpc/platforms/pseries/setup.c | 5 +++++
1 file changed, 5 insertions(+)
This applies cleanup on pci_dn_reconfig_notifier(), no functional
changes:
* Rename variable "pci" to "pdn" to indicate its purpose clearly.
* The parent node can be released at any time. So it should be
hold with of_get_parent() before accessing it.
* The device node doesn't have to have parent node in theory.
More check on this.
Signed-off-by: Gavin Shan <redacted>
---
arch/powerpc/platforms/pseries/setup.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2015-08-28 00:55:35
On Thu, 2015-27-08 at 04:12:36 UTC, Gavin Shan wrote:
Commit cca87d30 ("powerpc/pci: Refactor pci_dn") introduced pdn
list for SRIOV VFs. It means the pdn is be put into the child list
of its parent pdn when the pdn is created. When doing PCI hot
unplugging on pSeries, the PCI device node as well as its pdn are
released through procfs entry "powerpc/ofdt". Some one else grabs
the memory chunk of the pdn and update it accordingly. At the same
time, the pdn is still tracked in the child list of parent pdn. It
leads to corrupted child list in the parent pdn.
This fixes above issue by removing the pdn from the child list of
its parent pdn when the device node is detached from the system.
Note the pdn is free'd when the device node is released if the
device node is dynamic one. Otherwise, the device node as well
as the pdn won't be released.
Fixes: cca87d30 ("powerpc/pci: Refactor pci_dn")
That went into 4.1, so this should presumably go to stable?
cheers
On Fri, Aug 28, 2015 at 10:55:35AM +1000, Michael Ellerman wrote:
On Thu, 2015-27-08 at 04:12:36 UTC, Gavin Shan wrote:
quoted
Commit cca87d30 ("powerpc/pci: Refactor pci_dn") introduced pdn
list for SRIOV VFs. It means the pdn is be put into the child list
of its parent pdn when the pdn is created. When doing PCI hot
unplugging on pSeries, the PCI device node as well as its pdn are
released through procfs entry "powerpc/ofdt". Some one else grabs
the memory chunk of the pdn and update it accordingly. At the same
time, the pdn is still tracked in the child list of parent pdn. It
leads to corrupted child list in the parent pdn.
This fixes above issue by removing the pdn from the child list of
its parent pdn when the device node is detached from the system.
Note the pdn is free'd when the device node is released if the
device node is dynamic one. Otherwise, the device node as well
as the pdn won't be released.
Fixes: cca87d30 ("powerpc/pci: Refactor pci_dn")
That went into 4.1, so this should presumably go to stable?
Yeah, This should be put into 4.1 stable.
Thanks,
Gavin
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2015-08-28 01:32:41
On Fri, 2015-08-28 at 11:09 +1000, Gavin Shan wrote:
On Fri, Aug 28, 2015 at 10:55:35AM +1000, Michael Ellerman wrote:
quoted
On Thu, 2015-27-08 at 04:12:36 UTC, Gavin Shan wrote:
quoted
Commit cca87d30 ("powerpc/pci: Refactor pci_dn") introduced pdn
list for SRIOV VFs. It means the pdn is be put into the child list
of its parent pdn when the pdn is created. When doing PCI hot
unplugging on pSeries, the PCI device node as well as its pdn are
released through procfs entry "powerpc/ofdt". Some one else grabs
the memory chunk of the pdn and update it accordingly. At the same
time, the pdn is still tracked in the child list of parent pdn. It
leads to corrupted child list in the parent pdn.
This fixes above issue by removing the pdn from the child list of
its parent pdn when the device node is detached from the system.
Note the pdn is free'd when the device node is released if the
device node is dynamic one. Otherwise, the device node as well
as the pdn won't be released.
Fixes: cca87d30 ("powerpc/pci: Refactor pci_dn")
That went into 4.1, so this should presumably go to stable?
Yeah, This should be put into 4.1 stable.
OK thanks.
I've added:
Cc: stable@vger.kernel.org # 4.1
cheers
On Fri, Aug 28, 2015 at 11:32:40AM +1000, Michael Ellerman wrote:
On Fri, 2015-08-28 at 11:09 +1000, Gavin Shan wrote:
quoted
On Fri, Aug 28, 2015 at 10:55:35AM +1000, Michael Ellerman wrote:
quoted
On Thu, 2015-27-08 at 04:12:36 UTC, Gavin Shan wrote:
quoted
Commit cca87d30 ("powerpc/pci: Refactor pci_dn") introduced pdn
list for SRIOV VFs. It means the pdn is be put into the child list
of its parent pdn when the pdn is created. When doing PCI hot
unplugging on pSeries, the PCI device node as well as its pdn are
released through procfs entry "powerpc/ofdt". Some one else grabs
the memory chunk of the pdn and update it accordingly. At the same
time, the pdn is still tracked in the child list of parent pdn. It
leads to corrupted child list in the parent pdn.
This fixes above issue by removing the pdn from the child list of
its parent pdn when the device node is detached from the system.
Note the pdn is free'd when the device node is released if the
device node is dynamic one. Otherwise, the device node as well
as the pdn won't be released.
Fixes: cca87d30 ("powerpc/pci: Refactor pci_dn")
That went into 4.1, so this should presumably go to stable?
Yeah, This should be put into 4.1 stable.
OK thanks.
I've added:
Cc: stable@vger.kernel.org # 4.1
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2015-08-30 21:20:42
On Thu, 2015-27-08 at 04:12:36 UTC, Gavin Shan wrote:
Commit cca87d30 ("powerpc/pci: Refactor pci_dn") introduced pdn
list for SRIOV VFs. It means the pdn is be put into the child list
of its parent pdn when the pdn is created. When doing PCI hot
unplugging on pSeries, the PCI device node as well as its pdn are
released through procfs entry "powerpc/ofdt". Some one else grabs
the memory chunk of the pdn and update it accordingly. At the same
time, the pdn is still tracked in the child list of parent pdn. It
leads to corrupted child list in the parent pdn.
This fixes above issue by removing the pdn from the child list of
its parent pdn when the device node is detached from the system.
Note the pdn is free'd when the device node is released if the
device node is dynamic one. Otherwise, the device node as well
as the pdn won't be released.
Fixes: cca87d30 ("powerpc/pci: Refactor pci_dn")
Reported-by: Santwana Samantray <redacted>
Signed-off-by: Gavin Shan <redacted>
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2015-08-30 21:20:44
On Thu, 2015-27-08 at 04:12:37 UTC, Gavin Shan wrote:
This applies cleanup on pci_dn_reconfig_notifier(), no functional
changes:
* Rename variable "pci" to "pdn" to indicate its purpose clearly.
* The parent node can be released at any time. So it should be
hold with of_get_parent() before accessing it.
* The device node doesn't have to have parent node in theory.
More check on this.
Signed-off-by: Gavin Shan <redacted>