gpu: nvgpu: pass gk20a struct to gk20a_busy

After driver remove, the device structure passed in gk20a_busy can be
invalid. To solve this the prototype of the function is modified to pass
the gk20a struct instead of the device pointer.

bug 200277762
JIRA: EVLR-1023

Change-Id: I08eb74bd3578834d45115098ed9936ebbb436fdf
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1320194
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
David Nieto
2017-03-13 18:45:37 -07:00
committed by mobile promotions
parent a84f601fba
commit 2a502bdd5f
16 changed files with 206 additions and 199 deletions

View File

@@ -136,13 +136,14 @@ int gk20a_gr_debug_dump(struct device *dev)
static int gk20a_gr_debug_show(struct seq_file *s, void *unused)
{
struct device *dev = s->private;
struct gk20a *g = gk20a_get_platform(dev)->g;
struct gk20a_debug_output o = {
.fn = gk20a_debug_write_to_seqfile,
.ctx = s,
};
int err;
err = gk20a_busy(dev);
err = gk20a_busy(g);
if (err) {
gk20a_err(dev, "failed to power on gpu: %d", err);
return -EINVAL;
@@ -150,7 +151,7 @@ static int gk20a_gr_debug_show(struct seq_file *s, void *unused)
gk20a_gr_dump_regs(dev, &o);
gk20a_idle(dev);
gk20a_idle(g);
return 0;
}
@@ -183,7 +184,7 @@ static int gk20a_debug_show(struct seq_file *s, void *unused)
g = gk20a_get_platform(dev)->g;
err = gk20a_busy(g->dev);
err = gk20a_busy(g);
if (err) {
gk20a_err(g->dev, "failed to power on gpu: %d", err);
return -EFAULT;
@@ -193,7 +194,7 @@ static int gk20a_debug_show(struct seq_file *s, void *unused)
if (g->ops.debug.show_dump)
g->ops.debug.show_dump(g, &o);
gk20a_idle(g->dev);
gk20a_idle(g);
return 0;
}