mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Marco Scardovi <scardracs@disroot.org>
Cc: andriy.shevchenko@linux.intel.com, brgl@kernel.org,
	linusw@kernel.org, linux-acpi@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5] gpiolib: acpi: prevent address truncation in OperationRegion handler
Date: Tue, 2 Jun 2026 14:15:35 +0200	[thread overview]
Message-ID: <20260602121535.GC2990@black.igk.intel.com> (raw)
In-Reply-To: <vzcrnFOfR861L-H21KjtDQ@disroot.org>

Hi,

On Tue, Jun 02, 2026 at 01:59:36PM +0200, Marco Scardovi wrote:
> Hi Mika,
> 
> On Tue, Jun 02, 2026 at 01:45:40PM +0200, Mika Westerberg wrote:
> > How in practice this can be done given that the GPIO resource has only 2
> > bytes for the index?
> 
> The 2-byte limitation is in the GPIO resource descriptor representation of the 
> pin table, not in the ACPI address space handler interface itself.
> 
> The acpi_gpio_adr_space_handler() receives the access offset as a 64-bit 
> acpi_physical_address from ACPICA. This value is generated when AML
> accesses a Field within the GPIO OperationRegion, and it is not constrained
> by the GPIO resource descriptor's pin_table_length.

Yes, but you access it from AML like this:

Field(\_SB.GPI2.GPO2, ByteAcc, NoLock, Preserve)
{
	Connection (GpioIo(Exclusive, PullUp, , , , "\\_SB.GPI2") {7}),
	STAT, 1,           // e.g. Status signal from the device
	Connection (GpioIo (Exclusive, PullUp, , , , "\\_SB.GPI2") {9}),
	RSET, 1            // e.g. Reset signal to the device
}

In other words it still uses GPIO resource descriptor (so 2 bytes per pin),
nothing else is accepted as far as I understand.

The example is here: 

https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#declaring-generalpurposeio-fields

  reply	other threads:[~2026-06-02 12:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 11:32 [PATCH v5 0/2] gpiolib: acpi: Add bounds-checking and address validation Marco Scardovi
2026-06-02 11:32 ` [PATCH v5 1/2] gpiolib: acpi: Add robust bounds-checking for GPIO pin resources Marco Scardovi
2026-06-02 11:32 ` [PATCH v5] gpiolib: acpi: prevent address truncation in OperationRegion handler Marco Scardovi
2026-06-02 11:45   ` Mika Westerberg
2026-06-02 11:59     ` Marco Scardovi
2026-06-02 12:15       ` Mika Westerberg [this message]
2026-06-03  8:25         ` Marco Scardovi

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=20260602121535.GC2990@black.igk.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=scardracs@disroot.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

all inboxes | Powered by JetHome®