[Skiboot] [PATCH] ipmi: Simplify the sync message function

Neelesh Gupta neelegup at linux.vnet.ibm.com
Fri Jun 26 16:01:03 AEST 2015


Hi Alistair,

On 06/26/2015 11:21 AM, Alistair Popple wrote:
> Hi Neelesh,
>
> Comments below. Note that the sync function message queuing functions might go
> away so it would be best not to rely on them (it's only used in one place at
> the moment).
>
> On Wed, 24 Jun 2015 22:38:59 Neelesh Gupta wrote:
>> Signed-off-by: Neelesh Gupta <neelegup at linux.vnet.ibm.com>
>> ---
>>   core/ipmi.c |    6 ++----
>>   1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/core/ipmi.c b/core/ipmi.c
>> index 9d91c26..bee2987 100644
>> --- a/core/ipmi.c
>> +++ b/core/ipmi.c
>> @@ -160,13 +160,11 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg)
>>   	}
>>   
>>   	lock(&sync_lock);
>> -	while (sync_msg);
> This won't work. The loop is there to wait for any outstanding sync message to
> be sent.
>
>>   	sync_msg = msg;
>>   	ipmi_queue_msg(msg);
>> -	unlock(&sync_lock);
>> -
>> -	while (sync_msg == msg)
>> +	while (sync_msg)
>>   		time_wait_ms(100);
>> +	unlock(&sync_lock);
> You can't call time_wait_ms with a lock held as the pollers won't run so the
> message will never complete.

Got it, also seeing the problem when testing.
So, this change is *not* required.

Thanks for the review !

Neelesh.

>
>>   }
>>   
>>   static void ipmi_read_event_complete(struct ipmi_msg *msg)
>>
>> _______________________________________________
>> Skiboot mailing list
>> Skiboot at lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/skiboot
>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/skiboot/attachments/20150626/7e2e0ce3/attachment.html>


More information about the Skiboot mailing list