[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a0n7iJDrrn42KA9jPCTKMzW1pxFxP+38-7Viv5hnny79Q@mail.gmail.com>
Date: Wed, 29 Sep 2021 14:08:18 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Eli Billauer <eli.billauer@...il.com>
Cc: gregkh <gregkh@...uxfoundation.org>, Arnd Bergmann <arnd@...db.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: Re: [PATCH v2] char: xillybus: Eliminate redundant wrappers to DMA
related calls
On Wed, Sep 29, 2021 at 11:44 AM <eli.billauer@...il.com> wrote:
>
> From: Eli Billauer <eli.billauer@...il.com>
>
> The driver was originally written with the assumption that a different
> API must be used for DMA-related functions if the device is PCIe based
> or if not. Since Xillybus' driver supports devices on a PCIe bus (with
> xillybus_pcie) as well as connected directly to the processor (with
> xillybus_of), it originally used wrapper functions that ensure that
> a different API is used for each.
>
> This patch eliminates the said wrapper functions, as all use the same
> dma_* API now. This is most notable by the code deleted in xillybus_pcie.c
> and xillybus_of.c.
>
> It also eliminates the OF driver's check for a "dma-coherent" attribute
> in the device's OF entry, since this is taken care of by the kernel's
> implementation of dma_sync_single_for_*().
>
> There is however still need for one wrapper function, which is merged
> from xillybus_pcie.c and xillybus_of.c into xillybus_core.c: The call to
> dma_map_single() is wrapped by a function that uses the Managed Device
> (devres) framework, in the absence of a relevant function in the current
> kernel's API.
>
> Suggested-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Suggested-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Eli Billauer <eli.billauer@...il.com>
Reviewed-by: Arnd Bergmann <arnd@...db.de>
Powered by blists - more mailing lists