Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1217853rwb; Thu, 6 Oct 2022 09:55:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5w7hoLjUCPaF0VibFIB7yDEHKjnPPy50ZOeB8WsdElgqnMakZ+JZKmKfw4YEkxMUMlZJul X-Received: by 2002:a05:6402:5243:b0:451:6d52:5928 with SMTP id t3-20020a056402524300b004516d525928mr702096edd.328.1665075356327; Thu, 06 Oct 2022 09:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665075356; cv=none; d=google.com; s=arc-20160816; b=iKLRoPXjihWGbh3U8XAxGVCh9+ZpzhswUm2/LQWyjpbbvklOTiYuuaogBWxvYBdBqj 9Wtlhnn9Pu3dAHWfdnxgWsTnvEhWXfsmuLQNRNlHD5opqOEGoCh8GRh5UwspWFm8sSOp 2/f4rALkZ9PiwUFefRRUTPdKI0Xv5DXB6D+cUL/TMcTptzal5fdB9NHTzPYJCigQg4ql YY6PSPefbau3CoCj3N3GAkcHXoJM+CL11tnoqIIdxx9GmoMDIoyMae94BMpZ4iN357l2 Yii8DmDwv5aL2bVIIsrLvue2kBXQ7ycwF7zmqo/DSPjHxGDbTC8rcgkl9V1RZUl4AFix 5mTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:from:content-language:references:cc :to:subject:user-agent:mime-version:date:message-id; bh=TIULcHyG2DSeUQlXoMbC0298TzKCzpglutWX2dVY3T0=; b=dgZkoZhY7FbfizE9RquzFvwEhg7GN7p1V8C6oy4jUEiStTyYmDEZSbOAilimF+76d2 2hjGEJIEulFuD3dlfhB8i0QU9Lt5xDdYEFSMsJlAWbPTHClJVMCRDVc08wxts8dptwPd fsnHrWZDUofZRmtieiLUMAkwE4Tx4XvOiAGtsoGPt3MlzfBsqifQ704cE7ENfAz0Jtrw HUElTr+laQuLpko3zUBqHfWS6FXRPqrhjCDfpx1XebQlSaKO3DPHY54C+7sbHwS3GYJM 9Hb7/Owq6MgrQDeWBWqsayCJiHYypEkYbgQ93tTcnTvDK3meWAnC/UYg7HF/+pmCQ/nz Tfmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf13-20020a1709077f0d00b0078bdbb52361si11736070ejc.209.2022.10.06.09.55.28; Thu, 06 Oct 2022 09:55:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230354AbiJFQhL (ORCPT + 99 others); Thu, 6 Oct 2022 12:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbiJFQhJ (ORCPT ); Thu, 6 Oct 2022 12:37:09 -0400 Received: from mx.gpxsee.org (mx.gpxsee.org [37.205.14.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A0BCCCE9A1; Thu, 6 Oct 2022 09:37:03 -0700 (PDT) Received: from [192.168.4.25] (unknown [62.77.71.229]) by mx.gpxsee.org (Postfix) with ESMTPSA id 233C236BC1; Thu, 6 Oct 2022 18:37:01 +0200 (CEST) Content-Type: multipart/mixed; boundary="------------A3EY0LQxb1Rn0VPJLv1kXqq3" Message-ID: <4e4481e9-0eb9-ac28-b9ff-348adb4dc866@gpxsee.org> Date: Thu, 6 Oct 2022 18:37:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH V6 XDMA 0/2] xilinx XDMA driver To: Lizhi Hou , vkoul@kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, trix@redhat.com Cc: max.zhen@amd.com, sonal.santan@amd.com, larry.liu@amd.com, brian.xu@amd.com References: <1664919839-27149-1-git-send-email-lizhi.hou@amd.com> Content-Language: en-US From: =?UTF-8?Q?Martin_T=c5=afma?= In-Reply-To: <1664919839-27149-1-git-send-email-lizhi.hou@amd.com> X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------A3EY0LQxb1Rn0VPJLv1kXqq3 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 04. 10. 22 23:43, Lizhi Hou wrote: > Hello, > > This V6 of patch series is to provide the platform driver to support the > Xilinx XDMA subsystem. The XDMA subsystem is used in conjunction with the > PCI Express IP block to provide high performance data transfer between host > memory and the card's DMA subsystem. It also provides up to 16 user > interrupt wires to user logic that generate interrupts to the host. > > +-------+ +-------+ +-----------+ > PCIe | | | | | | > Tx/Rx | | | | AXI | | > <=======> | PCIE | <===> | XDMA | <====>| User Logic| > | | | | | | > +-------+ +-------+ +-----------+ > > The XDMA has been used for Xilinx Alveo PCIe devices. > And it is also integrated into Versal ACAP DMA and Bridge Subsystem. > https://www.xilinx.com/products/boards-and-kits/alveo.html > https://docs.xilinx.com/r/en-US/pg344-pcie-dma-versal/Introduction-to-the-DMA-and-Bridge-Subsystems > > The device driver for any FPGA based PCIe device which leverages XDMA can > call the standard dmaengine APIs to discover and use the XDMA subsystem > without duplicating the XDMA driver code in its own driver. > > Changes since v5: > - Modified user logic interrupt APIs to handle user logic IP which does not > have its own register to enable/disable interrupt. > - Clean up code based on review comments. > > Changes since v4: > - Modified user logic interrupt APIs. > > Changes since v3: > - Added one patch to support user logic interrupt. > > Changes since v2: > - Removed tasklet. > - Fixed regression bug introduced to V2. > - Test Robot warning. > > Changes since v1: > - Moved filling hardware descriptor to xdma_prep_device_sg(). > - Changed hardware descriptor enum to "struct xdma_hw_desc". > - Minor changes from code review comments. > > Lizhi Hou (2): > dmaengine: xilinx: xdma: Add xilinx xdma driver > dmaengine: xilinx: xdma: Add user logic interrupt support > > MAINTAINERS | 11 + > drivers/dma/Kconfig | 13 + > drivers/dma/xilinx/Makefile | 1 + > drivers/dma/xilinx/xdma-regs.h | 171 ++++ > drivers/dma/xilinx/xdma.c | 1034 ++++++++++++++++++++++++ > include/linux/dma/amd_xdma.h | 16 + > include/linux/platform_data/amd_xdma.h | 34 + > 7 files changed, 1280 insertions(+) > create mode 100644 drivers/dma/xilinx/xdma-regs.h > create mode 100644 drivers/dma/xilinx/xdma.c > create mode 100644 include/linux/dma/amd_xdma.h > create mode 100644 include/linux/platform_data/amd_xdma.h > Hi, I have rewritten our V4L2 driver to use this new XDMA driver, but it does not work on our HW (where the previous Xilinx XDMA driver derived from the Xilinx sample code worked fine). The driver is sucessfully loaded and 4(2+2) DMA channels are successfully created. But when a DMA transfer is initiated, I get an error from my PC's DMA chip: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x36a00000 flags=0x0000] and no error from XDMA. Does the driver expect some special FPGA IP core configuration? Or is there something else I'm missing? My code is quiet similar to what you use in your XRT repo on GitHub (there is btw. a bug in the XRT code - you do not clear the dma_slave_config struct before using) but in my case the DMA transfer triggers the AMD-Vi error and timeouts. The code of our driver is attached, the relevant parts are in mgb4_dma.c and mgb4_core.c. M. --------------A3EY0LQxb1Rn0VPJLv1kXqq3 Content-Type: text/x-patch; charset=UTF-8; name="mgb4.patch" Content-Disposition: attachment; filename="mgb4.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2RyaXZlcnMvbWVkaWEvcGNpL0tjb25maWcgYi9kcml2ZXJzL21lZGlh L3BjaS9LY29uZmlnCmluZGV4IDEyMjRkOTA4NzEzYS4uZTNmOWQwZDRlNGNjIDEwMDY0NAot LS0gYS9kcml2ZXJzL21lZGlhL3BjaS9LY29uZmlnCisrKyBiL2RyaXZlcnMvbWVkaWEvcGNp L0tjb25maWcKQEAgLTEzLDYgKzEzLDcgQEAgaWYgTUVESUFfUENJX1NVUFBPUlQKIGlmIE1F RElBX0NBTUVSQV9TVVBQT1JUCiAJY29tbWVudCAiTWVkaWEgY2FwdHVyZSBzdXBwb3J0Igog Citzb3VyY2UgImRyaXZlcnMvbWVkaWEvcGNpL21nYjQvS2NvbmZpZyIKIHNvdXJjZSAiZHJp dmVycy9tZWRpYS9wY2kvbWV5ZS9LY29uZmlnIgogc291cmNlICJkcml2ZXJzL21lZGlhL3Bj aS9zb2xvNngxMC9LY29uZmlnIgogc291cmNlICJkcml2ZXJzL21lZGlhL3BjaS9zdGEyeDEx L0tjb25maWciCmRpZmYgLS1naXQgYS9kcml2ZXJzL21lZGlhL3BjaS9NYWtlZmlsZSBiL2Ry aXZlcnMvbWVkaWEvcGNpL01ha2VmaWxlCmluZGV4IDU1MTE2OWEzZTQzNC4uOGNhODE5Y2Yz Y2MxIDEwMDY0NAotLS0gYS9kcml2ZXJzL21lZGlhL3BjaS9NYWtlZmlsZQorKysgYi9kcml2 ZXJzL21lZGlhL3BjaS9NYWtlZmlsZQpAQCAtMzMsNiArMzMsNyBAQCBvYmotJChDT05GSUdf VklERU9fQ1g4OCkgKz0gY3g4OC8KIG9iai0kKENPTkZJR19WSURFT19EVDMxNTUpICs9IGR0 MzE1NS8KIG9iai0kKENPTkZJR19WSURFT19JVlRWKSArPSBpdnR2Lwogb2JqLSQoQ09ORklH X1ZJREVPX01FWUUpICs9IG1leWUvCitvYmotJChDT05GSU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WludCBtOworCisJd2hpbGUgKGwgPD0gcikg eworCQltID0gKGwgKyByKSAvIDI7CisJCWlmIChhcnJheVttXSA8IGtleSkKKwkJCWwgPSBt ICsgMTsKKwkJZWxzZSBpZiAoYXJyYXlbbV0gPiBrZXkpCisJCQlyID0gbSAtIDE7CisJCWVs c2UKKwkJCXJldHVybiBtOworCX0KKworCWlmIChyIDwgMCB8fCBsID4gc2l6ZSAtIDEpCisJ CXJldHVybiBtOworCWVsc2UKKwkJcmV0dXJuIChhYnMoa2V5IC0gYXJyYXlbbF0pIDwgYWJz KGtleSAtIGFycmF5W3JdKSkgPyBsIDogcjsKK30KKworCit1MzIgbWdiNF9jbXRfc2V0X3Zv dXQoc3RydWN0IG1nYjRfdm91dF9kZXYgKnZvdXRkZXYsIHVuc2lnbmVkIGludCBmcmVxKQor eworCWNvbnN0IHVpbnQxNl90ICpyZWdfc2V0OworCWNvbnN0IHVpbnQzMl90ICphZGRyOwor CXUzMiBjb25maWc7CisJc2l6ZV90IGksIGluZGV4OworCisJaW5kZXggPSBmcmVxX3NyY2go ZnJlcSwgY210X2ZyZXEsIEFSUkFZX1NJWkUoY210X2ZyZXEpKTsKKwlhZGRyID0gY210X2Fk ZHJzX291dFt2b3V0ZGV2LT5jb25maWctPmlkXTsKKwlyZWdfc2V0ID0gY210X3ZhbHNfb3V0 W2luZGV4XTsKKworCWNvbmZpZyA9IG1nYjRfcmVhZF9yZWcoJnZvdXRkZXYtPm1nYmRldi0+ dmlkZW8sIHZvdXRkZXYtPmNvbmZpZy0+cmVncy5jb25maWcpOworCisJbWdiNF93cml0ZV9y ZWcoJnZvdXRkZXYtPm1nYmRldi0+dmlkZW8sIHZvdXRkZXYtPmNvbmZpZy0+cmVncy5jb25m aWcsCisJICAweDEgfCAoY29uZmlnICYgfjB4MykpOworCisJZm9yIChpID0gMDsgaSA8IEFS UkFZX1NJWkUoY210X2FkZHJzX291dFswXSk7IGkrKykKKwkJbWdiNF93cml0ZV9yZWcoJnZv dXRkZ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Qt PmFkZHIsCisJCQkuZmxhZ3MgPSAwLAorCQkJLmxlbiA9IDIgKyBsZW4sCisJCQkuYnVmID0g YnVmLAorCQl9CisJfTsKKworCWlmICgyICsgbGVuID4gc2l6ZW9mKGJ1ZikpCisJCXJldHVy biAtRUlOVkFMOworCisJYnVmWzBdID0gKHJlZyA+PiA4KSAmIDB4ZmY7CisJYnVmWzFdID0g KHJlZyA+PiAwKSAmIDB4ZmY7CisJbWVtY3B5KCZidWZbMl0sIHZhbCwgbGVuKTsKKworCXJl dCA9IGkyY190cmFuc2ZlcihjbGllbnQtPmFkYXB0ZXIsIG1zZywgMSk7CisJaWYgKHJldCA8 IDApCisJCXJldHVybiByZXQ7CisJZWxzZSBpZiAocmV0ICE9IDEpCisJCXJldHVybiAtRVJF TU9URUlPOworCWVsc2UKKwkJcmV0dXJuIDA7Cit9CisKKworaW50IG1nYjRfaTJjX2luaXQo c3RydWN0IG1nYjRfaTJjX2NsaWVudCAqY2xpZW50LCBzdHJ1Y3QgaTJjX2FkYXB0ZXIgKmFk YXAsCisJCSAgc3RydWN0IGkyY19ib2FyZF9pbmZvIGNvbnN0ICppbmZvLCBpbnQgYWRkcl9z aXplKQoreworCWNsaWVudC0+Y2xpZW50ID0gaTJjX25ld19jbGllbnRfZGV2aWNlKGFkYXAs IGluZm8pOworCWlmIChJU19FUlIoY2xpZW50LT5jbGllbnQpKQorCQlyZXR1cm4gUFRSX0VS UihjbGllbnQtPmNsaWVudCk7CisKKwljbGllbnQtPmFkZHJfc2l6ZSA9IGFkZHJfc2l6ZTsK KworCXJldHVybiAwOworfQorCit2b2lkIG1nYjRfaTJjX2ZyZWUoc3RydWN0IG1nYjRfaTJj X2NsaWVudCAqY2xpZW50KQoreworCWkyY191bnJlZ2lzdGVyX2RldmljZShjbGllbnQtPmNs aWVudCk7Cit9CisKKworczMyIG1nYjRfaTJjX3JlYWRfYnl0ZShzdHJ1Y3QgbWdiNF9pMmNf Y2xpZW50ICpjbGllbnQsIHUxNiByZ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GF0aWMgY29uc3Qgc3RydWN0IGlpb190cmlnZ2VyX29wcyB0cmlnZ2VyX29wcyA9 IHsKKwkuc2V0X3RyaWdnZXJfc3RhdGUgPSAmdHJpZ2dlcl9zZXRfc3RhdGUsCit9OworCitz dGF0aWMgY29uc3Qgc3RydWN0IGlpb19pbmZvIHRyaWdnZXJfaW5mbyA9IHsKKwkucmVhZF9y YXcgICAgICAgICA9IHRyaWdnZXJfcmVhZF9yYXcsCit9OworCisjZGVmaW5lIFRSSUdHRVJf Q0hBTk5FTChfc2kpIHsgICAgICAgICAgICAgICAgICAgIFwKKwkudHlwZSA9IElJT19BQ1RJ VklUWSwgICAgICAgICAgICAgICAgICAgICAgICAgXAorCS5pbmZvX21hc2tfc2VwYXJhdGUg PSBCSVQoSUlPX0NIQU5fSU5GT19SQVcpLCBcCisJLnNjYW5faW5kZXggPSBfc2ksICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFwKKwkuc2Nhbl90eXBlID0geyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgXAorCQkuc2lnbiA9ICd1JywgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcCisJCS5yZWFsYml0cyA9IDMyLCAgICAgICAgICAgICAgICAgICAgICAg ICAgIFwKKwkJLnN0b3JhZ2ViaXRzID0gMzIsICAgICAgICAgICAgICAgICAgICAgICAgXAor CQkuc2hpZnQgPSAwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCS5lbmRp YW5uZXNzID0gSUlPX0NQVSAgICAgICAgICAgICAgICAgICAgIFwKKwl9LCAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorfQorCitzdGF0aWMgY29uc3Qg c3RydWN0IGlpb19jaGFuX3NwZWMgdHJpZ2dlcl9jaGFubmVsc1tdID0geworCVRSSUdHRVJf Q0hBTk5FTCgwKSwKKwlJSU9fQ0hBTl9TT0ZUX1RJTUVTVEFNUCgxKSwKK307CisKK3N0YXRp YyBpcn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