]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dmaengine: ptdma: use consistent DMA masks
authorTadeusz Struk <tstruk@gigaio.com>
Thu, 22 Feb 2024 16:30:53 +0000 (17:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:48:40 +0000 (14:48 +0000)
commit4e0fe154be7b14498a8844cdffadda7ab51d5958
treea58dda1c23d8bcdcb2179ac3f341bddff3df145c
parent1291d278b5574819a7266568ce4c28bce9438705
dmaengine: ptdma: use consistent DMA masks

commit df2515a17914ecfc2a0594509deaf7fcb8d191ac upstream.

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>
Link: https://lore.kernel.org/r/20240222163053.13842-1-tstruk@gigaio.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/ptdma/ptdma-dmaengine.c