lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2ec1a8e8-6e85-4873-c1d1-61427b83a6ac@amd.com>
Date:   Tue, 21 Feb 2023 19:46:33 -0800
From:   Lizhi Hou <lizhi.hou@....com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
CC:     <vkoul@...nel.org>, <dmaengine@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <max.zhen@....com>,
        <sonal.santan@....com>, <larry.liu@....com>, <brian.xu@....com>,
        <tumic@...see.org>
Subject: Re: [RESEND PATCH V12 XDMA 1/2] dmaengine: xilinx: xdma: Add xilinx
 xdma driver


On 2/21/23 05:25, Geert Uytterhoeven wrote:
> Hi Lizhi,
>
> On Thu, Feb 9, 2023 at 8:18 PM Lizhi Hou <lizhi.hou@....com> wrote:
>> Add driver to enable PCIe board which uses XDMA (the DMA/Bridge Subsystem
>> for PCI Express). For example, Xilinx Alveo PCIe devices.
>>      https://www.xilinx.com/products/boards-and-kits/alveo.html
>>
>> The XDMA engine support up to 4 Host to Card (H2C) and 4 Card to Host (C2H)
>> channels. Memory transfers are specified on a per-channel basis in
>> descriptor linked lists, which the DMA fetches from host memory and
>> processes. Events such as descriptor completion and errors are signaled
>> using interrupts. The hardware detail is provided by
>>      https://docs.xilinx.com/r/en-US/pg195-pcie-dma/Introduction
>>
>> This driver implements dmaengine APIs.
>>      - probe the available DMA channels
>>      - use dma_slave_map for channel lookup
>>      - use virtual channel to manage dmaengine tx descriptors
>>      - implement device_prep_slave_sg callback to handle host scatter gather
>>        list
>>      - implement device_config to config device address for DMA transfer
>>
>> Signed-off-by: Lizhi Hou <lizhi.hou@....com>
>> Signed-off-by: Sonal Santan <sonal.santan@....com>
>> Signed-off-by: Max Zhen <max.zhen@....com>
>> Signed-off-by: Brian Xu <brian.xu@....com>
>> Tested-by: Martin Tuma <tumic@...see.org>
> Thanks for your patch, which is now commit 17ce252266c7f016
> ("dmaengine: xilinx: xdma: Add xilinx xdma driver") in dmaengine/next.
>
>> --- a/drivers/dma/Kconfig
>> +++ b/drivers/dma/Kconfig
>> @@ -735,6 +735,20 @@ config XILINX_DMA
>>            the scatter gather interface with multiple channels independent
>>            configuration support.
>>
>> +config XILINX_XDMA
>> +       tristate "Xilinx DMA/Bridge Subsystem DMA Engine"
>> +       depends on HAS_IOMEM
>> +       select DMA_ENGINE
>> +       select DMA_VIRTUAL_CHANNELS
>> +       select REGMAP_MMIO
> No platform dependencies at all, while this is a platform driver that
> relies on some other not-yet-existing driver creating an "xdma"
> platform device?
>
>> +       help
>> +         Enable support for Xilinx DMA/Bridge Subsystem DMA engine. The DMA
>> +         provides high performance block data movement between Host memory
>> +         and the DMA subsystem. These direct memory transfers can be both in
>> +         the Host to Card (H2C) and Card to Host (C2H) transfers.
>> +         The core also provides up to 16 user interrupt wires that generate
>> +         interrupts to the host.
>> +
>>   config XILINX_ZYNQMP_DMA
>>          tristate "Xilinx ZynqMP DMA Engine"
>>          depends on ARCH_ZYNQ || MICROBLAZE || ARM64 || COMPILE_TEST
>> --- /dev/null
>> +++ b/drivers/dma/xilinx/xdma.c
>> +/**
>> + * xdma_probe - Driver probe function
>> + * @pdev: Pointer to the platform_device structure
>> + */
>> +static int xdma_probe(struct platform_device *pdev)
>> +{
>> +       struct xdma_platdata *pdata = dev_get_platdata(&pdev->dev);
> Platform data? No DT?
> Do we still accept plain platform drivers?

The XDMA driver needs to support both the non-DT and DT use cases.

For the non-DT case the parent PCIe device driver will create the xdma 
platform device and pass the required information to the xdma driver. An 
example is 
https://lore.kernel.org/dmaengine/5fbe6029-61d5-bba4-556b-2282153f21dc@gpxsee.org/ 


For the DT use case, the xdma device will be populated by the FDT. This 
part is WIP and will be enabled with future patches.

>
>> +static const struct platform_device_id xdma_id_table[] = {
>> +       { "xdma", 0},
>> +       { },
>> +};
> This table is not needed, as the single entry matches driver.name below.

Thanks. I will create a patch to fix this.


Lizhi

>
>> +
>> +static struct platform_driver xdma_driver = {
>> +       .driver         = {
>> +               .name = "xdma",
>> +       },
>> +       .id_table       = xdma_id_table,
>> +       .probe          = xdma_probe,
>> +       .remove         = xdma_remove,
>> +};
>> +
>> +module_platform_driver(xdma_driver);
> Gr{oetje,eeting}s,
>
>                          Geert
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ