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: <Z4khbO_kQC8S2kQX@ryzen>
Date: Thu, 16 Jan 2025 16:10:36 +0100
From: Niklas Cassel <cassel@...nel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc: kw@...ux.com, gregkh@...uxfoundation.org, arnd@...db.de,
	lpieralisi@...nel.org, shuah@...nel.org, kishon@...nel.org,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	bhelgaas@...gle.com, linux-arm-msm@...r.kernel.org, robh@...nel.org,
	linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v5 1/4] PCI: endpoint: pci-epf-test: Fix the check for
 DMA MEMCPY test

On Thu, Jan 16, 2025 at 07:21:03PM +0530, Manivannan Sadhasivam wrote:
> Currently, if DMA MEMCPY test is requested by the host, and if the endpoint
> DMA controller supports DMA_PRIVATE, the test will fail. This is not
> correct since there is no check for DMA_MEMCPY capability and the DMA
> controller can support both DMA_PRIVATE and DMA_MEMCPY.
> 
> So fix the check and also reword the error message.
> 
> Reported-by: Niklas Cassel <cassel@...nel.org>
> Closes: https://lore.kernel.org/linux-pci/Z3QtEihbiKIGogWA@ryzen
> Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index ffb534a8e50a..b94e205ae10b 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -331,8 +331,8 @@ static void pci_epf_test_copy(struct pci_epf_test *epf_test,
>  	void *copy_buf = NULL, *buf;
>  
>  	if (reg->flags & FLAG_USE_DMA) {
> -		if (epf_test->dma_private) {
> -			dev_err(dev, "Cannot transfer data using DMA\n");
> +		if (!dma_has_cap(DMA_MEMCPY, epf_test->dma_chan_tx->device->cap_mask)) {
> +			dev_err(dev, "DMA controller doesn't support MEMCPY\n");
>  			ret = -EINVAL;
>  			goto set_status;
>  		}
> -- 
> 2.25.1
> 

Reviewed-by: Niklas Cassel <cassel@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ