Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp780026lqj; Sun, 2 Jun 2024 23:36:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVAhCQhgegvQSLHZKnBsaXP84hNea5nbq0qve1ND6+qIrBD7WGngDETnzW9blC9s8hf3YW6QYVRFRZKNBGUEIvqzqVPG/I0Anoro4xA2A== X-Google-Smtp-Source: AGHT+IHCS/Hp9biWePJNsya1HZIH3XR6VGRRBp/X3XvBLXnAfJ9IzvlSEP8uDeGALT6VrTBIq6II X-Received: by 2002:a05:6a00:883:b0:6eb:3c2d:76e0 with SMTP id d2e1a72fcca58-702477e9081mr11496664b3a.11.1717396561880; Sun, 02 Jun 2024 23:36:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717396561; cv=pass; d=google.com; s=arc-20160816; b=C4UCKIrNjYJ8SyOqnoFNzldxVxhObhZqUYlyuvxz0k0mI0/JyPqkG0y2SflntyLx5L cISjwFTRMeumMK8vdqbQLDCw5jATM3NroanK6oKcAxjPjxmGxh14geWOeNKxdc4ASDrW zg1M6zT+ZxTLqhcymQarKm7so9TwzYT8VubMZWNf1Mp58Xi7xQ9FSM1cesme6Yqz0BL8 +x5qtz9Gvu1wDRSdOtDd2LrN58oiwz2sP0X02kqrNntKfoPTXudzJWYmjPQdRYa/Gvfo 4iyXBehYsKevTvyKuIdfrZZIhx9jBFHbVaUAjUK72SEF0yGzcgz2xxDSx0gVh4IJ39GJ TCTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=bojy9gF1R8yC9iqL7eT/52jrj9k0xEJZxjxjJjYDUeA=; fh=cYS/sm4qEv4p8LUEn8phCGMaxEV5LtEJuSaxqy//V28=; b=Uljjp/OXtL+EFvNPPVJNIt9XddPCpgPd76fGB0FD4fbUscF+QjCKHfCSpJsk+xzywt 8zGjfdCP4JTUZl19e4v/2Q93AtydEWj5HyJlH/tu5Ssx6T9+53T+32mx/sb685IUqNe0 K40t/JHHeHhzLy+Pyr6EoX3+/JppdBn7v0PpQIg/jxqxJg4dfl2HqdagdJdE5QMeJ31X 2cFmu5UTG0pdimzQ2ycCyn0gQchb0USyKieTvvZP8FVQnUvDr26z70PyIi93rgASiSZU P5CJKRmdg0FFsJLuNbJRKlSXw50sIKmavo9pBDvCeR5kq9um+RaPRiir+lGcwxoAHXlo y6Ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@aruba.it header.s=a1 header.b=R9DzqFpB; arc=pass (i=1 spf=pass spfdomain=enneenne.com dkim=pass dkdomain=aruba.it dmarc=pass fromdomain=enneenne.com); spf=pass (google.com: domain of linux-kernel+bounces-198645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198645-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=enneenne.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35c73bfdcsi5966528a12.713.2024.06.02.23.36.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 23:36:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@aruba.it header.s=a1 header.b=R9DzqFpB; arc=pass (i=1 spf=pass spfdomain=enneenne.com dkim=pass dkdomain=aruba.it dmarc=pass fromdomain=enneenne.com); spf=pass (google.com: domain of linux-kernel+bounces-198645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198645-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=enneenne.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 52B02282059 for ; Mon, 3 Jun 2024 06:36:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 812F22C859; Mon, 3 Jun 2024 06:35:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=aruba.it header.i=@aruba.it header.b="R9DzqFpB" Received: from smtpcmd14161.aruba.it (smtpcmd14161.aruba.it [62.149.156.161]) (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 4FA7B1799B for ; Mon, 3 Jun 2024 06:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.149.156.161 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717396555; cv=none; b=m/Y/FrxLMgKRzW7tdNNWNXjf+slEz88zdrZJwjuBVxpedB6H1oaNmX2Y2IGsh0fC8I8nfIToZThkK88OfSYK5SqSpnxjuRzLl3A7x3kEbjsTFgKPxK5Bc//apoYmZ5lroXXb1Eu2JbWBzurtqKcjy9EYW1f1yv+tCKr33GFL1ac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717396555; c=relaxed/simple; bh=IM6Q+jA0EDWL/Yao5Tt0wSFrGtRBBIHLONyz8WNHFYQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VcrjJ3ZXmWrs5YLRE6DmYxNcHkTvLAV+A0y2y5Dog+1pX1W7I95LCU3XmCIm6DcSXOhcoivSBT+5OrUvwo1FONgUhDF7R3XEcfdI0Z7P5+ZHRBEzoJVaZ8+9HoSwwVLNrC49lYhS4ird1onu1nc6HhfgD+yTytaI9Ndh9NIx3ZA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=enneenne.com; spf=pass smtp.mailfrom=enneenne.com; dkim=pass (2048-bit key) header.d=aruba.it header.i=@aruba.it header.b=R9DzqFpB; arc=none smtp.client-ip=62.149.156.161 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=enneenne.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=enneenne.com Received: from [192.168.1.56] ([79.0.204.227]) by Aruba Outgoing Smtp with ESMTPSA id E1FJsoTyL0ADeE1FKsVFMb; Mon, 03 Jun 2024 08:32:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1717396362; bh=IM6Q+jA0EDWL/Yao5Tt0wSFrGtRBBIHLONyz8WNHFYQ=; h=Date:MIME-Version:Subject:To:From:Content-Type; b=R9DzqFpBL/BMy8BlyD0N7Np5fqJtWAhCKQoyuTf0ef8tJHutAorq5OgNG8LG3852i I4Os30PLVPECdrLroDoROQDho1lnKfYOyo4/0B+M+f0/j2HgfQC0iBbJamROyMIFv3 TWz4LdgBIGRKcXgRbONb3vSYDb9bHMVSb6xNAgS2f+uIPaH56W8+/ihzWJeEMvYW4U FAWq4ylezYjQkw7sy+zxkMCXxc9RJuxF6BjJkKvqU4qVVVnKYXSA+b061VJwja7LSm 6FR+UVl1apAoFTvMYdoBWVJEg14p/TvsvWjSuPfMCGy9MFU8kh3O8EnHcO/fVSrfP2 W5z7NkxcHSuyw== Message-ID: <177dd111-fb1a-4650-9c81-ab5903859c77@enneenne.com> Date: Mon, 3 Jun 2024 08:32:41 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] pps: clients: gpio: Continue after failing to get optional ECHO pin To: Curtis Klein Cc: linux-kernel@vger.kernel.org References: <20240531224411.3515712-1-curtis.klein@hpe.com> From: Rodolfo Giometti Content-Language: en-US In-Reply-To: <20240531224411.3515712-1-curtis.klein@hpe.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfHC5lwTERhkIDSX7sQY/7yTkARytNhgs87Le2gvIhIo+Nta0N5pjDUOMNooL1wd6RndHBaD0eTU8jIjM09nwNIG4KxOg01t1MWRxj3yaKxXpaQC2PsM3 2HzzsLA0v0+M5AZJPJ6RrmUuk4mRFriTYpCrYALidwW5uDVDAu6d8xYq2pHWRXFAvl/xBQFfSr6cDkcIxwisKlamY+HgbHfONbVOmUrrhyCmXkfLMe9wHyoV On 01/06/24 00:44, Curtis Klein wrote: > Warn but do not fail when devm_gpiod_get_optional returns an error when > trying to get the ECHO pin. When creating a pps-gpio device using > platform data and GPIO lookup tables, the call to gpiod_get_optional > will match on the unlabeled pin meant as the input when searching for > the "echo" pin. Since it is already in use as the PPS input, it will I'm not sure to well understand what you mean here: why the "echo" pin should be already in use as the PPS input? Can you please explain better this situation with a real example? > fail with -EBUSY. As the ECHO pin is optional, we just warn on the error > and continue the initialization. This allows us to support devices > created using GPIO lookup tables instead of ACPI, DT, swnode, etc. > > Signed-off-by: Curtis Klein > --- > drivers/pps/clients/pps-gpio.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c > index 2f4b11b4dfcd..b7db4a3ee97e 100644 > --- a/drivers/pps/clients/pps-gpio.c > +++ b/drivers/pps/clients/pps-gpio.c > @@ -114,9 +114,12 @@ static int pps_gpio_setup(struct device *dev) > device_property_read_bool(dev, "assert-falling-edge"); > > data->echo_pin = devm_gpiod_get_optional(dev, "echo", GPIOD_OUT_LOW); > - if (IS_ERR(data->echo_pin)) > - return dev_err_probe(dev, PTR_ERR(data->echo_pin), > - "failed to request ECHO GPIO\n"); > + if (IS_ERR(data->echo_pin)) { > + dev_warn(dev, "failed to request ECHO GPIO: %ld\n", > + PTR_ERR(data->echo_pin)); > + data->echo_pin = NULL; > + return 0; > + } > > if (!data->echo_pin) > return 0; Thanks, Rodolfo -- GNU/Linux Solutions e-mail: giometti@enneenne.com Linux Device Driver giometti@linux.it Embedded Systems phone: +39 349 2432127 UNIX programming