Page MenuHomeFreeBSD

arm: generic_timer: use interrupt-names when available
ClosedPublic

Authored by kevans on Mar 5 2023, 12:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 5:13 PM
Unknown Object (File)
Oct 16 2024, 6:08 AM
Unknown Object (File)
Oct 16 2024, 6:08 AM
Unknown Object (File)
Sep 18 2024, 12:30 AM
Unknown Object (File)
Sep 7 2024, 9:24 PM
Unknown Object (File)
Sep 6 2024, 2:29 AM
Unknown Object (File)
Aug 13 2024, 4:46 AM
Unknown Object (File)
Aug 13 2024, 4:46 AM
Subscribers

Details

Summary

Offsets for all of thse can be a bit complicated as not all interrupts
will be present, only phys and virt are actually required, and sec-phys
could optionally be specified before phys. Push idx/name pairs into
a new config struct and maintain the old indices while still getting the
correct timers.

Diff Detail

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

Event Timeline

Tested only on my M1 Mac for the moment.

I'm not a fan of mixing FDT and ACPI code paths, although note we have already done so in this driver. Would it be difficult to create a new attach fuction for FDT that handles interrupt-names then calls arm_tmr_attach?

Split out acpi/fdt attach functions and allocate interrupts there

Assert that we have non-optional interrupts allocated in the common
arm_tmr_attach(). The ACPI path is more clearly basically unchanged with this
patch with its own device_attach, though we mark the secure physical timer as
optional for now to match the spec. We may remove it entirely for now until we
can effectively use it.

While we're here, clean up interrupt resources on error.

sys/arm/arm/generic_timer.c
449

I guess this should probably be an error for !RF_OPTIONAL

sys/arm/arm/generic_timer.c
449

Yes, I think it just needs if !RF_OPTIONAL goto out

  • Not finding a required interrupt in interrupt-names now errors out
  • Less verbose when we can't find optional interrupt-names, bootverbose to bring them back. A large number of platforms won't have hypervisor timers, so this would otherwise add at least two lines worth of noise for non-error scenarios.
This revision is now accepted and ready to land.Mar 10 2023, 4:40 PM