linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Felipe Balbi <balbi@kernel.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-usb <linux-usb@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	David Brown <david.brown@linaro.org>,
	alokc@codeaurora.org, linux-i2c <linux-i2c@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Andy Gross <andy.gross@linaro.org>,
	Jeffrey Hugo <jlhugo@gmail.com>, Lee Jones <lee.jones@linaro.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 3/8] pinctrl: msm: Add ability for drivers to supply a reserved GPIO list
Date: Sat, 8 Jun 2019 16:22:03 +0200	[thread overview]
Message-ID: <CACRpkdZmBe6ucmekLUNkypDKx=eAXqtwdYNpZzwByzuWb-sjDA@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu-1QhX-9aNhFJauc9NVe6ceQQueE8Kd14031XJ-2yaupA@mail.gmail.com>

On Fri, Jun 7, 2019 at 1:10 PM Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On Fri, 7 Jun 2019 at 10:29, Lee Jones <lee.jones@linaro.org> wrote:
> >
> > When booting MSM based platforms with Device Tree or some ACPI
> > implementations, it is possible to provide a list of reserved pins
> > via the 'gpio-reserved-ranges' and 'gpios' properties respectively.
> > However some ACPI tables are not populated with this information,
> > thus it has to come from a knowledgable device driver instead.
> >
> > Here we provide the MSM common driver with additional support to
> > parse this informtion and correctly populate the widely used
> > 'valid_mask'.
> >
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> I'm not sure if this is the correct approach. Presumably, on ACPI
> systems, all the pinctl stuff is already set up by the firmware, and
> so we shouldn't touch *any* pins unless they have been requested
> explicitly. Is there any way we can support this in the current
> framework?

I don't suppose anything but the GPIO portions of the pinctrl
driver is ever used under ACPI. I guess in an ideal ACPI world
noone (like userspace) would ever use a GPIO because ACPI
would have all GPIOs assigned a particular purpose, so accessing
any of them would lead to a crash.

But in practice it seems a lot of GPIOs are available and used
for example by userspace hacks, so just blacklisting the ones
that cannot be accessed by the GPIO subsystem seems like
a viable compromise.

Then we have the ACPI paradigm of pin control being controlled
by ACPI: this is also great in theory, but it seems like the ACPI
firmware has in cases forgot or omitted to implement some of
it and people need to access it anyways. The people writing the
default firmware cannot think out or test all usecases, so some
will be left open-ended to non-firmware authoring users. This is why
drivers/pinctrl/intel/* exists despite being for exclusively
ACPI platforms. Being able to control pins also from the kernel
has become a viable compromise.

Yours,
Linus Walleij

  parent reply	other threads:[~2019-06-08 14:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07  8:28 [PATCH v2 1/8] i2c: i2c-qcom-geni: Provide support for ACPI Lee Jones
2019-06-07  8:28 ` [PATCH v2 2/8] i2c: i2c-qcom-geni: Signify successful driver probe Lee Jones
2019-06-07 11:08   ` Ard Biesheuvel
2019-06-07  8:28 ` [PATCH v2 3/8] pinctrl: msm: Add ability for drivers to supply a reserved GPIO list Lee Jones
2019-06-07 11:10   ` Ard Biesheuvel
2019-06-07 18:10     ` Bjorn Andersson
2019-06-08 14:22     ` Linus Walleij [this message]
2019-06-07  8:28 ` [PATCH v2 4/8] pinctrl: qcom: sdm845: Provide ACPI support Lee Jones
2019-06-07 11:12   ` Ard Biesheuvel
2019-06-07  8:28 ` [PATCH v2 5/8] soc: qcom: geni: Add support for ACPI Lee Jones
2019-06-07 11:14   ` Ard Biesheuvel
2019-06-07  8:28 ` [PATCH v2 6/8] usb: dwc3: qcom: Add support for booting with ACPI Lee Jones
2019-06-07  8:29 ` [PATCH v2 7/8] usb: dwc3: qcom: Start USB in 'host mode' on the SDM845 Lee Jones
2019-06-07  8:29 ` [PATCH v2 8/8] usb: dwc3: qcom: Improve error handling Lee Jones
2019-06-07 11:08 ` [PATCH v2 1/8] i2c: i2c-qcom-geni: Provide support for ACPI Ard Biesheuvel
2019-06-10  6:44   ` Lee Jones

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='CACRpkdZmBe6ucmekLUNkypDKx=eAXqtwdYNpZzwByzuWb-sjDA@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=alokc@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jlhugo@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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).