All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tadeusz Struk <tstruk@gmail.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Eric Pilmore <epilmore@gigaio.com>,
	dmaengine@vger.kernel.org, Tadeusz Struk <tstruk@gigaio.com>,
	stable@vger.kernel.org
Subject: [PATCH RESEND] dmaengine: ptdma: use consistent DMA masks
Date: Thu, 22 Feb 2024 17:30:53 +0100	[thread overview]
Message-ID: <20240222163053.13842-1-tstruk@gigaio.com> (raw)
In-Reply-To: <ZddShyFNaozKwB66@matsya>

From: Tadeusz Struk <tstruk@gigaio.com>

The PTDMA driver sets DMA masks in two different places for the same
device inconsistently. First call is in pt_pci_probe(), where it uses
48bit mask. The second call is in pt_dmaengine_register(), where it
uses a 64bit mask. Using 64bit dma mask causes IO_PAGE_FAULT errors
on DMA transfers between main memory and other devices.
Without the extra call it works fine. Additionally the second call
doesn't check the return value so it can silently fail.
Remove the superfluous dma_set_mask() call and only use 48bit mask.

Cc: stable@vger.kernel.org
Fixes: b0b4a6b10577 ("dmaengine: ptdma: register PTDMA controller as a DMA resource")
Reviewed-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Tadeusz Struk <tstruk@gigaio.com>
---
 drivers/dma/ptdma/ptdma-dmaengine.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/dma/ptdma/ptdma-dmaengine.c b/drivers/dma/ptdma/ptdma-dmaengine.c
index 1aa65e5de0f3..f79240734807 100644
--- a/drivers/dma/ptdma/ptdma-dmaengine.c
+++ b/drivers/dma/ptdma/ptdma-dmaengine.c
@@ -385,8 +385,6 @@ int pt_dmaengine_register(struct pt_device *pt)
 	chan->vc.desc_free = pt_do_cleanup;
 	vchan_init(&chan->vc, dma_dev);
 
-	dma_set_mask_and_coherent(pt->dev, DMA_BIT_MASK(64));
-
 	ret = dma_async_device_register(dma_dev);
 	if (ret)
 		goto err_reg;
-- 
2.43.2

  parent reply	other threads:[~2024-02-22 16:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 16:57 Using PTDMA driver for generic DMA Tadeusz Struk
2024-02-07 13:26 ` Raju Rangoju
2024-02-07 16:44   ` Eric Pilmore
2024-02-09  8:16   ` Tadeusz Struk
2024-02-19 20:10   ` [PATCH] dmaengine: ptdma: use consistent DMA masks Tadeusz Struk
2024-02-20  7:12     ` Basavaraj Natikar
2024-02-22 13:56     ` Vinod Koul
2024-02-22 16:24       ` Tadeusz Struk
2024-02-22 16:30       ` Tadeusz Struk [this message]
2024-02-23 12:08         ` [PATCH RESEND] " Vinod Koul
2024-02-23 12:08     ` [PATCH] " Vinod Koul

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=20240222163053.13842-1-tstruk@gigaio.com \
    --to=tstruk@gmail.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=epilmore@gigaio.com \
    --cc=stable@vger.kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=tstruk@gigaio.com \
    --cc=vkoul@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.