Skip to content

Commit a8dfe19

Browse files
author
Georgi Djakov
committed
interconnect: Add locking in icc_set_tag()
We must ensure that the tag is not changed while we aggregate the requests. Currently the icc_set_tag() is not using any locks and this may cause the values to be aggregated incorrectly. Fix this by acquiring the icc_lock while we set the tag. Link: https://lore.kernel.org/lkml/[email protected]/ Fixes: 127ab2c ("interconnect: Add support for path tags") Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Georgi Djakov <[email protected]>
1 parent 83c774f commit a8dfe19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/interconnect/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,12 @@ void icc_set_tag(struct icc_path *path, u32 tag)
405405
if (!path)
406406
return;
407407

408+
mutex_lock(&icc_lock);
409+
408410
for (i = 0; i < path->num_nodes; i++)
409411
path->reqs[i].tag = tag;
412+
413+
mutex_unlock(&icc_lock);
410414
}
411415
EXPORT_SYMBOL_GPL(icc_set_tag);
412416

0 commit comments

Comments
 (0)