summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Ruei <e-ruei1@ti.com>2019-01-17 22:42:05 +0300
committerAnand Balagopalakrishnan <anandb@ti.com>2019-02-28 16:27:11 +0300
commitc545bf1c937b6067d27b7a268093baa3b8091185 (patch)
tree9baacd8e7cc5c64993f912b1581ebc5b27a2988d
parent5f8570e190b37e534c9195728812190ec999c9d5 (diff)
downloadomap5-sgx-ddk-linux-ti-img-sgx/1.17.4948957/k4.14.tar.xz
km: pvr_drm.c: move the assert_reset from DrmRemove to DrmUnloadti-img-sgx/1.17.4948957/k4.14
The failure of SGX DDK kernel module removal has been observed during system shutdown and reboot on AM3/4 EVM since LTS2018. The root cause is that the SGX is put into reset state before the de-initialise operation starts. The function assert_reset() should be called after the PVRCore cleanup operation is completed at PVRSRVDrmUnload(). Note: The original code worked prior to LTS2018 because the kernel did not put SGX into reset when assert_reset() was invoked. Signed-off-by: Eric Ruei <e-ruei1@ti.com> Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
-rw-r--r--eurasia_km/services4/srvkm/env/linux/pvr_drm.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/eurasia_km/services4/srvkm/env/linux/pvr_drm.c b/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
index 4d8718c..5f3600e 100644
--- a/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
+++ b/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
@@ -269,6 +269,13 @@ exit:
DRI_DRM_STATIC void
PVRSRVDrmUnload(struct drm_device *dev)
{
+#if (AM_VERSION == 3) || (AM_VERSION == 4)
+ int ret;
+ struct device *pDev = dev->dev;
+ struct platform_device *pDevice = to_platform_device(pDev);
+ struct gfx_sgx_platform_data *pdata = pDev->platform_data;
+#endif
+
PVR_TRACE(("PVRSRVDrmUnload"));
#if defined(DISPLAY_CONTROLLER)
@@ -277,6 +284,15 @@ PVRSRVDrmUnload(struct drm_device *dev)
PVRCore_Cleanup();
+#if (AM_VERSION == 3) || (AM_VERSION == 4)
+ if (pdata && pdata->assert_reset) {
+ ret = pdata->assert_reset(pDevice, pdata->reset_name);
+ if (ret) {
+ dev_err(pDev, "Unable to reset SGX!\n");
+ }
+ }
+#endif
+
#if defined(PDUMP)
dbgdrv_cleanup();
#endif
@@ -727,25 +743,10 @@ PVRSRVDrmProbe(struct platform_device *pDevice)
static int
PVRSRVDrmRemove(struct platform_device *pDevice)
{
-#if (AM_VERSION == 3) || (AM_VERSION == 4)
- int ret;
- struct device *dev = &pDevice->dev;
- struct gfx_sgx_platform_data *pdata = dev->platform_data;
-#endif
struct drm_device *drm_dev = platform_get_drvdata(pDevice);
PVR_TRACE(("PVRSRVDrmRemove"));
-
-#if (AM_VERSION == 3) || (AM_VERSION == 4)
- if (pdata && pdata->assert_reset) {
- ret = pdata->assert_reset(pDevice, pdata->reset_name);
- if (ret) {
- dev_err(dev, "Unable to reset SGX!\n");
- }
- }
-#endif
-
drm_dev_unregister(drm_dev);
drm_dev_unref(drm_dev);