linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jyothi Kumar Seerapu <quic_jseerapu@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: "Vinod Koul" <vkoul@kernel.org>,
	"Mukesh Kumar Savaliya" <quic_msavaliy@quicinc.com>,
	"Viken Dadhaniya" <quic_vdadhani@quicinc.com>,
	"Andi Shyti" <andi.shyti@kernel.org>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, quic_vtanuku@quicinc.com
Subject: Re: [PATCH v6 1/2] dmaengine: qcom: gpi: Add GPI Block event interrupt support
Date: Tue, 17 Jun 2025 19:46:58 +0530	[thread overview]
Message-ID: <f04b5912-8e1c-47fe-8d0e-3bef72ae393d@quicinc.com> (raw)
In-Reply-To: <CAO9ioeUW9-7N2Ptu_p=XKzeb02RsXx8V3CzarPOD4EWy4QrnsA@mail.gmail.com>



On 5/30/2025 9:23 PM, Dmitry Baryshkov wrote:
> On Fri, 30 May 2025 at 17:05, Jyothi Kumar Seerapu
> <quic_jseerapu@quicinc.com> wrote:
>>
>>
>>
>> On 5/9/2025 11:48 AM, Jyothi Kumar Seerapu wrote:
>>>
>>>
>>> On 5/6/2025 5:02 PM, Dmitry Baryshkov wrote:
>>>> On Tue, May 06, 2025 at 04:48:43PM +0530, Jyothi Kumar Seerapu wrote:
>>>>> GSI hardware generates an interrupt for each transfer completion.
>>>>> For multiple messages within a single transfer, this results in
>>>>> N interrupts for N messages, leading to significant software
>>>>> interrupt latency.
>>>>>
>>>>> To mitigate this latency, utilize Block Event Interrupt (BEI) mechanism.
>>>>> Enabling BEI instructs the GSI hardware to prevent interrupt generation
>>>>> and BEI is disabled when an interrupt is necessary.
>>>>>
>>>>> When using BEI, consider splitting a single multi-message transfer into
>>>>> chunks of 8 messages internally and so interrupts are not expected for
>>>>> the first 7 message completions, only the last message triggers
>>>>> an interrupt, indicating the completion of 8 messages.
>>>>>
>>>>> This BEI mechanism enhances overall transfer efficiency.
>>>>>
>>>>> Signed-off-by: Jyothi Kumar Seerapu <quic_jseerapu@quicinc.com>
>>>>> ---
>>>>> v5 ->v6:
>>>>>     - For updating the block event interrupt bit, instead of relying on
>>>>>       bei_flag, decision check is moved with DMA_PREP_INTERRUPT flag.
>>>>> v4 -> v5:
>>>>>     - BEI flag naming changed from flags to bei_flag.
>>>>>     - QCOM_GPI_BLOCK_EVENT_IRQ macro is removed from qcom-gpi-dma.h
>>>>>       file, and Block event interrupt support is checked with bei_flag.
>>>>>
>>>>> v3 -> v4:
>>>>>     - API's added for Block event interrupt with multi descriptor
>>>>> support for
>>>>>       I2C is moved from qcom-gpi-dma.h file to I2C geni qcom driver file.
>>>>>     - gpi_multi_xfer_timeout_handler function is moved from GPI driver to
>>>>>       I2C driver.
>>>>>
>>>>> v2-> v3:
>>>>>      - Renamed gpi_multi_desc_process to gpi_multi_xfer_timeout_handler
>>>>>      - MIN_NUM_OF_MSGS_MULTI_DESC changed from 4 to 2
>>>>>      - Added documentation for newly added changes in "qcom-gpi-dma.h"
>>>>> file
>>>>>      - Updated commit description.
>>>>>
>>>>> v1 -> v2:
>>>>>      - Changed dma_addr type from array of pointers to array.
>>>>>      - To support BEI functionality with the TRE size of 64 defined in
>>>>> GPI driver,
>>>>>        updated QCOM_GPI_MAX_NUM_MSGS to 16 and NUM_MSGS_PER_IRQ to 4.
>>>>>
>>>>>    drivers/dma/qcom/gpi.c           | 3 +++
>>>>>    include/linux/dma/qcom-gpi-dma.h | 2 ++
>>>>>    2 files changed, 5 insertions(+)
>>>>>
>>>>> diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
>>>>> index b1f0001cc99c..7e511f54166a 100644
>>>>> --- a/drivers/dma/qcom/gpi.c
>>>>> +++ b/drivers/dma/qcom/gpi.c
>>>>> @@ -1695,6 +1695,9 @@ static int gpi_create_i2c_tre(struct gchan
>>>>> *chan, struct gpi_desc *desc,
>>>>>            tre->dword[3] = u32_encode_bits(TRE_TYPE_DMA, TRE_FLAGS_TYPE);
>>>>>            tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOT);
>>>>> +
>>>>> +        if (!(i2c->dma_flags & DMA_PREP_INTERRUPT))
>>>>> +            tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_BEI);
>>>>>        }
>>>>>        for (i = 0; i < tre_idx; i++)
>>>>> diff --git a/include/linux/dma/qcom-gpi-dma.h b/include/linux/dma/
>>>>> qcom-gpi-dma.h
>>>>> index 6680dd1a43c6..ebac0d3edff2 100644
>>>>> --- a/include/linux/dma/qcom-gpi-dma.h
>>>>> +++ b/include/linux/dma/qcom-gpi-dma.h
>>>>> @@ -65,6 +65,7 @@ enum i2c_op {
>>>>>     * @rx_len: receive length for buffer
>>>>>     * @op: i2c cmd
>>>>>     * @muli-msg: is part of multi i2c r-w msgs
>>>>> + * @dma_flags: Flags indicating DMA capabilities
>>>>>     */
>>>>>    struct gpi_i2c_config {
>>>>>        u8 set_config;
>>>>> @@ -78,6 +79,7 @@ struct gpi_i2c_config {
>>>>>        u32 rx_len;
>>>>>        enum i2c_op op;
>>>>>        bool multi_msg;
>>>>> +    unsigned int dma_flags;
>>>>
>>>> Why do you need extra field instead of using
>>>> dma_async_tx_descriptor.flags?
>>>
>>> In the original I2C QCOM GENI driver, using the local variable (unsigned
>>> in flags) and updating the "DMA_PREP_INTERRUPT" flag.
>>>
>>> Sure, i will review if "dma_async_tx_descriptor.flags" can be retrieved
>>> in GPI driver for DMA_PREP_INTERRUPT flag status.
>>
>> Hi Dmitry,
>>
>> In the I2C Geni driver, the dma flags are primarily used in the
>> dmaengine_prep_slave_single() function, which expects the argument type
>> to be unsigned int. Therefore, the flags should be defined either as
>> enum dma_ctrl_flags, or unsigned int.
>>
>> In the GPI driver, specifically within the gpi_prep_slave_sg() function,
>> the flags are correctly received from the I2C driver. However, these
>> flags are not currently passed to the gpi_create_i2c_tre() function.
>>
>> If we pass the existing flags variable to the gpi_create_i2c_tre()
>> function, we can retrieve the DMA flags information without introducing
>> any additional or external variables.
>>
>> Please confirm if this approach—reusing the existing flags argument in
>> the GPI driver—is acceptable and good to proceed with.
> 
> Could you please check how other drivers use the DMA_PREP_INTERRUPT
> flag? That will answer your question.
Sure, thanks.


> 
>>
>>>>
>>>>>    };
>>>>>    #endif /* QCOM_GPI_DMA_H */
>>>>> --
>>>>> 2.17.1
>>>>>
>>>>
>>>
>>>
>>
> 
> 


  reply	other threads:[~2025-06-17 14:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 11:18 [PATCH v6 0/2] Add Block event interrupt support for I2C protocol Jyothi Kumar Seerapu
2025-05-06 11:18 ` [PATCH v6 1/2] dmaengine: qcom: gpi: Add GPI Block event interrupt support Jyothi Kumar Seerapu
2025-05-06 11:32   ` Dmitry Baryshkov
2025-05-09  6:18     ` Jyothi Kumar Seerapu
2025-05-30 14:05       ` Jyothi Kumar Seerapu
2025-05-30 15:53         ` Dmitry Baryshkov
2025-06-17 14:16           ` Jyothi Kumar Seerapu [this message]
2025-05-06 11:18 ` [PATCH v6 2/2] i2c: i2c-qcom-geni: Add " Jyothi Kumar Seerapu
2025-05-06 11:46   ` Dmitry Baryshkov
2025-05-09  6:18     ` Jyothi Kumar Seerapu
2025-05-09 16:01       ` Dmitry Baryshkov
2025-05-21 10:28         ` Jyothi Kumar Seerapu
2025-05-21 12:45           ` Dmitry Baryshkov
2025-05-30 14:06             ` Jyothi Kumar Seerapu
2025-05-30 16:42               ` Dmitry Baryshkov
2025-06-17 14:11                 ` Jyothi Kumar Seerapu
2025-06-17 19:32                   ` Dmitry Baryshkov
2025-06-19 16:16                     ` Jyothi Kumar Seerapu
2025-07-03 12:50                       ` Jyothi Kumar Seerapu
2025-07-03 19:41                         ` Dmitry Baryshkov
2025-07-07 16:28                           ` Jyothi Kumar Seerapu
2025-07-19  9:57                             ` Dmitry Baryshkov
2025-07-22 12:20                               ` Jyothi Kumar Seerapu
2025-07-22 12:46                                 ` Dmitry Baryshkov
2025-07-23  7:15                                   ` Vinod Koul
2025-07-25 10:50                                     ` Jyothi Kumar Seerapu
2025-08-11 17:40                                       ` Vinod Koul
2025-08-14 12:44                                         ` Jyothi Kumar Seerapu
2025-05-07  2:21   ` ALOK TIWARI
2025-05-09  6:16     ` Jyothi Kumar Seerapu

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=f04b5912-8e1c-47fe-8d0e-3bef72ae393d@quicinc.com \
    --to=quic_jseerapu@quicinc.com \
    --cc=andi.shyti@kernel.org \
    --cc=christian.koenig@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=quic_msavaliy@quicinc.com \
    --cc=quic_vdadhani@quicinc.com \
    --cc=quic_vtanuku@quicinc.com \
    --cc=sumit.semwal@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).