[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190121155908.GA8084@infradead.org>
Date: Mon, 21 Jan 2019 07:59:08 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc: Christoph Hellwig <hch@...radead.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
amd-gfx@...ts.freedesktop.org,
Christian Koenig <christian.koenig@....com>,
Alex Deucher <alexander.deucher@....com>,
David Zhou <David1.Zhou@....com>,
Huang Rui <ray.huang@....com>,
Junwei Zhang <Jerry.Zhang@....com>,
Michel Daenzer <michel.daenzer@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Sean Paul <sean@...rly.run>,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Will Deacon <will.deacon@....com>
Subject: Re: [RFC PATCH] drm: disable WC optimization for cache coherent
devices on non-x86
On Mon, Jan 21, 2019 at 04:33:27PM +0100, Ard Biesheuvel wrote:
> On Mon, 21 Jan 2019 at 16:07, Christoph Hellwig <hch@...radead.org> wrote:
> >
> > > +#include <linux/dma-noncoherent.h>
> >
> > This header is not for usage in device drivers, but purely for
> > dma-mapping implementations!
> >
>
> Is that documented anywhere?
I'll add big fat comments. But the fact that nothing is exported
there should be a fairly big hint.
> > And even if something like this was valid to do, it would have to be
> > a core function with an arch hook, and not hidden in a random driver.
>
> Why would it not be valid to do? Is it wrong for a driver to be aware
> of whether a device is cache coherent or not?
>
> And in case it isn't, do you have an alternative suggestion on how to
> fix this mess?
For the write combine mappings we need a proper core API how instances
can advertise the support. One thing I want to do fairly soon is
error checking of the attrs argument to dma_alloc_attrs - so if you
pass in something unsupported it will give you back an error.
It seems that isn't quite enough for the drm use case, so we might
also need a way to query these features, but that really has to go
through the usual dma layer abstraction as well and not hacked together
in a driver based on an eduacted guestimate.
Powered by blists - more mailing lists