* [RFC] etnaviv: missing dma_mask
@ 2018-08-14 14:12 Eugeniy Paltsev
2018-08-17 6:42 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Eugeniy Paltsev @ 2018-08-14 14:12 UTC (permalink / raw)
To: linux-snps-arc, Lucas Stach, Christoph Hellwig
Cc: linux-kernel, Vineet Gupta, Alexey Brodkin, Russell King,
Christian Gmeiner, etnaviv, dri-devel, Eugeniy Paltsev
Hi Lucas, Christoph,
After switching ARC to generic dma_noncoherent cache ops
etnaviv driver start failing on dma maping functions because of
dma_mask lack.
So I'm wondering is it valid case to have device which is
DMA capable and doesn't have dma_mask set?
If not, then I guess something like that should work
(at least it works for ARC):
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 540b59fb4103..69d80937e021 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -593,7 +593,7 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct component_match *match = NULL;
- dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+ dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (!dev->platform_data) {
struct device_node *core_node;
--
2.14.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC] etnaviv: missing dma_mask
2018-08-14 14:12 [RFC] etnaviv: missing dma_mask Eugeniy Paltsev
@ 2018-08-17 6:42 ` Christoph Hellwig
2018-08-23 8:54 ` Lucas Stach
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2018-08-17 6:42 UTC (permalink / raw)
To: Eugeniy Paltsev
Cc: linux-snps-arc, Lucas Stach, Christoph Hellwig, linux-kernel,
Vineet Gupta, Alexey Brodkin, Russell King, Christian Gmeiner,
etnaviv, dri-devel
On Tue, Aug 14, 2018 at 05:12:25PM +0300, Eugeniy Paltsev wrote:
> Hi Lucas, Christoph,
>
> After switching ARC to generic dma_noncoherent cache ops
> etnaviv driver start failing on dma maping functions because of
> dma_mask lack.
>
> So I'm wondering is it valid case to have device which is
> DMA capable and doesn't have dma_mask set?
>
> If not, then I guess something like that should work
> (at least it works for ARC):
This looks ok is a minimal fix:
Reviewed-by: Christoph Hellwig <hch@lst.de>
But why doesn't this device have a dma-range property in DT?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC] etnaviv: missing dma_mask
2018-08-17 6:42 ` Christoph Hellwig
@ 2018-08-23 8:54 ` Lucas Stach
0 siblings, 0 replies; 3+ messages in thread
From: Lucas Stach @ 2018-08-23 8:54 UTC (permalink / raw)
To: Christoph Hellwig, Eugeniy Paltsev
Cc: linux-snps-arc, linux-kernel, Vineet Gupta, Alexey Brodkin,
Russell King, Christian Gmeiner, etnaviv, dri-devel
Am Freitag, den 17.08.2018, 08:42 +0200 schrieb Christoph Hellwig:
> On Tue, Aug 14, 2018 at 05:12:25PM +0300, Eugeniy Paltsev wrote:
> > Hi Lucas, Christoph,
> >
> > After switching ARC to generic dma_noncoherent cache ops
> > etnaviv driver start failing on dma maping functions because of
> > dma_mask lack.
> >
> > So I'm wondering is it valid case to have device which is
> > DMA capable and doesn't have dma_mask set?
> >
> > If not, then I guess something like that should work
> > (at least it works for ARC):
>
> This looks ok is a minimal fix:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> But why doesn't this device have a dma-range property in DT?
Because the etnaviv device is a virtual device not represented in DT,
as it is only used to expose the DRM device, which may cover multiple
GPU core devices. The GPU core devices are properly configured from DT,
but unfortunately many of the dma related operations happen through the
DRM device. We could fix this by replacing many of the DRM helpers with
etnaviv specific functions handling dma per GPU core, but it isn't a
clear win right now, as generally on SoCs with multiple GPU cores, the
devices are on the same bus and have the same dma requirements.
Regards,
Lucas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-23 8:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-14 14:12 [RFC] etnaviv: missing dma_mask Eugeniy Paltsev
2018-08-17 6:42 ` Christoph Hellwig
2018-08-23 8:54 ` Lucas Stach
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).