[PATCH] [RFC] etnaviv: Don't apply pgprot_noncached for ETNA_BO_UNCACHED
Lucas Stach
l.stach at pengutronix.de
Fri Sep 14 09:27:08 UTC 2018
Hi Guido,
Am Donnerstag, den 13.09.2018, 20:00 +0200 schrieb Guido Günther:
> Hi,
> On arm64 userspace does not seem to be able to mmap memory marked as
> pgprot_noncached(nGnRnE) or pgprot_device(nGnRE).
What's the issue with a normal uncached mapping on ARM64? Is the
mapping not set up at all, or do you get aborts or something?
Regards,
Lucas
> I've worked around
> this by treating it as write combined (see below) but wonder what the
> right fix would look like? I looked around for similar cases but
> didn't
> find anything that looked useful to me.
>
> omap seems to use the same code so likely suffers from the same
> problem.
>
> Cheers,
> -- Guido
>
> ---
> drivers/gpu/drm/etnaviv/etnaviv_gem.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index 209ef1274b80..1b2ac7311232 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -133,10 +133,8 @@ static int etnaviv_gem_mmap_obj(struct
> etnaviv_gem_object *etnaviv_obj,
>
> vm_page_prot = vm_get_page_prot(vma->vm_flags);
>
> - if (etnaviv_obj->flags & ETNA_BO_WC) {
> + if (etnaviv_obj->flags & (ETNA_BO_WC | ETNA_BO_UNCACHED)) {
> vma->vm_page_prot =
> pgprot_writecombine(vm_page_prot);
> - } else if (etnaviv_obj->flags & ETNA_BO_UNCACHED) {
> - vma->vm_page_prot = pgprot_noncached(vm_page_prot);
> } else {
> /*
> * Shunt off cached objs to shmem file so they have
> their own
More information about the etnaviv
mailing list