Skip to content

Commit db5ac6d

Browse files
committed
Merge: [RHEL 9.7] DMAEngine subsystem update
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6590 # Merge Request Required Information Upstream-Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Upstream-Status: git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next branch ## Summary of Changes Update to v6.14 merge window and current fixes. * FLR support for idxd. * Various fixes and clean up. Note: AMD qdma driver isn't being enabled, it just made it a simple cherry-pick to backport the re-org of ptdma driver into the amd directory, which will make future backports to ptdma apply cleanly. ## Approved Development Ticket(s) JIRA: https://issues.redhat.com/browse/RHEL-47414 JIRA: https://issues.redhat.com/browse/RHEL-78706 Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com> Approved-by: Eder Zulian <ezulian@redhat.com> Approved-by: Eric Chanudet <echanude@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents 8b1d91d + f3a4ef5 commit db5ac6d

39 files changed

+2158
-155
lines changed

MAINTAINERS

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,8 +1061,16 @@ F: drivers/cpufreq/amd-pstate*
10611061
AMD PTDMA DRIVER
10621062
M: Sanjay R Mehta <sanju.mehta@amd.com>
10631063
L: dmaengine@vger.kernel.org
1064-
S: Maintained
1065-
F: drivers/dma/ptdma/
1064+
S: Supported
1065+
F: drivers/dma/amd/ptdma/
1066+
1067+
AMD QDMA DRIVER
1068+
M: Nishad Saraf <nishads@amd.com>
1069+
M: Lizhi Hou <lizhi.hou@amd.com>
1070+
L: dmaengine@vger.kernel.org
1071+
S: Supported
1072+
F: drivers/dma/amd/qdma/
1073+
F: include/linux/platform_data/amd_qdma.h
10661074

10671075
AMD SEATTLE DEVICE TREE SUPPORT
10681076
M: Brijesh Singh <brijeshkumar.singh@amd.com>

drivers/dma/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,12 @@ config XILINX_ZYNQMP_DPDMA
747747
display driver.
748748

749749
# driver files
750+
source "drivers/dma/amd/Kconfig"
751+
750752
source "drivers/dma/bestcomm/Kconfig"
751753

752754
source "drivers/dma/mediatek/Kconfig"
753755

754-
source "drivers/dma/ptdma/Kconfig"
755-
756756
source "drivers/dma/qcom/Kconfig"
757757

758758
source "drivers/dma/dw/Kconfig"

drivers/dma/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ obj-$(CONFIG_DMATEST) += dmatest.o
1616
obj-$(CONFIG_ALTERA_MSGDMA) += altera-msgdma.o
1717
obj-$(CONFIG_AMBA_PL08X) += amba-pl08x.o
1818
obj-$(CONFIG_AMCC_PPC440SPE_ADMA) += ppc4xx/
19-
obj-$(CONFIG_AMD_PTDMA) += ptdma/
2019
obj-$(CONFIG_AT_HDMAC) += at_hdmac.o
2120
obj-$(CONFIG_AT_XDMAC) += at_xdmac.o
2221
obj-$(CONFIG_AXI_DMAC) += dma-axi-dmac.o
@@ -83,6 +82,7 @@ obj-$(CONFIG_ST_FDMA) += st_fdma.o
8382
obj-$(CONFIG_FSL_DPAA2_QDMA) += fsl-dpaa2-qdma/
8483
obj-$(CONFIG_INTEL_LDMA) += lgm/
8584

85+
obj-y += amd/
8686
obj-y += mediatek/
8787
obj-y += qcom/
8888
obj-y += ti/

drivers/dma/acpi-dma.c

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
* Mika Westerberg <mika.westerberg@linux.intel.com>
1010
*/
1111

12+
#include <linux/acpi.h>
13+
#include <linux/acpi_dma.h>
1214
#include <linux/device.h>
1315
#include <linux/dma-mapping.h>
1416
#include <linux/err.h>
15-
#include <linux/module.h>
17+
#include <linux/errno.h>
18+
#include <linux/export.h>
19+
#include <linux/ioport.h>
1620
#include <linux/kernel.h>
1721
#include <linux/list.h>
1822
#include <linux/mutex.h>
19-
#include <linux/slab.h>
20-
#include <linux/ioport.h>
21-
#include <linux/acpi.h>
22-
#include <linux/acpi_dma.h>
2323
#include <linux/property.h>
24+
#include <linux/slab.h>
25+
#include <linux/string.h>
26+
#include <linux/types.h>
2427

2528
static LIST_HEAD(acpi_dma_list);
2629
static DEFINE_MUTEX(acpi_dma_lock);
@@ -228,7 +231,7 @@ int acpi_dma_controller_free(struct device *dev)
228231
}
229232
EXPORT_SYMBOL_GPL(acpi_dma_controller_free);
230233

231-
static void devm_acpi_dma_release(struct device *dev, void *res)
234+
static void devm_acpi_dma_free(void *dev)
232235
{
233236
acpi_dma_controller_free(dev);
234237
}
@@ -251,37 +254,15 @@ int devm_acpi_dma_controller_register(struct device *dev,
251254
(struct acpi_dma_spec *, struct acpi_dma *),
252255
void *data)
253256
{
254-
void *res;
255257
int ret;
256258

257-
res = devres_alloc(devm_acpi_dma_release, 0, GFP_KERNEL);
258-
if (!res)
259-
return -ENOMEM;
260-
261259
ret = acpi_dma_controller_register(dev, acpi_dma_xlate, data);
262-
if (ret) {
263-
devres_free(res);
260+
if (ret)
264261
return ret;
265-
}
266-
devres_add(dev, res);
267-
return 0;
268-
}
269-
EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_register);
270262

271-
/**
272-
* devm_acpi_dma_controller_free - resource managed acpi_dma_controller_free()
273-
* @dev: device that is unregistering as DMA controller
274-
*
275-
* Unregister a DMA controller registered with
276-
* devm_acpi_dma_controller_register(). Normally this function will not need to
277-
* be called and the resource management code will ensure that the resource is
278-
* freed.
279-
*/
280-
void devm_acpi_dma_controller_free(struct device *dev)
281-
{
282-
WARN_ON(devres_release(dev, devm_acpi_dma_release, NULL, NULL));
263+
return devm_add_action_or_reset(dev, devm_acpi_dma_free, dev);
283264
}
284-
EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_free);
265+
EXPORT_SYMBOL_GPL(devm_acpi_dma_controller_register);
285266

286267
/**
287268
* acpi_dma_update_dma_spec - prepare dma specifier to pass to translation function

drivers/dma/ptdma/Kconfig renamed to drivers/dma/amd/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2+
#
23
config AMD_PTDMA
34
tristate "AMD PassThru DMA Engine"
45
depends on X86_64 && PCI
@@ -11,3 +12,16 @@ config AMD_PTDMA
1112
queue-based descriptor management. This DMA controller is intended
1213
to be used with AMD Non-Transparent Bridge devices and not for
1314
general purpose peripheral DMA.
15+
16+
config AMD_QDMA
17+
tristate "AMD Queue-based DMA"
18+
depends on HAS_IOMEM
19+
select DMA_ENGINE
20+
select DMA_VIRTUAL_CHANNELS
21+
select REGMAP_MMIO
22+
help
23+
Enable support for the AMD Queue-based DMA subsystem. The primary
24+
mechanism to transfer data using the QDMA is for the QDMA engine to
25+
operate on instructions (descriptors) provided by the host operating
26+
system. Using the descriptors, the QDMA can move data in either the
27+
Host to Card (H2C) direction or the Card to Host (C2H) direction.

drivers/dma/amd/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
obj-$(CONFIG_AMD_PTDMA) += ptdma/
4+
obj-$(CONFIG_AMD_QDMA) += qdma/
File renamed without changes.
File renamed without changes.

drivers/dma/ptdma/ptdma-dmaengine.c renamed to drivers/dma/amd/ptdma/ptdma-dmaengine.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
*/
1111

1212
#include "ptdma.h"
13-
#include "../dmaengine.h"
14-
#include "../virt-dma.h"
13+
#include "../../dmaengine.h"
1514

1615
static inline struct pt_dma_chan *to_pt_chan(struct dma_chan *dma_chan)
1716
{

0 commit comments

Comments
 (0)