Skip to contentSkip to conversation

drm: panfrost: Coherency support

PATCH In review Robin Murphy 7 participants 12 messages Sep 22, 2020 – Feb 4, 2021

Subsystems (8)
lore
Share & tools
lore

Robin Murphy

author reviewer
#0 lore raw

v2 cover drm: panfrost: Coherency support

Hi all,

Here's a quick v2 with the tags so far picked up and some inline commentary about the shareability domains for the pagetable code.

Robin.

Robin Murphy (3):
iommu/io-pgtable-arm: Support coherency for Mali LPAE drm/panfrost: Support cache-coherent integrations
arm64: dts: meson: Describe G12b GPU as coherent

 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi |  4 ++++
 drivers/gpu/drm/panfrost/panfrost_device.h  |  1 +
 drivers/gpu/drm/panfrost/panfrost_drv.c     |  2 ++
 drivers/gpu/drm/panfrost/panfrost_gem.c     |  2 ++
 drivers/gpu/drm/panfrost/panfrost_mmu.c     |  1 +
 drivers/iommu/io-pgtable-arm.c              | 11 ++++++++++-
 6 files changed, 20 insertions(+), 1 deletion(-)
Signature · 6 lines
2.28.0.dirty

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
author reviewer
#1 lore raw

PATCH v2 1/3 iommu/io-pgtable-arm: Support coherency for Mali LPAE

Midgard GPUs have ACE-Lite master interfaces which allows systems to integrate them in an I/O-coherent manner. It seems that from the GPU's viewpoint, the rest of the system is its outer shareable domain, and so even when snoop signals are wired up, they are only emitted for outer shareable accesses. As such, setting the TTBR_SHARE_OUTER bit does indeed get coherent pagetable walks working nicely for the coherent T620 in the Arm Juno SoC.

---
 drivers/iommu/io-pgtable-arm.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +10 -1
index dc7bcf858b6d..b4072a18e45d 100644
@@ -440,7 +440,13 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
 				<< ARM_LPAE_PTE_ATTRINDX_SHIFT);
 	}
 
-	if (prot & IOMMU_CACHE)
+	/*
+	 * Also Mali has its own notions of shareability wherein its Inner
+	 * domain covers the cores within the GPU, and its Outer domain is
+	 * "outside the GPU" (i.e. either the Inner or System domain in CPU
+	 * terms, depending on coherency).
+	 */
+	if (prot & IOMMU_CACHE && data->iop.fmt != ARM_MALI_LPAE)
 		pte |= ARM_LPAE_PTE_SH_IS;
 	else
 		pte |= ARM_LPAE_PTE_SH_OS;
@@ -1049,6 +1055,9 @@ arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
 	cfg->arm_mali_lpae_cfg.transtab = virt_to_phys(data->pgd) |
 					  ARM_MALI_LPAE_TTBR_READ_INNER |
 					  ARM_MALI_LPAE_TTBR_ADRMODE_TABLE;
+	if (cfg->coherent_walk)
+		cfg->arm_mali_lpae_cfg.transtab |= ARM_MALI_LPAE_TTBR_SHARE_OUTER;
+
 	return &data->iop;
 
 out_free_data:
Signature · 6 lines
2.28.0.dirty

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
maintainer Acked-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] iommu/io-pgtable-arm: Support coherency for Mali LPAE

Quoted 35 lines · Robin Murphy

Midgard GPUs have ACE-Lite master interfaces which allows systems to integrate them in an I/O-coherent manner. It seems that from the GPU's viewpoint, the rest of the system is its outer shareable domain, and so even when snoop signals are wired up, they are only emitted for outer shareable accesses. As such, setting the TTBR_SHARE_OUTER bit does indeed get coherent pagetable walks working nicely for the coherent T620 in the Arm Juno SoC.

---
 drivers/iommu/io-pgtable-arm.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +7 -1
index dc7bcf858b6d..b4072a18e45d 100644
@@ -440,7 +440,13 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
 				<< ARM_LPAE_PTE_ATTRINDX_SHIFT);
 	}
 
-	if (prot & IOMMU_CACHE)
+	/*
+	 * Also Mali has its own notions of shareability wherein its Inner
+	 * domain covers the cores within the GPU, and its Outer domain is
+	 * "outside the GPU" (i.e. either the Inner or System domain in CPU
+	 * terms, depending on coherency).
+	 */
+	if (prot & IOMMU_CACHE && data->iop.fmt != ARM_MALI_LPAE)
 		pte |= ARM_LPAE_PTE_SH_IS;
 	else
 		pte |= ARM_LPAE_PTE_SH_OS;

drivers/iommu/io-pgtable-arm.c arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie) · line 1060

Quoted 6 lines
drivers/iommu/io-pgtable-arm.c +3 -0
@@ -1049,6 +1055,9 @@ arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
 	cfg->arm_mali_lpae_cfg.transtab = virt_to_phys(data->pgd) |
 					  ARM_MALI_LPAE_TTBR_READ_INNER |
 					  ARM_MALI_LPAE_TTBR_ADRMODE_TABLE;
+	if (cfg->coherent_walk)
+		cfg->arm_mali_lpae_cfg.transtab |= ARM_MALI_LPAE_TTBR_SHARE_OUTER;
+

I'm assuming I'm not the right person to merge this, and it needs to go alongside the other patches in this series.

Will
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#3 lore raw

Re: [PATCH v2 1/3] iommu/io-pgtable-arm: Support coherency for Mali LPAE

In reply to Robin Murphy
Quoted 24 lines · On Tue, 22 Sep 2020 15:16:48 +0100 Robin Murphy <[email protected]> wrote:

Midgard GPUs have ACE-Lite master interfaces which allows systems to integrate them in an I/O-coherent manner. It seems that from the GPU's viewpoint, the rest of the system is its outer shareable domain, and so even when snoop signals are wired up, they are only emitted for outer shareable accesses. As such, setting the TTBR_SHARE_OUTER bit does indeed get coherent pagetable walks working nicely for the coherent T620 in the Arm Juno SoC.

---
 drivers/iommu/io-pgtable-arm.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +0 -1
index dc7bcf858b6d..b4072a18e45d 100644
@@ -440,7 +440,13 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
 				<< ARM_LPAE_PTE_ATTRINDX_SHIFT);
 	}
 
-	if (prot & IOMMU_CACHE)

drivers/iommu/io-pgtable-arm.c static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, · line 452

Quoted 10 lines
drivers/iommu/io-pgtable-arm.c +7 -0
+	/*
+	 * Also Mali has its own notions of shareability wherein its Inner
+	 * domain covers the cores within the GPU, and its Outer domain is
+	 * "outside the GPU" (i.e. either the Inner or System domain in CPU
+	 * terms, depending on coherency).
+	 */
+	if (prot & IOMMU_CACHE && data->iop.fmt != ARM_MALI_LPAE)
 		pte |= ARM_LPAE_PTE_SH_IS;
 	else
 		pte |= ARM_LPAE_PTE_SH_OS;

Actually, it still doesn't work on s922x :-/. For it to work I correctly, I need to drop the outer shareable flag here.

drivers/iommu/io-pgtable-arm.c arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie) · line 1063

Quoted 10 lines
drivers/iommu/io-pgtable-arm.c +3 -0
@@ -1049,6 +1055,9 @@ arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
 	cfg->arm_mali_lpae_cfg.transtab = virt_to_phys(data->pgd) |
 					  ARM_MALI_LPAE_TTBR_READ_INNER |
 					  ARM_MALI_LPAE_TTBR_ADRMODE_TABLE;
+	if (cfg->coherent_walk)
+		cfg->arm_mali_lpae_cfg.transtab |= ARM_MALI_LPAE_TTBR_SHARE_OUTER;
+
 	return &data->iop;
 
 out_free_data:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#4 lore raw

Re: [PATCH v2 1/3] iommu/io-pgtable-arm: Support coherency for Mali LPAE

Quoted 26 lines · Boris Brezillon
Quoted 23 lines · On Tue, 22 Sep 2020 15:16:48 +0100 Robin Murphy <[email protected]> wrote:

Midgard GPUs have ACE-Lite master interfaces which allows systems to integrate them in an I/O-coherent manner. It seems that from the GPU's viewpoint, the rest of the system is its outer shareable domain, and so even when snoop signals are wired up, they are only emitted for outer shareable accesses. As such, setting the TTBR_SHARE_OUTER bit does indeed get coherent pagetable walks working nicely for the coherent T620 in the Arm Juno SoC.

---
  drivers/iommu/io-pgtable-arm.c | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +0 -0
index dc7bcf858b6d..b4072a18e45d 100644
@@ -440,7 +440,13 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
  				<< ARM_LPAE_PTE_ATTRINDX_SHIFT);
  	}
 
Quoted 14 lines

drivers/iommu/io-pgtable-arm.c static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, · line 452

Quoted 11 lines
drivers/iommu/io-pgtable-arm.c +7 -1
-	if (prot & IOMMU_CACHE)
+	/*
+	 * Also Mali has its own notions of shareability wherein its Inner
+	 * domain covers the cores within the GPU, and its Outer domain is
+	 * "outside the GPU" (i.e. either the Inner or System domain in CPU
+	 * terms, depending on coherency).
+	 */
+	if (prot & IOMMU_CACHE && data->iop.fmt != ARM_MALI_LPAE)
  		pte |= ARM_LPAE_PTE_SH_IS;
  	else
  		pte |= ARM_LPAE_PTE_SH_OS;

Actually, it still doesn't work on s922x :-/. For it to work I correctly, I need to drop the outer shareable flag here.

The logic here does seem a bit odd. Originally it was:

IOMMU_CACHE -> Inner shared (value 3)
!IOMMU_CACHE -> Outer shared (value 2)

For Mali we're forcing everything to the second option. But Mali being Mali doesn't do things the same as LPAE, so for Mali we have:

0 - not shared
1 - reserved
2 - inner(*) and outer shareable
3 - inner shareable only

(*) where "inner" means internal to the GPU, and "outer" means shared with the CPU "inner". Very confusing!

So originally we had:
IOMMU_CACHE -> not shared with CPU (only internally in the GPU) !IOMMU_CACHE -> shared with CPU

The change above gets us to "always shared", dropping the SH_OS bit would get us to not even shareable between cores (which doesn't sound like what we want).

It's not at all clear to me why the change helps, but I suspect we want at least "inner" shareable.

Steve

Quoted 11 lines

drivers/iommu/io-pgtable-arm.c arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie) · line 1063

Quoted 10 lines
drivers/iommu/io-pgtable-arm.c +3 -0
@@ -1049,6 +1055,9 @@ arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
  	cfg->arm_mali_lpae_cfg.transtab = virt_to_phys(data->pgd) |
  					  ARM_MALI_LPAE_TTBR_READ_INNER |
  					  ARM_MALI_LPAE_TTBR_ADRMODE_TABLE;
+	if (cfg->coherent_walk)
+		cfg->arm_mali_lpae_cfg.transtab |= ARM_MALI_LPAE_TTBR_SHARE_OUTER;
+
  	return &data->iop;
 
  out_free_data:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#5 lore raw

Re: [PATCH v2 1/3] iommu/io-pgtable-arm: Support coherency for Mali LPAE

Quoted 58 lines · On Mon, 5 Oct 2020 16:16:32 +0100 Steven Price <[email protected]> wrote:
Quoted 26 lines · Boris Brezillon
Quoted 23 lines · On Tue, 22 Sep 2020 15:16:48 +0100 Robin Murphy <[email protected]> wrote:

Midgard GPUs have ACE-Lite master interfaces which allows systems to integrate them in an I/O-coherent manner. It seems that from the GPU's viewpoint, the rest of the system is its outer shareable domain, and so even when snoop signals are wired up, they are only emitted for outer shareable accesses. As such, setting the TTBR_SHARE_OUTER bit does indeed get coherent pagetable walks working nicely for the coherent T620 in the Arm Juno SoC.

---
  drivers/iommu/io-pgtable-arm.c | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +0 -0
index dc7bcf858b6d..b4072a18e45d 100644
@@ -440,7 +440,13 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
  				<< ARM_LPAE_PTE_ATTRINDX_SHIFT);
  	}
 
Quoted 14 lines

drivers/iommu/io-pgtable-arm.c static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, · line 452

Quoted 11 lines
drivers/iommu/io-pgtable-arm.c +7 -1
-	if (prot & IOMMU_CACHE)
+	/*
+	 * Also Mali has its own notions of shareability wherein its Inner
+	 * domain covers the cores within the GPU, and its Outer domain is
+	 * "outside the GPU" (i.e. either the Inner or System domain in CPU
+	 * terms, depending on coherency).
+	 */
+	if (prot & IOMMU_CACHE && data->iop.fmt != ARM_MALI_LPAE)
  		pte |= ARM_LPAE_PTE_SH_IS;
  	else
  		pte |= ARM_LPAE_PTE_SH_OS;  

Actually, it still doesn't work on s922x :-/. For it to work I correctly, I need to drop the outer shareable flag here.

The logic here does seem a bit odd. Originally it was:

IOMMU_CACHE -> Inner shared (value 3)
!IOMMU_CACHE -> Outer shared (value 2)

For Mali we're forcing everything to the second option. But Mali being Mali doesn't do things the same as LPAE, so for Mali we have:

0 - not shared
1 - reserved
2 - inner(*) and outer shareable
3 - inner shareable only

(*) where "inner" means internal to the GPU, and "outer" means shared with the CPU "inner". Very confusing!

Quoted 7 lines

So originally we had:
IOMMU_CACHE -> not shared with CPU (only internally in the GPU) !IOMMU_CACHE -> shared with CPU

The change above gets us to "always shared", dropping the SH_OS bit would get us to not even shareable between cores (which doesn't sound like what we want).

Thanks for this explanation.

Quoted 3 lines

It's not at all clear to me why the change helps, but I suspect we want at least "inner" shareable.

Right. Looks like all this was caused by a bad conflict resolution during a rebase. Sorry for the noise :-/.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author reviewer
#6 lore raw

PATCH v2 2/3 drm/panfrost: Support cache-coherent integrations

In reply to Robin Murphy

When the GPU's ACE-Lite interface is fully wired up and capable of snooping CPU caches, it may be described as "dma-coherent" in devicetree, which will already inform the DMA layer not to perform unnecessary cache maintenance. However, we still need to ensure that the GPU uses the appropriate cacheable outer-shareable attributes in order to generate the requisite snoop signals, and that CPU mappings don't create a mismatch by using a non-cacheable type either.

---
 drivers/gpu/drm/panfrost/panfrost_device.h | 1 +
 drivers/gpu/drm/panfrost/panfrost_drv.c    | 2 ++
 drivers/gpu/drm/panfrost/panfrost_gem.c    | 2 ++
 drivers/gpu/drm/panfrost/panfrost_mmu.c    | 1 +
 4 files changed, 6 insertions(+)
drivers/gpu/drm/panfrost/panfrost_device.h +1 -0
index c30c719a8059..b31f45315e96 100644
@@ -84,6 +84,7 @@ struct panfrost_device {
 	/* pm_domains for devices with more than one. */
 	struct device *pm_domain_devs[MAX_PM_DOMAINS];
 	struct device_link *pm_domain_links[MAX_PM_DOMAINS];
+	bool coherent;
 
 	struct panfrost_features features;
 	const struct panfrost_compatible *comp;
drivers/gpu/drm/panfrost/panfrost_drv.c +2 -0
index ada51df9a7a3..2a6f2f716b2f 100644
@@ -588,6 +588,8 @@ static int panfrost_probe(struct platform_device *pdev)
 	if (!pfdev->comp)
 		return -ENODEV;
 
+	pfdev->coherent = device_get_dma_attr(&pdev->dev) == DEV_DMA_COHERENT;
+
 	/* Allocate and initialze the DRM device. */
 	ddev = drm_dev_alloc(&panfrost_drm_driver, &pdev->dev);
 	if (IS_ERR(ddev))
drivers/gpu/drm/panfrost/panfrost_gem.c +2 -0
index 33355dd302f1..cdf1a8754eba 100644
@@ -220,6 +220,7 @@ static const struct drm_gem_object_funcs panfrost_gem_funcs = {
  */
 struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t size)
 {
+	struct panfrost_device *pfdev = dev->dev_private;
 	struct panfrost_gem_object *obj;
 
 	obj = kzalloc(sizeof(*obj), GFP_KERNEL);
@@ -229,6 +230,7 @@ struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t
 	INIT_LIST_HEAD(&obj->mappings.list);
 	mutex_init(&obj->mappings.lock);
 	obj->base.base.funcs = &panfrost_gem_funcs;
+	obj->base.map_cached = pfdev->coherent;
 
 	return &obj->base.base;
 }
drivers/gpu/drm/panfrost/panfrost_mmu.c +1 -0
index e8f7b11352d2..8852fd378f7a 100644
@@ -371,6 +371,7 @@ int panfrost_mmu_pgtable_alloc(struct panfrost_file_priv *priv)
 		.pgsize_bitmap	= SZ_4K | SZ_2M,
 		.ias		= FIELD_GET(0xff, pfdev->features.mmu_features),
 		.oas		= FIELD_GET(0xff00, pfdev->features.mmu_features),
+		.coherent_walk	= pfdev->coherent,
 		.tlb		= &mmu_tlb_ops,
 		.iommu_dev	= pfdev->dev,
 	};
Signature · 6 lines
2.28.0.dirty

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
author reviewer
#7 lore raw

PATCH v2 3/3 arm64: dts: meson: Describe G12b GPU as coherent

In reply to Robin Murphy

According to a downstream commit I found in the Khadas vendor kernel, the GPU on G12b is wired up for ACE-lite, so (now that Panfrost knows how to handle this properly) we should describe it as such. Otherwise the mismatch leads to all manner of fun with mismatched attributes and inadvertently snooping stale data from caches, which would account for at least some of the brokenness observed on this platform.

---
 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12b.dtsi +4 -0
index 9b8548e5f6e5..ee8fcae9f9f0 100644
@@ -135,3 +135,7 @@ map1 {
 		};
 	};
 };
+
+&mali {
+	dma-coherent;
+};
Signature · 6 lines
2.28.0.dirty

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Acked-by on the v2 series
#8 lore raw
In reply to Robin Murphy

Series is:

Quoted 13 lines · Robin Murphy

Hi all,

Here's a quick v2 with the tags so far picked up and some inline commentary about the shareability domains for the pagetable code.

Robin.

Robin Murphy (3):
iommu/io-pgtable-arm: Support coherency for Mali LPAE drm/panfrost: Support cache-coherent integrations
arm64: dts: meson: Describe G12b GPU as coherent

Quoted 11 lines
 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi |  4 ++++
 drivers/gpu/drm/panfrost/panfrost_device.h  |  1 +
 drivers/gpu/drm/panfrost/panfrost_drv.c     |  2 ++
 drivers/gpu/drm/panfrost/panfrost_gem.c     |  2 ++
 drivers/gpu/drm/panfrost/panfrost_mmu.c     |  1 +
 drivers/iommu/io-pgtable-arm.c              | 11 ++++++++++-
 6 files changed, 20 insertions(+), 1 deletion(-)
Signature · 1 line
2.28.0.dirty

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

#9 lore raw
In reply to Robin Murphy
Quoted 13 lines · Robin Murphy

Hi all,

Here's a quick v2 with the tags so far picked up and some inline commentary about the shareability domains for the pagetable code.

Robin.

Robin Murphy (3):
iommu/io-pgtable-arm: Support coherency for Mali LPAE drm/panfrost: Support cache-coherent integrations
arm64: dts: meson: Describe G12b GPU as coherent

Quoted 8 lines
 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi |  4 ++++
 drivers/gpu/drm/panfrost/panfrost_device.h  |  1 +
 drivers/gpu/drm/panfrost/panfrost_drv.c     |  2 ++
 drivers/gpu/drm/panfrost/panfrost_gem.c     |  2 ++
 drivers/gpu/drm/panfrost/panfrost_mmu.c     |  1 +
 drivers/iommu/io-pgtable-arm.c              | 11 ++++++++++-
 6 files changed, 20 insertions(+), 1 deletion(-)

Applying to drm-misc-next

Thanks !
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author reviewer
#10 lore raw
In reply to Robin Murphy

Hi Greg,

Quoted 5 lines · Robin Murphy

Hi all,

Here's a quick v2 with the tags so far picked up and some inline commentary about the shareability domains for the pagetable code.

Quoted 7 lines

Robin.

Robin Murphy (3):
iommu/io-pgtable-arm: Support coherency for Mali LPAE drm/panfrost: Support cache-coherent integrations
arm64: dts: meson: Describe G12b GPU as coherent

Please would you consider applying these patches to 5.10 stable? The mainline commit IDs are now:

728da60da7c1 iommu/io-pgtable-arm: Support coherency for Mali LPAE 268af50f38b1 drm/panfrost: Support cache-coherent integrations 03544505cb10 arm64: dts: meson: Describe G12b GPU as coherent

and I've checked that they cherry-pick to the current 5.10.y branch (5.10.12) cleanly.

Amlogic-based boards that require this support are quite popular, and end-users are now starting to run into the weird behaviour that ensues without it, which is all to easy to misattribute to the userspace driver in Mesa, e.g. [1],[2]. Fortunately 5.10 also happens to be the first kernel version to start probing the particular GPU models on these SoCs anyway, and I'm not aware of any other significant systems that are affected, so I don't believe we will need to worry about any other stable versions.

Thanks,
Robin.

[1] https://gitlab.freedesktop.org/mesa/mesa/-/issues/4157
[2] https://gitlab.freedesktop.org/mesa/mesa/-/issues/4160

Quoted 9 lines
  arch/arm64/boot/dts/amlogic/meson-g12b.dtsi |  4 ++++
  drivers/gpu/drm/panfrost/panfrost_device.h  |  1 +
  drivers/gpu/drm/panfrost/panfrost_drv.c     |  2 ++
  drivers/gpu/drm/panfrost/panfrost_gem.c     |  2 ++
  drivers/gpu/drm/panfrost/panfrost_mmu.c     |  1 +
  drivers/iommu/io-pgtable-arm.c              | 11 ++++++++++-
  6 files changed, 20 insertions(+), 1 deletion(-)
#11 lore raw
Quoted 26 lines · Robin Murphy

Hi Greg,

Quoted 5 lines · Robin Murphy

Hi all,

Here's a quick v2 with the tags so far picked up and some inline commentary about the shareability domains for the pagetable code.

Quoted 7 lines

Robin.

Robin Murphy (3):
iommu/io-pgtable-arm: Support coherency for Mali LPAE drm/panfrost: Support cache-coherent integrations
arm64: dts: meson: Describe G12b GPU as coherent

Please would you consider applying these patches to 5.10 stable? The mainline commit IDs are now:

728da60da7c1 iommu/io-pgtable-arm: Support coherency for Mali LPAE 268af50f38b1 drm/panfrost: Support cache-coherent integrations 03544505cb10 arm64: dts: meson: Describe G12b GPU as coherent

and I've checked that they cherry-pick to the current 5.10.y branch (5.10.12) cleanly.

Quoted 7 lines

Amlogic-based boards that require this support are quite popular, and end-users are now starting to run into the weird behaviour that ensues without it, which is all to easy to misattribute to the userspace driver in Mesa, e.g. [1],[2]. Fortunately 5.10 also happens to be the first kernel version to start probing the particular GPU models on these SoCs anyway, and I'm not aware of any other significant systems that are affected, so I don't believe we will need to worry about any other stable versions.

That's small enough, now queued up, thanks.

greg k-h