[Skiboot] [PATCH] cpu: Fix hang issue in opal_reinit_cpus()

Mahesh Jagannath Salgaonkar mahesh at linux.vnet.ibm.com
Fri Jun 12 17:04:11 AEST 2015


On 06/12/2015 11:14 AM, Benjamin Herrenschmidt wrote:
> On Thu, 2015-06-11 at 16:37 +0530, Hari Bathini wrote:
>> Commit 87690bd19dbb introduced a label "again" so as to avoid holding
>> the lock while waiting. But this leads to hang in scenarios like kdump,
>> where 'cpu_state_os' will be the state for all offline cpus. Actaully,
>> the wait loop doesn't really take off with the goto statement in it.
>> This patch tries to fix this problem by removing the goto statement
>> and unlocking/locking within the wait loop instead.
> 
> That means that kdump cannot change the endian state, is that ok ?

Usually kdump kernel is of same endianess of crashing kernel so we are good.

Thanks,
-Mahesh.

> 
> Cheers,
> Ben.
> 
>> Signed-off-by: Hari Bathini <hbathini at linux.vnet.ibm.com>
>> ---
>>  core/cpu.c |    3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/core/cpu.c b/core/cpu.c
>> index 6812ff0..cdf84ac 100644
>> --- a/core/cpu.c
>> +++ b/core/cpu.c
>> @@ -695,7 +695,6 @@ static int64_t opal_reinit_cpus(uint64_t flags)
>>  
>>  	prerror("OPAL: Trying a CPU re-init with flags: 0x%llx\n", flags);
>>  
>> - again:
>>  	lock(&reinit_lock);
>>  
>>  	for (cpu = first_cpu(); cpu; cpu = next_cpu(cpu)) {
>> @@ -710,7 +709,7 @@ static int64_t opal_reinit_cpus(uint64_t flags)
>>  				     (cpu->state == cpu_state_os); i++) {
>>  				unlock(&reinit_lock);
>>  				time_wait_ms(1);
>> -				goto again;
>> +				lock(&reinit_lock);
>>  			}
>>  			if (cpu->state == cpu_state_os) {
>>  				prerror("OPAL: CPU 0x%x not in OPAL !\n", cpu->pir);
> 
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
> 



More information about the Skiboot mailing list