Page MenuHomeFreeBSD

amdgpio, gpiobus: Add interrupt support for !INTRNG platforms
Needs ReviewPublic

Authored by rz_fabmicro.ru on Tue, Jun 30, 5:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 5, 4:30 AM
Unknown Object (File)
Sat, Jul 4, 6:37 AM
Unknown Object (File)
Fri, Jul 3, 6:42 AM
Unknown Object (File)
Fri, Jul 3, 6:33 AM
Unknown Object (File)
Thu, Jul 2, 11:48 AM
Unknown Object (File)
Thu, Jul 2, 11:48 AM
Unknown Object (File)
Thu, Jul 2, 11:48 AM
Unknown Object (File)
Thu, Jul 2, 11:48 AM
Subscribers

Details

Summary

This commit is based on work done by Andriy Gapon initially
submmitted in D26407 back in 2020. The idea was to add internal PIC
controller to serve GPIO interrupts to attached bus client (child),
new flag IE_BUS_PRIV is introduced to mark interrupts internal to the
bus. The code has been adopted to build with recent kernel source.

It was observed that after client event handler is removed (module
unloaded), a stray interrupt may appear because handler is scheduled
for execution one last time to let it remove itself. The sometimes
delayed handler then consequently calls to pre_ and post_ithread which
unmasks interrupts on no longer used GPIO pin.
A workaround added to prevent such stray interrupts, see extended
comment in gpiopic_remove_handler().

Test Plan

Tested on AMD Ryzen 5 based laptops: HP-15s and Lenovo Ideapad Gaming
with gpioaei.ko (Power Button connected to GPIO pin 0).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74420
Build 71303: arc lint + arc unit