* [PATCH 1/3] doc: dmaengine: client-api: Add immediate commands in the DMA client API
2026-11-15 14:02 [PATCH 0/3] dmaengine: Add support for immediate commands Nickolay Goppen
@ 2026-11-15 14:02 ` Nickolay Goppen
2026-11-15 14:02 ` [PATCH 2/3] dmaengine: Add support for immediate commands in the " Nickolay Goppen
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Nickolay Goppen @ 2026-11-15 14:02 UTC (permalink / raw)
To: Vinod Koul, Frank Li, Jonathan Corbet, Shuah Khan, Randy Dunlap
Cc: dmaengine, linux-doc, linux-kernel, linux-arm-msm,
Nickolay Goppen, Sireesh Kodali
From: Sireesh Kodali <sireeshkodali1@gmail.com>
Immediate commands are used by the IPA driver to send commands to the
microcontroller over BAM. These are different from PREP_CMD.
Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
---
Documentation/driver-api/dmaengine/provider.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Documentation/driver-api/dmaengine/provider.rst b/Documentation/driver-api/dmaengine/provider.rst
index be47852e5a0f..05911c03558d 100644
--- a/Documentation/driver-api/dmaengine/provider.rst
+++ b/Documentation/driver-api/dmaengine/provider.rst
@@ -612,6 +612,16 @@ DMA_CTRL_REUSE
writes for which the descriptor should be in different format from
normal data descriptors.
+- DMA_PREP_IMM_CMD
+
+ - If set, the client driver tells DMA controller that passed data in DMA
+ API is immediate command data.
+
+ - Interpretation of command data is DMA controller specific. It can be
+ used for issuing immediate commands to other peripherals/register
+ reads/register writes for which the descriptor should be in a
+ different format from normal data descriptors.
+
- DMA_PREP_REPEAT
- If set, the transfer will be automatically repeated when it ends until a
--
2.56.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/3] dmaengine: Add support for immediate commands in the client API
2026-11-15 14:02 [PATCH 0/3] dmaengine: Add support for immediate commands Nickolay Goppen
2026-11-15 14:02 ` [PATCH 1/3] doc: dmaengine: client-api: Add immediate commands in the DMA client API Nickolay Goppen
@ 2026-11-15 14:02 ` Nickolay Goppen
2026-11-18 20:03 ` Frank Li
2026-11-15 14:02 ` [PATCH 3/3] dmaengine: bam_dma: Add support for immediate commands Nickolay Goppen
2026-12-03 18:31 ` [PATCH 0/3] dmaengine: " Nickolay Goppen
3 siblings, 1 reply; 7+ messages in thread
From: Nickolay Goppen @ 2026-11-15 14:02 UTC (permalink / raw)
To: Vinod Koul, Frank Li, Jonathan Corbet, Shuah Khan, Randy Dunlap
Cc: dmaengine, linux-doc, linux-kernel, linux-arm-msm,
Nickolay Goppen, Sireesh Kodali
From: Sireesh Kodali <sireeshkodali1@gmail.com>
Immediate commands are needed by the IPA network driver, so that it can
send commands via BAM to the IPA microcontroller.
Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
---
include/linux/dmaengine.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 805668fbe437..56c49254ed04 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -200,6 +200,9 @@ struct dma_vec {
* transaction is marked with DMA_PREP_REPEAT will cause the new transaction
* to never be processed and stay in the issued queue forever. The flag is
* ignored if the previous transaction is not a repeated transaction.
+ * @DMA_PREP_IMM_CMD: tell the driver that the data passed to the DMA API is
+ * immediate command data and the descriptor should be in a different format
+ * from the normal data and descriptor
*/
enum dma_ctrl_flags {
DMA_PREP_INTERRUPT = (1 << 0),
@@ -212,6 +215,7 @@ enum dma_ctrl_flags {
DMA_PREP_CMD = (1 << 7),
DMA_PREP_REPEAT = (1 << 8),
DMA_PREP_LOAD_EOT = (1 << 9),
+ DMA_PREP_IMM_CMD = (1 << 10),
};
/**
--
2.56.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 2/3] dmaengine: Add support for immediate commands in the client API
2026-11-15 14:02 ` [PATCH 2/3] dmaengine: Add support for immediate commands in the " Nickolay Goppen
@ 2026-11-18 20:03 ` Frank Li
2026-11-18 20:20 ` Nickolay Goppen
0 siblings, 1 reply; 7+ messages in thread
From: Frank Li @ 2026-11-18 20:03 UTC (permalink / raw)
To: Nickolay Goppen
Cc: Vinod Koul, Frank Li, Jonathan Corbet, Shuah Khan, Randy Dunlap,
dmaengine, linux-doc, linux-kernel, linux-arm-msm, Sireesh Kodali
On Sun, Nov 15, 2026 at 05:02:44PM +0300, Nickolay Goppen wrote:
> [You don't often get email from setotau@mainlining.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Sireesh Kodali <sireeshkodali1@gmail.com>
>
> Immediate commands are needed by the IPA network driver, so that it can
> send commands via BAM to the IPA microcontroller.
>
> Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
> Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
> ---
> include/linux/dmaengine.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index 805668fbe437..56c49254ed04 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -200,6 +200,9 @@ struct dma_vec {
> * transaction is marked with DMA_PREP_REPEAT will cause the new transaction
> * to never be processed and stay in the issued queue forever. The flag is
> * ignored if the previous transaction is not a repeated transaction.
> + * @DMA_PREP_IMM_CMD: tell the driver that the data passed to the DMA API is
> + * immediate command data and the descriptor should be in a different format
> + * from the normal data and descriptor
does dmaengine_desc_attach_metadata() work for your case?
Frank
> */
> enum dma_ctrl_flags {
> DMA_PREP_INTERRUPT = (1 << 0),
> @@ -212,6 +215,7 @@ enum dma_ctrl_flags {
> DMA_PREP_CMD = (1 << 7),
> DMA_PREP_REPEAT = (1 << 8),
> DMA_PREP_LOAD_EOT = (1 << 9),
> + DMA_PREP_IMM_CMD = (1 << 10),
> };
>
> /**
>
> --
> 2.56.1
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 2/3] dmaengine: Add support for immediate commands in the client API
2026-11-18 20:03 ` Frank Li
@ 2026-11-18 20:20 ` Nickolay Goppen
0 siblings, 0 replies; 7+ messages in thread
From: Nickolay Goppen @ 2026-11-18 20:20 UTC (permalink / raw)
To: Frank Li
Cc: Vinod Koul, Frank Li, Jonathan Corbet, Shuah Khan, Randy Dunlap,
dmaengine, linux-doc, linux-kernel, linux-arm-msm, Sireesh Kodali
18.11.2026 23:03, Frank Li пишет:
> On Sun, Nov 15, 2026 at 05:02:44PM +0300, Nickolay Goppen wrote:
>> [You don't often get email from setotau@mainlining.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>
>> From: Sireesh Kodali <sireeshkodali1@gmail.com>
>>
>> Immediate commands are needed by the IPA network driver, so that it can
>> send commands via BAM to the IPA microcontroller.
>>
>> Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
>> Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
>> ---
>> include/linux/dmaengine.h | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
>> index 805668fbe437..56c49254ed04 100644
>> --- a/include/linux/dmaengine.h
>> +++ b/include/linux/dmaengine.h
>> @@ -200,6 +200,9 @@ struct dma_vec {
>> * transaction is marked with DMA_PREP_REPEAT will cause the new transaction
>> * to never be processed and stay in the issued queue forever. The flag is
>> * ignored if the previous transaction is not a repeated transaction.
>> + * @DMA_PREP_IMM_CMD: tell the driver that the data passed to the DMA API is
>> + * immediate command data and the descriptor should be in a different format
>> + * from the normal data and descriptor
> does dmaengine_desc_attach_metadata() work for your case?
Sorry, I don't get your question. Can you explain?
> Frank
>
>> */
>> enum dma_ctrl_flags {
>> DMA_PREP_INTERRUPT = (1 << 0),
>> @@ -212,6 +215,7 @@ enum dma_ctrl_flags {
>> DMA_PREP_CMD = (1 << 7),
>> DMA_PREP_REPEAT = (1 << 8),
>> DMA_PREP_LOAD_EOT = (1 << 9),
>> + DMA_PREP_IMM_CMD = (1 << 10),
>> };
>>
>> /**
>>
>> --
>> 2.56.1
--
Best regards,
Nickolay
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] dmaengine: bam_dma: Add support for immediate commands
2026-11-15 14:02 [PATCH 0/3] dmaengine: Add support for immediate commands Nickolay Goppen
2026-11-15 14:02 ` [PATCH 1/3] doc: dmaengine: client-api: Add immediate commands in the DMA client API Nickolay Goppen
2026-11-15 14:02 ` [PATCH 2/3] dmaengine: Add support for immediate commands in the " Nickolay Goppen
@ 2026-11-15 14:02 ` Nickolay Goppen
2026-12-03 18:31 ` [PATCH 0/3] dmaengine: " Nickolay Goppen
3 siblings, 0 replies; 7+ messages in thread
From: Nickolay Goppen @ 2026-11-15 14:02 UTC (permalink / raw)
To: Vinod Koul, Frank Li, Jonathan Corbet, Shuah Khan, Randy Dunlap
Cc: dmaengine, linux-doc, linux-kernel, linux-arm-msm,
Nickolay Goppen, Sireesh Kodali
From: Sireesh Kodali <sireeshkodali1@gmail.com>
Immediate commands are handled similar to regular commands that are sent
over BAM, only a different flag needs to be set. The immediate command
support is needed to implement support for IPA v2.x, which rely on BAM
immediate commands to send commands to the IPA microcontroller.
Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
---
drivers/dma/qcom/bam_dma.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index e62e411dc8f8..668fd15ab544 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -59,6 +59,7 @@ struct bam_desc_hw {
#define DESC_FLAG_EOB BIT(13)
#define DESC_FLAG_NWD BIT(12)
#define DESC_FLAG_CMD BIT(11)
+#define DESC_FLAG_IMM BIT(8)
struct bam_async_desc {
struct virt_dma_desc vd;
@@ -714,6 +715,8 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
do {
if (flags & DMA_PREP_CMD)
desc->flags |= cpu_to_le16(DESC_FLAG_CMD);
+ else if (flags & DMA_PREP_IMM_CMD)
+ desc->flags |= cpu_to_le16(DESC_FLAG_IMM);
desc->addr = cpu_to_le32(sg_dma_address(sg) +
curr_offset);
--
2.56.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 0/3] dmaengine: Add support for immediate commands
2026-11-15 14:02 [PATCH 0/3] dmaengine: Add support for immediate commands Nickolay Goppen
` (2 preceding siblings ...)
2026-11-15 14:02 ` [PATCH 3/3] dmaengine: bam_dma: Add support for immediate commands Nickolay Goppen
@ 2026-12-03 18:31 ` Nickolay Goppen
3 siblings, 0 replies; 7+ messages in thread
From: Nickolay Goppen @ 2026-12-03 18:31 UTC (permalink / raw)
To: Vinod Koul, Frank Li, Jonathan Corbet, Shuah Khan, Randy Dunlap
Cc: dmaengine, linux-doc, linux-kernel, linux-arm-msm, Sireesh Kodali
15.11.2026 17:02, Nickolay Goppen пишет:
> The IPA v2.x block, found on some older Qualcomm SoCs, uses BAM DMA to
> send and receive packets from the AP. It also uses BAM to receive
> commands from the AP (and possibly the modem). These commands are
> encoded as "Immediate Commands".
>
> Immediate (IMM) (only for BAM-NDP): Allows the software to create
> descriptors of type immediate, which does not generate any data
> transmissions or registers configuration, it is simply supplied to the
> peripheral, the peripheral then parses its fields (which are
> irrelevant to the BAM). Only the flags of this descriptor are relevant
> to the BAM, address and size are irrelevant, and BAM simply passes
> them as is to the peripheral. This can be used for the software to
> operate peripheral-specific operations within regular data operations.
> Immediate descriptors are published on the sidebands as 1 byte size
> descriptor, once BAM_NDP fetches an immediate descriptor, it publishes
> all recently fetched descriptors including the immediate descriptor
> with immediate indication, to inform the peripheral that the last
> published descriptor was immediate descriptor.
>
> Adding support for immediate commands is trivial, but requires
> also adding Immediate Commands to the dmaengine API, which is
> what this patch series does.
>
> Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
> ---
> Sireesh Kodali (3):
> doc: dmaengine: client-api: Add immediate commands in the DMA client API
> dmaengine: Add support for immediate commands in the client API
> dmaengine: bam_dma: Add support for immediate commands
>
> Documentation/driver-api/dmaengine/provider.rst | 10 ++++++++++
> drivers/dma/qcom/bam_dma.c | 3 +++
> include/linux/dmaengine.h | 4 ++++
> 3 files changed, 17 insertions(+)
> ---
> base-commit: 84abb955b1015477aa11a96e2f3ac1b938b77f48
> change-id: 20261115-qcom-bam-dma-immediate-577133c77c2e
>
> Best regards,
> --
> Nickolay Goppen <setotau@mainlining.org>
Can someone take a look?
--
Best regards,
Nickolay
^ permalink raw reply [flat|nested] 7+ messages in thread