[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH] xen/gntdev: Stop abusing DT of_dma_configure API

  • To: Julien Grall <julien.grall@xxxxxxx>, Rob Herring <robh@xxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Thu, 26 Sep 2019 10:17:13 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c0LLwycakkjnsZodPYRx8JwmRKzE1nVFPfZLQlrJMjc=; b=DtkEmFun1a/zzcYrCHGIDBIpKEjyk+vC/PiqFg7jSm4CHOwPbOxkQfd2yTRRQxjxfJpKuVFbfy+D/vWozm1PbRhk7cMb3Ow+2vqWA7D2L71fAabLOdjWHm/KdafqXHspDcvzoNP4xGDC2e8eho/bFchu70vLyNhDg3H9JfOvZq54mvbpPT9qEPHJtGjngZjDyb+F7k3+7/RIrsmlLIU5IXLtdIbQ8RLYP0gvSugjNYCqslCls3r//TEkpFTPSdX2I4XE9cae95tXTmISmsYubUTCgZl30qjJ2yLQTtawzLvSfaj39YhqjbhRyrHtG+OIYRxElf3cw7JR8q/TH9aV8w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n91qe1MBcgqc5UvUutJOk6jBIH/qsdLyeEzZZ8BfqWfvMLHVZnGYj/bfet42Bj02gAuw43EH5Arjplrf5UG0k+zBXkaBSFbSNekMGLP3H3w3/kRr7EbBIXxySWamdc0n6Tvv/+4HxEWj37+dghW893o3pwyAh0I43jXYp158T1Q6sn488P5KtxtfaDFb7r7njccNCIv4258+j9JIfwi6QDiEAJMJVLbX421vpjtKinWhlyX6mAQQafVm1kSUDBwuqPLbYqxjLIv3wBKzuy6n0aU0sH0pm7LuMNSPEqgnwy0Ey/i3gfNnnVcM76T15RiJk4WeqJYXswy5C/8ACmggFg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Oleksandr_Andrushchenko@xxxxxxxx;
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, Nicolas Saenz Julienne <nsaenzjulienne@xxxxxxx>
  • Delivery-date: Thu, 26 Sep 2019 10:17:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVc+s0RRpCCJNN+0uv/ZIcTqnc7ac9t66AgAAHl4A=
  • Thread-topic: [RFC PATCH] xen/gntdev: Stop abusing DT of_dma_configure API

On 9/26/19 12:49 PM, Julien Grall wrote:
> Hi Rob,
> On 9/25/19 10:50 PM, Rob Herring wrote:
>> As the comment says, this isn't a DT based device. of_dma_configure()
>> is going to stop allowing a NULL DT node, so this needs to be fixed.
> And this can't work on arch not selecting CONFIG_OF and can select 
> We are lucky enough on x86 because, AFAICT, arch_setup_dma_ops is just 
> a nop.
No luck is needed as [1] does nothing for those platforms not using 
>> Not sure exactly what setup besides arch_setup_dma_ops is needed...
> We probably want to update dma_mask, coherent_dma_mask and 
> dma_pfn_offset.
> Also, while look at of_configure_dma, I noticed that we consider the 
> DMA will not be coherent for the grant-table. Oleksandr, do you know 
> why they can't be coherent?
The main and the only reason to use of_configure_dma is that if we don't 
then we
are about to stay with dma_dummy_ops [2]. It effectively means that 
operations on dma-bufs
will end up returning errors, like [3], [4], thus not making it possible 
for Xen PV DRM and DMA
part of gntdev driver to do what we need (dma-bufs in our use-cases 
allow zero-copying
while using graphics buffers and many more).

I didn't find any better way of achieving that, but of_configure_dma...
If there is any better solution which will not break the existing 
functionality then
I will definitely change the drivers so we do not abuse DT )
Before that, please keep in mind that merging this RFC will break Xen PV 
DMA buf support in gntdev...
Hope we can work out some acceptable solution, so everyone is happy
> Cheers,

Thank you,

[2] https://elixir.bootlin.com/linux/v5.3.1/source/kernel/dma/dummy.c#L33
[3] https://elixir.bootlin.com/linux/v5.3.1/source/kernel/dma/dummy.c#L11
[4] https://elixir.bootlin.com/linux/v5.3.1/source/kernel/dma/dummy.c#L18
Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.