]> nv-tegra.nvidia Code Review - linux-3.10.git/commitdiff
video: tegra: host: Remove DEVICE_UNKNOWN
authorArto Merilainen <amerilainen@nvidia.com>
Mon, 9 Sep 2013 11:23:14 +0000 (14:23 +0300)
committerDan Willemsen <dwillemsen@nvidia.com>
Tue, 17 Sep 2013 00:41:36 +0000 (17:41 -0700)
nvhost scale profiles informed by DEVICE_UNKNOWN that the device
has not received idle/busy events since the last probe. This case
has never been used.

This patch replaces DEVICE_UNKNOWN by DEVICE_IDLE (on boot) and
keeps the current status untouched if nothing has changed.

Change-Id: I021d6ebf788ad9532cd25370ba30af32145aa148
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/272013
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/gk20a/gk20a_scale.c
drivers/video/tegra/host/gr3d/pod_scaling.c
drivers/video/tegra/host/nvhost_scale.c
include/linux/nvhost.h

index 307dffebf12d5aa240c7f90fe96b17d60bd6ebe1..3b51efadf33d32600cac4d9175de8582cc8efa26 100644 (file)
@@ -196,7 +196,6 @@ static int gk20a_scale_get_dev_status(struct device *dev,
        /* Finally, clear out the local values */
        profile->dev_stat.total_time = 0;
        profile->dev_stat.busy_time = 0;
-       profile->last_event_type = DEVICE_UNKNOWN;
 
        return 0;
 }
@@ -218,13 +217,13 @@ void nvhost_gk20a_scale_init(struct platform_device *pdev)
        if (!profile)
                return;
        profile->pdev = pdev;
-       profile->last_event_type = DEVICE_UNKNOWN;
+       profile->last_event_type = DEVICE_IDLE;
 
        /* Initialize devfreq related structures */
        profile->dev_stat.private_data = &profile->ext_stat;
        profile->ext_stat.min_freq = gk20a_clk_round_rate(g, 0);
        profile->ext_stat.max_freq = gk20a_clk_round_rate(g, UINT_MAX);
-       profile->ext_stat.busy = DEVICE_UNKNOWN;
+       profile->ext_stat.busy = DEVICE_IDLE;
 
        if (profile->ext_stat.min_freq == profile->ext_stat.max_freq) {
                dev_warn(&pdev->dev, "max rate = min rate (%lu), disabling scaling\n",
index 7134e9cda29538ca9f6308856a28e1cfb7c36a74..86328ce132219e3427a27e9aca057f2f841af157 100644 (file)
@@ -1016,10 +1016,6 @@ static int nvhost_pod_estimate_freq(struct devfreq *df,
                cancel_delayed_work(&podgov->idle_timer);
                *freq = scaling_state_check(df, now);
                break;
-       case DEVICE_UNKNOWN:
-               *freq = scaling_state_check(df, now);
-               break;
-
        }
 
        if (!(*freq) || (*freq == df->previous_freq))
index 2a5d09617972f19b5f35029c2dbd36b0134fa245..f73e8611d265b6470548ff0e7ac5fdb46c437533 100644 (file)
@@ -216,7 +216,6 @@ static int nvhost_scale_get_dev_status(struct device *dev,
        /* Finally, clear out the local values */
        profile->dev_stat.total_time = 0;
        profile->dev_stat.busy_time = 0;
-       profile->last_event_type = DEVICE_UNKNOWN;
 
        return 0;
 }
@@ -239,7 +238,7 @@ void nvhost_scale_init(struct platform_device *pdev)
        pdata->power_profile = profile;
        profile->pdev = pdev;
        profile->clk = pdata->clk[0];
-       profile->last_event_type = DEVICE_UNKNOWN;
+       profile->last_event_type = DEVICE_IDLE;
 
        /* Initialize devfreq related structures */
        profile->dev_stat.private_data = &profile->ext_stat;
@@ -247,7 +246,7 @@ void nvhost_scale_init(struct platform_device *pdev)
                clk_round_rate(clk_get_parent(profile->clk), 0);
        profile->ext_stat.max_freq =
                clk_round_rate(clk_get_parent(profile->clk), UINT_MAX);
-       profile->ext_stat.busy = DEVICE_UNKNOWN;
+       profile->ext_stat.busy = DEVICE_IDLE;
 
        if (profile->ext_stat.min_freq == profile->ext_stat.max_freq) {
                dev_warn(&pdev->dev, "max rate = min rate (%lu), disabling scaling\n",
index fe31bade1f6c8477521673ed2b6e53ca2770fe70..571248ff9ff286311a1167f4f2b1c2904383d807 100644 (file)
@@ -271,9 +271,8 @@ struct nvhost_device_data *nvhost_get_devdata(struct platform_device *pdev)
 }
 
 enum nvhost_devfreq_busy {
-       DEVICE_UNKNOWN = 0,
-       DEVICE_IDLE = 1,
-       DEVICE_BUSY = 2
+       DEVICE_IDLE = 0,
+       DEVICE_BUSY = 1
 };
 
 struct nvhost_devfreq_ext_stat {