mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
firmware: arm_scmi: Skip scmi mbox channel setup for addtional devices
Now that the scmi bus supports adding multiple devices per protocol, and since scmi_create_protocol_device calls scmi_mbox_chan_setup, we must avoid allocating and initialising the mbox channel if it is already initialised. Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
parent
ee7a9c9f67
commit
11040889af
1 changed files with 5 additions and 0 deletions
|
@ -735,6 +735,11 @@ static int scmi_mbox_chan_setup(struct scmi_info *info, struct device *dev,
|
||||||
idx = tx ? 0 : 1;
|
idx = tx ? 0 : 1;
|
||||||
idr = tx ? &info->tx_idr : &info->rx_idr;
|
idr = tx ? &info->tx_idr : &info->rx_idr;
|
||||||
|
|
||||||
|
/* check if already allocated, used for multiple device per protocol */
|
||||||
|
cinfo = idr_find(idr, prot_id);
|
||||||
|
if (cinfo)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (scmi_mailbox_check(np, idx)) {
|
if (scmi_mailbox_check(np, idx)) {
|
||||||
cinfo = idr_find(idr, SCMI_PROTOCOL_BASE);
|
cinfo = idr_find(idr, SCMI_PROTOCOL_BASE);
|
||||||
if (unlikely(!cinfo)) /* Possible only if platform has no Rx */
|
if (unlikely(!cinfo)) /* Possible only if platform has no Rx */
|
||||||
|
|
Loading…
Add table
Reference in a new issue