Displaying 9 results from an estimated 9 matches for "gk20a_instobj_acquire_iommu".
2017 Jan 30
2
[PATCH] drm/nouveau: gk20a: Turn instmem lock into mutex
...0a.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
@@ -94,7 +94,7 @@ struct gk20a_instmem {
struct nvkm_instmem base;
/* protects vaddr_* and gk20a_instobj::vaddr* */
- spinlock_t lock;
+ struct mutex lock;
/* CPU mappings LRU */
unsigned int vaddr_use;
@@ -184,11 +184,10 @@ gk20a_instobj_acquire_iommu(struct nvkm_memory *memory)
struct gk20a_instmem *imem = node->base.imem;
struct nvkm_ltc *ltc = imem->base.subdev.device->ltc;
const u64 size = nvkm_memory_size(memory);
- unsigned long flags;
nvkm_ltc_flush(ltc);
- spin_lock_irqsave(&imem->lock, flags);
+ mutex_lock(&a...
2017 Feb 24
1
[PATCH] drm/nouveau: gk20a: Turn instmem lock into mutex
...@@ struct gk20a_instmem {
>> struct nvkm_instmem base;
>>
>> /* protects vaddr_* and gk20a_instobj::vaddr* */
>> - spinlock_t lock;
>> + struct mutex lock;
>>
>> /* CPU mappings LRU */
>> unsigned int vaddr_use;
>> @@ -184,11 +184,10 @@ gk20a_instobj_acquire_iommu(struct nvkm_memory *memory)
>> struct gk20a_instmem *imem = node->base.imem;
>> struct nvkm_ltc *ltc = imem->base.subdev.device->ltc;
>> const u64 size = nvkm_memory_size(memory);
>> - unsigned long flags;
>>
>> nvkm_ltc_flush(ltc);
>>
>...
2017 Feb 23
0
[PATCH] drm/nouveau: gk20a: Turn instmem lock into mutex
...tmem/gk20a.c
> @@ -94,7 +94,7 @@ struct gk20a_instmem {
> struct nvkm_instmem base;
>
> /* protects vaddr_* and gk20a_instobj::vaddr* */
> - spinlock_t lock;
> + struct mutex lock;
>
> /* CPU mappings LRU */
> unsigned int vaddr_use;
> @@ -184,11 +184,10 @@ gk20a_instobj_acquire_iommu(struct nvkm_memory *memory)
> struct gk20a_instmem *imem = node->base.imem;
> struct nvkm_ltc *ltc = imem->base.subdev.device->ltc;
> const u64 size = nvkm_memory_size(memory);
> - unsigned long flags;
>
> nvkm_ltc_flush(ltc);
>
> - spin_lock_irqsave(&am...
2023 Dec 14
1
[PATCH] drm/nouveau: Fixup gk20a instobj hierarchy
...e derived from struct nvkm_instobj. For the gk20a family that's not
> the case and they are derived from struct nvkm_memory instead. This
> causes some subtle data corruption (nvkm_instobj.preserve ends up
> mapping to gk20a_instobj.vaddr) that causes a NULL pointer dereference
> in gk20a_instobj_acquire_iommu() (and possibly elsewhere) and also
> prevents suspend/resume from working.
>
> Fix this by making struct gk20a_instobj derive from struct nvkm_instobj
> instead.
>
> Fixes: 12c9b05da918 ("drm/nouveau/imem: support allocations not preserved across suspend")
> Report...
2015 Nov 11
2
[PATCH] instmem/gk20a: use DMA API CPU mapping
...gk20a_instobj_acquire_dma(struct nvkm_memory *memory)
{
struct gk20a_instobj *node = gk20a_instobj(memory);
struct gk20a_instmem *imem = node->imem;
struct nvkm_ltc *ltc = imem->base.subdev.device->ltc;
+
+ nvkm_ltc_flush(ltc);
+
+ return node->vaddr;
+}
+
+static void __iomem *
+gk20a_instobj_acquire_iommu(struct nvkm_memory *memory)
+{
+ struct gk20a_instobj_iommu *node = gk20a_instobj_iommu(memory);
+ struct gk20a_instmem *imem = node->base.imem;
+ struct nvkm_ltc *ltc = imem->base.subdev.device->ltc;
const u64 size = nvkm_memory_size(memory);
unsigned long flags;
@@ -205,7 +190,7 @@...
2023 Dec 08
1
[PATCH] drm/nouveau: Fixup gk20a instobj hierarchy
...instance objects
are derived from struct nvkm_instobj. For the gk20a family that's not
the case and they are derived from struct nvkm_memory instead. This
causes some subtle data corruption (nvkm_instobj.preserve ends up
mapping to gk20a_instobj.vaddr) that causes a NULL pointer dereference
in gk20a_instobj_acquire_iommu() (and possibly elsewhere) and also
prevents suspend/resume from working.
Fix this by making struct gk20a_instobj derive from struct nvkm_instobj
instead.
Fixes: 12c9b05da918 ("drm/nouveau/imem: support allocations not preserved across suspend")
Reported-by: Jonathan Hunter <jonathan...
2015 Nov 11
0
[PATCH] instmem/gk20a: use DMA API CPU mapping
...{
> struct gk20a_instobj *node = gk20a_instobj(memory);
> struct gk20a_instmem *imem = node->imem;
> struct nvkm_ltc *ltc = imem->base.subdev.device->ltc;
> +
> + nvkm_ltc_flush(ltc);
> +
> + return node->vaddr;
> +}
> +
> +static void __iomem *
> +gk20a_instobj_acquire_iommu(struct nvkm_memory *memory)
> +{
> + struct gk20a_instobj_iommu *node = gk20a_instobj_iommu(memory);
> + struct gk20a_instmem *imem = node->base.imem;
> + struct nvkm_ltc *ltc = imem->base.subdev.device->ltc;
> const u64 size = nvkm_memory_size(memory);
> unsigned lon...
2019 Sep 16
0
[PATCH 1/2] drm/nouveau: tegra: Fix NULL pointer dereference
...+ addr = gk20a_instobj_addr(&iobj->base.memory);
+
+ gk20a_instobj_release_dma(&iobj->base.memory);
+
+ return addr;
+}
+
+static u64
+gk20a_instobj_bar2_iommu(struct nvkm_memory *memory)
+{
+ struct gk20a_instobj_iommu *iobj = gk20a_instobj_iommu(memory);
+ u64 addr = ~0ULL;
+
+ if (gk20a_instobj_acquire_iommu(&iobj->base.memory))
+ addr = gk20a_instobj_addr(&iobj->base.memory);
+
+ gk20a_instobj_release_iommu(&iobj->base.memory);
+
+ return addr;
+}
+
static u32
gk20a_instobj_rd32(struct nvkm_memory *memory, u64 offset)
{
@@ -353,6 +381,7 @@ static const struct nvkm_memory_func...
2019 Sep 16
6
[PATCH 0/2] drm/nouveau: Two more fixes
From: Thierry Reding <treding at nvidia.com>
Hi Ben,
I messed up the ordering of patches in my tree a bit, so these two fixes
got separated from the others. I don't consider these particularily
urgent because the crash that the first one fixes only happens on gp10b
which we don't enable by default yet and the second patch fixes a crash
that only happens on module unload (or driver