From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF2A0C56202 for ; Wed, 11 Nov 2020 08:53:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5A729206E3 for ; Wed, 11 Nov 2020 08:53:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gb1TppyS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Nibxc0Nw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A729206E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:In-Reply-To:Subject:To: From:References:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nHFAXhpUa8bgK0hXrkOVQQCxEo0zQ2GsZQOJEsZPC54=; b=gb1TppyS6a85nxjPxIOtc7eHX l4g7BlT1O1jUSPoOfLwX5viKzddIUUciCMEivM6SXJjZtepoOxskFyjAbUuVcBqd1b4M9WtgF5JYd e/86+nh4MmoX2fxDkxrIVQ1H5lIPSG9RRPdnPP8u2MdPDvfIwwNoiG2tUqYirTX6WUJixBbAUCRTq hjwaWjJjSZx2PIdRr2eEzEp7LL0M1UrQyOUzLTQtx5Jo0baWpo/rwsgQ5rnk0A8GffHwPu5j1fuGd Oe8x/Qr8KlsUvdRp6V6D43tBKRSuvs70aiEq4vqHbPijaWZh6nAY2+jGNTWMRsuvDV+ly7jJNSXcM o4Q9ZEP0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kclrm-0001xN-8Z; Wed, 11 Nov 2020 08:52:34 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kclrj-0001wo-Ll for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2020 08:52:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1605084751; x=1636620751; h=references:from:to:cc:subject:in-reply-to:date: message-id:mime-version; bh=mPPy1TkcVOlW/Zjck2Emjg838QadGoDmShOXyWNzpns=; b=Nibxc0NwdlCGIiWU00QteLNuC8oqa/AokLnrf/R/ywAf1VPCiFxOZIfj vXZ5eSrvfam/ROUXG1xbRf3uoQR+GB58qS3xtxFpuKrKcycwy5zITOTA5 ULlViHhXEtRDl56rfQHBYeFiDVcF1NlMdJFv4juDyxY9FRWgEGrurrmo2 +gees5SSpcHlbmZsYuSOl70qniF+fFtEpxY8bla7ZxTLpGoPllOvkD7TP Ry5nxinCIA4pDwyRlFtwnjbuBkodKwwC3V9qAj7g4beIsM8OetHizMWki bu0NxtG2aIjI+T5Vl93vv0PClOIvXqFTaF1T3y1Wt9Gx/EoewS82r3rcR g==; IronPort-SDR: vriVf8UGjCnWN9V1LMJVSV66qS6uYu96PDzWV8heInFGVS3xNRLeUhigGq6SrUWEgFCLf+xD5Q 5SNx2NqrpRHKkmjbP6xjwKJ0Aa/CB7RHEwHx/hU0d6eWiX4CkwulRDBfCuy8bmiPAzj859x0wM Xh4drdJEfsWayKYHbwk1GzbbP5wXbJDfac8ZfcNvHj24Dc/tpjBbYg7GPj+Gwk7rmw8MkB/gZc tIHKAW5GuLMnFWieBTq1+s1v3M8h3KBxlYL/DrdBiukeOx2vwPUpe602nOKPTsmRPFjt6LNo4D Tec= X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="103025944" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Nov 2020 01:52:29 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 11 Nov 2020 01:52:28 -0700 Received: from soft-dev10.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3 via Frontend Transport; Wed, 11 Nov 2020 01:52:26 -0700 References: <20201109132643.457932-1-lars.povlsen@microchip.com> <20201109132643.457932-3-lars.povlsen@microchip.com> <87361hfbwu.fsf@microchip.com> User-agent: mu4e 1.2.0; emacs 26.3 From: Lars Povlsen To: Andy Shevchenko Subject: Re: [PATCH v8 2/3] pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO In-Reply-To: Date: Wed, 11 Nov 2020 09:51:52 +0100 Message-ID: <87zh3oe0nr.fsf@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_035232_089418_F740174C X-CRM114-Status: GOOD ( 32.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree , Alexandre Belloni , Linus Walleij , Linux Kernel Mailing List , Microchip Linux Driver Support , "open list:GPIO SUBSYSTEM" , Lars Povlsen , linux-arm Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Andy Shevchenko writes: > On Tue, Nov 10, 2020 at 5:51 PM Lars Povlsen wrote: >> > On Mon, Nov 9, 2020 at 3:27 PM Lars Povlsen wrote: > >> >> This adds a pinctrl driver for the Microsemi/Microchip Serial GPIO >> >> (SGPIO) device used in various SoC's. >> > >> > Please, elaborate what you said previously, because now it has no >> > justification to be a pin control driver. >> >> As previously stated, the individual pins have possible other functions >> than GPIO. When these functions are added, the driver will need pinctrl >> functinality. This was accepted by Linux Walleij. > > Yes, I understand that. What I meant is to update the commit message > to tell this to the reviewers / readers / anthropologists. Ok, will do. > > ... > >> >> + return -EOPNOTSUPP; >> > >> > Are you sure? IIRC internally we are using ENOTSUPP. >> > >> > Couple of drivers seem to be wrongly using the other one. >> >> Checkpatch complains about ENOTSUPP: >> >> # ENOTSUPP is not a standard error code and should be avoided in new patches. >> # Folks usually mean EOPNOTSUPP (also called ENOTSUP), when they type ENOTSUPP. > > checkpatch is wrong if this is internal code and to me sounds like > it's not going out of the kernel. > > ... As it appears there are different opinions on this I'll let the pinctrl maintainer decide. > >> >> + err = -EOPNOTSUPP; >> > >> > Ditto. >> >> Ditto. > > Ditto. > > ... > >> >> + dev_err(pctldev->dev, "Pin %d direction as %s is not possible\n", >> >> + pin, input ? "input" : "output"); >> > >> > Do we need this noise? Isn't user space getting a proper error code as >> > per doc and can handle this? >> > >> >> This need not go to user space, as one use-case is using the pin as a >> i2c mux. In this case no signs of the error condition is recorded, it >> just doesn't work. So I concur it is not noise, it is sign of an >> erroneous situation which should be fixed, IMHO. >> >> The message makes it easy to locate the issue, if any. The message will >> not occur on a properly configured system. > > It's noise. As we discussed with Alexandre (and I guess came to the > same page) that its consumer's business how to treat the error. > >> Lets have the maintainer make the call. > > ... I digress. I'll remove it. > >> >> +static int microchip_sgpio_get_ports(struct sgpio_priv *priv) >> >> +{ > >> >> +} >> > >> > As per previous version comment, i.e. perhaps find an existing API for >> > this kind of parser or introduce a generic one. >> >> I fixed the use of OF api's - that was surely an oversight. >> >> I have searched for a suitable API without finding one. The closest >> thing was the parsing of "gpio-reserved-ranges" in gpiolib-of.c, but >> that was coded directly. So I think this might not be of general use. >> >> If it is, lets do that after the driver is merged. > > I guess it will be a lot of benefit to have such API earlier than later. Thank you for your comments. I'll send the new version shortly. ---Lars -- Lars Povlsen, Microchip _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel