diff options
author | Niklas Cassel <cassel@kernel.org> | 2024-03-22 17:41:38 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2024-07-10 00:57:27 +0200 |
commit | 2a35703a6a00e87bf65d61e70516ae2524f70ec7 (patch) | |
tree | 941430be5b3c11ac186460a864b73bb59262578a /security | |
parent | misc: pci_endpoint_test: Add support for Rockchip rk3588 (diff) | |
download | linux-2a35703a6a00e87bf65d61e70516ae2524f70ec7.tar.xz linux-2a35703a6a00e87bf65d61e70516ae2524f70ec7.zip |
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>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions