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

Commit 7d0f2b2c authored by Sagar Dharia's avatar Sagar Dharia
Browse files

slim: msm: ngd: Fix incorrect casting of slimbus context-bank devices



Slimbus controller's context-bank(CB) devices are created to
facilitate IOMMU mapping for respective slimbus controllers.
Calling the suspend/resume routines on CB-devices will result in
incorrect casting of these devices to controller devices leading to
a kernel-panic.
CB-devices for slimbus don't need to do anything in suspend/resume
since power management aspects are handled by controller devices.

Change-Id: Ib83ef58c2a8e212a74bb2b215345805ef3c032bd
Signed-off-by: default avatarSagar Dharia <sdharia@codeaurora.org>
parent 9cd18ff1
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -2074,8 +2074,13 @@ static int ngd_slim_suspend(struct device *dev)
{
	int ret = -EBUSY;
	struct platform_device *pdev = to_platform_device(dev);
	struct msm_slim_ctrl *cdev = platform_get_drvdata(pdev);
	struct msm_slim_ctrl *cdev;

	if (of_device_is_compatible(pdev->dev.of_node,
				    "qcom,iommu-slim-ctrl-cb"))
		return 0;

	cdev = platform_get_drvdata(pdev);
	if (!pm_runtime_enabled(dev) ||
		(!pm_runtime_suspended(dev) &&
			cdev->state == MSM_CTRL_IDLE)) {
@@ -2111,9 +2116,14 @@ static int ngd_slim_suspend(struct device *dev)
static int ngd_slim_resume(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct msm_slim_ctrl *cdev = platform_get_drvdata(pdev);
	struct msm_slim_ctrl *cdev;
	int ret = 0;

	if (of_device_is_compatible(pdev->dev.of_node,
				    "qcom,iommu-slim-ctrl-cb"))
		return 0;

	cdev = platform_get_drvdata(pdev);
	/*
	 * If deferred response was requested for power-off and it failed,
	 * mark runtime-pm status as active to be consistent