dmaengine: add helper macro dmaengine_prep_submit()
Subsystems (4)
v2 cover dmaengine: add helper macro dmaengine_prep_submit()
Add helper macro dmaengine_prep_submit() to combine prep and submit to one call.
Pervious try to use cleanup
https://lore.kernel.org/dmaengine/[email protected]/
It is not simple enough and easy missing retain_and_null_ptr() at success path.
struct dma_async_tx_descriptor *rx_cmd_desc __free(dma_async_tx_descriptor) = NULL;
...
cookie = dmaengine_submit(rx_cmd_desc);
if (dma_submit_error(cookie))
return dma_submit_error(cookie);
...
retain_and_null_ptr(rx_cmd_desc);
}So create help macro to combine prep and submit by one call. patch 2.
static int lpi2c_dma_rx_cmd_submit(struct lpi2c_imx_struct *lpi2c_imx) {
- struct dma_async_tx_descriptor *rx_cmd_desc;
struct lpi2c_imx_dma *dma = lpi2c_imx->dma;
struct dma_chan *txchan = dma->chan_tx;
dma_cookie_t cookie;
@@ -761,15 +760,10 @@ static int lpi2c_dma_rx_cmd_submit(struct lpi2c_imx_struct *lpi2c_imx)
return -EINVAL;
}- rx_cmd_desc = dmaengine_prep_slave_single(txchan, dma->dma_tx_addr,
- dma->rx_cmd_buf_len, DMA_MEM_TO_DEV,
- DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
- if (!rx_cmd_desc) {
- dev_err(&lpi2c_imx->adapter.dev, "DMA prep slave sg failed, use pio\n");
- goto desc_prepare_err_exit;
- }
-
- cookie = dmaengine_submit(rx_cmd_desc);
+ cookie = dmaengine_prep_submit(txchan, NULL, NULL, slave_single,
+ dma->dma_tx_addr,
+ dma->rx_cmd_buf_len, DMA_MEM_TO_DEV,
+ DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (dma_submit_error(cookie)) {
dev_err(&lpi2c_imx->adapter.dev, "submitting DMA failed, use pio\n");
goto submit_err_exit;@@ -779,15 +773,9 @@ static int lpi2c_dma_rx_cmd_submit(struct lpi2c_imx_struct *lpi2c_imx)
return 0;
-desc_prepare_err_exit:
- dma_unmap_single(txchan->device->dev, dma->dma_tx_addr,
- dma->rx_cmd_buf_len, DMA_TO_DEVICE);
- return -EINVAL;
-
submit_err_exit:
dma_unmap_single(txchan->device->dev, dma->dma_tx_addr,
dma->rx_cmd_buf_len, DMA_TO_DEVICE);
- dmaengine_desc_free(rx_cmd_desc);
return -EINVAL;}
---
Changes in v2:
- use API dmaengine_prep_submit_slave_single()
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Frank Li (2):
dmaengine: Add helper dmaengine_prep_submit_slave_single()
i2c: imx-lpi2c: use dmaengine_prep_submit() to simple code
drivers/dma/dmaengine.c | 28 ++++++++++++++++++++++++++++ drivers/i2c/busses/i2c-imx-lpi2c.c | 21 +++++---------------- include/linux/dmaengine.h | 17 +++++++++++++++++ 3 files changed, 50 insertions(+), 16 deletions(-)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20260130-dma_prep_submit-cbeac742de48
Best regards,
Signature · 1 line
Frank Li <[email protected]>
PATCH v2 1/2 dmaengine: Add helper dmaengine_prep_submit_slave_single()
From: Frank Li <[email protected]>
Previously, DMA users had to call dmaengine_prep_slave_single() followed by dmaengine_submit(). Many DMA consumers missed call dmaengine_desc_free() when dmaengine_submit() returned an error.
Introduce dmaengine_prep_submit_slave_single() to combine preparation and submission into a single step and ensure the descriptor is freed on submission failure.
---
change in v2
- use api function dmaengine_prep_submit_slave_single()
--- drivers/dma/dmaengine.c | 28 ++++++++++++++++++++++++++++ include/linux/dmaengine.h | 17 +++++++++++++++++ 2 files changed, 45 insertions(+)
drivers/dma/dmaengine.c +28 -0
@@ -1619,6 +1619,34 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx) }EXPORT_SYMBOL_GPL (dma_run_dependencies); +#define dmaengine_prep_submit (chan, cb, cb_param, func, ...) \ +({ struct dma_async_tx_descriptor *tx = \ + dmaengine_prep_##func(chan, __VA_ARGS__); \ + dma_cookie_t cookie = -ENOMEM; \ + \ + if (tx) { \ + tx->callback = cb; \ + tx->callback_param = cb_param; \ + cookie = dmaengine_submit(tx); \ + \ + if (dma_submit_error(cookie)) \ + dmaengine_desc_free(tx); \ + } \ + cookie; \ +}) + +dma_cookie_t +dmaengine_prep_submit_slave_single (struct dma_chan *chan, +dma_async_tx_callback cb,void *cb_param, +dma_addr_t buf,size_t len, +enum dma_transfer_direction dir, +unsigned long flags) +{ +return dmaengine_prep_submit (chan, cb, cb_param, slave_single, + buf, len, dir, flags); +} +EXPORT_SYMBOL_GPL (dmaengine_prep_submit_slave_single); +static int __init dma_bus_init (void ) {int err =dmaengine_init_unmap_pool ();
include/linux/dmaengine.h +17 -0
@@ -990,6 +990,13 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( dir, flags, NULL); } +dma_cookie_t +dmaengine_prep_submit_slave_single (struct dma_chan *chan, +dma_async_tx_callback cb,void *cb_param, +dma_addr_t buf,size_t len, +enum dma_transfer_direction dir, +unsigned long flags); +/** * dmaengine_prep_peripheral_dma_vec() - Prepare a DMA scatter-gather descriptor * @chan: The channel to be used for this descriptor
@@ -1575,6 +1582,16 @@ static inline int dma_get_slave_caps(struct dma_chan *chan, {return -ENXIO ; } + +static inline dma_cookie_t +dmaengine_prep_submit_slave_single (struct dma_chan *chan, + dma_async_tx_callback cb, void *cb_param; + dma_addr_t buf, size_t len, + enum dma_transfer_direction dir, + unsigned long flags); +{ +return -ENODEV ; +}#endif static inline int dmaengine_desc_set_reuse (struct dma_async_tx_descriptor *tx)
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v2 1/2] dmaengine: Add helper dmaengine_prep_submit_slave_single()
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Critical] The macro accesses the descriptor after calling `dmaengine_submit()`, violating the DMA Engine…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Critical] The macro accesses the descriptor after calling dmaengine_submit(), violating the DMA Engine API contract and causing a Use-After-Free.
- [Medium] Calling dmaengine_desc_free() fails to prevent memory leaks for standard, non-reusable DMA descriptors, defeating the primary goal of the patch.
- [Low] The fallback implementation of dmaengine_prep_submit_slave_single contains severe syntax errors that break compilation when CONFIG_DMA_ENGINE is disabled. --
commit c731d16a7ec5a6fed71b17234ae1bc2184ad8818
Author: Frank Li <[email protected]>
dmaengine: Add helper dmaengine_prep_submit_slave_single()
This commit introduces a helper macro and function to combine the preparation and submission of a DMA slave single transfer into a single step. It also aims to automatically free the descriptor if the submission fails.
Quoted 4 lines
drivers/dma/dmaengine.c +0
-0
[ ... ]
Quoted 6 lines
drivers/dma/dmaengine.c +2
-0@@ -1619,6 +1619,34 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx) }EXPORT_SYMBOL_GPL (dma_run_dependencies); +#define dmaengine_prep_submit (chan, cb, cb_param, func, ...) \ +({ struct dma_async_tx_descriptor *tx = \
drivers/dma/dmaengine.c void dma_run_dependencies(struct dma_async_tx_descriptor *tx) · line 1633
Quoted 10 lines
drivers/dma/dmaengine.c +10
-0+ dmaengine_prep_##func(chan, __VA_ARGS__); \ + dma_cookie_t cookie = -ENOMEM; \ + \ + if (tx) { \ + tx->callback = cb; \ + tx->callback_param = cb_param; \ + cookie = dmaengine_submit(tx); \ + \ + if (dma_submit_error(cookie)) \ + dmaengine_desc_free(tx); \
[Severity: Critical]
Does this access the descriptor after ownership has been transferred?
The DMA Engine API contract specifies that once dmaengine_submit is called, the client must consider the descriptor pointer invalid. If submission fails, some DMA providers (like the idxd driver in idxd_dma_tx_submit) internally free the descriptor before returning an error.
Calling dmaengine_desc_free here would read tx->flags on an already-freed pointer on the error path, resulting in a use-after-free.
[Severity: Medium]
Will this actually free standard, non-reusable descriptors?
The dmaengine_desc_free function is explicitly designed for reusable descriptors. It internally calls dmaengine_desc_test_reuse, which checks the DMA_CTRL_REUSE flag and returns -EPERM immediately if it is not set.
Since standard descriptors created via dmaengine_prep_slave_single don't have this flag set by default, it seems this call acts as a no-op and might not resolve the resource leak mentioned in the commit message.
Quoted 4 lines
drivers/dma/dmaengine.c +4
-0+ } \ + cookie; \ +}) +
[ ... ]
Quoted 4 lines
include/linux/dmaengine.h +0
-0
[ ... ]
include/linux/dmaengine.h static inline int dma_get_slave_caps(struct dma_chan *chan, · line 1592
Quoted 12 lines
include/linux/dmaengine.h +8
-0@@ -1575,6 +1582,16 @@ static inline int dma_get_slave_caps(struct dma_chan *chan, {return -ENXIO ; } + +static inline dma_cookie_t +dmaengine_prep_submit_slave_single (struct dma_chan *chan, + dma_async_tx_callback cb, void *cb_param; + dma_addr_t buf, size_t len, + enum dma_transfer_direction dir, + unsigned long flags); +{
[Severity: Low]
Are there syntax errors in this fallback implementation?
The parameter list uses a semicolon instead of a comma after cb_param, and there is a stray semicolon immediately preceding the function body. This will cause a build failure when CONFIG_DMA_ENGINE is disabled.
Quoted 5 lines
include/linux/dmaengine.h +2
-0+ return -ENODEV; +}#endif static inline int dmaengine_desc_set_reuse (struct dma_async_tx_descriptor *tx)
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Frank Li
maintainerRe: [PATCH v2 1/2] dmaengine: Add helper dmaengine_prep_submit_slave_single()
Quoted 40 lines · On Fri, May 22, 2026 at 08:45:38PM +0000, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Critical] The macro accesses the descriptor after callingdmaengine_submit(), violating the DMA Engine API contract and causing a Use-After-Free.
- [Medium] Callingdmaengine_desc_free()fails to prevent memory leaks for standard, non-reusable DMA descriptors, defeating the primary goal of the patch.
- [Low] The fallback implementation ofdmaengine_prep_submit_slave_singlecontains severe syntax errors that break compilation whenCONFIG_DMA_ENGINEis disabled. --commit
c731d16a7ec5a6fed71b17234ae1bc2184ad8818
Author: Frank Li <[email protected]>dmaengine: Add helper
dmaengine_prep_submit_slave_single()This commit introduces a helper macro and function to combine the preparation and submission of a DMA slave single transfer into a single step. It also aims to automatically free the descriptor if the submission fails.
Quoted 4 lines
drivers/dma/dmaengine.c +0
-0[ ... ]
Quoted 6 lines
drivers/dma/dmaengine.c +2
-0@@ -1619,6 +1619,34 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx) }EXPORT_SYMBOL_GPL (dma_run_dependencies); +#define dmaengine_prep_submit (chan, cb, cb_param, func, ...) \ +({ struct dma_async_tx_descriptor *tx = \drivers/dma/dmaengine.c void dma_run_dependencies(struct dma_async_tx_descriptor *tx) · line 1633
Quoted 10 lines
drivers/dma/dmaengine.c +10
-0+ dmaengine_prep_##func(chan, __VA_ARGS__); \ + dma_cookie_t cookie = -ENOMEM; \ + \ + if (tx) { \ + tx->callback = cb; \ + tx->callback_param = cb_param; \ + cookie = dmaengine_submit(tx); \ + \ + if (dma_submit_error(cookie)) \ + dmaengine_desc_free(tx); \[Severity: Critical]
Does this access the descriptor after ownership has been transferred?
Quoted 4 lines
The DMA Engine API contract specifies that once
dmaengine_submitis called, the client must consider the descriptor pointer invalid. If submission fails, some DMA providers (like the idxd driver inidxd_dma_tx_submit) internally free the descriptor before returning an error.
Not sure if it is defined beheavor or just idxd implement as it. If it is defined beheavor, suggest update Document.
From API document:
"Once a descriptor has been obtained, the callback information can be
added and the descriptor must then be submitted. Some DMA engine drivers may hold a spinlock between a successful preparation and submission so it is important that these two operations are closely paired."
prep_submit() API should be provide to align document. but not sure if dmaengine_desc_free() call for reusable descriptors, Or providor should consider this like idxd_dma_tx_submit()?
Frank
Quoted 53 lines
Calling
dmaengine_desc_freehere would readtx->flagson an already-freed pointer on the error path, resulting in a use-after-free.[Severity: Medium]
Will this actually free standard, non-reusable descriptors?The
dmaengine_desc_freefunction is explicitly designed for reusable descriptors. It internally callsdmaengine_desc_test_reuse, which checks theDMA_CTRL_REUSEflag and returns-EPERMimmediately if it is not set.Since standard descriptors created via
dmaengine_prep_slave_singledon't have this flag set by default, it seems this call acts as a no-op and might not resolve the resource leak mentioned in the commit message.Quoted 4 lines
drivers/dma/dmaengine.c +4
-0+ } \ + cookie; \ +}) +[ ... ]
Quoted 4 lines
include/linux/dmaengine.h +0
-0[ ... ]
include/linux/dmaengine.h static inline int dma_get_slave_caps(struct dma_chan *chan, · line 1592
Quoted 12 lines
include/linux/dmaengine.h +8
-0@@ -1575,6 +1582,16 @@ static inline int dma_get_slave_caps(struct dma_chan *chan, {return -ENXIO ; } + +static inline dma_cookie_t +dmaengine_prep_submit_slave_single (struct dma_chan *chan, + dma_async_tx_callback cb, void *cb_param; + dma_addr_t buf, size_t len, + enum dma_transfer_direction dir, + unsigned long flags); +{[Severity: Low]
Are there syntax errors in this fallback implementation?The parameter list uses a semicolon instead of a comma after
cb_param, and there is a stray semicolon immediately preceding the function body. This will cause a build failure whenCONFIG_DMA_ENGINEis disabled.include/linux/dmaengine.h static inline int dma_get_slave_caps(struct dma_chan *chan, · line 1597
Quoted 5 lines
include/linux/dmaengine.h +2
-0+ return -ENODEV; +}#endif static inline int dmaengine_desc_set_reuse (struct dma_async_tx_descriptor *tx)--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v2 2/2 i2c: imx-lpi2c: use dmaengine_prep_submit() to simple code
In reply to [email protected]From: Frank Li <[email protected]>
Use dmaengine_prep_submit() to simple code. No functional change.
--- drivers/i2c/busses/i2c-imx-lpi2c.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
drivers/i2c/busses/i2c-imx-lpi2c.c +5 -16
@@ -720,7 +720,6 @@ static void lpi2c_dma_callback(void *data)static int lpi2c_dma_rx_cmd_submit (struct lpi2c_imx_struct *lpi2c_imx) { -struct dma_async_tx_descriptor *rx_cmd_desc;struct lpi2c_imx_dma *dma = lpi2c_imx->dma;struct dma_chan *txchan = dma->chan_tx;dma_cookie_t cookie;
@@ -733,15 +732,11 @@ static int lpi2c_dma_rx_cmd_submit(struct lpi2c_imx_struct *lpi2c_imx)return -EINVAL ; } - rx_cmd_desc =dmaengine_prep_slave_single (txchan, dma->dma_tx_addr, - dma->rx_cmd_buf_len,DMA_MEM_TO_DEV , -DMA_PREP_INTERRUPT |DMA_CTRL_ACK ); -if (!rx_cmd_desc) { -dev_err (&lpi2c_imx->adapter.dev,"DMA prep slave sg failed, use pio\n" ); - goto desc_prepare_err_exit; - } - - cookie =dmaengine_submit (rx_cmd_desc); + cookie =dmaengine_prep_submit_slave_single (txchan,NULL ,NULL , + dma->dma_tx_addr, + dma->rx_cmd_buf_len, +DMA_MEM_TO_DEV , +DMA_PREP_INTERRUPT |DMA_CTRL_ACK );if (dma_submit_error (cookie)) {dev_err (&lpi2c_imx->adapter.dev,"submitting DMA failed, use pio\n" ); goto submit_err_exit;
@@ -751,15 +746,9 @@ static int lpi2c_dma_rx_cmd_submit(struct lpi2c_imx_struct *lpi2c_imx)return 0 ; -desc_prepare_err_exit: -dma_unmap_single (txchan->device->dev, dma->dma_tx_addr, - dma->rx_cmd_buf_len,DMA_TO_DEVICE ); -return -EINVAL ; - submit_err_exit:dma_unmap_single (txchan->device->dev, dma->dma_tx_addr, dma->rx_cmd_buf_len,DMA_TO_DEVICE ); -dmaengine_desc_free (rx_cmd_desc);return -EINVAL ; }
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v2 2/2] i2c: imx-lpi2c: use dmaengine_prep_submit() to simple code
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
New issues:
- [Medium] Incomplete implementation of the refactoring pattern intended by the commit.
- [Low] The fallback declaration for dmaengine_prep_submit_slave_single contains semicolons instead of commas, breaking the build when CONFIG_DMA_ENGINE is disabled.
Pre-existing issues:
- [Critical] A critical double free vulnerability can occur on dma->rx_cmd_buf in the error handling path of lpi2c_imx_dma_xfer().
- [High] DMA channels requested during probe are never released on device removal or on a subsequent probe failure. --
commit c9c1ee53a58bc638a612c603e4f9002874839ea5
Author: Frank Li <[email protected]>
i2c: imx-lpi2c: use dmaengine_prep_submit() to simple code
Use dmaengine_prep_submit() to simple code. No functional change.
Quoted 1 line
Use
dmaengine_prep_submit()to simple code. No functional change.
[Severity: Medium]
Is the refactoring incomplete here? The commit message states it simplifies the code by using dmaengine_prep_submit(), but it only updates lpi2c_dma_rx_cmd_submit().
An identical DMA preparation sequence exists just below it in lpi2c_dma_submit(), which continues to manually call dmaengine_prep_slave_single() and dmaengine_submit(). Should lpi2c_dma_submit() be updated as well for consistency?
Quoted 12 lines
drivers/i2c/busses/i2c-imx-lpi2c.c +0
-4@@ -733,15 +732,11 @@ static int lpi2c_dma_rx_cmd_submit(struct lpi2c_imx_struct *lpi2c_imx)return -EINVAL ; } - rx_cmd_desc =dmaengine_prep_slave_single (txchan, dma->dma_tx_addr, - dma->rx_cmd_buf_len,DMA_MEM_TO_DEV , -DMA_PREP_INTERRUPT |DMA_CTRL_ACK ); -if (!rx_cmd_desc) {
drivers/i2c/busses/i2c-imx-lpi2c.c static int lpi2c_dma_rx_cmd_submit(struct lpi2c_imx_struct *lpi2c_imx) · line 739
Quoted 10 lines
drivers/i2c/busses/i2c-imx-lpi2c.c +5
-5-dev_err (&lpi2c_imx->adapter.dev,"DMA prep slave sg failed, use pio\n" ); - goto desc_prepare_err_exit; - } - - cookie =dmaengine_submit (rx_cmd_desc); + cookie =dmaengine_prep_submit_slave_single (txchan,NULL ,NULL , + dma->dma_tx_addr, + dma->rx_cmd_buf_len, +DMA_MEM_TO_DEV , +DMA_PREP_INTERRUPT |DMA_CTRL_ACK );
[Severity: Low]
Will this break the build when CONFIG_DMA_ENGINE is disabled?
In include/linux/dmaengine.h, the !CONFIG_DMA_ENGINE stub for dmaengine_prep_submit_slave_single() contains semicolons instead of commas:
static inline dma_cookie_t dmaengine_prep_submit_slave_single(struct dma_chan *chan,
dma_async_tx_callback cb, void *cb_param;
dma_addr_t buf, size_t len,
enum dma_transfer_direction dir,
unsigned long flags);
{
return -ENODEV;
}This syntax error will cause a compilation failure for any driver calling it when CONFIG_DMA_ENGINE is not set.
drivers/i2c/busses/i2c-imx-lpi2c.c static int lpi2c_dma_rx_cmd_submit(struct lpi2c_imx_struct *lpi2c_imx) · line 742
Quoted 3 lines
drivers/i2c/busses/i2c-imx-lpi2c.c +0
-0if (dma_submit_error (cookie)) {dev_err (&lpi2c_imx->adapter.dev,"submitting DMA failed, use pio\n" ); goto submit_err_exit;
[ ... ]
[Severity: Critical]
This isn't a bug introduced by this patch, but could this result in a double free on dma->rx_cmd_buf in the error handling path of lpi2c_imx_dma_xfer()?
When a read transfer (I2C_M_RD) finishes, dma->rx_cmd_buf is freed at the disable_dma label:
if (dma->dma_msg_flag & I2C_M_RD) kfree(dma->rx_cmd_buf);
However, the pointer is not set to NULL. If a subsequent read transfer fails early (e.g., if lpi2c_dma_config() or lpi2c_dma_submit() fails), the code jumps to disable_dma before lpi2c_imx_alloc_rx_cmd_buf() can allocate a new buffer.
Since dma->dma_msg_flag & I2C_M_RD is true, wouldn't kfree() be called a second time on the dangling pointer from the previous transfer?
[Severity: High]
This is a pre-existing issue, but are the DMA channels requested during probe leaking on device removal or probe failure?
In lpi2c_dma_init(), the "tx" and "rx" DMA channels are acquired using the non-managed dma_request_chan() API. However, the driver's remove function lpi2c_imx_remove() does not call dma_release_channel() to free them.
Furthermore, if i2c_add_adapter() fails during lpi2c_imx_probe(), the error path (rpm_disable) fails to release the DMA channels that were successfully acquired moments earlier. Should these paths be updated to release the channels?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
kernel test robot
build botRe: [PATCH v2 2/2] i2c: imx-lpi2c: use dmaengine_prep_submit() to simple code
In reply to [email protected]kernel test robot noticed the following build errors:
Hi Frank,
kernel test robot noticed the following build errors:
[auto build test ERROR on 8f0b4cce4481fb22653697cced8d0d04027cb1e8]
url: https://github.com/intel-lab-lkp/linux/commits/Frank-Li-oss-nxp-com/dmaengine-Add-helper-dmaengine_prep_submit_slave_single/20260523-041812 base: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 patch link: https://lore.kernel.org/r/20260522-dma_prep_submit-v2-2-7a87a5a29525%40nxp.com patch subject: [PATCH v2 2/2] i2c: imx-lpi2c: use dmaengine_prep_submit() to simple code config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260527/[email protected]/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260527/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
In file included from net/core/dev.c:124:
>> include/linux/dmaengine.h:1588:48: error: expected ')'
1588 | dma_async_tx_callback cb, void *cb_param;
| ^
include/linux/dmaengine.h:1587:35: note: to match this '('
1587 | dmaengine_prep_submit_slave_single(struct dma_chan *chan,
| ^
>> include/linux/dmaengine.h:1587:1: error: conflicting types for 'dmaengine_prep_submit_slave_single'
1587 | dmaengine_prep_submit_slave_single(struct dma_chan *chan,
| ^
include/linux/dmaengine.h:994:1: note: previous declaration is here
994 | dmaengine_prep_submit_slave_single(struct dma_chan *chan,
| ^
>> include/linux/dmaengine.h:1589:24: error: redefinition of 'size_t' as different kind of symbol
1589 | dma_addr_t buf, size_t len,
| ^
include/linux/types.h:62:26: note: previous definition is here
62 | typedef __kernel_size_t size_t;
| ^
In file included from net/core/dev.c:124:
>> include/linux/dmaengine.h:1589:30: error: expected ';' after top level declarator
1589 | dma_addr_t buf, size_t len,
| ^
| ;
>> include/linux/dmaengine.h:1592:1: error: expected identifier or '('
1592 | {
| ^5 errors generated.
vim +1588 include/linux/dmaengine.h
1585
1586 static inline dma_cookie_t
> 1587 dmaengine_prep_submit_slave_single(struct dma_chan *chan,
> 1588 dma_async_tx_callback cb, void *cb_param;
> 1589 dma_addr_t buf, size_t len,
1590 enum dma_transfer_direction dir,
1591 unsigned long flags);
> 1592 { 1593 return -ENODEV;
1594 }
1595 #endif
1596
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki