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)
Wed, Jul 10, 11:55 AM
Unknown Object (File)
Wed, Jul 3, 9:31 PM
Unknown Object (File)
Mon, Jun 24, 6:11 AM
Unknown Object (File)
May 24 2024, 9:36 PM
Unknown Object (File)
May 24 2024, 9:36 PM
Unknown Object (File)
May 24 2024, 9:36 PM
Unknown Object (File)
May 24 2024, 9:33 PM
Unknown Object (File)
May 24 2024, 9:32 PM
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 Not Applicable
Unit
Tests Not Applicable

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
461

I guess this should probably be an error for !RF_OPTIONAL

sys/arm/arm/generic_timer.c
461

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