mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
firewire: core: use context analysis annotations and lockdep checks for topology map lock
The spinlock protects the topology map from concurrent access. Add context analysis annotations and lockdep checks for this lock. Link: https://lore.kernel.org/r/20261011063146.497455-6-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
parent
8540ec31c8
commit
c2b3fb6326
|
|
@ -474,9 +474,12 @@ static void update_topology_map(__be32 *buffer, size_t buffer_size, int root_nod
|
|||
|
||||
void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation,
|
||||
int self_id_count, u32 *self_ids, bool bm_abdicate)
|
||||
__must_not_hold(&card->topology_map.lock)
|
||||
{
|
||||
struct fw_node *local_node;
|
||||
|
||||
lockdep_assert_not_held(&card->topology_map.lock);
|
||||
|
||||
trace_bus_reset_handle(card->index, generation, node_id, bm_abdicate, self_ids, self_id_count);
|
||||
|
||||
scoped_guard(spinlock, &card->lock) {
|
||||
|
|
|
|||
|
|
@ -1290,9 +1290,12 @@ static void handle_topology_map(struct fw_card *card, struct fw_request *request
|
|||
int tcode, int destination, int source, int generation,
|
||||
unsigned long long offset, void *payload, size_t length,
|
||||
void *callback_data)
|
||||
__must_not_hold(&card->topology_map.lock)
|
||||
{
|
||||
int start;
|
||||
|
||||
lockdep_assert_not_held(&card->topology_map.lock);
|
||||
|
||||
if (!tcode_is_read_request(tcode)) {
|
||||
fw_send_response(card, request, RCODE_TYPE_ERROR);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ struct fw_card {
|
|||
u32 broadcast_channel;
|
||||
|
||||
struct {
|
||||
__be32 buffer[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
|
||||
__be32 buffer[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4] __guarded_by(&lock);
|
||||
spinlock_t lock;
|
||||
} topology_map;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user