[PATCH v3 1/3] powerpc/powernv: convert codes returned by OPAL calls

Cedric Le Goater clg at fr.ibm.com
Mon Mar 30 17:56:20 AEDT 2015


On 03/30/2015 08:54 AM, Michael Ellerman wrote:
> On Mon, 2015-03-30 at 08:37 +0200, Cedric Le Goater wrote:
>> On 03/30/2015 04:05 AM, Michael Ellerman wrote:
>>> On Fri, 2015-03-27 at 17:39 +0100, Cédric Le Goater wrote:
>>>> OPAL has its own list of return codes. The patch provides a translation
>>>> of such codes in errnos for the opal_sensor_read call, and possibly 
>>>> others if needed.
>>>>
>>>> +	case OPAL_UNSUPPORTED:		return -ENOSYS;
>>>
>>> You shouldn't use ENOSYS here, that should only ever mean "no such syscall",
>>> otherwise you get very confusing results like read() returning ENOSYS.
>>
>> Indeed. How about ENODEV then ? 
> 
> That can also be confusing from userspace.
> 
> I think it's probably best just to use EIO, as far as userspace is concerned if
> the kernel lets it call an unsupported OPAL routine that is more or less a
> kernel bug.

OK. Will do.

Thanks,

C.



More information about the Linuxppc-dev mailing list