[Skiboot] [PATCH 2/2] rtc: rtc tod state need to be updated on success

Neelesh Gupta neelegup at linux.vnet.ibm.com
Tue Jan 20 17:13:56 AEDT 2015


On 01/20/2015 05:45 AM, Jeremy Kerr wrote:
> Hi Neelesh & Alistair,
>
>> The OPAL rtc read interface currently fails as the tod state is
>> not getting updated in the callback. The patch fixes this issue.
>>
>> Signed-off-by: Neelesh Gupta <neelegup at linux.vnet.ibm.com>
>> ---
>>   hw/fsp/fsp-rtc.c |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/fsp/fsp-rtc.c b/hw/fsp/fsp-rtc.c
>> index f60d2f3..b83bb2e 100644
>> --- a/hw/fsp/fsp-rtc.c
>> +++ b/hw/fsp/fsp-rtc.c
>> @@ -158,6 +158,7 @@ static void fsp_rtc_process_read(struct fsp_msg *read_resp)
>>   
>>   	case FSP_STATUS_SUCCESS:
>>   		/* Save the read RTC value in our cache */
>> +		rtc_tod_state = RTC_TOD_VALID;
>>   		datetime_to_tm(read_resp->data.words[0],
>>   			       (u64) read_resp->data.words[1] << 32, &tm);
>>   		rtc_cache_update(&tm);
> We seem to have this state in the rtc core code too
> (rtc_tod_cache.valid) - do we need both?

'rtc_tod_state' is required indeed, it is more discrete while 
'rtc_tod_cache.valid'
is a bool. So, I think both are required, but I also see that 
'rtc_tod_cahce.valid'
doesn't get updated, it maintains a 'true' value all the time.. probably 
that
should be fixed separately..

- Neelesh

>
> Cheers,
>
>
> Jeremy
>



More information about the Skiboot mailing list