Page MenuHomeFreeBSD

acpi_gpiobus: IoRestriction is only for type IO
AcceptedPublic

Authored by cperciva on Oct 29 2024, 5:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 1:47 AM
Unknown Object (File)
Thu, Dec 5, 6:04 AM
Unknown Object (File)
Nov 17 2024, 12:25 PM
Unknown Object (File)
Nov 8 2024, 11:24 AM
Unknown Object (File)
Nov 6 2024, 12:26 PM
Unknown Object (File)
Nov 2 2024, 6:44 AM
Unknown Object (File)
Oct 29 2024, 11:21 PM
F101444451: image.png
Oct 29 2024, 5:34 PM
Subscribers

Details

Reviewers
jrtc27
Summary

The IoRestriction field of ACPI_RESOURCE_GPIO is only meaningful
for resources of type ACPI_RESOURCE_GPIO_TYPE_IO.

Reported by: jrtc27

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60249
Build 57133: arc lint + arc unit

Event Timeline

Don't we need to set GPIO_PIN_INPUT for interrupts?

This revision is now accepted and ready to land.Oct 29 2024, 5:18 PM

Don't we need to set GPIO_PIN_INPUT for interrupts?

Depends what our framework is expecting I guess, but that would seem sensible to me.

Hmm, I don't actually see anything in the ACPI spec saying that IoRestriction only applies for ACPI_RESOURCE_GPIO_TYPE_IO. So I think we have three options here:

  1. Go ahead with this patch, on the basis of "this is what Linux does",
  2. Force GPIO_PIN_INPUT for ACPI_RESOURCE_GPIO_TYPE_INT on the basis of "if we're generating interrupts obviously it's an input", or
  3. Just parse the values we're given and hope they make sense.

@andrew, @jrtc27, any preference?

Hmm, I don't actually see anything in the ACPI spec saying that IoRestriction only applies for ACPI_RESOURCE_GPIO_TYPE_IO. So I think we have three options here:

  1. Go ahead with this patch, on the basis of "this is what Linux does",
  2. Force GPIO_PIN_INPUT for ACPI_RESOURCE_GPIO_TYPE_INT on the basis of "if we're generating interrupts obviously it's an input", or
  3. Just parse the values we're given and hope they make sense.

@andrew, @jrtc27, any preference?

This table in the link I posted above:

image.png (744×2 px, 191 KB)

Hmm, I don't actually see anything in the ACPI spec saying that IoRestriction only applies for ACPI_RESOURCE_GPIO_TYPE_IO. So I think we have three options here:

  1. Go ahead with this patch, on the basis of "this is what Linux does",
  2. Force GPIO_PIN_INPUT for ACPI_RESOURCE_GPIO_TYPE_INT on the basis of "if we're generating interrupts obviously it's an input", or
  3. Just parse the values we're given and hope they make sense.

@andrew, @jrtc27, any preference?

This table in the link I posted above:

image.png (744×2 px, 191 KB)

(Note that interrupts have a separate definition for byte 7, with some common fields, but the I/O Restriction bits are replaced by the Interrupt Mode and half the Interrupt Polarity)

This table in the link I posted above:

Aha, I didn't notice the text "for IO Connections" .