Skip to content

Commit 8c71c61

Browse files
ambarusJassi Brar
authored andcommitted
mailbox: don't protect of_parse_phandle_with_args with con_mutex
There are no concurrency problems if multiple consumers parse the phandle, don't gratuiously protect the parsing with the mutex used for the controllers list. Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
1 parent 24fdd50 commit 8c71c61

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/mailbox/mailbox.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,16 +413,15 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index)
413413
return ERR_PTR(-ENODEV);
414414
}
415415

416-
mutex_lock(&con_mutex);
417-
418416
ret = of_parse_phandle_with_args(dev->of_node, "mboxes", "#mbox-cells",
419417
index, &spec);
420418
if (ret) {
421419
dev_dbg(dev, "%s: can't parse \"mboxes\" property\n", __func__);
422-
mutex_unlock(&con_mutex);
423420
return ERR_PTR(ret);
424421
}
425422

423+
mutex_lock(&con_mutex);
424+
426425
chan = ERR_PTR(-EPROBE_DEFER);
427426
list_for_each_entry(mbox, &mbox_cons, node)
428427
if (mbox->dev->of_node == spec.np) {

0 commit comments

Comments
 (0)