From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 A5EA069959 for ; Wed, 31 Jan 2024 09:50:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706694610; cv=none; b=qH631xW+vnleiP3EnCTKlVLuEr376e/9FGmORTe4PQU1T0dyGJkC4Ke5ZLdCnkG6qi80uhapFzHRi0RTpOiSNYV4vhT4WGrVmTQb0MXMT+0IC4ak7CaQGw1V8xyHCZMxcs4RY+OEd2WWbTmNsqXB2S61luZ/w5zYAe6g8l3NbKQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706694610; c=relaxed/simple; bh=D2SxnRMLSR82V6Oi5/NAc91qViUnD7/+ZI0XF3o3fmM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qeoMx8aZLbommAOiNK+xdWJgfvq7ubU7Jvhg2qCaXI1WXWdJMxj0SUVEwkvU12L2LvYw+2LEEeG2RxiU+zLxf6QaXLlkHJztQvqdti3gfI+I/IHGoh5GnZLtfolJ9uBMuJmw04iv+jxYmQU/qJibxoqHjcJfEfqXPI1lHQsNkAw= 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=qvNeBmPm; arc=none smtp.client-ip=209.85.208.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qvNeBmPm" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-55f15762840so3036392a12.0 for ; Wed, 31 Jan 2024 01:50:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706694606; x=1707299406; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=STatSmLQt71RU1CUhKC1WCgSc7AlGVVE3QhLj6cY57Y=; b=qvNeBmPmnhTnIKrry+CgC7gGwh0VWVVh6rIrmbQzKNlN0nZFysXAuWmXsv+/SOTj/O n3BdxnWxcJ+de7IshrLGJlybY5K9DM6NqOJmh6HrnG+v3R5hmP7lROYh2WkbuyDx65cF TJDQ+TXfoOnv0FqQtWrq4w4lDKaJa9h6GBtvxsSS2K+MPw/LfH2xtWdqvJjGjq02V0uL waGsT4fuPdXJkHvgAz9JMz4VBSCe3iDYQn2ERqZ/1R/9WxS0bxdYch01878jEJ9RKNPr slkgo1dcG0DCQqNodDgpumXEASe0EA9O195/AHIZqMjr5OTNwqkoBhIr/DMm7ucQcThn /v2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706694606; x=1707299406; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=STatSmLQt71RU1CUhKC1WCgSc7AlGVVE3QhLj6cY57Y=; b=IiRoNQq2SHoQtlUQIX0fGYpVGQlY/H78rcmuBx7hMn2tYVIwv3f1FIpl2dxxvFizO6 uJ9YQK/XV5dhUI4eyJ4MM1yi6EJfQWC7ztlFKd9ulReC8r5HV7GSLqPLvsv1Pha0Kpgy ZfhUQaX9rLdKbHBUL9eeHKqXc83dx9d9jBPSHyUO1DEzYbgyP3yBEUF5uW5kwJhWptmy AQqSdTSYFKuMxMc/9SM9WHCq81/PhkzEdDzDt4XevaYLmXRycpYlTE2wp4yjXgCjKAAa Jt9ZcOhbre2SPuIBn1NdnfxHXTlyoJeLRIxSfkCUNnKBKWehUaPHjHtSVpHXfcDjgTrG A7bw== X-Gm-Message-State: AOJu0Yw1Yjn2gsiapH9wbdPqp8AtmRwuXktnYi/Fk+h7M0hpLJDTXjl1 WBs9QaM7mvjk7gyDxaLrK5FJlJ+J4qGoWP9zUj6/1sdyn4DjuO48SkjgaJQ7bjg= X-Google-Smtp-Source: AGHT+IGLFqdwp+tZWw0+FhhM8d3VY4sd1Lxq65pmRHfbtRsEAp9eMdXJqf0ADu50FMtqVcKymHSf7w== X-Received: by 2002:a05:6402:1215:b0:55f:7a8:fdf1 with SMTP id c21-20020a056402121500b0055f07a8fdf1mr678144edw.29.1706694605840; Wed, 31 Jan 2024 01:50:05 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXxNeFtCa4X6MxNQs01yfL2oP0GERimVq2CidH1mC7hasbzybtO+NeXHXtaDYzQgNZGWSYqKgQxKP3RQdkeB2apizbU5qSFJtUugIuNnj5H1cp2fl3px7FYRrPuty1r1D8sFXInam9jtbBFNGlfDoPi58yikNjIvnokKv9Hunork0QUaWo80UR7CrJAkhrIFhF7kCiylS3NMyEuGNGDNNf87IpyFNcS6h3zqTQqQ6OFI4gAHh0D42pF1om8n0F8GPuVwr3wV4zvKSFKLQN7Zn104EguLF0g/yvlDeTxgn+THRSovkiMA3VePSLmAbwseiwMt5avM1a9UOe7xOoZcDmWEi8tKTbsjwGojF615JKMstWof4dT2rJR3QDHnOf6ffWF6vTcYHVeEgXS9XYMpkefzvoOveC9Sv8Fiy+3kp4my/cmvXPxVy+J0miNMOXNpQvlUwmZg2d2rGyLrmmgWj11mJlpnBCBtcSf845Tga2cTq0G2PFFa41y3c7tcB6UEKhkhHZtH9n75ksZKtEOh719Z2OqK/BD7uI+TasQXh1v2/IQYOAWo/sRixGrINZ2nfXm9Tm1O1EBxZvoETug7T4BUYpxkzdivIMjlpbNpAgCORpFgiNZjHEjSJ9vt7JjtDhSPI8EXUhCwNTGRg3zbZ/u7rL42ov1GPFy1tvFHtaNcfBpY5pZ6fTV/RLdMhe6dthK/ZJL69FQL9LuT2IBfqeaxjdLoEq8pBiThEg1jSVFbYkfzJm/8CnaA6LrTqAkzQDw6PemYTFkWfTl9pICJlg9vcCZzwLvgYVxHHhNNAIDOzqS0sDBzRUgoSwl2LZnKzvHv7n2rA== Received: from [192.168.1.20] ([178.197.222.62]) by smtp.gmail.com with ESMTPSA id k7-20020aa7c047000000b0055f3edfc3desm1481087edo.20.2024.01.31.01.50.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Jan 2024 01:50:05 -0800 (PST) Message-ID: <6473952d-893d-4591-9bfd-dd983313bee9@linaro.org> Date: Wed, 31 Jan 2024 10:50:02 +0100 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 4/6] reset: Instantiate reset GPIO controller for shared reset-gpios Content-Language: en-US To: Linus Walleij , 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 References: <20240129115216.96479-1-krzysztof.kozlowski@linaro.org> <20240129115216.96479-5-krzysztof.kozlowski@linaro.org> From: Krzysztof Kozlowski Autocr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ODaFicsUkjheOD4BfWEcVUqa+XdUEciwG/SgNyxBZepj41oVq FPSVE+Ni2tNrW/e16b8mgXNngHSnbsr6pAIXZH3qFW+4TKPMGZ2rZ6zITrMip+12jgw4mGjy 5y06JZvA02rZT2k9aa7i9dUUFggaanI09jNGbRA/ABEBAAHCwXwEGAEKACYCGwwWIQSb0H4O DFH41ZZ3t1Qbk0N9O0FimwUCYDzvagUJFF+UtgAKCRAbk0N9O0Fim9JzD/0auoGtUu4mgnna oEEpQEOjgT7l9TVuO3Qa/SeH+E0m55y5Fjpp6ZToc481za3xAcxK/BtIX5Wn1mQ6+szfrJQ6 59y2io437BeuWIRjQniSxHz1kgtFECiV30yHRgOoQlzUea7FgsnuWdstgfWi6LxstswEzxLZ Sj1EqpXYZE4uLjh6dW292sO+j4LEqPYr53hyV4I2LPmptPE9Rb9yCTAbSUlzgjiyyjuXhcwM qf3lzsm02y7Ooq+ERVKiJzlvLd9tSe4jRx6Z6LMXhB21fa5DGs/tHAcUF35hSJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 31/01/2024 09:57, Linus Walleij wrote: > Hi Krzysztof, > > something is odd with the addresses on this patch, because neither GPIO Nothing is odd - I use get_maintainers.pl which just don't print your names. I can add your addresses manually, no problem, but don't blame the contributor that get_maintainers.pl has a missing content-regex. If you want to be Cced on usage of GPIOs, you need to be sure that MAINTAINERS file has appropriate pattern. > 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.kozlowski@linaro.org/ > > On Mon, Jan 29, 2024 at 12:53 PM 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] It does not, there is no single GPIO here. There is a single reset controller, though, but still multiple GPIOs in DTS. > > 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. It does not match the hardware thus I don't know how to implement it in DTS while keeping the requirement that we are describing hardware, not OS abstractions. > > 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. And how do you solve the reset requirements? The problem is not just to share GPIO. The problem is to share in a way that devices operate properly when they assert/deassert reset. > > 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. So none of these ideas were posted in previous threads, just because you were not CCed (except one thread)? https://lore.kernel.org/lkml/20191030120440.3699-1-peter.ujfalusi@ti.com/ https://lore.kernel.org/all/9eebec9b-e6fd-4a22-89ea-b434f446e061@linaro.org/ https://lore.kernel.org/all/20231018100055.140847-1-krzysztof.kozlowski@linaro.org/ https://social.treehouse.systems/@marcan/111268780311634160 Please implement some custom lei filter, so you will get such notifications earlier. We keep discussing this for many months on various attempts and this specific attempt already reached v6. Best regards, Krzysztof