From cd30d2af63d20d7501a8a05a424382c4c8096abc Mon Sep 17 00:00:00 2001 From: Veera Vegivada Date: Sun, 17 Jan 2021 22:44:28 +0530 Subject: [PATCH] interconnect: qcom: Fix re-initializing the bcm Currently, qcom_icc_bcm_init always assumes the bcm is not initialized. There is a possibility that same bcm can belong to multiple providers and re-initing the bcm adds the same bcm multiple times to the nodes which are under the control of the bcm. Hence add condition to check for bcm inited. Change-Id: I3961963a6ef1a7b76d7ab708f648146fe1a30c99 Signed-off-by: Veera Vegivada --- drivers/interconnect/qcom/icc-rpmh.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c index eb521067de75..367b70810db5 100644 --- a/drivers/interconnect/qcom/icc-rpmh.c +++ b/drivers/interconnect/qcom/icc-rpmh.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * */ @@ -131,6 +131,10 @@ int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev) size_t data_count; int i; + /* BCM is already initialised*/ + if (bcm->addr) + return 0; + bcm->addr = cmd_db_read_addr(bcm->name); if (!bcm->addr) { dev_err(dev, "%s could not find RPMh address\n",