diff options
| author | David Cemin <dcemin@nvidia.com> | 2026-10-20 15:09:01 -0700 |
|---|---|---|
| committer | Sudeep Holla <sudeep.holla@kernel.org> | 2026-10-21 14:08:29 +0100 |
| commit | 8ab2e426762d199ce8b799d029edafbfb981f5c6 (patch) | |
| tree | 96af609db3af55d02100a26d83f63e7f0bc131c1 /tools/perf/scripts/python | |
| parent | c03c1a14507dfaf8b856c2608f9ac216021fc222 (diff) | |
firmware: arm_ffa: Compare notify_id when looking up notifier callbacks
The notifier callbacks are kept in a hash table keyed by notification ID,
but struct notifier_cb_info does not store the ID and none of the lookup
helpers compare it. hash_for_each_possible() walks the whole bucket, so
any two IDs that hash to the same bucket are treated as the same
registration.
With the 64-bucket table, hash_32() maps IDs 2 and 36 to the same
bucket. A driver that requests notifications sequentially therefore
fails at the 37th request:
ARM FF-A: Failed to register callback for 36 - -22
because update_notifier_cb() finds the node registered for ID 2 and
rejects the new registration as a duplicate. The same lookup is used on
the delivery path, so a notification for a colliding ID can also be
dispatched to the callback registered for the other ID.
Store the notification ID in the node and compare it in all three
lookup helpers.
This was found on an arm64 laptop whose embedded controller partition
declares 38 notifications: the EC driver failed to probe and every
EC event (AC, battery, lid, hotkeys) was lost.
Fixes: e0573444edbf ("firmware: arm_ffa: Add interfaces to request notification callbacks")
Fixes: c10debfe7f02 ("firmware: arm_ffa: Add support for {un,}registration of framework notifications")
Signed-off-by: David Cemin <dcemin@nvidia.com>
Link: https://patch.msgid.link/20261020220902.611138-1-dcemin@nvidia.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
