Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1669371rdb; Wed, 31 Jan 2024 05:54:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfVHuOlBa4hkBUFY5RpxGH3HIPRManNICRPZIXGK2dYrrsm+j2bonzSFLeqR9qIf91tHTa X-Received: by 2002:a17:90a:f2d4:b0:290:121a:c382 with SMTP id gt20-20020a17090af2d400b00290121ac382mr1492151pjb.24.1706709293488; Wed, 31 Jan 2024 05:54:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706709293; cv=pass; d=google.com; s=arc-20160816; b=URQZGdXtzYcVk0ndYDprHONqn6zvom/cnNHr40PV5C2O7MngXtUNSw6USJZyWk+OoO AeAZ4GYriDkmZcVvwddQ34CfQiQE/jmflq6MgCaRYS6B5zBoLIoOPGnkfk3fUdNOglC3 +tKVX/f5w6W4Ir/sz4lOXnxPpNPO2oD/jFLsbcwTGJKQifaVQIpssP25KfKxI6fhIU3f p/pl+QrY0RCXY7CqGyBz7OHEX2u+AXthO2sEDs/FJEXkKPXXzJ3oKOpLKIGoAixkKWxJ 2fd17yQ2Eg6QChrkVAxOiitiSYjkz5pSe7bxa3wavxd/Tkr5HDZ36TUMETAnwYqmyi2c 4csA== 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=dr6D8tcSVVpexu92k5w3N7i9nF+7FRKOS7uUR00A6YM=; fh=wbVlil4n9bRDswU+5FBjFXUkXSj3o4jL2IpTYEHcbYY=; b=wghHIzQ0MhIojqZ4WjyN/UgYrpv/h620/wey5cjoXHZ9X5wuRwbSfGzEZ0nfjW2eYm amVz/KaaZQtadn970v68HVQvv61639i0zquJQeHG3qO8jyW+R1E9qsAUK8REy2knL1Y6 iJCbBBGeQrSjhss8MOHdS4N35tB05ffNOvEhfDCyfpKh/yktahKFSD57H8CoCJv89tMJ RcJrGVr3MSphylmFYY/pDr1uO30rEw+iMcclT/6SCmjMzSpV4EFZmCe5Py0XSVgcHXNP o5FgXJJHPWY8SutjBtO7XPu9r15IXacucSvaINGR8MINzlZz9Re0yRDCs7uqbnN5O6d/ 2ndA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QnI8TbWG; 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-46481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46481-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; AJvYcCXZ+i8pxSKhzLacWHh6WdYE/WeRKrwrMLUQaFxUOnhLzxI+6BHHNAXx6PuBLRWSZON0is+V4T9Y5MYWRh5XuDURrL65QiCXEA7pRtkAhA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y2-20020a17090a86c200b00295cd8cf1fasi1296378pjv.178.2024.01.31.05.54.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 05:54:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QnI8TbWG; 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-46481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46481-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F3239B2F931 for ; Wed, 31 Jan 2024 13:18:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D1A87BAFF; Wed, 31 Jan 2024 13:18:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QnI8TbWG" 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 EEE7D7AE77 for ; Wed, 31 Jan 2024 13:18:06 +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=1706707088; cv=none; b=cm2VASRzalmAPZ+8IEQef09pjQf7Gam95QGtZnVpknUB3bEVV92rPVMpuyjfZq3j6YS331wb+hVoc3yoZXjYyVk3jRc80zlFpR7vORObSxT8vfSEcsscAt/2BHkUOZwsQzHGgmX2WZrcTdMq1W69B0iCzl6xwqr00fcSYn2hQjo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706707088; c=relaxed/simple; bh=dr6D8tcSVVpexu92k5w3N7i9nF+7FRKOS7uUR00A6YM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=X617LQlgBbi4FDnhj+xWXtCWA3cgNQMtq8BgAro0olvih+t7jKOOjaY07Ee1Q335i5a87Om3bVRF45xr+oMrG6995bhXBnOwOdcL4avnfLowty43ZvSgvoJWpkSTPd3/Nd/r3Xm2Hpaej+jN3Mp39hcQA/xyJIvjKUKbPa4jPTI= 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=QnI8TbWG; 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-6002317a427so43206337b3.2 for ; Wed, 31 Jan 2024 05:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706707086; x=1707311886; 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=dr6D8tcSVVpexu92k5w3N7i9nF+7FRKOS7uUR00A6YM=; b=QnI8TbWG2XKPFB9aozCWTavISGyEjEIeKvQBhFVZ5daEc2Gvbg1a+uRaA9AEr1386U 0xudJNvDJ30LyjyFJmsPwFu/u7Hxt8SIIBM4vL+b/JJRqFYk5NMC3lOENIkHYFOrbVxh GF57jP3AFv8Xg2eMG0Hb1EPlibZ0ZyS3kqTNZHy8iuxaX7s2XpL6+15F89GUjAoDWNXD MMfPk55M/V13sFxB+NHHhB3FiOQLnkaGO5GgUogGV91PZepnmTwbXwl7JBq2lwTO80KD 0OQe5pFIf2uRB9A6KAJL0XvN1CspSRq3q2brtC/BDwHx7OAeIrhTEdKgC5qtkeOxjk2V hvFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706707086; x=1707311886; 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=dr6D8tcSVVpexu92k5w3N7i9nF+7FRKOS7uUR00A6YM=; b=PQJCpGqjimE3tmY9Mz33CA4daomwADKBaSZSooB2bWpPz5rOQwd3DNQS0wdtGpM9sZ VHXzZcLqWR9wyvWjh91QJ+iDiaPoaBdiuzmioflZDrrOselSTssb2MqzIga1GKRZJmWg fjro1vTg4hiUyz7HDf0Ad/k+YuKpQftDMS2XHJyZLkuL/Q1IQ3fz+4qfKo4T8anVD+Iq 0SrLo39WLWeaqjfbL1tbrRmXH+TUAvb2DvnGrF/sdMbpOHVF9aDo3UcqPY2EeAfRSjKM +0S4MK1+YTUIxkSqs6neuQzN3OyJ2B046lDArL6sB7w6i7Su0FV+4ydk1afLQ1lDVaWt jsvw== X-Gm-Message-State: AOJu0YzMY+Vw6Ws4wuywkQGgTzxviK9YziSUNpdtBWtDrRA6JzaNBACC 91lEP+xgFWFR1g1FeTWEX/WVN5YyOKXyjvOYAK1jQMlD3IIqyOBsoMeoxpkC2QYBF4SBjoeis4T 6czWksfZDqxtnpV/sRKR1vCA9gJed4euiU7a7EQ== X-Received: by 2002:a81:79d5:0:b0:5ff:f756:8804 with SMTP id u204-20020a8179d5000000b005fff7568804mr1275150ywc.45.1706707085871; Wed, 31 Jan 2024 05:18:05 -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: From: Linus Walleij Date: Wed, 31 Jan 2024 14:17:54 +0100 Message-ID: Subject: Re: [PATCH v6 4/6] reset: Instantiate reset GPIO controller for shared reset-gpios To: Bartosz Golaszewski Cc: Krzysztof Kozlowski , Geert Uytterhoeven , 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 On Wed, Jan 31, 2024 at 10:37=E2=80=AFAM Bartosz Golaszewski wrote: > [Me] > > reset -> virtual "gpio" -> many physical gpios[0..n] > > This is a different problem: it supports many users enabling the same > GPIO (in Krzysztof's patch it's one but could be more if needed) but - > unlike the broken NONEXCLUSIVE GPIOs in GPIOLIB - it counts the number > of users and doesn't disable the GPIO for as long as there's at least > one. I don't know if the NONEXCLUSIVE stuff is broken, if you mean reference counting isn't working on them, then that is by design because they were invented for regulators and such use cases that do their own reference counting. It's also used for hacks where people need to look up a desc in a second spot, (perhaps we can fix those better). As I say in commit b0ce7b29bfcd090ddba476f45a75ec0a797b048a "This solution with a special flag is not entirely elegant and should ideal= ly be replaced by something more careful as this makes it possible for several consumers to enable/disable the same GPIO line to the left and right without any consistency." I think for regulators (which is the vast majority using it) it isn't broke= n because the regulator reference counting is working. So if we solve that problem for reset, we probably should put it in drivers/gpio/* somewhere so we can reuse the same solution for regulators and get rid of NONEXCLUSIVE altogether I think? The NONEXCLUSIVE stuff was prompted by converting regulators to gpio descriptors, so it was for the greater good one can say. Or the lesser evil :( my judgement can be questioned here. Yours, Linus Walleij