Commit Graph

66 Commits

Author SHA1 Message Date
Myron Stowe f9b8586aab misc: pci_endpoint_test: Remove unused pci_endpoint_test_bar_{readl,writel} functions
JIRA: https://issues.redhat.com/browse/RHEL-59033
Upstream Status: 1ae27dacae42c0259d17097eb7dcb98d16568cce

commit 1ae27dacae42c0259d17097eb7dcb98d16568cce
Author: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Date:   Thu Jul 4 10:32:27 2024 +0800

    misc: pci_endpoint_test: Remove unused pci_endpoint_test_bar_{readl,writel} functions

    These two functions are defined in the pci_endpoint_test.c file, but not
    called elsewhere, so delete these unused functions.

    This fixes the following warning:

      drivers/misc/pci_endpoint_test.c:144:19: warning: unused function 'pci_endpoint_test_bar_readl'.
      drivers/misc/pci_endpoint_test.c:150:20: warning: unused function 'pci_endpoint_test_bar_writel'.

    No functional changes intended.

    [kwilczynski: commit log]
    Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9064
    Link: https://lore.kernel.org/linux-pci/20240704023227.87039-1-jiapeng.chong@linux.alibaba.com
    Reported-by: Abaci Robot <abaci@linux.alibaba.com>
    Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-10-01 13:25:32 -06:00
Myron Stowe d39530deae misc: pci_endpoint_test: Document policy about adding pci_device_id
JIRA: https://issues.redhat.com/browse/RHEL-59033
Upstream Status: 76084965a91df915c47f59c938bb5b8eb467b16e

commit 76084965a91df915c47f59c938bb5b8eb467b16e
Author: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date:   Tue Jun 11 21:50:57 2024 +0900

    misc: pci_endpoint_test: Document policy about adding pci_device_id

    Add a comment suggesting that if the endpoint controller Vendor and Device
    ID are programmable, an existing entry might be usable for testing without
    having to add an entry to pci_endpoint_test_tbl[].

    Link: https://lore.kernel.org/linux-pci/20240611125057.1232873-6-yoshihiro.shimoda.uh@renesas.com
    Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-10-01 13:25:31 -06:00
Myron Stowe 4a827da60c misc: pci_endpoint_test: Refactor dma_set_mask_and_coherent() logic
JIRA: https://issues.redhat.com/browse/RHEL-59033
Upstream Status: a50c7de0607c65af588900b1236d88faf561374e

commit a50c7de0607c65af588900b1236d88faf561374e
Author: Frank Li <Frank.Li@nxp.com>
Date:   Thu May 2 15:59:03 2024 -0400

    misc: pci_endpoint_test: Refactor dma_set_mask_and_coherent() logic

    dma_set_mask_and_coherent() should never fail when the mask is >= 32bit,
    unless the architecture has no DMA support. So no need to check for the
    error and also no need to set dma_set_mask_and_coherent(32) as a fallback.

    Even if dma_set_mask_and_coherent(48) fails due to the lack of DMA support
    (theoretically), then dma_set_mask_and_coherent(32) will also fail for the
    same reason. So the fallback doesn't make sense.

    Simplify the code by setting the streaming and coherent DMA mask to 48
    bits.

    Link: https://lore.kernel.org/linux-pci/20240502195903.3191049-1-Frank.Li@nxp.com
    Signed-off-by: Frank Li <Frank.Li@nxp.com>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Reviewed-by: Niklas Cassel <cassel@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-10-01 13:25:31 -06:00
Myron Stowe 43f0869bf4 misc: pci_endpoint_test: Use memcpy_toio()/memcpy_fromio() for BAR tests
JIRA: https://issues.redhat.com/browse/RHEL-59033
Upstream Status: 2a35703a6a00e87bf65d61e70516ae2524f70ec7

commit 2a35703a6a00e87bf65d61e70516ae2524f70ec7
Author: Niklas Cassel <cassel@kernel.org>
Date:   Fri Mar 22 17:41:38 2024 +0100

    misc: pci_endpoint_test: Use memcpy_toio()/memcpy_fromio() for BAR tests

    The current code uses writel()/readl(), which has an implicit memory
    barrier for every single readl()/writel().

    Additionally, reading 4 bytes at a time over the PCI bus is not really
    optimal, considering that this code is running in an ioctl handler.

    Use memcpy_toio()/memcpy_fromio() for BAR tests.

    Before patch with a 4MB BAR:

      $ time /usr/bin/pcitest -b 1
      BAR1:           OKAY
      real    0m 1.56s

    After patch with a 4MB BAR:

      $ time /usr/bin/pcitest -b 1
      BAR1:           OKAY
      real    0m 0.54s

    Link: https://lore.kernel.org/linux-pci/20240322164139.678228-1-cassel@kernel.org
    Signed-off-by: Niklas Cassel <cassel@kernel.org>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-10-01 13:25:31 -06:00
Myron Stowe 756226f42c misc: pci_endpoint_test: Add support for Rockchip rk3588
JIRA: https://issues.redhat.com/browse/RHEL-59033
Upstream Status: 199b03db86b9d9e263cb136d6c8902d443725ca3

commit 199b03db86b9d9e263cb136d6c8902d443725ca3
Author: Niklas Cassel <cassel@kernel.org>
Date:   Fri Jun 7 13:14:31 2024 +0200

    misc: pci_endpoint_test: Add support for Rockchip rk3588

    Rockchip rk3588 requires 64KB alignment for BARs.

    While there is an existing device_id:vendor_id in the driver with 64KB
    alignment, that device_id:vendor_id is am654, which uses BAR2 instead of
    BAR0 as the test_reg_bar, and also has special is_am654_pci_dev() checks
    in the driver to disallow BAR0. In order to allow testing all BARs, add a
    new rk3588 entry in the driver.

    We intentionally do not add the vendor id to pci_ids.h, since the policy
    for that file is that the vendor id has to be used by multiple drivers.

    Hopefully, this new entry will be short-lived, as there is a series on the
    mailing list which intends to move the address alignment restrictions from
    this driver to the endpoint side.

    Add a new entry for rk3588 in order to allow us to test all BARs.

    Link: https://lore.kernel.org/linux-pci/20240607-rockchip-pcie-ep-v1-v5-11-0a042d6b0049@kernel.org
    Signed-off-by: Niklas Cassel <cassel@kernel.org>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-10-01 13:25:31 -06:00
Myron Stowe 18b8ab6b1b misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support
JIRA: https://issues.redhat.com/browse/RHEL-59033
Upstream Status: 8293703a492ae97c86af27c75b76e6239ec86483

commit 8293703a492ae97c86af27c75b76e6239ec86483
Author: Siddharth Vadapalli <s-vadapalli@ti.com>
Date:   Fri Oct 20 17:32:48 2023 +0530

    misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support

    Add DEVICE_ID for J721S2 and enable support for endpoints configured
    with this DEVICE_ID in the pci_endpoint_test driver.

    Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
    Cc: stable <stable@kernel.org>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Link: https://lore.kernel.org/r/20231020120248.3168406-1-s-vadapalli@ti.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-10-01 11:50:41 -06:00
Myron Stowe 40ec964232 misc: pci_endpoint_test: Fix pci_endpoint_test_{copy,write,read}() panic
JIRA: https://issues.redhat.com/browse/RHEL-59033
Upstream Status: 8e30538eca016de8e252bef174beadecd64239f0

commit 8e30538eca016de8e252bef174beadecd64239f0
Author: Shunsuke Mie <mie@igel.co.jp>
Date:   Wed Sep 7 11:01:00 2022 +0900

    misc: pci_endpoint_test: Fix pci_endpoint_test_{copy,write,read}() panic

    The dma_map_single() doesn't permit zero length mapping. It causes a follow
    panic.

    A panic was reported on arm64:

    [   60.137988] ------------[ cut here ]------------
    [   60.142630] kernel BUG at kernel/dma/swiotlb.c:624!
    [   60.147508] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
    [   60.152992] Modules linked in: dw_hdmi_cec crct10dif_ce simple_bridge rcar_fdp1 vsp1 rcar_vin videobuf2_vmalloc rcar_csi2 v4l
    2_mem2mem videobuf2_dma_contig videobuf2_memops pci_endpoint_test videobuf2_v4l2 videobuf2_common rcar_fcp v4l2_fwnode v4l2_asyn
    c videodev mc gpio_bd9571mwv max9611 pwm_rcar ccree at24 authenc libdes phy_rcar_gen3_usb3 usb_dmac display_connector pwm_bl
    [   60.186252] CPU: 0 PID: 508 Comm: pcitest Not tainted 6.0.0-rc1rpci-dev+ #237
    [   60.193387] Hardware name: Renesas Salvator-X 2nd version board based on r8a77951 (DT)
    [   60.201302] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [   60.208263] pc : swiotlb_tbl_map_single+0x2c0/0x590
    [   60.213149] lr : swiotlb_map+0x88/0x1f0
    [   60.216982] sp : ffff80000a883bc0
    [   60.220292] x29: ffff80000a883bc0 x28: 0000000000000000 x27: 0000000000000000
    [   60.227430] x26: 0000000000000000 x25: ffff0004c0da20d0 x24: ffff80000a1f77c0
    [   60.234567] x23: 0000000000000002 x22: 0001000040000010 x21: 000000007a000000
    [   60.241703] x20: 0000000000200000 x19: 0000000000000000 x18: 0000000000000000
    [   60.248840] x17: 0000000000000000 x16: 0000000000000000 x15: ffff0006ff7b9180
    [   60.255977] x14: ffff0006ff7b9180 x13: 0000000000000000 x12: 0000000000000000
    [   60.263113] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
    [   60.270249] x8 : 0001000000000010 x7 : ffff0004c6754b20 x6 : 0000000000000000
    [   60.277385] x5 : ffff0004c0da2090 x4 : 0000000000000000 x3 : 0000000000000001
    [   60.284521] x2 : 0000000040000000 x1 : 0000000000000000 x0 : 0000000040000010
    [   60.291658] Call trace:
    [   60.294100]  swiotlb_tbl_map_single+0x2c0/0x590
    [   60.298629]  swiotlb_map+0x88/0x1f0
    [   60.302115]  dma_map_page_attrs+0x188/0x230
    [   60.306299]  pci_endpoint_test_ioctl+0x5e4/0xd90 [pci_endpoint_test]
    [   60.312660]  __arm64_sys_ioctl+0xa8/0xf0
    [   60.316583]  invoke_syscall+0x44/0x108
    [   60.320334]  el0_svc_common.constprop.0+0xcc/0xf0
    [   60.325038]  do_el0_svc+0x2c/0xb8
    [   60.328351]  el0_svc+0x2c/0x88
    [   60.331406]  el0t_64_sync_handler+0xb8/0xc0
    [   60.335587]  el0t_64_sync+0x18c/0x190
    [   60.339251] Code: 52800013 d2e00414 35fff45c d503201f (d4210000)
    [   60.345344] ---[ end trace 0000000000000000 ]---

    To fix it, this patch adds a checking the payload length if it is zero.

    Fixes: 343dc693f7 ("misc: pci_endpoint_test: Prevent some integer overflows")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
    Link: https://lore.kernel.org/r/20220907020100.122588-2-mie@igel.co.jp
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-10-01 11:50:40 -06:00
Myron Stowe 902c7f0004 misc: pci_endpoint_test: Aggregate params checking for xfer
JIRA: https://issues.redhat.com/browse/RHEL-59033
Upstream Status: 3e42deaac06567c7e86d287c305ccda24db4ae3d

commit 3e42deaac06567c7e86d287c305ccda24db4ae3d
Author: Shunsuke Mie <mie@igel.co.jp>
Date:   Wed Sep 7 11:00:59 2022 +0900

    misc: pci_endpoint_test: Aggregate params checking for xfer

    Each transfer test functions have same parameter checking code. This patch
    unites those to an introduced function.

    Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
    Cc: stable <stable@kernel.org>
    Link: https://lore.kernel.org/r/20220907020100.122588-1-mie@igel.co.jp
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-10-01 11:50:40 -06:00
Myron Stowe cf9bde6b9c misc: pci_endpoint_test: Use a unique test pattern for each BAR
JIRA: https://issues.redhat.com/browse/RHEL-28627
Upstream Status: 516f366434e1db71b83c77b970cfcc0804671e1c

commit 516f366434e1db71b83c77b970cfcc0804671e1c
Author: Niklas Cassel <niklas.cassel@wdc.com>
Date:   Fri Dec 15 11:59:51 2023 +0100

    misc: pci_endpoint_test: Use a unique test pattern for each BAR

    Use a unique test pattern for each BAR in. This makes it easier to
    detect/debug address translation issues, since a developer can dump
    the backing memory on the EP side, using e.g. devmem, to verify that
    the address translation for each BAR is actually correct.

    Link: https://lore.kernel.org/linux-pci/20231215105952.1531683-1-nks@flawful.org
    Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-03-30 14:55:37 -06:00
Myron Stowe b1081dd68e misc: pci_endpoint_test: Remove usage of the deprecated ida_simple_*() API
JIRA: https://issues.redhat.com/browse/RHEL-28627
Upstream Status: 130f335630b6475d314658ef69b225db8e328daa

commit 130f335630b6475d314658ef69b225db8e328daa
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date:   Tue Dec 19 07:15:37 2023 +0100

    misc: pci_endpoint_test: Remove usage of the deprecated ida_simple_*() API

    ida_alloc() and ida_free() should be preferred to the deprecated
    ida_simple_get() and ida_simple_remove() functions.

    This is also less verbose.

    Link: https://lore.kernel.org/linux-pci/47a30441242c4d5f0e00555cbddd7783350ff1b2.1702966523.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-03-30 14:55:37 -06:00
Myron Stowe 4aefb1be2e misc: pci_endpoint_test: Use INTX instead of LEGACY
JIRA: https://issues.redhat.com/browse/RHEL-28627
Upstream Status: acd288666979a49538d70e0c0d86e1118b445058

commit acd288666979a49538d70e0c0d86e1118b445058
Author: Damien Le Moal <dlemoal@kernel.org>
Date:   Wed Nov 22 15:03:55 2023 +0900

    misc: pci_endpoint_test: Use INTX instead of LEGACY

    In the root complex pci endpoint test function driver, change macros and
    functions names using the term "legacy" to use "intx" instead to
    match the term used in the PCI specifications.

    Link: https://lore.kernel.org/r/20231122060406.14695-6-dlemoal@kernel.org
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-03-30 14:55:37 -06:00
Myron Stowe 17a861f978 misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller
JIRA: https://issues.redhat.com/browse/RHEL-26162
Upstream Status: 6c4b39937f4e65688ea294725ae432b2565821ff

commit 6c4b39937f4e65688ea294725ae432b2565821ff
Author: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date:   Wed Oct 18 17:56:31 2023 +0900

    misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller

    Add Renesas R8A779F0 in pci_device_id table so that pci-epf-test
    can be used for testing PCIe EP on R-Car S4-8.

    Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-16-yoshihiro.shimoda.uh@renesas.com
    Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Acked-by: Manivannan Sadhasivam <mani@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2024-02-25 08:38:08 -07:00
Myron Stowe 9d431325e4 misc: pci_endpoint_test: Simplify pci_endpoint_test_msi_irq()
JIRA: https://issues.redhat.com/browse/RHEL-2570
Upstream Status: 4c50f933f50e018653a11bd77eb872d46d67c193

commit 4c50f933f50e018653a11bd77eb872d46d67c193
Author: Damien Le Moal <dlemoal@kernel.org>
Date:   Sat Apr 15 11:35:42 2023 +0900

    misc: pci_endpoint_test: Simplify pci_endpoint_test_msi_irq()

    Simplify the code of pci_endpoint_test_msi_irq() by correctly using
    booleans: remove the msix comparison to false as that variable is already a
    boolean, and directly return the result of the comparison of the raised
    interrupt number.

    Link: https://lore.kernel.org/r/20230415023542.77601-18-dlemoal@kernel.org
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-09-19 13:32:23 -06:00
Myron Stowe 8da3558acc misc: pci_endpoint_test: Do not write status in IRQ handler
JIRA: https://issues.redhat.com/browse/RHEL-2570
Upstream Status: 168e6f62e4298815125591ff9c85d374b2a93c6c

commit 168e6f62e4298815125591ff9c85d374b2a93c6c
Author: Damien Le Moal <dlemoal@kernel.org>
Date:   Sat Apr 15 11:35:41 2023 +0900

    misc: pci_endpoint_test: Do not write status in IRQ handler

    pci_endpoint_test_irqhandler() always rewrites the status register when an
    IRQ is raised, either as-is if STATUS_IRQ_RAISED is not set, or with
    STATUS_IRQ_RAISED cleared if that flag is set. The first case creates a
    race window with the endpoint side, meaning that the host side test driver
    may end up reading what it just wrote, thus losing the real status as set
    by the endpoint side before raising the next interrupt.  This can prevent
    detecting that the STATUS_IRQ_RAISED flag was set by the endpoint.

    Remove this race window by not clearing the STATUS_IRQ_RAISED status flag
    and not rewriting that register for every IRQ received.

    Link: https://lore.kernel.org/r/20230415023542.77601-17-dlemoal@kernel.org
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-09-19 13:32:23 -06:00
Myron Stowe 486c769aba misc: pci_endpoint_test: Re-init completion for every test
JIRA: https://issues.redhat.com/browse/RHEL-2570
Upstream Status: fb620ae73b70c2f57b9d3e911fc24c024ba2324f

commit fb620ae73b70c2f57b9d3e911fc24c024ba2324f
Author: Damien Le Moal <dlemoal@kernel.org>
Date:   Sat Apr 15 11:35:40 2023 +0900

    misc: pci_endpoint_test: Re-init completion for every test

    The irq_raised completion used to detect the end of a test case is
    initialized when the test device is probed, but never reinitialized again
    before a test case. As a result, the irq_raised completion synchronization
    is effective only for the first ioctl test case executed. Any subsequent
    call to wait_for_completion() by another ioctl() call will immediately
    return, potentially too early, leading to false positive failures.

    Fix this by reinitializing the irq_raised completion before starting a new
    ioctl() test command.

    Link: https://lore.kernel.org/r/20230415023542.77601-16-dlemoal@kernel.org
    Fixes: 2c156ac71c ("misc: Add host side PCI driver for PCI test function device")
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
    Cc: stable@vger.kernel.org

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-09-19 13:32:23 -06:00
Myron Stowe 12430c8d3e misc: pci_endpoint_test: Free IRQs before removing the device
JIRA: https://issues.redhat.com/browse/RHEL-2570
Upstream Status: f61b7634a3249d12b9daa36ffbdb9965b6f24c6c

commit f61b7634a3249d12b9daa36ffbdb9965b6f24c6c
Author: Damien Le Moal <dlemoal@kernel.org>
Date:   Sat Apr 15 11:35:39 2023 +0900

    misc: pci_endpoint_test: Free IRQs before removing the device

    In pci_endpoint_test_remove(), freeing the IRQs after removing the device
    creates a small race window for IRQs to be received with the test device
    memory already released, causing the IRQ handler to access invalid memory,
    resulting in an oops.

    Free the device IRQs before removing the device to avoid this issue.

    Link: https://lore.kernel.org/r/20230415023542.77601-15-dlemoal@kernel.org
    Fixes: e03327122e ("pci_endpoint_test: Add 2 ioctl commands")
    Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
    Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
    Cc: stable@vger.kernel.org

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-09-19 13:32:23 -06:00
Myron Stowe bcb0840eb7 misc: pci_endpoint_test: Drop initial kernel-doc marker
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2179137
Upstream Status: 1aa3f2b02fcd3817a0b1caa0a4654e40433a33be

commit 1aa3f2b02fcd3817a0b1caa0a4654e40433a33be
Author: Randy Dunlap <rdunlap@infradead.org>
Date:   Thu Jan 12 22:39:37 2023 -0800

    misc: pci_endpoint_test: Drop initial kernel-doc marker

    This beginning comment is not kernel-doc, so change the "/**" to a
    normal "/*" comment to prevent a kernel-doc warning:

      drivers/misc/pci_endpoint_test.c:3: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

    Link: https://lore.kernel.org/r/20230113063937.20912-1-rdunlap@infradead.org
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
    Cc: Krzysztof Wilczyński <kw@linux.com>
    Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Cc: Kishon Vijay Abraham I <kishon@kernel.org>
    Cc: linux-pci@vger.kernel.org
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-03-29 09:01:28 -06:00
Myron Stowe e1f84c4f68 misc: pci_endpoint_test: Add i.MX8 PCIe EP device support
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2179137
Upstream Status: 01ea5ede419733fdc39e75875f0861d16a829fe6

commit 01ea5ede419733fdc39e75875f0861d16a829fe6
Author: Richard Zhu <hongxing.zhu@nxp.com>
Date:   Mon Jan 16 13:41:20 2023 +0800

    misc: pci_endpoint_test: Add i.MX8 PCIe EP device support

    Set the DEVICE_ID of i.MX8 PCIe and add i.MX8 PCIE EP device support in
    pci_endpoint_test driver.

    Link: https://lore.kernel.org/r/1673847684-31893-11-git-send-email-hongxing.zhu@nxp.com
    Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
    Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2023-03-29 08:56:53 -06:00
Myron Stowe 5330f32bea misc: pci_endpoint_test: Terminate statement with semicolon
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2066898
Upstream Status: 560dbc4654fa013fadcbcd9647904051d6fadc11

commit 560dbc4654fa013fadcbcd9647904051d6fadc11
Author: Ming Wang <wangming01@loongson.cn>
Date:   Sat Jan 8 17:09:37 2022 +0800

    misc: pci_endpoint_test: Terminate statement with semicolon

    Terminate the misc_device->fops assignment statement with a semicolon.

    Link: https://lore.kernel.org/r/1641632977-6588-1-git-send-email-wangming01@loongson.cn
    Fixes: 2c156ac71c ("misc: Add host side PCI driver for PCI test function device")
    Signed-off-by: Ming Wang <wangming01@loongson.cn>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-04-20 10:14:03 -06:00
Myron Stowe 65dedb3429 misc: pci_endpoint_test: Ensure relationship between miscdev and PCI
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2066898
Upstream Status: 74a03c20bc8809a41d66ea614e55358064adbd7d

commit 74a03c20bc8809a41d66ea614e55358064adbd7d
Author: Richard Weinberger <richard@nod.at>
Date:   Tue Jul 6 17:43:10 2021 +0200

    misc: pci_endpoint_test: Ensure relationship between miscdev and PCI

    Set the parent pointer of the misc device to ensure a relationship
    between PCI and misc dev. That way it is possible to see in
    /sys/class/misc/ which pci_endpoint_test instance serves what
    PCI device.

    Signed-off-by: Richard Weinberger <richard@nod.at>
    Link: https://lore.kernel.org/r/20210706154310.26773-1-richard@nod.at
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-04-20 10:13:46 -06:00
Myron Stowe 5aac1d2ebe misc: pci_endpoint_test: Populate sriov_configure ops to configure SR-IOV device
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2045254
Upstream Status: 489b1f41e54fc47596ffcb420439204f760153dd

commit 489b1f41e54fc47596ffcb420439204f760153dd
Author: Kishon Vijay Abraham I <kishon@ti.com>
Date:   Thu Aug 19 18:03:42 2021 +0530

    misc: pci_endpoint_test: Populate sriov_configure ops to configure SR-IOV device

    Populate sriov_configure ops with pci_sriov_configure_simple to
    configure SR-IOV device.

    Link: https://lore.kernel.org/r/20210819123343.1951-8-kishon@ti.com
    Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-03-03 20:43:42 -07:00
Myron Stowe bdb1f0400b misc: pci_endpoint_test: Add deviceID for AM64 and J7200
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2045254
Upstream Status: 7c52009d94ab561e70cb72e007a6076f20451f85

commit 7c52009d94ab561e70cb72e007a6076f20451f85
Author: Kishon Vijay Abraham I <kishon@ti.com>
Date:   Wed Aug 11 18:03:36 2021 +0530

    misc: pci_endpoint_test: Add deviceID for AM64 and J7200

    Add device ID specific to AM64 and J7200 in pci_endpoint_test so that
    endpoints configured with those deviceIDs can use pci_endpoint_test
    driver.

    Link: https://lore.kernel.org/r/20210811123336.31357-6-kishon@ti.com
    Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-03-03 20:43:37 -07:00
Kishon Vijay Abraham I 599f86872f PCI: Add TI J721E device to PCI IDs
Add TI J721E device to the PCI ID database. Since this device has a
configurable PCIe endpoint, it could be used with different drivers.

Link: https://lore.kernel.org/r/20210201195809.7342-15-kishon@ti.com
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2021-02-23 14:12:41 -06:00
Xiongfeng Wang 1749c90489 misc: pci_endpoint_test: fix return value of error branch
We return 'err' in the error branch, but this variable may be set as
zero before. Fix it by setting 'err' as a negative value before we
goto the error label.

Fixes: e03327122e ("pci_endpoint_test: Add 2 ioctl commands")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Link: https://lore.kernel.org/r/1605790158-6780-1-git-send-email-wangxiongfeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-09 19:43:44 +01:00
Gustavo Pimentel 33fcc54918 misc: pci_endpoint_test: Remove unnecessary verification
The first condition of the if statement can never be true, because
bar variable is an enum variable type defined between 0 and 5, and
also bar variable acquires the value from arg function parameter which
is an unsigned long variable.

The constant 5 was replaced the the equivalent enum type, in this case
BAR_5.

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Link: https://lore.kernel.org/r/142cbbc215bed4243a219ea17b46f4256ceccb22.1603315690.git.gustavo.pimentel@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-03 10:11:44 +01:00
Bjorn Helgaas f95f023d11 Merge branch 'remotes/lorenzo/pci/rcar'
- Document R8A774A1, R8A774B1, R8A774E1 endpoint support in DT (Lad
  Prabhakar)

- Add R8A774A1, R8A774B1, R8A774E1 (RZ/G2M, RZ/G2N, RZ/G2H) IDs to endpoint
  test (Lad Prabhakar)

- Add device tree support for R8A7742 (Lad Prabhakar)

- Use "fallthrough" pseudo-keyword (Gustavo A. R. Silva)

* remotes/lorenzo/pci/rcar:
  dt-bindings: PCI: rcar: Add device tree support for r8a7742
  PCI: rcar-gen2: Use fallthrough pseudo-keyword
  misc: pci_endpoint_test: Add Device ID for RZ/G2H PCIe controller
  dt-bindings: pci: rcar-pci-ep: Document r8a774e1
  misc: pci_endpoint_test: Add Device ID for RZ/G2M and RZ/G2N PCIe controllers
  dt-bindings: pci: rcar-pci-ep: Document r8a774a1 and r8a774b1
2020-10-21 09:58:43 -05:00
Hou Zhiqiang 09fb37b35e misc: pci_endpoint_test: Add driver data for Layerscape PCIe controllers
The commit 0a121f9bc3 ("misc: pci_endpoint_test: Use streaming DMA
APIs for buffer allocation") changed to use streaming DMA APIs, however,
dma_map_single() might not return a 4KB aligned address, so add the
default_data as driver data for Layerscape PCIe controllers to make it
4KB aligned.

Link: https://lore.kernel.org/r/20200918080024.13639-13-Zhiqiang.Hou@nxp.com
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
2020-09-24 13:53:07 +01:00
Xiaowei Bao 6b8ab42137 misc: pci_endpoint_test: Add LS1088a in pci_device_id table
Add LS1088a in pci_device_id table so that pci-epf-test can be used
for testing PCIe EP in LS1088a.

Link: https://lore.kernel.org/r/20200918080024.13639-12-Zhiqiang.Hou@nxp.com
Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Andrew Murray <andrew.murray@arm.com>
2020-09-24 13:53:07 +01:00
Lad Prabhakar a63c5f3db0 misc: pci_endpoint_test: Add Device ID for RZ/G2H PCIe controller
Add Renesas R8A774E1 in pci_device_id table so that pci-epf-test
can be used for testing PCIe EP on RZ/G2H.

Link: https://lore.kernel.org/r/20200904103851.3946-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
2020-09-07 12:19:49 +01:00
Lad Prabhakar cfb824ddd1 misc: pci_endpoint_test: Add Device ID for RZ/G2M and RZ/G2N PCIe controllers
Add Renesas R8A774A1 and R8A774B1 in pci_device_id table so that
pci-epf-test can be used for testing PCIe EP on RZ/G2M and RZ/G2N.

Link: https://lore.kernel.org/r/20200814173037.17822-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
2020-09-07 11:11:26 +01:00
Kishon Vijay Abraham I 6546ae2996 misc: pci_endpoint_test: Add J721E in pci_device_id table
Add J721E in pci_device_id table so that pci-epf-test can be used
for testing PCIe EP in J721E.

Link: https://lore.kernel.org/r/20200722110317.4744-15-kishon@ti.com
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2020-08-03 14:50:08 +01:00
Lad Prabhakar b03025c573 misc: pci_endpoint_test: Add Device ID for RZ/G2E PCIe controller
Add Renesas R8A774C0 in pci_device_id table so that pci-epf-test can be
used for testing PCIe EP on RZ/G2E.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/1589493809-2602-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-19 16:46:12 +02:00
Lad Prabhakar e48ba3eb29 misc: pci_endpoint_test: remove duplicate macro PCI_ENDPOINT_TEST_STATUS
PCI_ENDPOINT_TEST_STATUS is already defined in pci_endpoint_test.c along
with the status bits, drop the duplicate definition.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2020-04-02 17:57:10 +01:00
Kishon Vijay Abraham I c2be14ab32 misc: pci_endpoint_test: Use full pci-endpoint-test name in request_irq()
Use full pci-endpoint-test name in request_irq(), so that it's easy to
profile the device that actually raised the interrupt.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2020-04-02 17:57:10 +01:00
Kishon Vijay Abraham I 6b443e5c80 misc: pci_endpoint_test: Fix to support > 10 pci-endpoint-test devices
Adding more than 10 pci-endpoint-test devices results in
"kobject_add_internal failed for pci-endpoint-test.1 with -EEXIST, don't
try to register things with the same name in the same directory". This
is because commit 2c156ac71c ("misc: Add host side PCI driver for PCI
test function device") limited the length of the "name" to 20 characters.
Change the length of the name to 24 in order to support upto 10000
pci-endpoint-test devices.

Fixes: 2c156ac71c ("misc: Add host side PCI driver for PCI test function device")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org # v4.14+
2020-04-02 17:57:10 +01:00
Kishon Vijay Abraham I 475007f9ce misc: pci_endpoint_test: Add ioctl to clear IRQ
Add ioctl to clear IRQ which can be used to free the allocated
IRQ vectors and free the requested IRQ.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2020-04-02 17:57:10 +01:00
Kishon Vijay Abraham I b2ba9225e0 misc: pci_endpoint_test: Avoid using module parameter to determine irqtype
commit e03327122e ("pci_endpoint_test: Add 2 ioctl commands")
uses module parameter 'irqtype' in pci_endpoint_test_set_irq()
to check if IRQ vectors of a particular type (MSI or MSI-X or
LEGACY) is already allocated. However with multi-function devices,
'irqtype' will not correctly reflect the IRQ type of the PCI device.

Fix it here by adding 'irqtype' for each PCI device to show the
IRQ type of a particular PCI device.

Fixes: e03327122e ("pci_endpoint_test: Add 2 ioctl commands")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org # v4.19+
2020-04-02 17:57:10 +01:00
Kishon Vijay Abraham I cf376b4b59 misc: pci_endpoint_test: Add support to get DMA option from userspace
'pcitest' utility now uses '-d' option to allow the user to test DMA.
Add support to parse option to use DMA from userspace application.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Alan Mikhak <alan.mikhak@sifive.com>
2020-04-02 17:57:10 +01:00
Kishon Vijay Abraham I 0a121f9bc3 misc: pci_endpoint_test: Use streaming DMA APIs for buffer allocation
Use streaming DMA APIs (dma_map_single/dma_unmap_single) for buffers
transmitted/received by the endpoint device instead of allocating
a coherent memory. Also add default_data to set the alignment to
4KB since dma_map_single might not return a 4KB aligned address.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Alan Mikhak <alan.mikhak@sifive.com>
2020-04-02 17:57:10 +01:00
Denis Efremov c9c13ba428 PCI: Add PCI_STD_NUM_BARS for the number of standard BARs
Code that iterates over all standard PCI BARs typically uses
PCI_STD_RESOURCE_END.  However, that requires the unusual test
"i <= PCI_STD_RESOURCE_END" rather than something the typical
"i < PCI_STD_NUM_BARS".

Add a definition for PCI_STD_NUM_BARS and change loops to use the more
idiomatic C style to help avoid fencepost errors.

Link: https://lore.kernel.org/r/20190927234026.23342-1-efremov@linux.com
Link: https://lore.kernel.org/r/20190927234308.23935-1-efremov@linux.com
Link: https://lore.kernel.org/r/20190916204158.6889-3-efremov@linux.com
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Sebastian Ott <sebott@linux.ibm.com>			# arch/s390/
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>	# video/fbdev/
Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>	# pci/controller/dwc/
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>		# scsi/pm8001/
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>	# scsi/pm8001/
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>			# memstick/
2019-10-14 10:22:26 -05:00
Linus Torvalds 47ebe00b68 dmaengine updates for v5.3-rc1
- Add support in dmaengine core to do device node checks for DT devices and
    update bunch of drivers to use that and remove open coding from drivers
  - New driver/driver support for new hardware, namely:
    - MediaTek UART APDMA
    - Freescale i.mx7ulp edma2
    - Synopsys eDMA IP core version 0
    - Allwinner H6 DMA
  - Updates to axi-dma and support for interleaved cyclic transfers
  - Greg's debugfs return value check removals on drivers
  - Updates to stm32-dma, hsu, dw, pl330, tegra drivers
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJdLKxYAAoJEHwUBw8lI4NHsH8P/AqYZpUlLthe5L4qItzM1Uf0
 HqxsJYs0xworjSRml8uptx/TzjIgJnJfEk2PV5VA+0zJNz/HnH7lDH85wKDx1Ydl
 AatUuyAFRO3GZOup/hY0AEIPhoIMdg/3zS2aapjJmaEZCVK2eVKmcj0KMvO5g0cw
 tsmXm3O0xd2Na1ToslNyYgFfCn8ortuAeoKiXJxhivMbGjRfw4LW/RPgS17Vspvh
 mEuxNXFWAZ+DorgPF5BmDPZ+LXcGgCXGNIoj64W+VHaXU5yXnlky+6/0f7cEcFEd
 yl3hjXVwyAq5zIItIOmiuozZidi5yfoizXg4S2ZD3P4xXKZ5OZ9Gf/0SMyXUIErU
 pwGxo6ZgsBcEpAHtqySELQedttttID+jYYeWU6oDr2LOy3W3F7AHOEGg9l9ZllLh
 gRdIoz3PrMK1wy/9Ytl37xklZyBk+HJLkeoIAvjrNgNJ1YRKqcysUCwsmqO7SG3N
 HnIGx74sG8ChljT/yX5pElq3ip6qLdb4pJcsfxKJ9VSxsTZ3JNINGNQtvI19hKR/
 6sn/c1Rb5/S1WxINGr+2FxChxXF8OESCN6GIEu6mNYVBzQnNPzwgPxfAGCqdoOOH
 mqXXgYNePMaBGYXBkdgvP1CnqenRRmTYo/1L4QmI4Mve4xpd5zhx5cZt9FlQJ2Im
 /hVT8gZ6bIrutsVOy4rg
 =R+aC
 -----END PGP SIGNATURE-----

Merge tag 'dmaengine-5.3-rc1' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine updates from Vinod Koul:

 - Add support in dmaengine core to do device node checks for DT devices
   and update bunch of drivers to use that and remove open coding from
   drivers

 - New driver/driver support for new hardware, namely:
     - MediaTek UART APDMA
     - Freescale i.mx7ulp edma2
     - Synopsys eDMA IP core version 0
     - Allwinner H6 DMA

 - Updates to axi-dma and support for interleaved cyclic transfers

 - Greg's debugfs return value check removals on drivers

 - Updates to stm32-dma, hsu, dw, pl330, tegra drivers

* tag 'dmaengine-5.3-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (68 commits)
  dmaengine: Revert "dmaengine: fsl-edma: add i.mx7ulp edma2 version support"
  dmaengine: at_xdmac: check for non-empty xfers_list before invoking callback
  Documentation: dmaengine: clean up description of dmatest usage
  dmaengine: tegra210-adma: remove PM_CLK dependency
  dmaengine: fsl-edma: add i.mx7ulp edma2 version support
  dt-bindings: dma: fsl-edma: add new i.mx7ulp-edma
  dmaengine: fsl-edma-common: version check for v2 instead
  dmaengine: fsl-edma-common: move dmamux register to another single function
  dmaengine: fsl-edma: add drvdata for fsl-edma
  dmaengine: Revert "dmaengine: fsl-edma: support little endian for edma driver"
  dmaengine: rcar-dmac: Reject zero-length slave DMA requests
  dmaengine: dw: Enable iDMA 32-bit on Intel Elkhart Lake
  dmaengine: dw-edma: fix semicolon.cocci warnings
  dmaengine: sh: usb-dmac: Use [] to denote a flexible array member
  dmaengine: dmatest: timeout value of -1 should specify infinite wait
  dmaengine: dw: Distinguish ->remove() between DW and iDMA 32-bit
  dmaengine: fsl-edma: support little endian for edma driver
  dmaengine: hsu: Revert "set HSU_CH_MTSR to memory width"
  dmagengine: pl330: add code to get reset property
  dt-bindings: pl330: document the optional resets property
  ...
2019-07-17 09:55:43 -07:00
Gustavo Pimentel 1f418f4650 PCI: Add Synopsys endpoint EDDA Device ID
Create and add Synopsys Endpoint EDDA Device ID to PCI ID list, since
this ID is now being use on two different drivers (pci_endpoint_test.ko
and dw-edma-pcie.ko).

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-06-10 13:10:39 +05:30
Thomas Gleixner 6b1baefec0 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 341
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 of
  the license as published by the free software foundation this
  program is distributed in the hope that it will be useful but
  without any warranty without even the implied warranty of
  merchantability or fitness for a particular purpose see the gnu
  general public license for more details you should have received a
  copy of the gnu general public license along with this program if
  not see http www gnu org licenses

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 8 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Armijn Hemel <armijn@tjaldur.nl>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000437.144869442@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:37:07 +02:00
Kishon Vijay Abraham I 8f22066457 misc: pci_endpoint_test: Fix test_reg_bar to be updated in pci_endpoint_test
commit 834b905199 ("misc: pci_endpoint_test: Add support for
PCI_ENDPOINT_TEST regs to be mapped to any BAR") while adding
test_reg_bar in order to map PCI_ENDPOINT_TEST regs to be mapped to any
BAR failed to update test_reg_bar in pci_endpoint_test, resulting in
test_reg_bar having invalid value when used outside probe.

Fix it.

Fixes: 834b905199 ("misc: pci_endpoint_test: Add support for PCI_ENDPOINT_TEST regs to be mapped to any BAR")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2019-05-01 15:50:13 +01:00
Kishon Vijay Abraham I 5bb04b1923 misc: pci_endpoint_test: Add support to test PCI EP in AM654x
TI's AM654x PCIe EP has a restriction that BAR_0 is mapped to
application registers. "PCIe Inbound Address Translation" section in
AM65x Sitara Processors TRM (SPRUID7 – April 2018) describes BAR0 as
reserved.

Configure pci_endpoint_test to use BAR_2 instead.

Also set alignment to 64K since "PCIe Subsystem Address Translation"
section in TRM indicates minimum ATU window size is 64K.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2019-05-01 15:50:13 +01:00
Xiaowei Bao 85cef374d0 misc: pci_endpoint_test: Add the layerscape EP device support
Add the layerscape EP device support in pci_endpoint_test driver.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Minghuan Lian <minghuan.lian@nxp.com>
Reviewed-by: Zhiqiang Hou <zhiqiang.hou@nxp.com>
Reviewed-by: Greg KH <gregkh@linuxfoundation.org>
2019-02-21 10:48:36 +00:00
Gustavo Pimentel e03327122e pci_endpoint_test: Add 2 ioctl commands
Add MSI-X support and update driver documentation accordingly.

Add 2 new IOCTL commands:
 - Allow to reconfigure driver IRQ type in runtime.
 - Allow to retrieve current driver IRQ type configured.

Add IRQ type validation before executing the READ/WRITE/COPY tests.

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
2018-07-19 11:46:57 +01:00
Gustavo Pimentel c2e00e3108 pci-epf-test/pci_endpoint_test: Add MSI-X support
Add MSI-X support and update driver documentation accordingly.

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
2018-07-19 11:46:45 +01:00
Gustavo Pimentel 9133e394d5 pci-epf-test/pci_endpoint_test: Use irq_type module parameter
Add new driver parameter to allow interruption type selection.

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
2018-07-19 11:46:33 +01:00
Gustavo Pimentel e8817de7fb pci-epf-test/pci_endpoint_test: Cleanup PCI_ENDPOINT_TEST memspace
Cleanup PCI_ENDPOINT_TEST memspace (by moving the interrupt number away
from command section).

Add IRQ_TYPE register to identify the triggered ID interrupt required
for the READ/WRITE/COPY tests and raise IRQ test commands.

Update documentation accordingly.

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
2018-07-19 11:39:44 +01:00