Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acpi_gpiobus: assume GPIO_PIN_INPUT for interrupt pins #1558

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VexedUXR
Copy link
Contributor

Most drivers do nothing when neither GPIO_PIN_INPUT or GPIO_PIN_OUTPUT are set. However, some return EINVAL while others (bytgpio is the only example I could find of this) give bad flags to the GPIO controller.

In the case of bytgpio, it causes both the input and output of the GPIO pin to be disabled which the controller doesn't seem to like as it causes the entire machine to lose power shortly after.

To fix this, simply assume GPIO_PIN_INPUT for interrupt pins.

I'll CC everyone from the original revision where this change was suggested (see 0ffd7d4)

CC @zxombie @jrtc27 @cperciva

Different drivers respond differently to having neither GPIO_PIN_INPUT
or GPIO_PIN_OUTPUT set, this stops the unpredictable results.
Copy link
Member

@bsdimp bsdimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok

@jrtc27
Copy link
Contributor

jrtc27 commented Dec 19, 2024

Well what does Linux do for dodgy ACPI tables? We should follow whatever they do if we want the best chance of working.

@VexedUXR
Copy link
Contributor Author

VexedUXR commented Dec 19, 2024

They seem to be doing the same: https://github.com/torvalds/linux/blob/eabcdba/drivers/gpio/gpiolib-acpi.c#L292
(If that's what you mean)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants