diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2014-05-07 06:09:36 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:09:48 -0400 |
commit | 66bb831f44312b8490470e3ea4fee2947167bc7f (patch) | |
tree | 635e4d474503f5621fd04e4f7ec87de6e3c6f518 /drivers/gpu/nvgpu | |
parent | 69f5a5718b6a5d9dd30dea5c2d31bfdf1d3fca71 (diff) |
gpu: nvgpu: Register as subdomain of host1x
Add gk20a as a sub power domain of host1x. This enforces keeping
host1x on when using gk20a.
Bug 200003112
Change-Id: I08db595bc7b819d86d33fb98af0d8fb4de369463
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/407006
(cherry picked from commit 009812b3e510518740e9c7e89b8b8b80439fe26a)
Reviewed-on: http://git-master/r/408013
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/as_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 48 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 52 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 2 |
8 files changed, 48 insertions, 72 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c index ea0fb8f5..42fa2167 100644 --- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c | |||
@@ -231,7 +231,7 @@ long gk20a_as_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
231 | return -EFAULT; | 231 | return -EFAULT; |
232 | } | 232 | } |
233 | 233 | ||
234 | err = gk20a_channel_busy(g->dev); | 234 | err = gk20a_busy(g->dev); |
235 | if (err) | 235 | if (err) |
236 | return err; | 236 | return err; |
237 | 237 | ||
@@ -288,7 +288,7 @@ long gk20a_as_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
288 | break; | 288 | break; |
289 | } | 289 | } |
290 | 290 | ||
291 | gk20a_channel_idle(g->dev); | 291 | gk20a_idle(g->dev); |
292 | 292 | ||
293 | if ((err == 0) && (_IOC_DIR(cmd) & _IOC_READ)) | 293 | if ((err == 0) && (_IOC_DIR(cmd) & _IOC_READ)) |
294 | err = copy_to_user((void __user *)arg, buf, _IOC_SIZE(cmd)); | 294 | err = copy_to_user((void __user *)arg, buf, _IOC_SIZE(cmd)); |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 60f7d4e3..344223ae 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -697,14 +697,14 @@ int gk20a_channel_release(struct inode *inode, struct file *filp) | |||
697 | 697 | ||
698 | trace_gk20a_channel_release(dev_name(&g->dev->dev)); | 698 | trace_gk20a_channel_release(dev_name(&g->dev->dev)); |
699 | 699 | ||
700 | err = gk20a_channel_busy(ch->g->dev); | 700 | err = gk20a_busy(ch->g->dev); |
701 | if (err) { | 701 | if (err) { |
702 | gk20a_err(dev_from_gk20a(g), "failed to release channel %d", | 702 | gk20a_err(dev_from_gk20a(g), "failed to release channel %d", |
703 | ch->hw_chid); | 703 | ch->hw_chid); |
704 | return err; | 704 | return err; |
705 | } | 705 | } |
706 | gk20a_free_channel(ch, true); | 706 | gk20a_free_channel(ch, true); |
707 | gk20a_channel_idle(ch->g->dev); | 707 | gk20a_idle(ch->g->dev); |
708 | 708 | ||
709 | gk20a_put_client(g); | 709 | gk20a_put_client(g); |
710 | filp->private_data = NULL; | 710 | filp->private_data = NULL; |
@@ -767,14 +767,14 @@ static int __gk20a_channel_open(struct gk20a *g, struct file *filp) | |||
767 | return err; | 767 | return err; |
768 | } | 768 | } |
769 | 769 | ||
770 | err = gk20a_channel_busy(g->dev); | 770 | err = gk20a_busy(g->dev); |
771 | if (err) { | 771 | if (err) { |
772 | gk20a_put_client(g); | 772 | gk20a_put_client(g); |
773 | gk20a_err(dev_from_gk20a(g), "failed to power on, %d", err); | 773 | gk20a_err(dev_from_gk20a(g), "failed to power on, %d", err); |
774 | return err; | 774 | return err; |
775 | } | 775 | } |
776 | ch = gk20a_open_new_channel(g); | 776 | ch = gk20a_open_new_channel(g); |
777 | gk20a_channel_idle(g->dev); | 777 | gk20a_idle(g->dev); |
778 | if (!ch) { | 778 | if (!ch) { |
779 | gk20a_put_client(g); | 779 | gk20a_put_client(g); |
780 | gk20a_err(dev_from_gk20a(g), | 780 | gk20a_err(dev_from_gk20a(g), |
@@ -1417,7 +1417,7 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) | |||
1417 | 1417 | ||
1418 | list_del_init(&job->list); | 1418 | list_del_init(&job->list); |
1419 | kfree(job); | 1419 | kfree(job); |
1420 | gk20a_channel_idle(g->dev); | 1420 | gk20a_idle(g->dev); |
1421 | } | 1421 | } |
1422 | 1422 | ||
1423 | /* | 1423 | /* |
@@ -1436,7 +1436,7 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) | |||
1436 | mutex_unlock(&c->submit_lock); | 1436 | mutex_unlock(&c->submit_lock); |
1437 | 1437 | ||
1438 | for (i = 0; i < nr_completed; i++) | 1438 | for (i = 0; i < nr_completed; i++) |
1439 | gk20a_channel_idle(c->g->dev); | 1439 | gk20a_idle(c->g->dev); |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | void add_wait_cmd(u32 *ptr, u32 id, u32 thresh) | 1442 | void add_wait_cmd(u32 *ptr, u32 id, u32 thresh) |
@@ -1484,7 +1484,7 @@ static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
1484 | gk20a_dbg_info("channel %d", c->hw_chid); | 1484 | gk20a_dbg_info("channel %d", c->hw_chid); |
1485 | 1485 | ||
1486 | /* gk20a_channel_update releases this ref. */ | 1486 | /* gk20a_channel_update releases this ref. */ |
1487 | err = gk20a_channel_busy(g->dev); | 1487 | err = gk20a_busy(g->dev); |
1488 | if (err) { | 1488 | if (err) { |
1489 | gk20a_err(d, "failed to host gk20a to submit gpfifo"); | 1489 | gk20a_err(d, "failed to host gk20a to submit gpfifo"); |
1490 | return err; | 1490 | return err; |
@@ -1645,7 +1645,7 @@ clean_up: | |||
1645 | gk20a_err(d, "fail"); | 1645 | gk20a_err(d, "fail"); |
1646 | free_priv_cmdbuf(c, wait_cmd); | 1646 | free_priv_cmdbuf(c, wait_cmd); |
1647 | free_priv_cmdbuf(c, incr_cmd); | 1647 | free_priv_cmdbuf(c, incr_cmd); |
1648 | gk20a_channel_idle(g->dev); | 1648 | gk20a_idle(g->dev); |
1649 | return err; | 1649 | return err; |
1650 | } | 1650 | } |
1651 | 1651 | ||
@@ -2079,7 +2079,7 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2079 | case NVHOST_IOCTL_CHANNEL_SET_NVMAP_FD: | 2079 | case NVHOST_IOCTL_CHANNEL_SET_NVMAP_FD: |
2080 | break; | 2080 | break; |
2081 | case NVHOST_IOCTL_CHANNEL_ALLOC_OBJ_CTX: | 2081 | case NVHOST_IOCTL_CHANNEL_ALLOC_OBJ_CTX: |
2082 | err = gk20a_channel_busy(dev); | 2082 | err = gk20a_busy(dev); |
2083 | if (err) { | 2083 | if (err) { |
2084 | dev_err(&dev->dev, | 2084 | dev_err(&dev->dev, |
2085 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | 2085 | "%s: failed to host gk20a for ioctl cmd: 0x%x", |
@@ -2088,10 +2088,10 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2088 | } | 2088 | } |
2089 | err = gk20a_alloc_obj_ctx(ch, | 2089 | err = gk20a_alloc_obj_ctx(ch, |
2090 | (struct nvhost_alloc_obj_ctx_args *)buf); | 2090 | (struct nvhost_alloc_obj_ctx_args *)buf); |
2091 | gk20a_channel_idle(dev); | 2091 | gk20a_idle(dev); |
2092 | break; | 2092 | break; |
2093 | case NVHOST_IOCTL_CHANNEL_FREE_OBJ_CTX: | 2093 | case NVHOST_IOCTL_CHANNEL_FREE_OBJ_CTX: |
2094 | err = gk20a_channel_busy(dev); | 2094 | err = gk20a_busy(dev); |
2095 | if (err) { | 2095 | if (err) { |
2096 | dev_err(&dev->dev, | 2096 | dev_err(&dev->dev, |
2097 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | 2097 | "%s: failed to host gk20a for ioctl cmd: 0x%x", |
@@ -2100,10 +2100,10 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2100 | } | 2100 | } |
2101 | err = gk20a_free_obj_ctx(ch, | 2101 | err = gk20a_free_obj_ctx(ch, |
2102 | (struct nvhost_free_obj_ctx_args *)buf); | 2102 | (struct nvhost_free_obj_ctx_args *)buf); |
2103 | gk20a_channel_idle(dev); | 2103 | gk20a_idle(dev); |
2104 | break; | 2104 | break; |
2105 | case NVHOST_IOCTL_CHANNEL_ALLOC_GPFIFO: | 2105 | case NVHOST_IOCTL_CHANNEL_ALLOC_GPFIFO: |
2106 | err = gk20a_channel_busy(dev); | 2106 | err = gk20a_busy(dev); |
2107 | if (err) { | 2107 | if (err) { |
2108 | dev_err(&dev->dev, | 2108 | dev_err(&dev->dev, |
2109 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | 2109 | "%s: failed to host gk20a for ioctl cmd: 0x%x", |
@@ -2112,14 +2112,14 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2112 | } | 2112 | } |
2113 | err = gk20a_alloc_channel_gpfifo(ch, | 2113 | err = gk20a_alloc_channel_gpfifo(ch, |
2114 | (struct nvhost_alloc_gpfifo_args *)buf); | 2114 | (struct nvhost_alloc_gpfifo_args *)buf); |
2115 | gk20a_channel_idle(dev); | 2115 | gk20a_idle(dev); |
2116 | break; | 2116 | break; |
2117 | case NVHOST_IOCTL_CHANNEL_SUBMIT_GPFIFO: | 2117 | case NVHOST_IOCTL_CHANNEL_SUBMIT_GPFIFO: |
2118 | err = gk20a_ioctl_channel_submit_gpfifo(ch, | 2118 | err = gk20a_ioctl_channel_submit_gpfifo(ch, |
2119 | (struct nvhost_submit_gpfifo_args *)buf); | 2119 | (struct nvhost_submit_gpfifo_args *)buf); |
2120 | break; | 2120 | break; |
2121 | case NVHOST_IOCTL_CHANNEL_WAIT: | 2121 | case NVHOST_IOCTL_CHANNEL_WAIT: |
2122 | err = gk20a_channel_busy(dev); | 2122 | err = gk20a_busy(dev); |
2123 | if (err) { | 2123 | if (err) { |
2124 | dev_err(&dev->dev, | 2124 | dev_err(&dev->dev, |
2125 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | 2125 | "%s: failed to host gk20a for ioctl cmd: 0x%x", |
@@ -2128,10 +2128,10 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2128 | } | 2128 | } |
2129 | err = gk20a_channel_wait(ch, | 2129 | err = gk20a_channel_wait(ch, |
2130 | (struct nvhost_wait_args *)buf); | 2130 | (struct nvhost_wait_args *)buf); |
2131 | gk20a_channel_idle(dev); | 2131 | gk20a_idle(dev); |
2132 | break; | 2132 | break; |
2133 | case NVHOST_IOCTL_CHANNEL_ZCULL_BIND: | 2133 | case NVHOST_IOCTL_CHANNEL_ZCULL_BIND: |
2134 | err = gk20a_channel_busy(dev); | 2134 | err = gk20a_busy(dev); |
2135 | if (err) { | 2135 | if (err) { |
2136 | dev_err(&dev->dev, | 2136 | dev_err(&dev->dev, |
2137 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | 2137 | "%s: failed to host gk20a for ioctl cmd: 0x%x", |
@@ -2140,10 +2140,10 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2140 | } | 2140 | } |
2141 | err = gk20a_channel_zcull_bind(ch, | 2141 | err = gk20a_channel_zcull_bind(ch, |
2142 | (struct nvhost_zcull_bind_args *)buf); | 2142 | (struct nvhost_zcull_bind_args *)buf); |
2143 | gk20a_channel_idle(dev); | 2143 | gk20a_idle(dev); |
2144 | break; | 2144 | break; |
2145 | case NVHOST_IOCTL_CHANNEL_SET_ERROR_NOTIFIER: | 2145 | case NVHOST_IOCTL_CHANNEL_SET_ERROR_NOTIFIER: |
2146 | err = gk20a_channel_busy(dev); | 2146 | err = gk20a_busy(dev); |
2147 | if (err) { | 2147 | if (err) { |
2148 | dev_err(&dev->dev, | 2148 | dev_err(&dev->dev, |
2149 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | 2149 | "%s: failed to host gk20a for ioctl cmd: 0x%x", |
@@ -2152,11 +2152,11 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2152 | } | 2152 | } |
2153 | err = gk20a_init_error_notifier(ch, | 2153 | err = gk20a_init_error_notifier(ch, |
2154 | (struct nvhost_set_error_notifier *)buf); | 2154 | (struct nvhost_set_error_notifier *)buf); |
2155 | gk20a_channel_idle(dev); | 2155 | gk20a_idle(dev); |
2156 | break; | 2156 | break; |
2157 | #ifdef CONFIG_GK20A_CYCLE_STATS | 2157 | #ifdef CONFIG_GK20A_CYCLE_STATS |
2158 | case NVHOST_IOCTL_CHANNEL_CYCLE_STATS: | 2158 | case NVHOST_IOCTL_CHANNEL_CYCLE_STATS: |
2159 | err = gk20a_channel_busy(dev); | 2159 | err = gk20a_busy(dev); |
2160 | if (err) { | 2160 | if (err) { |
2161 | dev_err(&dev->dev, | 2161 | dev_err(&dev->dev, |
2162 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | 2162 | "%s: failed to host gk20a for ioctl cmd: 0x%x", |
@@ -2165,7 +2165,7 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2165 | } | 2165 | } |
2166 | err = gk20a_channel_cycle_stats(ch, | 2166 | err = gk20a_channel_cycle_stats(ch, |
2167 | (struct nvhost_cycle_stats_args *)buf); | 2167 | (struct nvhost_cycle_stats_args *)buf); |
2168 | gk20a_channel_idle(dev); | 2168 | gk20a_idle(dev); |
2169 | break; | 2169 | break; |
2170 | #endif | 2170 | #endif |
2171 | case NVHOST_IOCTL_CHANNEL_SET_TIMEOUT: | 2171 | case NVHOST_IOCTL_CHANNEL_SET_TIMEOUT: |
@@ -2195,7 +2195,7 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2195 | ch->has_timedout; | 2195 | ch->has_timedout; |
2196 | break; | 2196 | break; |
2197 | case NVHOST_IOCTL_CHANNEL_SET_PRIORITY: | 2197 | case NVHOST_IOCTL_CHANNEL_SET_PRIORITY: |
2198 | err = gk20a_channel_busy(dev); | 2198 | err = gk20a_busy(dev); |
2199 | if (err) { | 2199 | if (err) { |
2200 | dev_err(&dev->dev, | 2200 | dev_err(&dev->dev, |
2201 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | 2201 | "%s: failed to host gk20a for ioctl cmd: 0x%x", |
@@ -2204,7 +2204,7 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2204 | } | 2204 | } |
2205 | gk20a_channel_set_priority(ch, | 2205 | gk20a_channel_set_priority(ch, |
2206 | ((struct nvhost_set_priority_args *)buf)->priority); | 2206 | ((struct nvhost_set_priority_args *)buf)->priority); |
2207 | gk20a_channel_idle(dev); | 2207 | gk20a_idle(dev); |
2208 | break; | 2208 | break; |
2209 | default: | 2209 | default: |
2210 | dev_err(&dev->dev, "unrecognized ioctl cmd: 0x%x", cmd); | 2210 | dev_err(&dev->dev, "unrecognized ioctl cmd: 0x%x", cmd); |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index dd93fb4a..55ee5181 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -227,14 +227,14 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s, | |||
227 | 227 | ||
228 | if (register_irq) { | 228 | if (register_irq) { |
229 | /* nvhost action_gpfifo_submit_complete releases this ref. */ | 229 | /* nvhost action_gpfifo_submit_complete releases this ref. */ |
230 | err = gk20a_channel_busy(c->g->dev); | 230 | err = gk20a_busy(c->g->dev); |
231 | 231 | ||
232 | if (!err) { | 232 | if (!err) { |
233 | err = nvhost_intr_register_notifier(sp->host1x_pdev, | 233 | err = nvhost_intr_register_notifier(sp->host1x_pdev, |
234 | sp->id, thresh, | 234 | sp->id, thresh, |
235 | gk20a_channel_syncpt_update, c); | 235 | gk20a_channel_syncpt_update, c); |
236 | if (err) | 236 | if (err) |
237 | gk20a_channel_idle(c->g->dev); | 237 | gk20a_idle(c->g->dev); |
238 | } | 238 | } |
239 | 239 | ||
240 | /* Adding interrupt action should never fail. A proper error | 240 | /* Adding interrupt action should never fail. A proper error |
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index 9fe1729f..77806a5e 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |||
@@ -573,7 +573,7 @@ static int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, | |||
573 | 573 | ||
574 | gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "module busy"); | 574 | gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "module busy"); |
575 | gk20a_busy(g->dev); | 575 | gk20a_busy(g->dev); |
576 | err = gk20a_channel_busy(dbg_s->pdev); | 576 | err = gk20a_busy(dbg_s->pdev); |
577 | if (err) | 577 | if (err) |
578 | return -EPERM; | 578 | return -EPERM; |
579 | 579 | ||
@@ -618,7 +618,7 @@ static int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, | |||
618 | gk20a_pmu_enable_elpg(g); | 618 | gk20a_pmu_enable_elpg(g); |
619 | 619 | ||
620 | gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "module idle"); | 620 | gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "module idle"); |
621 | gk20a_channel_idle(dbg_s->pdev); | 621 | gk20a_idle(dbg_s->pdev); |
622 | gk20a_idle(g->dev); | 622 | gk20a_idle(g->dev); |
623 | } | 623 | } |
624 | 624 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 3fa4f0c6..0c6b1e5f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -740,10 +740,10 @@ void gk20a_put_client(struct gk20a *g) | |||
740 | WARN_ON(g->client_refcount < 0); | 740 | WARN_ON(g->client_refcount < 0); |
741 | } | 741 | } |
742 | 742 | ||
743 | static int gk20a_pm_prepare_poweroff(struct device *_dev) | 743 | static int gk20a_pm_prepare_poweroff(struct device *dev) |
744 | { | 744 | { |
745 | struct platform_device *dev = to_platform_device(_dev); | 745 | struct platform_device *pdev = to_platform_device(dev); |
746 | struct gk20a *g = get_gk20a(dev); | 746 | struct gk20a *g = get_gk20a(pdev); |
747 | int ret = 0; | 747 | int ret = 0; |
748 | 748 | ||
749 | gk20a_dbg_fn(""); | 749 | gk20a_dbg_fn(""); |
@@ -770,6 +770,7 @@ static int gk20a_pm_prepare_poweroff(struct device *_dev) | |||
770 | 770 | ||
771 | /* Disable GPCPLL */ | 771 | /* Disable GPCPLL */ |
772 | ret |= gk20a_suspend_clk_support(g); | 772 | ret |= gk20a_suspend_clk_support(g); |
773 | |||
773 | g->power_on = false; | 774 | g->power_on = false; |
774 | 775 | ||
775 | return ret; | 776 | return ret; |
@@ -793,10 +794,10 @@ static void gk20a_detect_chip(struct gk20a *g) | |||
793 | g->gpu_characteristics.rev); | 794 | g->gpu_characteristics.rev); |
794 | } | 795 | } |
795 | 796 | ||
796 | static int gk20a_pm_finalize_poweron(struct device *_dev) | 797 | static int gk20a_pm_finalize_poweron(struct device *dev) |
797 | { | 798 | { |
798 | struct platform_device *dev = to_platform_device(_dev); | 799 | struct platform_device *pdev = to_platform_device(dev); |
799 | struct gk20a *g = get_gk20a(dev); | 800 | struct gk20a *g = get_gk20a(pdev); |
800 | int err, nice_value; | 801 | int err, nice_value; |
801 | 802 | ||
802 | gk20a_dbg_fn(""); | 803 | gk20a_dbg_fn(""); |
@@ -849,7 +850,7 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) | |||
849 | saving features (blcg/slcg) are enabled. For now, do it here. */ | 850 | saving features (blcg/slcg) are enabled. For now, do it here. */ |
850 | err = gk20a_init_clk_support(g); | 851 | err = gk20a_init_clk_support(g); |
851 | if (err) { | 852 | if (err) { |
852 | gk20a_err(&dev->dev, "failed to init gk20a clk"); | 853 | gk20a_err(dev, "failed to init gk20a clk"); |
853 | goto done; | 854 | goto done; |
854 | } | 855 | } |
855 | 856 | ||
@@ -868,7 +869,7 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) | |||
868 | 869 | ||
869 | err = gk20a_init_fifo_reset_enable_hw(g); | 870 | err = gk20a_init_fifo_reset_enable_hw(g); |
870 | if (err) { | 871 | if (err) { |
871 | gk20a_err(&dev->dev, "failed to reset gk20a fifo"); | 872 | gk20a_err(dev, "failed to reset gk20a fifo"); |
872 | goto done; | 873 | goto done; |
873 | } | 874 | } |
874 | 875 | ||
@@ -877,43 +878,43 @@ static int gk20a_pm_finalize_poweron(struct device *_dev) | |||
877 | 878 | ||
878 | err = gk20a_init_mm_support(g); | 879 | err = gk20a_init_mm_support(g); |
879 | if (err) { | 880 | if (err) { |
880 | gk20a_err(&dev->dev, "failed to init gk20a mm"); | 881 | gk20a_err(dev, "failed to init gk20a mm"); |
881 | goto done; | 882 | goto done; |
882 | } | 883 | } |
883 | 884 | ||
884 | err = gk20a_init_pmu_support(g); | 885 | err = gk20a_init_pmu_support(g); |
885 | if (err) { | 886 | if (err) { |
886 | gk20a_err(&dev->dev, "failed to init gk20a pmu"); | 887 | gk20a_err(dev, "failed to init gk20a pmu"); |
887 | goto done; | 888 | goto done; |
888 | } | 889 | } |
889 | 890 | ||
890 | err = gk20a_init_fifo_support(g); | 891 | err = gk20a_init_fifo_support(g); |
891 | if (err) { | 892 | if (err) { |
892 | gk20a_err(&dev->dev, "failed to init gk20a fifo"); | 893 | gk20a_err(dev, "failed to init gk20a fifo"); |
893 | goto done; | 894 | goto done; |
894 | } | 895 | } |
895 | 896 | ||
896 | err = gk20a_init_gr_support(g); | 897 | err = gk20a_init_gr_support(g); |
897 | if (err) { | 898 | if (err) { |
898 | gk20a_err(&dev->dev, "failed to init gk20a gr"); | 899 | gk20a_err(dev, "failed to init gk20a gr"); |
899 | goto done; | 900 | goto done; |
900 | } | 901 | } |
901 | 902 | ||
902 | err = gk20a_init_pmu_setup_hw2(g); | 903 | err = gk20a_init_pmu_setup_hw2(g); |
903 | if (err) { | 904 | if (err) { |
904 | gk20a_err(&dev->dev, "failed to init gk20a pmu_hw2"); | 905 | gk20a_err(dev, "failed to init gk20a pmu_hw2"); |
905 | goto done; | 906 | goto done; |
906 | } | 907 | } |
907 | 908 | ||
908 | err = gk20a_init_therm_support(g); | 909 | err = gk20a_init_therm_support(g); |
909 | if (err) { | 910 | if (err) { |
910 | gk20a_err(&dev->dev, "failed to init gk20a therm"); | 911 | gk20a_err(dev, "failed to init gk20a therm"); |
911 | goto done; | 912 | goto done; |
912 | } | 913 | } |
913 | 914 | ||
914 | err = gk20a_init_gpu_characteristics(g); | 915 | err = gk20a_init_gpu_characteristics(g); |
915 | if (err) { | 916 | if (err) { |
916 | gk20a_err(&dev->dev, "failed to init gk20a gpu characteristics"); | 917 | gk20a_err(dev, "failed to init gk20a gpu characteristics"); |
917 | goto done; | 918 | goto done; |
918 | } | 919 | } |
919 | 920 | ||
@@ -1540,27 +1541,6 @@ void gk20a_busy_noresume(struct platform_device *pdev) | |||
1540 | pm_runtime_get_noresume(&pdev->dev); | 1541 | pm_runtime_get_noresume(&pdev->dev); |
1541 | } | 1542 | } |
1542 | 1543 | ||
1543 | int gk20a_channel_busy(struct platform_device *pdev) | ||
1544 | { | ||
1545 | int ret = 0; | ||
1546 | |||
1547 | ret = gk20a_platform_channel_busy(pdev); | ||
1548 | if (ret) | ||
1549 | return ret; | ||
1550 | |||
1551 | ret = gk20a_busy(pdev); | ||
1552 | if (ret) | ||
1553 | gk20a_platform_channel_idle(pdev); | ||
1554 | |||
1555 | return ret; | ||
1556 | } | ||
1557 | |||
1558 | void gk20a_channel_idle(struct platform_device *pdev) | ||
1559 | { | ||
1560 | gk20a_idle(pdev); | ||
1561 | gk20a_platform_channel_idle(pdev); | ||
1562 | } | ||
1563 | |||
1564 | int gk20a_busy(struct platform_device *pdev) | 1544 | int gk20a_busy(struct platform_device *pdev) |
1565 | { | 1545 | { |
1566 | int ret = 0; | 1546 | int ret = 0; |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 366ee5a7..ef7945f4 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -551,8 +551,6 @@ int clk_gk20a_debugfs_init(struct platform_device *dev); | |||
551 | void gk20a_busy_noresume(struct platform_device *pdev); | 551 | void gk20a_busy_noresume(struct platform_device *pdev); |
552 | int gk20a_busy(struct platform_device *pdev); | 552 | int gk20a_busy(struct platform_device *pdev); |
553 | void gk20a_idle(struct platform_device *pdev); | 553 | void gk20a_idle(struct platform_device *pdev); |
554 | int gk20a_channel_busy(struct platform_device *pdev); | ||
555 | void gk20a_channel_idle(struct platform_device *pdev); | ||
556 | void gk20a_disable(struct gk20a *g, u32 units); | 554 | void gk20a_disable(struct gk20a *g, u32 units); |
557 | void gk20a_enable(struct gk20a *g, u32 units); | 555 | void gk20a_enable(struct gk20a *g, u32 units); |
558 | void gk20a_reset(struct gk20a *g, u32 units); | 556 | void gk20a_reset(struct gk20a *g, u32 units); |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index 2d2cf220..9ebc5bab 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | |||
@@ -301,7 +301,7 @@ static ssize_t elpg_enable_store(struct device *device, | |||
301 | * Since elpg is refcounted, we should not unnecessarily call | 301 | * Since elpg is refcounted, we should not unnecessarily call |
302 | * enable/disable if it is already so. | 302 | * enable/disable if it is already so. |
303 | */ | 303 | */ |
304 | err = gk20a_channel_busy(g->dev); | 304 | err = gk20a_busy(g->dev); |
305 | if (err) | 305 | if (err) |
306 | return -EAGAIN; | 306 | return -EAGAIN; |
307 | 307 | ||
@@ -312,7 +312,7 @@ static ssize_t elpg_enable_store(struct device *device, | |||
312 | g->elpg_enabled = false; | 312 | g->elpg_enabled = false; |
313 | gk20a_pmu_disable_elpg(g); | 313 | gk20a_pmu_disable_elpg(g); |
314 | } | 314 | } |
315 | gk20a_channel_idle(g->dev); | 315 | gk20a_idle(g->dev); |
316 | 316 | ||
317 | dev_info(device, "ELPG is %s.\n", g->elpg_enabled ? "enabled" : | 317 | dev_info(device, "ELPG is %s.\n", g->elpg_enabled ? "enabled" : |
318 | "disabled"); | 318 | "disabled"); |
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c index 7af801f8..3a739cb6 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | |||
@@ -560,8 +560,6 @@ struct gk20a_platform gm20b_tegra_platform = { | |||
560 | .devfreq_governor = "nvhost_podgov", | 560 | .devfreq_governor = "nvhost_podgov", |
561 | .qos_id = PM_QOS_GPU_FREQ_MIN, | 561 | .qos_id = PM_QOS_GPU_FREQ_MIN, |
562 | 562 | ||
563 | .channel_busy = gk20a_tegra_channel_busy, | ||
564 | .channel_idle = gk20a_tegra_channel_idle, | ||
565 | .secure_alloc = gk20a_tegra_secure_alloc, | 563 | .secure_alloc = gk20a_tegra_secure_alloc, |
566 | .dump_platform_dependencies = gk20a_tegra_debug_dump, | 564 | .dump_platform_dependencies = gk20a_tegra_debug_dump, |
567 | }; | 565 | }; |