* [PATCH] cxl: Route eeh events to all slices for pci_channel_io_perm_failure state
@ 2017-02-22 10:51 Vaibhav Jain
2017-02-22 16:08 ` Matthew R. Ochs
2017-02-22 23:58 ` Andrew Donnellan
0 siblings, 2 replies; 4+ messages in thread
From: Vaibhav Jain @ 2017-02-22 10:51 UTC (permalink / raw)
To: linuxppc-dev
Cc: Vaibhav Jain, frederic.barrat, Andrew Donnellan, Ian Munsie,
Christophe Lombard, Philippe Bergheaud, Gregory Kurz
Fix a boundary condition where in some cases an eeh event with
state == pci_channel_io_perm_failure wont be passed on to a driver
attached to the virtual pci device associated with a slice. This will
happen in case the slice just before (n-1) doesn't have any vph bus
associated with it, that results in an early return from
cxl_pci_error_detected callback.
This also simplifies branch that handles this eeh state by returning
PCI_ERS_RESULT_DISCONNECTED in all cases as the adapter is will be
removed irrespective of the return value of cxl_pci_error_detected
callback.
Fixes: e4f5fc001a6("cxl: Do not create vPHB if there are no AFU configuration records")
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
---
drivers/misc/cxl/pci.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 80a87ab..679afc9 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -1780,15 +1780,13 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev,
/* If we're permanently dead, give up. */
if (state == pci_channel_io_perm_failure) {
- /* Tell the AFU drivers; but we don't care what they
- * say, we're going away.
- */
for (i = 0; i < adapter->slices; i++) {
afu = adapter->afu[i];
- /* Only participate in EEH if we are on a virtual PHB */
- if (afu->phb == NULL)
- return PCI_ERS_RESULT_NONE;
- cxl_vphb_error_detected(afu, state);
+ /* Tell the AFU drivers; but we don't care what they
+ * say, we're going away.
+ */
+ if (afu->phb != NULL)
+ cxl_vphb_error_detected(afu, state);
}
return PCI_ERS_RESULT_DISCONNECT;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] cxl: Route eeh events to all slices for pci_channel_io_perm_failure state
2017-02-22 10:51 [PATCH] cxl: Route eeh events to all slices for pci_channel_io_perm_failure state Vaibhav Jain
@ 2017-02-22 16:08 ` Matthew R. Ochs
2017-02-22 23:58 ` Andrew Donnellan
1 sibling, 0 replies; 4+ messages in thread
From: Matthew R. Ochs @ 2017-02-22 16:08 UTC (permalink / raw)
To: Vaibhav Jain
Cc: linuxppc-dev, Philippe Bergheaud, frederic.barrat, Ian Munsie,
Andrew Donnellan, Gregory Kurz, Christophe Lombard
> On Feb 22, 2017, at 4:51 AM, Vaibhav Jain <vaibhav@linux.vnet.ibm.com> =
wrote:
>=20
> Fix a boundary condition where in some cases an eeh event with
> state =3D=3D pci_channel_io_perm_failure wont be passed on to a driver
> attached to the virtual pci device associated with a slice. This will
> happen in case the slice just before (n-1) doesn't have any vph bus
> associated with it, that results in an early return from
> cxl_pci_error_detected callback.
>=20
> This also simplifies branch that handles this eeh state by returning
> PCI_ERS_RESULT_DISCONNECTED in all cases as the adapter is will be
> removed irrespective of the return value of cxl_pci_error_detected
> callback.
This sentence could be cleaned up a bit.
>=20
> Fixes: e4f5fc001a6("cxl: Do not create vPHB if there are no AFU =
configuration records")
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Fix looks good!
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] cxl: Route eeh events to all slices for pci_channel_io_perm_failure state
2017-02-22 10:51 [PATCH] cxl: Route eeh events to all slices for pci_channel_io_perm_failure state Vaibhav Jain
2017-02-22 16:08 ` Matthew R. Ochs
@ 2017-02-22 23:58 ` Andrew Donnellan
2017-02-23 3:30 ` Vaibhav Jain
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Donnellan @ 2017-02-22 23:58 UTC (permalink / raw)
To: Vaibhav Jain, linuxppc-dev
Cc: Philippe Bergheaud, frederic.barrat, Ian Munsie, Andrew Donnellan,
Gregory Kurz, Christophe Lombard
On 22/02/17 21:51, Vaibhav Jain wrote:
> Fix a boundary condition where in some cases an eeh event with
> state == pci_channel_io_perm_failure wont be passed on to a driver
> attached to the virtual pci device associated with a slice. This will
> happen in case the slice just before (n-1) doesn't have any vph bus
s/vph/vPHB/?
> associated with it, that results in an early return from
> cxl_pci_error_detected callback.
>
> This also simplifies branch that handles this eeh state by returning
> PCI_ERS_RESULT_DISCONNECTED in all cases as the adapter is will be
> removed irrespective of the return value of cxl_pci_error_detected
> callback.
Agree with Matthew that this could be simplified a bit. If I'm
interpreting this correctly, we could reword it something like:
"As the adapter will be removed irrespective of the return value of
cxl_vphb_error_detected(), return PCI_ERS_RESULT_DISCONNECT in all
cases, even if the AFU isn't using a vPHB (in which case we currently
return PCI_ERS_RESULT_NONE)."
>
> Fixes: e4f5fc001a6("cxl: Do not create vPHB if there are no AFU configuration records")
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Fix looks reasonable to me!
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> ---
> drivers/misc/cxl/pci.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> index 80a87ab..679afc9 100644
> --- a/drivers/misc/cxl/pci.c
> +++ b/drivers/misc/cxl/pci.c
> @@ -1780,15 +1780,13 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev,
>
> /* If we're permanently dead, give up. */
> if (state == pci_channel_io_perm_failure) {
> - /* Tell the AFU drivers; but we don't care what they
> - * say, we're going away.
> - */
> for (i = 0; i < adapter->slices; i++) {
> afu = adapter->afu[i];
> - /* Only participate in EEH if we are on a virtual PHB */
> - if (afu->phb == NULL)
> - return PCI_ERS_RESULT_NONE;
> - cxl_vphb_error_detected(afu, state);
> + /* Tell the AFU drivers; but we don't care what they
> + * say, we're going away.
> + */
> + if (afu->phb != NULL)
> + cxl_vphb_error_detected(afu, state);
> }
> return PCI_ERS_RESULT_DISCONNECT;
> }
>
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] cxl: Route eeh events to all slices for pci_channel_io_perm_failure state
2017-02-22 23:58 ` Andrew Donnellan
@ 2017-02-23 3:30 ` Vaibhav Jain
0 siblings, 0 replies; 4+ messages in thread
From: Vaibhav Jain @ 2017-02-23 3:30 UTC (permalink / raw)
To: Andrew Donnellan, linuxppc-dev
Cc: Philippe Bergheaud, frederic.barrat, Ian Munsie, Andrew Donnellan,
Gregory Kurz, Christophe Lombard
Thanks for reviewing the patch Matt and Andrew. I have updated the patch
description as you have suggested and sent-out an updated one.
--
Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Linux Technology Center, IBM India Pvt. Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-23 3:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-22 10:51 [PATCH] cxl: Route eeh events to all slices for pci_channel_io_perm_failure state Vaibhav Jain
2017-02-22 16:08 ` Matthew R. Ochs
2017-02-22 23:58 ` Andrew Donnellan
2017-02-23 3:30 ` Vaibhav Jain
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).