[Skiboot] [PATCH V2 1/2] opal-prd: Add support for runtime OCC reset in ZZ

Shilpasri G Bhat shilpa.bhat at linux.vnet.ibm.com
Thu Dec 7 15:48:30 AEDT 2017


Hi,

On 12/06/2017 08:40 PM, Nicholas Piggin wrote:
> On Wed,  6 Dec 2017 19:47:01 +0530
> Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com> wrote:
> 
>> This patch handles OCC_RESET runtime events in host opal-prd and also
>> provides support for calling 'hostinterface->wakeup()' which is
>> required for doing the reset operation.
>>
>> Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
>> ---
>>  core/direct-controls.c       |  27 +++++++++++
>>  core/hostservices.c          |  46 +++++++++++++++++-
>>  external/opal-prd/opal-prd.c | 112 +++++++++++++++++++++++++++++++++++++++++++
>>  external/opal-prd/thunk.S    |   2 +-
>>  hw/occ.c                     |  51 +++++++++++++++++++-
>>  hw/prd.c                     |  22 +++++++++
>>  include/cpu.h                |   1 +
>>  include/hostservices.h       |   2 +
>>  include/opal-api.h           |  11 +++++
>>  include/skiboot.h            |   1 +
>>  10 files changed, 272 insertions(+), 3 deletions(-)
>>
>> diff --git a/core/direct-controls.c b/core/direct-controls.c
>> index ba3e4d1..39c9a75 100644
>> --- a/core/direct-controls.c
>> +++ b/core/direct-controls.c
>> @@ -554,6 +554,33 @@ int dctl_core_is_gated(struct cpu_thread *t)
>>  	return !!(val & P9_CORE_GATED);
>>  }
>>  
>> +int dctl_clear_all_special_wakeup(void)
>> +{
>> +	struct proc_chip *chip;
>> +	struct cpu_thread *c;
>> +	int rc;
>> +
>> +	if (proc_gen != proc_gen_p9)
>> +		return OPAL_UNSUPPORTED;
>> +
>> +	for_each_chip(chip)
>> +		for_each_available_core_in_chip(c, chip->id) {
>> +			lock(&c->dctl_lock);
>> +			if (c->special_wakeup_count) {
>> +				rc = p9_core_clear_special_wakeup(c);
>> +				if (!rc) {
>> +					c->special_wakeup_count = 0;
>> +				} else {
>> +					unlock(&c->dctl_lock);
>> +					return rc;
>> +				}
>> +			}
>> +			unlock(&c->dctl_lock);
>> +		}
>> +
>> +	return OPAL_SUCCESS;
>> +}
> 
> This seems wrong, because there may be other users of special wakeup
> apart from host services.
> 
> What are the semantics expected for this? My guess is that it wants
> to undo the effect of all previous calls to ->wakeup(). In that case
> I think another counter is needed to count hservice wakeups.
> 
> Thanks,
> Nick
> 

Yup agree. There is cpu->hbrt_spec_wakeup counter which is used in P8 to track
the special wakeup. I will use this counter itself for the above case.

Thanks and Regards,
Shilpa



More information about the Skiboot mailing list