From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Banajit Goswami <bgoswami@quicinc.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Frank Rowand <frowand.list@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
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 <chris.packham@alliedtelesis.co.nz>,
Sean Anderson <sean.anderson@seco.com>
Subject: Re: [PATCH v6 4/6] reset: Instantiate reset GPIO controller for shared reset-gpios
Date: Wed, 31 Jan 2024 10:52:41 +0100 [thread overview]
Message-ID: <3f906732-74b7-4219-88ee-59509bff8459@linaro.org> (raw)
In-Reply-To: <6473952d-893d-4591-9bfd-dd983313bee9@linaro.org>
On 31/01/2024 10:50, Krzysztof Kozlowski wrote:
> 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 <linux/gpio/driver.h>
>> 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
>> <krzysztof.kozlowski@linaro.org> 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 <brgl@bgdev.pl>
>>> Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
>>> Cc: Sean Anderson <sean.anderson@seco.com>
>>> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> (...)
>>
>> 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
>
And here:
https://lore.kernel.org/all/CAL_JsqL3oZXJJ5_i4BRGpvWu1X8QFB7OGG=D+zLvvWb=UR1mWg@mail.gmail.com/
which the place where this idea of using resets appeared. I agree that
you were not CCed there, but that only means you miss lei filters or
pattern in MAINTAINERS.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-01-31 9:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 11:52 [PATCH v6 0/6] reset: gpio: ASoC: shared GPIO resets Krzysztof Kozlowski
2024-01-29 11:52 ` [PATCH v6 1/6] of: Add of_phandle_args_equal() helper Krzysztof Kozlowski
2024-01-29 11:52 ` [PATCH v6 2/6] cpufreq: do not open-code of_phandle_args_equal() Krzysztof Kozlowski
2024-01-29 11:52 ` [PATCH v6 3/6] reset: gpio: Add GPIO-based reset controller Krzysztof Kozlowski
2024-01-29 11:52 ` [PATCH v6 4/6] reset: Instantiate reset GPIO controller for shared reset-gpios Krzysztof Kozlowski
2024-01-31 8:57 ` Linus Walleij
2024-01-31 9:37 ` Bartosz Golaszewski
2024-01-31 13:17 ` Linus Walleij
2024-01-31 13:31 ` Mark Brown
2024-01-31 13:32 ` Krzysztof Kozlowski
2024-01-31 13:42 ` Linus Walleij
2024-01-31 13:59 ` Mark Brown
2024-01-31 14:11 ` Bartosz Golaszewski
2024-01-31 9:50 ` Krzysztof Kozlowski
2024-01-31 9:52 ` Krzysztof Kozlowski [this message]
2024-01-31 12:50 ` Linus Walleij
2024-02-12 14:16 ` Krzysztof Kozlowski
2024-02-12 20:47 ` Linus Walleij
2024-02-12 21:32 ` Bartosz Golaszewski
2024-01-29 11:52 ` [PATCH v6 5/6] ASoC: dt-bindings: qcom,wsa8840: Add reset-gpios for shared line Krzysztof Kozlowski
2024-01-29 11:52 ` [PATCH v6 6/6] ASoC: codecs: wsa884x: Allow sharing reset GPIO Krzysztof Kozlowski
2024-02-21 9:44 ` [PATCH v6 0/6] reset: gpio: ASoC: shared GPIO resets Krzysztof Kozlowski
2024-02-21 11:26 ` Philipp Zabel
2024-02-21 11:28 ` Krzysztof Kozlowski
2024-02-21 11:14 ` Philipp Zabel
2024-02-22 14:18 ` (subset) " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f906732-74b7-4219-88ee-59509bff8459@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=andersson@kernel.org \
--cc=bgoswami@quicinc.com \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=geert+renesas@glider.be \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=perex@perex.cz \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sean.anderson@seco.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.com \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).