diff mbox series

FSP: Disable PSI link whenever FSP tells OPAL about impending R/R

Message ID 20171007151032.19708-1-hegdevasant@linux.vnet.ibm.com
State Superseded
Headers show
Series FSP: Disable PSI link whenever FSP tells OPAL about impending R/R | expand

Commit Message

Vasant Hegde Oct. 7, 2017, 3:10 p.m. UTC
Commit 42d5d047 fixed scenario where DPO has been initiated, but FSP went
into reset before the CEC power down came in. But this is generic issue
that can happen in normal shutdown path as well.

Hence disable PSI link as soon as we detect FSP impending R/R.

CC: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
CC: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/fsp/fsp.c  | 25 ++++++++-----------------
 include/fsp.h |  1 -
 2 files changed, 8 insertions(+), 18 deletions(-)

Comments

Ananth N Mavinakayanahalli Oct. 9, 2017, 4:45 a.m. UTC | #1
On Sat, Oct 07, 2017 at 03:10:32PM +0000, Vasant Hegde wrote:
> Commit 42d5d047 fixed scenario where DPO has been initiated, but FSP went
> into reset before the CEC power down came in. But this is generic issue
> that can happen in normal shutdown path as well.
> 
> Hence disable PSI link as soon as we detect FSP impending R/R.
> 
> CC: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
> CC: Stewart Smith <stewart@linux.vnet.ibm.com>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
>  hw/fsp/fsp.c  | 25 ++++++++-----------------
>  include/fsp.h |  1 -
>  2 files changed, 8 insertions(+), 18 deletions(-)
> 
> diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
> index 4d17397..0d6ea6d 100644
> --- a/hw/fsp/fsp.c
> +++ b/hw/fsp/fsp.c
> @@ -720,23 +720,14 @@ static void fsp_handle_errors(struct fsp *fsp)
>  		if (fsp->state == fsp_mbx_rr)
>  			return;
> 
> -		if (fsp_dpo_pending) {
> -			/*
> -			 * If we are about to process a reset when DPO
> -			 * is pending, its possible that the host has
> -			 * gone down, and OPAL is on its way down and
> -			 * hence will not see the subsequent PSI interrupt.
> -			 * So, just give up the link here.
> -			 */
> -			prlog(PR_NOTICE, "FSP #%d: FSP reset with DPO pending."
> -					" Giving up PSI link\n",
> -					fsp->index);
> -			psi_disable_link(psi);
> -		} else {
> -			prlog(PR_NOTICE, "FSP #%d: FSP in Reset."
> -				" Waiting for PSI interrupt\n",
> -				fsp->index);
> -		}
> +		/*
> +		 * Its possible that the host has gone down, and OPAL is on
> +		 * its way down and hence will not see the subsequent PSI
> +		 * interrupt. So, just give up the link here.
> +		 */
> +		psi_disable_link(psi);
> +		prlog(PR_NOTICE, "FSP #%d: FSP in Reset."
> +			" Waiting for PSI interrupt\n", fsp->index);

The comment also needs fixing. If the FSP is already in reset, you may
not get the PSI interrupt.
Vasant Hegde Oct. 9, 2017, 6:03 a.m. UTC | #2
On 10/09/2017 10:15 AM, Ananth N Mavinakayanahalli wrote:
> On Sat, Oct 07, 2017 at 03:10:32PM +0000, Vasant Hegde wrote:
>> Commit 42d5d047 fixed scenario where DPO has been initiated, but FSP went
>> into reset before the CEC power down came in. But this is generic issue
>> that can happen in normal shutdown path as well.
>>
>> Hence disable PSI link as soon as we detect FSP impending R/R.
>>

.../...

>> +		/*
>> +		 * Its possible that the host has gone down, and OPAL is on
>> +		 * its way down and hence will not see the subsequent PSI
>> +		 * interrupt. So, just give up the link here.
>> +		 */
>> +		psi_disable_link(psi);
>> +		prlog(PR_NOTICE, "FSP #%d: FSP in Reset."
>> +			" Waiting for PSI interrupt\n", fsp->index);
>
> The comment also needs fixing. If the FSP is already in reset, you may
> not get the PSI interrupt.
>
Ah! right. Will fix it in v2. Thanks.

-Vasant
diff mbox series

Patch

diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index 4d17397..0d6ea6d 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -720,23 +720,14 @@  static void fsp_handle_errors(struct fsp *fsp)
 		if (fsp->state == fsp_mbx_rr)
 			return;
 
-		if (fsp_dpo_pending) {
-			/*
-			 * If we are about to process a reset when DPO
-			 * is pending, its possible that the host has
-			 * gone down, and OPAL is on its way down and
-			 * hence will not see the subsequent PSI interrupt.
-			 * So, just give up the link here.
-			 */
-			prlog(PR_NOTICE, "FSP #%d: FSP reset with DPO pending."
-					" Giving up PSI link\n",
-					fsp->index);
-			psi_disable_link(psi);
-		} else {
-			prlog(PR_NOTICE, "FSP #%d: FSP in Reset."
-				" Waiting for PSI interrupt\n",
-				fsp->index);
-		}
+		/*
+		 * Its possible that the host has gone down, and OPAL is on
+		 * its way down and hence will not see the subsequent PSI
+		 * interrupt. So, just give up the link here.
+		 */
+		psi_disable_link(psi);
+		prlog(PR_NOTICE, "FSP #%d: FSP in Reset."
+			" Waiting for PSI interrupt\n", fsp->index);
 		fsp_start_rr(fsp);
 	}
 
diff --git a/include/fsp.h b/include/fsp.h
index 1d877d8..36802a1 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -837,7 +837,6 @@  extern void fsp_epow_init(void);
 
 /* DPO */
 extern void fsp_dpo_init(void);
-extern bool fsp_dpo_pending;
 
 /* Chiptod */
 extern void fsp_chiptod_init(void);