Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1535464rdb; Wed, 31 Jan 2024 01:17:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEae9mbZ8WEjqHnb3UZWH2CCt6FBbEplG20ti1R+JpHAprPRl64Lu8HwSp6RWbPFG7rA3oB X-Received: by 2002:a92:dc06:0:b0:363:8077:e8f8 with SMTP id t6-20020a92dc06000000b003638077e8f8mr1335882iln.10.1706692665892; Wed, 31 Jan 2024 01:17:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706692665; cv=pass; d=google.com; s=arc-20160816; b=QCl2jFiEN9F4j5Y7diNMoWk7J7ico9k7C/nOMFfpWASTobO4Hxr+CjUm7KH/Toqj1O X+ZCqKue8K7p9V90pGWQmCnkxn+ujdCowCyNzFWUb9uHEAapevj8wdjeDQLsc1RoEtXf hXN8NzB1eFglbMG0LNPS9voeTufuFpHeGDsBjtSnrEUZp01unlW880O4B5tE1avzAil4 tVeZt62IoHjfKCQHNrMCrvJgz5F+wOkNvqdPSpWpxLSj1FL2gKCAthoiNqvqCZIVQ52x h+ZBax8J0AFPudpGcfpxb1RCk4r1CQ0RZiDxNzx9EmHYYEiZmjb2jaVgnSp63aPC1Ntm jsLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=19iyMKPgVV/OnzcKafV91f/kV0b2fJZ+DHL/skL3AYc=; fh=mlT6zsy79HD/uI2exUZ7xYlM91xrR3QbBybABxHNNBg=; b=Sro67vL13bZmyV/h1rrCAdRvxUBE6jR2l6DRbcPrr8KxF7MmQW7K4j9xDVnaKVo9Xc UpgyKw9jCChZ1JAu1JkZgtwMKeu+F6uV9Ds9kFOGIsbRLpXlw96yXHIu8rq6h3CgyXWH Vmh+7XjGUy2b2A0RHiZ730P6UVgam74DNMa+GpCgYqgA8nY5xe47DQ8zap0PAqG8YvQN gzyvkj0+2y+7EaB93Mqt9lJ2hs/dVFCbth9xvSNYGh7QDhMtnaM5QqNnHpkEGOvvDzRm 1b07xsghgOeXeXiF7ONTwJHLu8yNaqzumYB1Cpw6HbYNLDn0DGj54CtXzVsuYH8dogRR 61Kg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZlZoqKvn; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-46087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCXi8+Ctlwq+WRUGJjyvwr7d+jTZW4haHSu0CNs7faHc+SgQnj2U4022MiWitvzgNZjz2s68hnBdWVJYAobMU1kbhfh3xTSOj5IaOY3QKg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q11-20020a65684b000000b005cdf3787c1fsi9372442pgt.67.2024.01.31.01.17.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 01:17:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46087-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=@linaro.org header.s=google header.b=ZlZoqKvn; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-46087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 1BEC128FFB8 for ; Wed, 31 Jan 2024 09:05:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B78F569DE9; Wed, 31 Jan 2024 08:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZlZoqKvn" Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C996869D32 for ; Wed, 31 Jan 2024 08:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706691434; cv=none; b=QQAlTRoMVkli1W6RPD3gc7bLrbOBDcSZo+ju3EZoSJYvEJReGMvUz0S7Y5edzUWIVXu2xRTAg+qUGMQn6J3m8oHvUbmbZ7HhBxodW66mro1bP7GD79Xwq9hXAVvcXXAlRMKgwKmB71hLUtywMSiK73yv37j7G6S4kkcSbjl57vM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706691434; c=relaxed/simple; bh=i/0xGVWxmLGZ/l4MKKj0oTxK2I+o2zUxh3bsKs/n+Iw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LvU3uReTnHLtZVWFVGJklzPa7gnNeX6MIt8X52pwVeMNvIKrwp1qKukJGC6Kqsw679luogDKdEc4cDoTTb2kx1B7SGHNiX2gKqs34sB87K/ziJr6JUKyBYmkH2uPnlYJ0FG1ESaFqrs6q6Nd9XK3wLSxJ1zi4BnuHbMgrhgu8iM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZlZoqKvn; arc=none smtp.client-ip=209.85.128.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-603e086c05bso28043927b3.3 for ; Wed, 31 Jan 2024 00:57:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706691432; x=1707296232; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=19iyMKPgVV/OnzcKafV91f/kV0b2fJZ+DHL/skL3AYc=; b=ZlZoqKvnK9OMXxhyDnAHPKZgYrPCtuhp7e1LksxIle5ypFPscvs+hduyajZzs2TsSX RYtsEUu4xAzDEkY49ltoJ7lIGqG7G0rK6numdJxC4EvFci0hvUDp8tpx6A0DUs6i5KDM 1eKhPoxhKPrzQgdE5Sbx8fVxdd0T9zA4dLZUHYRnULQpAF0+QagNHE+FNc4uqelEK9nx qA9/80W/aungYw0rIh4aDr26uyquHOWEDT/Tz8/uoZkavhvW27iFUkUhdtfJmgBhtUZi pbKEekHZNNVxIWXfvAWfRHImycGZwF1ggyonJH5IRMLR/Ke0VhT6dhH4rdEjenBJ7KDm gXcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706691432; x=1707296232; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=19iyMKPgVV/OnzcKafV91f/kV0b2fJZ+DHL/skL3AYc=; b=MYjM2nwPiMkzDaFRvnr8EdyOvM5eBB4CJVwrHy+uTGOM2NSfyS58cuii2woS5EV5b3 QulHKNp+TYyK3F/FaSXMmgE9VKkDB+LmPMn5gMTqjJytmTgB5uL0DKDUwtv9DfUm0WnG FLLDKw5p/4tCElabmEjmw+DurlqJ785OAjxYCNodCBatluHH5C2Tb/zgdBu+GD6GeJyt wZl3TEJ/EbPei0ZrUwQj+JCpUCQInYS5zbbyx+EUHaZrpWXsM9ob3KX9f4JjJsuepB3j 9Ol5FaqwzMvbqaAII91h06XWW2vu9fdv3DIa80rBjKin1YiOfVtP3InWICeaGQl3Ff4N k+aQ== X-Gm-Message-State: AOJu0YxdwuxRXS4JmUvQS6l3DlehPUm4+00/OqcNXJOiv1x/qfBHSLqB eD/luvIhytXLUJKuJDgkn3fEqVzeJMABnn7o+ywr0P9Rjmp55VsoRRoTykvZymmmkc4PdV+9Y5a PHy9eA5BPJITUlth4w7Kh1fQuraIDMbE8iF9xKg== X-Received: by 2002:a25:7904:0:b0:dc6:7e97:ae62 with SMTP id u4-20020a257904000000b00dc67e97ae62mr1105679ybc.21.1706691431753; Wed, 31 Jan 2024 00:57:11 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240129115216.96479-1-krzysztof.kozlowski@linaro.org> <20240129115216.96479-5-krzysztof.kozlowski@linaro.org> In-Reply-To: <20240129115216.96479-5-krzysztof.kozlowski@linaro.org> From: Linus Walleij Date: Wed, 31 Jan 2024 09:57:00 +0100 Message-ID: Subject: Re: [PATCH v6 4/6] reset: Instantiate reset GPIO controller for shared reset-gpios To: Krzysztof Kozlowski , Bartosz Golaszewski , Geert Uytterhoeven Cc: Srinivas Kandagatla , Banajit Goswami , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , "Rafael J. Wysocki" , Viresh Kumar , Frank Rowand , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Chris Packham , Sean Anderson Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Krzysztof, something is odd with the addresses on this patch, because neither GPIO maintainer is on CC nor linux-gpio@vger, and it's such a GPIO-related patch. We only saw it through side effects making optional, as required by this patch. Please also CC Geert Uytterhoeven, the author of the GPIO aggregator. i.e. this: > 2. !GPIOLIB stub: > https://lore.kernel.org/all/20240125081601.118051-3-krzysztof.kozlowsk= i@linaro.org/ On Mon, Jan 29, 2024 at 12:53=E2=80=AFPM Krzysztof Kozlowski wrote: > Devices sharing a reset GPIO could use the reset framework for > coordinated handling of that shared GPIO line. We have several cases of > such needs, at least for Devicetree-based platforms. > > If Devicetree-based device requests a reset line, while "resets" > Devicetree property is missing but there is a "reset-gpios" one, > instantiate a new "reset-gpio" platform device which will handle such > reset line. This allows seamless handling of such shared reset-gpios > without need of changing Devicetree binding [1]. > > To avoid creating multiple "reset-gpio" platform devices, store the > Devicetree "reset-gpios" GPIO specifiers used for new devices on a > linked list. Later such Devicetree GPIO specifier (phandle to GPIO > controller, GPIO number and GPIO flags) is used to check if reset > controller for given GPIO was already registered. > > If two devices have conflicting "reset-gpios" property, e.g. with > different ACTIVE_xxx flags, this would allow to spawn two separate > "reset-gpio" devices, where the second would fail probing on busy GPIO > request. > > Link: https://lore.kernel.org/all/YXi5CUCEi7YmNxXM@robh.at.kernel.org/ [1= ] > Cc: Bartosz Golaszewski > Cc: Chris Packham > Cc: Sean Anderson > Reviewed-by: Philipp Zabel > Signed-off-by: Krzysztof Kozlowski (...) In my naive view, this implements the following: reset -> virtual "gpio" -> many physical gpios[0..n] So if there was already a way in the kernel to map one GPIO to many GPIOs, the framework could just use that with a simple single GPIO? See the bindings in: Documentation/devicetree/bindings/gpio/gpio-delay.yaml This is handled by drivers/gpio/gpio-aggregator.c. This supports a 1-to-1 map: one GPIO in, one GPIO out, same offset. So if that is extended to support 1-to-many, this problem is solved. Proposed solution: add a single boolean property such as aggregate-all-gpios; to the gpio-delay node, making it provide one single gpio at offset 0 on the consumer side, and refuse any more consumers. This will also solve the problem with induced delays on some GPIO lines as I can see was discussed in the bindings, the gpio aggregator already supports that, but it would work fine with a delay being zero as well. This avoids all the hackery with driver stubs etc as well. Yours, Linus Walleij