Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd64180a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iommu: msm: Use GDSC property for power status check"

parents 06e459ae 2b9e38ac
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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.
@@ -129,6 +130,7 @@ struct msm_iommu_drvdata {
	unsigned int ctx_attach_count;
	unsigned int bus_client;
	int needs_rem_spinlock;
	int powered_on;
};

/**
+9 −3
Original line number Diff line number Diff line
@@ -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;
}
@@ -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)
@@ -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");
@@ -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");