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 <pauli.nieminen@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
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) {