]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
accel/ivpu: Move set autosuspend delay to HW specific code
authorKrystian Pradzynski <krystian.pradzynski@linux.intel.com>
Fri, 1 Sep 2023 09:49:47 +0000 (11:49 +0200)
committerStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Mon, 4 Sep 2023 09:01:26 +0000 (11:01 +0200)
Configure autosuspend values per HW generation and per platform.

For non silicon platforms disable autosuspend for now, for silicon
reduce it to 10 ms.

Signed-off-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-2-stanislaw.gruszka@linux.intel.com
drivers/accel/ivpu/ivpu_drv.h
drivers/accel/ivpu/ivpu_hw_37xx.c
drivers/accel/ivpu/ivpu_hw_40xx.c
drivers/accel/ivpu/ivpu_pm.c

index 9e8c075fe9ef15c447a6705ae5845d9a7792bd2f..44d857094bbce31ec25ed5f01e475e99269c0cd5 100644 (file)
@@ -117,6 +117,7 @@ struct ivpu_device {
                int jsm;
                int tdr;
                int reschedule_suspend;
+               int autosuspend;
        } timeout;
 };
 
index 9eae1c241bc0e51f86b394b7aabb05e7936a59aa..1090c91e1ba34eeebd4ec73b39d55408bfe6cad5 100644 (file)
@@ -113,11 +113,13 @@ static void ivpu_hw_timeouts_init(struct ivpu_device *vdev)
                vdev->timeout.jsm = 50000;
                vdev->timeout.tdr = 2000000;
                vdev->timeout.reschedule_suspend = 1000;
+               vdev->timeout.autosuspend = -1;
        } else {
                vdev->timeout.boot = 1000;
                vdev->timeout.jsm = 500;
                vdev->timeout.tdr = 2000;
                vdev->timeout.reschedule_suspend = 10;
+               vdev->timeout.autosuspend = 10;
        }
 }
 
index 34626d66fa10284263435dda3c62866ce6853d55..09ba07443396c45db970a8d07884cc9b31e4ec9d 100644 (file)
@@ -135,16 +135,19 @@ static void ivpu_hw_timeouts_init(struct ivpu_device *vdev)
                vdev->timeout.jsm = 50000;
                vdev->timeout.tdr = 2000000;
                vdev->timeout.reschedule_suspend = 1000;
+               vdev->timeout.autosuspend = -1;
        } else if (ivpu_is_simics(vdev)) {
                vdev->timeout.boot = 50;
                vdev->timeout.jsm = 500;
                vdev->timeout.tdr = 10000;
                vdev->timeout.reschedule_suspend = 10;
+               vdev->timeout.autosuspend = -1;
        } else {
                vdev->timeout.boot = 1000;
                vdev->timeout.jsm = 500;
                vdev->timeout.tdr = 2000;
                vdev->timeout.reschedule_suspend = 10;
+               vdev->timeout.autosuspend = 10;
        }
 }
 
index e6f27daf5560b691a8483ff7963f89aa69dbea65..954c9ecd3e1464157d385d855e9f8f4d50a38a91 100644 (file)
@@ -286,6 +286,7 @@ int ivpu_pm_init(struct ivpu_device *vdev)
 {
        struct device *dev = vdev->drm.dev;
        struct ivpu_pm_info *pm = vdev->pm;
+       int delay;
 
        pm->vdev = vdev;
        pm->suspend_reschedule_counter = PM_RESCHEDULE_LIMIT;
@@ -293,14 +294,15 @@ int ivpu_pm_init(struct ivpu_device *vdev)
        atomic_set(&pm->in_reset, 0);
        INIT_WORK(&pm->recovery_work, ivpu_pm_recovery_work);
 
-       pm_runtime_use_autosuspend(dev);
-
        if (ivpu_disable_recovery)
-               pm_runtime_set_autosuspend_delay(dev, -1);
-       else if (ivpu_is_silicon(vdev))
-               pm_runtime_set_autosuspend_delay(dev, 100);
+               delay = -1;
        else
-               pm_runtime_set_autosuspend_delay(dev, 60000);
+               delay = vdev->timeout.autosuspend;
+
+       pm_runtime_use_autosuspend(dev);
+       pm_runtime_set_autosuspend_delay(dev, delay);
+
+       ivpu_dbg(vdev, PM, "Autosuspend delay = %d\n", delay);
 
        return 0;
 }