Kernel/aarch64: Reject ARMv8Timers with the "interrupt-names" property

Our current check `interrupts.size() != 4` doesn't always work because
timers with the "interrupt-names" property can define 4 timers at the
same indices mapping to different interrupts.

The old devicetree binding only allowed 4 interrupts, so keep the old
check as well.
This commit is contained in:
Sönke Holz 2024-12-14 19:00:41 +01:00
parent 98f26fac1b
commit 4cc9bea86d

View file

@ -101,7 +101,8 @@ DEVICETREE_DRIVER(ARMv8TimerDriver, compatibles_array);
ErrorOr<void> ARMv8TimerDriver::probe(DeviceTree::Device const& device, StringView) const
{
auto const interrupts = TRY(device.node().interrupts(DeviceTree::get()));
if (interrupts.size() != 4)
if (device.node().has_property("interrupt-names"sv) || interrupts.size() != 4)
return ENOTSUP; // TODO: Support the interrupt-names property.
// Index 1 is the interrupt for the EL1 physical timer. This driver currently only uses that timer.