From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DBA51474DC; Fri, 5 Apr 2024 09:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712310371; cv=none; b=PTMa3XlPPk+ouVtRRqUSqjd9NWYC3iNNQsj4/KEzhOWoKYBlQgdE27HDEB8GgfhocyJFPWpDWt2Y1L2doHy2BvAcirkLjlGwXDjPN59nfsltWr9mRX1UPiNIBQ7MRVxH7rNicX0wJSsELE2tdyGnLFkImTv+WuGsdJ/TTo7wi9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712310371; c=relaxed/simple; bh=N/ilJYPULnziC1IDqUT0V88hxfBEu9DOsd7q2tbFgn8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LVq7xQ6Dca7GdhI+pMqKBZr1mjbnpqdoOBc4oqINPijzhZQYyI98JNPmVuJYXrrg7JCoaWpPWUG2yAK7aPfststfjLU2Jf3rmQIhsVuRPjLSfBLVyKP2NWwG7NSwLk3Ep3s5DSPwEx/Auw7s2PubEfQZuMoaU3fC7KKzJqts808= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D534FEC; Fri, 5 Apr 2024 02:46:39 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4AF6A3F64C; Fri, 5 Apr 2024 02:46:07 -0700 (PDT) Date: Fri, 5 Apr 2024 10:46:04 +0100 From: Sudeep Holla To: Andy Shevchenko , Linus Walleij Cc: Peng Fan , Sudeep Holla , "Peng Fan (OSS)" , "brgl@bgdev.pl" , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "cristian.marussi@arm.com" Subject: Re: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP Message-ID: References: <20240401141031.3106216-1-peng.fan@oss.nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Apr 05, 2024 at 02:13:28AM +0000, Peng Fan wrote: > Hi Andy, > > > Subject: Re: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP > > > > On Thu, Apr 04, 2024 at 01:44:50PM +0200, Linus Walleij wrote: > > > On Mon, Apr 1, 2024 at 4:02 PM Peng Fan (OSS) > > wrote: > > > > > > > From: Peng Fan > > > > > > > > The SCMI error value SCMI_ERR_SUPPORT maps to linux error value > > > > '-EOPNOTSUPP', so when dump configs, need check the error value > > > > EOPNOTSUPP, otherwise there will be log "ERROR READING CONFIG > > SETTING". > > > > > > > > Signed-off-by: Peng Fan > > > (...) > > > > ret = pin_config_get_for_pin(pctldev, pin, &config); > > > > /* These are legal errors */ > > > > - if (ret == -EINVAL || ret == -ENOTSUPP) > > > > + if (ret == -EINVAL || ret == -ENOTSUPP || ret == > > > > + -EOPNOTSUPP) > > > > > > TBH it's a bit odd to call an in-kernel API such as > > > pin_config_get_for_pin() and get -EOPNOTSUPP back. But it's not like I care > > a lot, so patch applied. > > > > Hmm... I would like actually to get this being consistent. The documentation > > explicitly says that in-kernel APIs uses Linux error code and not POSIX one. > > Would you please share me the documentation? > +1, I am interested in knowing more about this as I wasn't aware of this. > > > > This check opens a Pandora box. > > > > FWIW, it just like dozen or so drivers that needs to be fixed, I prefer to have > > them being moved to ENOTSUPP, rather this patch. > > I see many patches convert to use EOPNOTSUPP by checking git log. > > And checkpatch.pl reports warning for using ENOTSUPP. > Exactly, I do remember changing ENOTSUPP to EOPNOTSUPP based on checkpatch suggestion. So either the checkpatch.pl or the document you are referring is inconsistent and needs fixing either way. -- Regards, Sudeep