From 8e11bdb5db2d61d540404a44e3042bd6e3c738c1 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Fri, 20 Jan 2012 14:59:36 +0200 Subject: [PATCH] HACK: gfx: drv: when resuming make sure power is on The PVR driver expects ospm_power_using_hw_begin to return only when power is already on. But at the moment that function will only call pm_runtime_get which is asynchronous. This can lead to the PVR driver accessing its HW registers before the HW is powered and cause a CPU fabric error hung. To work around this call the sync version of pm_runtime_get if we are not in atomic context. In fact I can't see any reason to call it atomically, since then power on can't be guaranteed on return anyway. But to clean up that we should check all call-sites for correctness. Jani Nikula is currently reworking ospm_power_using_hw_begin() and related parts that will give us a clean solution. Until that's done we'd like this hack applied to let us resolve other PM related issues that are currently hidden by this bug. Signed-off-by: Pauli Nieminen Signed-off-by: Imre Deak Acked-by: Jani Nikula Signed-off-by: Kirill A. Shutemov --- drivers/staging/mrst/drv/psb_powermgmt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/mrst/drv/psb_powermgmt.c b/drivers/staging/mrst/drv/psb_powermgmt.c index 7923d50..6628b4b 100644 --- a/drivers/staging/mrst/drv/psb_powermgmt.c +++ b/drivers/staging/mrst/drv/psb_powermgmt.c @@ -1598,7 +1598,10 @@ bool ospm_power_using_hw_begin(int hw_island, UHBUsage usage) IMG_UINT32 deviceID = 0; bool force_on = usage ? true : false; - pm_runtime_get(&drm_dev->pdev->dev); + if (b_atomic) + pm_runtime_get(&drm_dev->pdev->dev); + else + pm_runtime_get_sync(&drm_dev->pdev->dev); /*quick path, not 100% race safe, but should be enough comapre to current other code in this file */ if (!force_on) { -- 2.7.4