Loading arch/arm/mach-msm/include/mach/iommu.h +2 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ struct msm_iommu_bfb_settings { * @ctx_attach_count: Count of how many context are attached. * @bus_client : Bus client needed to vote for bus bandwidth. * @needs_rem_spinlock : 1 if remote spinlock is needed, 0 otherwise * @powered_on: Powered status of the IOMMU. 0 means powered off. * * A msm_iommu_drvdata holds the global driver data about a single piece * of an IOMMU hardware instance. Loading @@ -129,6 +130,7 @@ struct msm_iommu_drvdata { unsigned int ctx_attach_count; unsigned int bus_client; int needs_rem_spinlock; int powered_on; }; /** Loading drivers/iommu/msm_iommu-v1.c +9 −3 Original line number Diff line number Diff line Loading @@ -62,9 +62,13 @@ static int __enable_regulators(struct msm_iommu_drvdata *drvdata) if (drvdata->alt_gdsc) ret = regulator_enable(drvdata->alt_gdsc); if (ret) if (ret) { regulator_disable(drvdata->gdsc); goto fail; } } ++drvdata->powered_on; fail: return ret; } Loading @@ -76,6 +80,8 @@ static void __disable_regulators(struct msm_iommu_drvdata *drvdata) if (drvdata->gdsc) regulator_disable(drvdata->gdsc); --drvdata->powered_on; } static int apply_bus_vote(struct msm_iommu_drvdata *drvdata, unsigned int vote) Loading Loading @@ -1097,7 +1103,7 @@ irqreturn_t msm_iommu_global_fault_handler(int irq, void *dev_id) drvdata = dev_get_drvdata(&pdev->dev); BUG_ON(!drvdata); if (!drvdata->ctx_attach_count) { if (!drvdata->powered_on) { pr_err("Unexpected IOMMU global fault !!\n"); pr_err("name = %s\n", drvdata->name); pr_err("Power is OFF. Can't read global fault information\n"); Loading Loading @@ -1150,7 +1156,7 @@ irqreturn_t msm_iommu_fault_handler_v2(int irq, void *dev_id) ctx_drvdata = dev_get_drvdata(&pdev->dev); BUG_ON(!ctx_drvdata); if (!drvdata->ctx_attach_count) { if (!drvdata->powered_on) { pr_err("Unexpected IOMMU page fault!\n"); pr_err("name = %s\n", drvdata->name); pr_err("Power is OFF. Unable to read page fault information\n"); Loading Loading
arch/arm/mach-msm/include/mach/iommu.h +2 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ struct msm_iommu_bfb_settings { * @ctx_attach_count: Count of how many context are attached. * @bus_client : Bus client needed to vote for bus bandwidth. * @needs_rem_spinlock : 1 if remote spinlock is needed, 0 otherwise * @powered_on: Powered status of the IOMMU. 0 means powered off. * * A msm_iommu_drvdata holds the global driver data about a single piece * of an IOMMU hardware instance. Loading @@ -129,6 +130,7 @@ struct msm_iommu_drvdata { unsigned int ctx_attach_count; unsigned int bus_client; int needs_rem_spinlock; int powered_on; }; /** Loading
drivers/iommu/msm_iommu-v1.c +9 −3 Original line number Diff line number Diff line Loading @@ -62,9 +62,13 @@ static int __enable_regulators(struct msm_iommu_drvdata *drvdata) if (drvdata->alt_gdsc) ret = regulator_enable(drvdata->alt_gdsc); if (ret) if (ret) { regulator_disable(drvdata->gdsc); goto fail; } } ++drvdata->powered_on; fail: return ret; } Loading @@ -76,6 +80,8 @@ static void __disable_regulators(struct msm_iommu_drvdata *drvdata) if (drvdata->gdsc) regulator_disable(drvdata->gdsc); --drvdata->powered_on; } static int apply_bus_vote(struct msm_iommu_drvdata *drvdata, unsigned int vote) Loading Loading @@ -1097,7 +1103,7 @@ irqreturn_t msm_iommu_global_fault_handler(int irq, void *dev_id) drvdata = dev_get_drvdata(&pdev->dev); BUG_ON(!drvdata); if (!drvdata->ctx_attach_count) { if (!drvdata->powered_on) { pr_err("Unexpected IOMMU global fault !!\n"); pr_err("name = %s\n", drvdata->name); pr_err("Power is OFF. Can't read global fault information\n"); Loading Loading @@ -1150,7 +1156,7 @@ irqreturn_t msm_iommu_fault_handler_v2(int irq, void *dev_id) ctx_drvdata = dev_get_drvdata(&pdev->dev); BUG_ON(!ctx_drvdata); if (!drvdata->ctx_attach_count) { if (!drvdata->powered_on) { pr_err("Unexpected IOMMU page fault!\n"); pr_err("name = %s\n", drvdata->name); pr_err("Power is OFF. Unable to read page fault information\n"); Loading