From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
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 14:32:48 +0100 [thread overview]
Message-ID: <5ef64082-0b44-4bb2-bd4c-654c96f4a9bb@linaro.org> (raw)
In-Reply-To: <CACRpkdbaxqTzwL9L02vCpMMdBYsubNP1VkNuJ8mXB_=4E3Kjaw@mail.gmail.com>
On 31/01/2024 14:17, Linus Walleij wrote:
> On Wed, Jan 31, 2024 at 10:37 AM Bartosz Golaszewski <brgl@bgdev.pl> 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 ideally
> 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 broken
> 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.
I discussed the non-exclusive GPIOs with Bartosz quite a lot, who was
Cced since beginning of this patchset, because that was my first
approach, which was rejected:
https://lore.kernel.org/all/b7aeda24-d638-45b7-8e30-80d287f498f8@sirena.org.uk/
The non-exclusive GPIO was made explicitly for regulators, so it is
working fine there, but it is broken everywhere else, where the drivers
do not handle it in sane way as regulator core does.
To make it working, either GPIO should be enable-count-aware, to which
Bartosz was opposing with talks with me, or the subsystem should mimic
regulators approach. In some way, my patchset is the second way here -
reset framework subsystem being aware of shared GPIO and handles the
enable-count, even though it is not using non-exclusive flag.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-01-31 13:32 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 [this message]
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
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=5ef64082-0b44-4bb2-bd4c-654c96f4a9bb@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).