From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 2611C1A00CA for ; Mon, 30 Mar 2015 17:56:29 +1100 (AEDT) Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Mar 2015 07:56:26 +0100 Message-ID: <5518F394.2030907@fr.ibm.com> Date: Mon, 30 Mar 2015 08:56:20 +0200 From: Cedric Le Goater MIME-Version: 1.0 To: Michael Ellerman Subject: Re: [PATCH v3 1/3] powerpc/powernv: convert codes returned by OPAL calls References: <20150327095936.50A921400A0@ozlabs.org> <1427474362-3903-1-git-send-email-clg@fr.ibm.com> <1427681112.4218.6.camel@ellerman.id.au> <5518EF16.9070502@fr.ibm.com> <1427698456.28219.2.camel@ellerman.id.au> In-Reply-To: <1427698456.28219.2.camel@ellerman.id.au> Content-Type: text/plain; charset=utf-8 Cc: Stewart Smith , skiboot@lists.ozlabs.org, benh@au1.ibm.com, linuxppc-dev@lists.ozlabs.org, Neelesh Gupta List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.