summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Ruei <e-ruei1@ti.com>2018-10-18 01:05:37 +0300
committerAnand Balagopalakrishnan <anandb@ti.com>2018-11-16 12:28:55 +0300
commit76da7d73976f0a5dc04fdc84a3af899d6c2b1fe2 (patch)
treeb21f5894b37831814028a6fbb4cd022de8aaaaec
parentd2b3959738cfcc6209e8e882d1989de790866c8f (diff)
downloadomap5-sgx-ddk-linux-ti-img-sgx/1.14.3699939/k4.14.tar.xz
km: pvr_drm.c: move the assert_reset from DrmRemove to DrmUnloadti-img-sgx/1.14.3699939/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 33f6c3d..a9af82a 100644
--- a/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
+++ b/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
@@ -265,6 +265,13 @@ exit:
DRI_DRM_STATIC void
PVRSRVDrmUnload(struct drm_device *dev)
{
+#if (AM_VERSION != 5)
+ 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)
@@ -273,6 +280,15 @@ PVRSRVDrmUnload(struct drm_device *dev)
PVRCore_Cleanup();
+#if (AM_VERSION != 5)
+ 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
@@ -699,25 +715,10 @@ PVRSRVDrmProbe(struct platform_device *pDevice)
static int
PVRSRVDrmRemove(struct platform_device *pDevice)
{
-#if (AM_VERSION != 5)
- 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 != 5)
- 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);