All of lore.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: kw@linux.com, gregkh@linuxfoundation.org, arnd@arndb.de,
	lpieralisi@kernel.org, shuah@kernel.org, kishon@kernel.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	bhelgaas@google.com, linux-arm-msm@vger.kernel.org,
	robh@kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v5 1/4] PCI: endpoint: pci-epf-test: Fix the check for DMA MEMCPY test
Date: Thu, 16 Jan 2025 16:10:36 +0100	[thread overview]
Message-ID: <Z4khbO_kQC8S2kQX@ryzen> (raw)
In-Reply-To: <20250116135106.19143-2-manivannan.sadhasivam@linaro.org>

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@kernel.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@linaro.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@kernel.org>

  reply	other threads:[~2025-01-16 15:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 13:51 [PATCH v5 0/4] Migrate PCI Endpoint Subsystem tests to Kselftest Manivannan Sadhasivam
2025-01-16 13:51 ` [PATCH v5 1/4] PCI: endpoint: pci-epf-test: Fix the check for DMA MEMCPY test Manivannan Sadhasivam
2025-01-16 15:10   ` Niklas Cassel [this message]
2025-01-16 13:51 ` [PATCH v5 2/4] misc: pci_endpoint_test: Fix the return value of IOCTL Manivannan Sadhasivam
2025-01-16 13:51 ` [PATCH v5 3/4] selftests: Move PCI Endpoint tests from tools/pci to Kselftests Manivannan Sadhasivam
2025-01-16 15:39   ` Niklas Cassel
2025-01-16 13:51 ` [PATCH v5 4/4] selftests: pci_endpoint: Migrate to Kselftest framework Manivannan Sadhasivam
2025-01-16 15:39   ` Niklas Cassel
2025-01-16 15:36 ` [PATCH v5 0/4] Migrate PCI Endpoint Subsystem tests to Kselftest Niklas Cassel
2025-01-16 16:12   ` Manivannan Sadhasivam
2025-01-16 16:39     ` Niklas Cassel
2025-01-16 17:10       ` Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z4khbO_kQC8S2kQX@ryzen \
    --to=cassel@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh@kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.