mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: fix arbiter teardown on PCI
The driver is not properly tearing down the arbiter on the PCI driver
unload. This change makes sure that the workqueues are drained before
tearing down the driver
bug 200277762
JIRA: EVLR-1023
Change-Id: If98fd00e27949ba1569dd26e2af02b75897231a7
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1320147
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
(cherry picked from commit 469308beca)
Reviewed-on: http://git-master/r/1324636
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ce057d784d
commit
26f904e2b7
@@ -39,6 +39,7 @@
|
||||
|
||||
struct gk20a_ctrl_priv {
|
||||
struct device *dev;
|
||||
struct gk20a *g;
|
||||
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
|
||||
struct nvgpu_clk_session *clk_session;
|
||||
#endif
|
||||
@@ -58,28 +59,33 @@ int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp)
|
||||
priv = kzalloc(sizeof(struct gk20a_ctrl_priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
filp->private_data = priv;
|
||||
priv->dev = g->dev;
|
||||
/*
|
||||
* We dont close the arbiter fd's after driver teardown to support
|
||||
* GPU_LOST events, so we store g here, instead of dereferencing the
|
||||
* dev structure on teardown
|
||||
*/
|
||||
priv->g = g;
|
||||
|
||||
if (!g->gr.sw_ready) {
|
||||
err = gk20a_busy(g->dev);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
gk20a_idle(g->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
|
||||
err = nvgpu_clk_arb_init_session(g, &priv->clk_session);
|
||||
if (err)
|
||||
return err;
|
||||
#endif
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int gk20a_ctrl_dev_release(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct gk20a_ctrl_priv *priv = filp->private_data;
|
||||
|
||||
gk20a_dbg_fn("");
|
||||
|
||||
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
|
||||
@@ -87,6 +93,7 @@ int gk20a_ctrl_dev_release(struct inode *inode, struct file *filp)
|
||||
nvgpu_clk_arb_release_session(gk20a_from_dev(priv->dev),
|
||||
priv->clk_session);
|
||||
#endif
|
||||
|
||||
kfree(priv);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user