mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
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
(cherry picked from commit 2a502bdd5f)
Reviewed-on: http://git-master/r/1327754
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ecd71ed447
commit
83721dfab9
@@ -232,13 +232,13 @@ static int gk20a_sched_dev_ioctl_tsg_set_timeslice(
|
||||
if (!kref_get_unless_zero(&tsg->refcount))
|
||||
return -ENXIO;
|
||||
|
||||
err = gk20a_busy(g->dev);
|
||||
err = gk20a_busy(g);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = gk20a_tsg_set_timeslice(tsg, arg->timeslice);
|
||||
|
||||
gk20a_idle(g->dev);
|
||||
gk20a_idle(g);
|
||||
|
||||
done:
|
||||
kref_put(&tsg->refcount, gk20a_tsg_release);
|
||||
@@ -265,13 +265,13 @@ static int gk20a_sched_dev_ioctl_tsg_set_runlist_interleave(
|
||||
if (!kref_get_unless_zero(&tsg->refcount))
|
||||
return -ENXIO;
|
||||
|
||||
err = gk20a_busy(g->dev);
|
||||
err = gk20a_busy(g);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
err = gk20a_tsg_set_runlist_interleave(tsg, arg->runlist_interleave);
|
||||
|
||||
gk20a_idle(g->dev);
|
||||
gk20a_idle(g);
|
||||
|
||||
done:
|
||||
kref_put(&tsg->refcount, gk20a_tsg_release);
|
||||
@@ -388,11 +388,11 @@ int gk20a_sched_dev_open(struct inode *inode, struct file *filp)
|
||||
gk20a_dbg(gpu_dbg_fn | gpu_dbg_sched, "g=%p", g);
|
||||
|
||||
if (!sched->sw_ready) {
|
||||
err = gk20a_busy(g->dev);
|
||||
err = gk20a_busy(g);
|
||||
if (err)
|
||||
goto free_ref;
|
||||
|
||||
gk20a_idle(g->dev);
|
||||
gk20a_idle(g);
|
||||
}
|
||||
|
||||
if (!nvgpu_mutex_tryacquire(&sched->busy_lock)) {
|
||||
@@ -537,7 +537,7 @@ static int gk20a_sched_debugfs_show(struct seq_file *s, void *unused)
|
||||
int i;
|
||||
int err;
|
||||
|
||||
err = gk20a_busy(g->dev);
|
||||
err = gk20a_busy(g);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -562,7 +562,7 @@ static int gk20a_sched_debugfs_show(struct seq_file *s, void *unused)
|
||||
|
||||
nvgpu_mutex_release(&sched->status_lock);
|
||||
|
||||
gk20a_idle(g->dev);
|
||||
gk20a_idle(g);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -596,13 +596,13 @@ void gk20a_sched_ctrl_tsg_added(struct gk20a *g, struct tsg_gk20a *tsg)
|
||||
gk20a_dbg(gpu_dbg_fn | gpu_dbg_sched, "tsgid=%u", tsg->tsgid);
|
||||
|
||||
if (!sched->sw_ready) {
|
||||
err = gk20a_busy(g->dev);
|
||||
err = gk20a_busy(g);
|
||||
if (err) {
|
||||
WARN_ON(err);
|
||||
return;
|
||||
}
|
||||
|
||||
gk20a_idle(g->dev);
|
||||
gk20a_idle(g);
|
||||
}
|
||||
|
||||
nvgpu_mutex_acquire(&sched->status_lock);
|
||||
|
||||
Reference in New Issue
Block a user