mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
firewire: core: use spin lock specific to topology map
At present, the operation for read transaction to topology map register is not protected by any kind of lock primitives. This causes a potential problem to result in the mixed content of topology map. This commit adds and uses spin lock specific to topology map. Link: https://lore.kernel.org/r/20250915234747.915922-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
@@ -1196,7 +1196,11 @@ static void handle_topology_map(struct fw_card *card, struct fw_request *request
|
||||
}
|
||||
|
||||
start = (offset - topology_map_region.start) / 4;
|
||||
memcpy(payload, &card->topology_map[start], length);
|
||||
|
||||
// NOTE: This can be without irqsave when we can guarantee that fw_send_request() for local
|
||||
// destination never runs in any type of IRQ context.
|
||||
scoped_guard(spinlock_irqsave, &card->topology_map.lock)
|
||||
memcpy(payload, &card->topology_map.buffer[start], length);
|
||||
|
||||
fw_send_response(card, request, RCODE_COMPLETE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user