[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52769AEAFD33D2501B6571538C4C9@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Tue, 20 Sep 2022 06:15:21 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Nicolin Chen <nicolinc@...dia.com>,
"agross@...nel.org" <agross@...nel.org>,
"bjorn.andersson@...aro.org" <bjorn.andersson@...aro.org>,
"konrad.dybcio@...ainline.org" <konrad.dybcio@...ainline.org>,
"joro@...tes.org" <joro@...tes.org>,
"will@...nel.org" <will@...nel.org>,
"robin.murphy@....com" <robin.murphy@....com>,
"sricharan@...eaurora.org" <sricharan@...eaurora.org>
CC: "jgg@...dia.com" <jgg@...dia.com>,
"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 1/6] iommu/msm: Add missing __disable_clocks calls
> From: Nicolin Chen <nicolinc@...dia.com>
> Sent: Thursday, September 15, 2022 3:56 PM
>
> The clock is not symmetrically disabled in the error-out routines.
>
> Fixes: 109bd48ea2e1 ("iommu/msm: Add DT adaptation")
> Cc: stable@...r.kernel.org
> Cc: Sricharan R <sricharan@...eaurora.org>
> Cc: Andy Gross <agross@...nel.org>
> Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
> Cc: Konrad Dybcio <konrad.dybcio@...ainline.org>
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
> ---
> drivers/iommu/msm_iommu.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
> index 6a24aa804ea3..a7d41ba4a47b 100644
> --- a/drivers/iommu/msm_iommu.c
> +++ b/drivers/iommu/msm_iommu.c
> @@ -418,6 +418,7 @@ static int msm_iommu_attach_dev(struct
> iommu_domain *domain, struct device *dev)
> list_for_each_entry(master, &iommu->ctx_list, list) {
> if (master->num) {
> dev_err(dev, "domain already
> attached");
> + __disable_clocks(iommu);
> ret = -EEXIST;
> goto fail;
> }
> @@ -425,6 +426,7 @@ static int msm_iommu_attach_dev(struct
> iommu_domain *domain, struct device *dev)
> msm_iommu_alloc_ctx(iommu-
> >context_map,
> 0, iommu->ncb);
> if (IS_ERR_VALUE(master->num)) {
> + __disable_clocks(iommu);
also need to free_ctx() for already walked nodes.
btw it's a bit weird that although here is coded based on a list
in reality there is at most one node per list. According to
insert_iommu_master() a master object is allocated and inserted
to the ctx_list only if the ctx_list is currently empty...
> ret = -ENODEV;
> goto fail;
> }
> --
> 2.17.1
Powered by blists - more mailing lists