Received: by 2002:a05:7208:c24f:b0:81:d631:dc8 with SMTP id w15csp394575rbd; Thu, 4 Apr 2024 12:25:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5fyCJPZsBC4iSYU68Pso258A6ao87dFfrL+jDMDc3vcz8EH68WxH2TAYBxo47QLuBXpRXVrSPdv91FSSUSFtttfOLpG7VL9ZSf8aqQQ== X-Google-Smtp-Source: AGHT+IGEKw5c8IJx93wx1G2JTKfNrnM6NQdYVxX2pFZ6rDDvIaji+HG1n/fYlNPZdWDJ5mVBLH4R X-Received: by 2002:a37:c446:0:b0:78d:41b6:3f8b with SMTP id h6-20020a37c446000000b0078d41b63f8bmr2639436qkm.39.1712258741480; Thu, 04 Apr 2024 12:25:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712258741; cv=pass; d=google.com; s=arc-20160816; b=LhDbI6RlEDsldIgsf33h4ZaBEOIl/FUt5gdNgcoiSfTG/GJL1PfgHfO2uovrY+jlOI To5x/F0FzmSo1NJ5nbipZ47kk3upAHZfM0FM0fcTcf0kl0Z4Gvq301w/sq8+7HlOaocI B2OFfKDlhyMG2r9UulJWNNEsVFDl88i8oJuZ1hi/cMzi0QZy6EzhcTah8EZfIAGXxYD0 uiuCgrrurexAxrzE7CBUUcvOHx+cE6Tp7AodNWUuIDmjja5EFZ9s9hZDsvWR8bKuHcmX rbJ+uYSFa1BsknMCOx693YbulbgvsKcfXywb9LwIJoVZjB/L3TS82bFLMDm0T8gRqoh6 N2wQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dV9CEYWlMp0wjiWk94j3pf7SmnIfH/DvIrDrkgZ6qgs=; fh=BZDuehAZ6lS7jpbuy0tAJ93Lem3y7TZc5n0utgMFeKA=; b=OxrxD5ZManucfPJ/VOiFMMJqSY+QzBZsuhxbO9HCSK8GOJxs6QG0xAqQq038pNDLM2 QxT3/1XlayOufShDgc2tnZPRCHP/vizw0HlFAEsN1LGor1xjFOolIViIrP/DUV/eRH6B M9gw6nmpvXuOIrqdI6VsfLhfAfpooUNvGReUmr99bY5gfktNWKE1oLTG3cwEuR45g/vL KtVskAs77+D1g1JJGz8O9joFVEUq/oaH9dYgow8pNim9xOBN83foKQukYTwhoBH6GaBb ElK4tPA6oXlgzsfB/M77rY8QMWVNBeHRki3LlP7MFhPnolRAondHRs6GV3ZX8Jrff0aT 5yHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K7dHScuh; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-132029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132029-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bj30-20020a05620a191e00b0078a5dd4165bsi53310qkb.130.2024.04.04.12.25.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 12:25:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K7dHScuh; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-132029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132029-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 95F201C294EF for ; Thu, 4 Apr 2024 19:23:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0644613440C; Thu, 4 Apr 2024 19:23:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="K7dHScuh" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ACCC133413; Thu, 4 Apr 2024 19:23:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712258613; cv=none; b=pzjSM9jeK/ffeDOrDwKYis4SD+jMeh2HmFPUvxv7WcOu1dNuL7oHNRx/6J/GYtK0M++4UZmorgmRLODF1DSNjvhDgOKAthFf6rT+g1b307cq491EdobUz99klsOUPQ94+Pyh4F+h5hQx+vZXCmcSQ5dLu3CcJFxafHSNHuqLv7g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712258613; c=relaxed/simple; bh=zUn2BFtvpGzp35925+pPKXzoZXaRiJJeRXXgLpCJrvE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AuT1gvHiQmcuRHSihmGSYsoNWXVXaRC+aQ5dTCQVFZzOSVSj9IKNN4Zj1yUtL0ZUwQkx5Pg1VdjwEpwObkPhuUzbEWlvJ8B20zAnI3rX3+BttJ3dWqWKE3SyP3QU49fqOrCNG/kaumJzSYS2vuf+8XuEDG+KmolaBABYA9w2BEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=K7dHScuh; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712258612; x=1743794612; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=zUn2BFtvpGzp35925+pPKXzoZXaRiJJeRXXgLpCJrvE=; b=K7dHScuhjryNgTGGHwbL1iN83V7KidPGdQXfD38Oarqe8IQxqGOsb6/o rY8smRN/JDghdE22OUPY+DXxXy5jGmjQUsO4dmPxgDETCAFtWHUV9J7Z6 hoKSltTEXucULjDsgvdV/6IYqMAagPvdM2Hlp/jzzQ9SfwOGRJ8OwQJNQ 240yTLPvFCE6k1Rzv76quZPtblviQyd69f/lcs6NW40Ehn/RSWIbNozJi 2AOEs5dKwlE0L6c0+RBW8LkuBf937HGuMBaY6Qj8w2lM+vM9H38QUxYpM YnKnzS9ix7LkVvDEbaL1sCZvUWEyGhf7YUlzqlyH7a+01ja9xPxqbnAA5 A==; X-CSE-ConnectionGUID: b9BxSUtdS3OphypWRiFD5g== X-CSE-MsgGUID: ZPvpUdhCQWmPbmliI1X5DQ== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="18177831" X-IronPort-AV: E=Sophos;i="6.07,180,1708416000"; d="scan'208";a="18177831" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:23:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="915227478" X-IronPort-AV: E=Sophos;i="6.07,180,1708416000"; d="scan'208";a="915227478" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 12:23:27 -0700 Received: from andy by smile with local (Exim 4.97) (envelope-from ) id 1rsSgH-00000001YWz-1DO1; Thu, 04 Apr 2024 22:23:25 +0300 Date: Thu, 4 Apr 2024 22:23:24 +0300 From: Andy Shevchenko To: Linus Walleij Cc: "Peng Fan (OSS)" , brgl@bgdev.pl, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, cristian.marussi@arm.com, sudeep.holla@arm.com, Peng Fan 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: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Apr 04, 2024 at 09:03:02PM +0200, Linus Walleij wrote: > On Thu, Apr 4, 2024 at 7:05 PM Andy Shevchenko > wrote: > > 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. > > > > 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. $ git grep -lw EOPNOTSUPP -- drivers/pinctrl/ drivers/gpio/ drivers/gpio/gpio-crystalcove.c drivers/gpio/gpio-pcie-idio-24.c drivers/gpio/gpio-regmap.c drivers/gpio/gpio-wcove.c // drivers/gpio/gpiolib-cdev.c <<< Here it goes to user space, no need to fix drivers/pinctrl/actions/pinctrl-s500.c drivers/pinctrl/mediatek/mtk-eint.c drivers/pinctrl/mediatek/mtk-eint.h drivers/pinctrl/nxp/pinctrl-s32cc.c drivers/pinctrl/pinctrl-at91-pio4.c // drivers/pinctrl/pinctrl-aw9523.c <<< Should be fixed in Linus' tree by me drivers/pinctrl/pinctrl-ocelot.c drivers/pinctrl/renesas/pinctrl-rzg2l.c drivers/pinctrl/renesas/pinctrl-rzv2m.c drivers/pinctrl/sunplus/sppctl.c drivers/pinctrl/visconti/pinctrl-common.c > Andy is one of the wisest men I know so I have taken out the patch. > > Peng, what about fixing the problem at its source? Patch away, > we will help you if need be. Indeed. -- With Best Regards, Andy Shevchenko