[v2] opal-prd: hservice: Enable hservice->wakeup() in BMC
diff mbox series

Message ID 1542086934-13580-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com
State Accepted
Headers show
Series
  • [v2] opal-prd: hservice: Enable hservice->wakeup() in BMC
Related show

Checks

Context Check Description
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Shilpasri G Bhat Nov. 13, 2018, 5:28 a.m. UTC
This patch enables HBRT to use HYP special wakeup register in openBMC
which until now was only used in FSP based machines.

This patch also adds a capability check for opal-prd so that HBRT can
decide if the host special wakeup register can be used.

Fixes: 49999302251b("opal-prd: Add support for runtime OCC reset in ZZ")
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
---
 external/opal-prd/hostboot-interface.h | 1 +
 external/opal-prd/opal-prd.c           | 6 ++----
 2 files changed, 3 insertions(+), 4 deletions(-)

Comments

Vasant Hegde Nov. 29, 2018, 9:24 a.m. UTC | #1
On 11/13/2018 10:58 AM, Shilpasri G Bhat wrote:
> This patch enables HBRT to use HYP special wakeup register in openBMC
> which until now was only used in FSP based machines.
> 
> This patch also adds a capability check for opal-prd so that HBRT can
> decide if the host special wakeup register can be used.

Patch looks good to me.

As discussed offline please double check whether we have to pass 
"HBRT_CAPS_OPAL_HAS_WAKEUP_CLEAR" as part of get_capability or not.

-Vasant


> 
> Fixes: 49999302251b("opal-prd: Add support for runtime OCC reset in ZZ")
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
> ---
>   external/opal-prd/hostboot-interface.h | 1 +
>   external/opal-prd/opal-prd.c           | 6 ++----
>   2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/external/opal-prd/hostboot-interface.h b/external/opal-prd/hostboot-interface.h
> index 41ffcbc..9df6888 100644
> --- a/external/opal-prd/hostboot-interface.h
> +++ b/external/opal-prd/hostboot-interface.h
> @@ -59,6 +59,7 @@ enum MemoryError_t
>    * Previous implementations may have incorrectly ignored failures.
>    */
>   #define HBRT_CAPS_OPAL_HAS_XSCOM_RC   (1ul << 0)
> +#define HBRT_CAPS_OPAL_HAS_WAKEUP_SUPPORT (1ul << 1)
> 
>   /**
>    *  Load types for the load_pm_complex() interface
> diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
> index e3b4439..1452a17 100644
> --- a/external/opal-prd/opal-prd.c
> +++ b/external/opal-prd/opal-prd.c
> @@ -747,7 +747,8 @@ int hservice_memory_error(uint64_t i_start_addr, uint64_t i_endAddr,
>   uint64_t hservice_get_interface_capabilities(uint64_t set)
>   {
>   	if (set == HBRT_CAPS_SET1_OPAL)
> -		return HBRT_CAPS_OPAL_HAS_XSCOM_RC;
> +		return HBRT_CAPS_OPAL_HAS_XSCOM_RC ||
> +			HBRT_CAPS_OPAL_HAS_WAKEUP_SUPPORT;
> 
>   	return 0;
>   }
> @@ -2196,9 +2197,6 @@ static int run_prd_daemon(struct opal_prd_ctx *ctx)
>   		hinterface.pnor_write = NULL;
>   	}
> 
> -	if (!is_fsp_system())
> -		hinterface.wakeup = NULL;
> -
>   	ipmi_init(ctx);
> 
>   	pr_debug("HBRT: calling hservices_init");
>
Shilpasri G Bhat Nov. 30, 2018, 10:42 a.m. UTC | #2
Hi Vasant,

On 11/29/2018 02:54 PM, Vasant Hegde wrote:
> Patch looks good to me.
> 
> As discussed offline please double check whether we have to pass
> "HBRT_CAPS_OPAL_HAS_WAKEUP_CLEAR" as part of get_capability or not.
> 
> -Vasant

Thanks for the review. This is a new flag "HBRT_CAPS_OPAL_HAS_WAKEUP_CLEAR" and
does not require to be part of this patch and can be added as a separate patch
to address its requirements.
Stewart Smith Dec. 12, 2018, 11:19 p.m. UTC | #3
Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> writes:
> This patch enables HBRT to use HYP special wakeup register in openBMC
> which until now was only used in FSP based machines.
>
> This patch also adds a capability check for opal-prd so that HBRT can
> decide if the host special wakeup register can be used.
>
> Fixes: 49999302251b("opal-prd: Add support for runtime OCC reset in ZZ")
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>

Merged to master as of 05dc67bf4f3d85fc6212d1644d46ce6d8bd71140. Is this
something that should go to stable as well? It looks like it.
Shilpasri G Bhat Dec. 13, 2018, 3:14 a.m. UTC | #4
On 12/13/2018 04:49 AM, Stewart Smith wrote:
> Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> writes:
>> This patch enables HBRT to use HYP special wakeup register in openBMC
>> which until now was only used in FSP based machines.
>>
>> This patch also adds a capability check for opal-prd so that HBRT can
>> decide if the host special wakeup register can be used.
>>
>> Fixes: 49999302251b("opal-prd: Add support for runtime OCC reset in ZZ")
>> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
> 
> Merged to master as of 05dc67bf4f3d85fc6212d1644d46ce6d8bd71140. Is this
> something that should go to stable as well? It looks like it.
> 

Thanks. Yes this should go to stable v5.10+
Stewart Smith Dec. 17, 2018, 3:42 a.m. UTC | #5
Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> writes:
> On 12/13/2018 04:49 AM, Stewart Smith wrote:
>> Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> writes:
>>> This patch enables HBRT to use HYP special wakeup register in openBMC
>>> which until now was only used in FSP based machines.
>>>
>>> This patch also adds a capability check for opal-prd so that HBRT can
>>> decide if the host special wakeup register can be used.
>>>
>>> Fixes: 49999302251b("opal-prd: Add support for runtime OCC reset in ZZ")
>>> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
>> 
>> Merged to master as of 05dc67bf4f3d85fc6212d1644d46ce6d8bd71140. Is this
>> something that should go to stable as well? It looks like it.
>> 
>
> Thanks. Yes this should go to stable v5.10+

It's in 6.0.15 as ad92cf94b5f7a2a6c653c0473918b1d51f9f3875.

We're not doing any more stable releases on anything older, so this
should be all we currentyl do.

Patch
diff mbox series

diff --git a/external/opal-prd/hostboot-interface.h b/external/opal-prd/hostboot-interface.h
index 41ffcbc..9df6888 100644
--- a/external/opal-prd/hostboot-interface.h
+++ b/external/opal-prd/hostboot-interface.h
@@ -59,6 +59,7 @@  enum MemoryError_t
  * Previous implementations may have incorrectly ignored failures.
  */
 #define HBRT_CAPS_OPAL_HAS_XSCOM_RC   (1ul << 0)
+#define HBRT_CAPS_OPAL_HAS_WAKEUP_SUPPORT (1ul << 1)
 
 /**
  *  Load types for the load_pm_complex() interface
diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index e3b4439..1452a17 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -747,7 +747,8 @@  int hservice_memory_error(uint64_t i_start_addr, uint64_t i_endAddr,
 uint64_t hservice_get_interface_capabilities(uint64_t set)
 {
 	if (set == HBRT_CAPS_SET1_OPAL)
-		return HBRT_CAPS_OPAL_HAS_XSCOM_RC;
+		return HBRT_CAPS_OPAL_HAS_XSCOM_RC ||
+			HBRT_CAPS_OPAL_HAS_WAKEUP_SUPPORT;
 
 	return 0;
 }
@@ -2196,9 +2197,6 @@  static int run_prd_daemon(struct opal_prd_ctx *ctx)
 		hinterface.pnor_write = NULL;
 	}
 
-	if (!is_fsp_system())
-		hinterface.wakeup = NULL;
-
 	ipmi_init(ctx);
 
 	pr_debug("HBRT: calling hservices_init");