diff options
author | David Nieto <dmartineznie@nvidia.com> | 2018-01-04 14:09:57 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-08 17:38:06 -0500 |
commit | 6dde9e67d91419d1e671a520571a2be9bde93999 (patch) | |
tree | 0471b3f8ef26bed5b3adf4c8ddc6c949e8651bf4 /drivers/gpu/nvgpu/common/linux/module.c | |
parent | 82f253b7c14d7811a54f8187ff82f8d8befae529 (diff) |
gpu: nvgpu: allocate from coherent pool
Maps memory coherently on devices that are connected to a coherent bus.
(1) Add code to be able to get the platform device node.
(2) Create a new flag to mark if the device is connected to a coherent bus
(3) Map memory coherently on coherent devices.
bug 2040331
Change-Id: Ide83a9261acdbbc6e9fef4fc5f38d6f9d0e5ab5b
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1633985
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index 4fe38588..5d91da8f 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/pm_runtime.h> | 24 | #include <linux/pm_runtime.h> |
25 | #include <linux/reset.h> | 25 | #include <linux/reset.h> |
26 | #include <linux/platform/tegra/common.h> | 26 | #include <linux/platform/tegra/common.h> |
27 | #include <linux/pci.h> | ||
28 | |||
27 | #include <uapi/linux/nvgpu.h> | 29 | #include <uapi/linux/nvgpu.h> |
28 | #include <dt-bindings/soc/gm20b-fuse.h> | 30 | #include <dt-bindings/soc/gm20b-fuse.h> |
29 | #include <dt-bindings/soc/gp10b-fuse.h> | 31 | #include <dt-bindings/soc/gp10b-fuse.h> |
@@ -70,6 +72,23 @@ | |||
70 | #define CREATE_TRACE_POINTS | 72 | #define CREATE_TRACE_POINTS |
71 | #include <trace/events/gk20a.h> | 73 | #include <trace/events/gk20a.h> |
72 | 74 | ||
75 | |||
76 | struct device_node *nvgpu_get_node(struct gk20a *g) | ||
77 | { | ||
78 | struct device *dev = dev_from_gk20a(g); | ||
79 | |||
80 | if (dev_is_pci(dev)) { | ||
81 | struct pci_bus *bus = to_pci_dev(dev)->bus; | ||
82 | |||
83 | while (!pci_is_root_bus(bus)) | ||
84 | bus = bus->parent; | ||
85 | |||
86 | return bus->bridge->parent->of_node; | ||
87 | } | ||
88 | |||
89 | return dev->of_node; | ||
90 | } | ||
91 | |||
73 | void gk20a_busy_noresume(struct gk20a *g) | 92 | void gk20a_busy_noresume(struct gk20a *g) |
74 | { | 93 | { |
75 | pm_runtime_get_noresume(dev_from_gk20a(g)); | 94 | pm_runtime_get_noresume(dev_from_gk20a(g)); |
@@ -1042,7 +1061,7 @@ static inline void set_gk20a(struct platform_device *pdev, struct gk20a *gk20a) | |||
1042 | 1061 | ||
1043 | static int nvgpu_read_fuse_overrides(struct gk20a *g) | 1062 | static int nvgpu_read_fuse_overrides(struct gk20a *g) |
1044 | { | 1063 | { |
1045 | struct device_node *np = dev_from_gk20a(g)->of_node; | 1064 | struct device_node *np = nvgpu_get_node(g); |
1046 | u32 *fuses; | 1065 | u32 *fuses; |
1047 | int count, i; | 1066 | int count, i; |
1048 | 1067 | ||