gpu: nvgpu: Add refcounting to driver fds

The main driver structure is not refcounted properly,
so when the driver unload, file desciptors associated to the
driver are kept open with dangling references to the main object.

This change adds referencing to the gk20a structure.

bug 200277762
JIRA: EVLR-1023

Change-Id: Id892e9e1677a344789e99bf649088c076f0bf8de
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1317420
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
David Nieto
2017-02-13 11:22:59 -08:00
committed by mobile promotions
parent 469308beca
commit 74fe1caa2b
12 changed files with 190 additions and 41 deletions

View File

@@ -481,7 +481,8 @@ static void nvgpu_pci_remove(struct pci_dev *pdev)
enable_irq(g->irq_stall);
kfree(g);
gk20a_get_platform(&pdev->dev)->g = NULL;
gk20a_put(g);
}
static struct pci_driver nvgpu_pci_driver = {