[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f1cf0dd1-06f5-4633-b2c3-fd3666911f07@quicinc.com>
Date: Mon, 2 Dec 2024 12:07:26 +0530
From: Jyothi Kumar Seerapu <quic_jseerapu@...cinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
CC: Vinod Koul <vkoul@...nel.org>, Mark Brown <broonie@...nel.org>,
<linux-arm-msm@...r.kernel.org>, <dmaengine@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-spi@...r.kernel.org>,
<quic_msavaliy@...cinc.com>, <quic_vtanuku@...cinc.com>
Subject: Re: [PATCH v2 2/2] spi: spi-geni-qcom: Add immediate DMA support
On 11/28/2024 7:36 PM, Dmitry Baryshkov wrote:
> On Thu, Nov 28, 2024 at 07:03:51PM +0530, Jyothi Kumar Seerapu wrote:
>> The DMA TRE(Transfer ring element) buffer contains the DMA
>> buffer address. Accessing data from this address can cause
>> significant delays in SPI transfers, which can be mitigated to
>> some extent by utilizing immediate DMA support.
>>
>> QCOM GPI DMA hardware supports an immediate DMA feature for data
>> up to 8 bytes, storing the data directly in the DMA TRE buffer
>> instead of the DMA buffer address. This enhancement enables faster
>> SPI data transfers.
>>
>> This optimization reduces the average transfer time from 25 us to
>> 16 us for a single SPI transfer of 8 bytes length, with a clock
>> frequency of 50 MHz.
>>
>> Signed-off-by: Jyothi Kumar Seerapu <quic_jseerapu@...cinc.com>
>> ---
>>
>> v1 -> v2:
>> - Moved the spi changes as patch2.
>>
>> drivers/spi/spi-geni-qcom.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
>> index 768d7482102a..53c8f6b7f3c5 100644
>> --- a/drivers/spi/spi-geni-qcom.c
>> +++ b/drivers/spi/spi-geni-qcom.c
>> @@ -472,11 +472,18 @@ static int setup_gsi_xfer(struct spi_transfer *xfer, struct spi_geni_master *mas
>> mas->cur_speed_hz = xfer->speed_hz;
>> }
>>
>> + /*
>> + * Set QCOM_GPI_IMMEDIATE_DMA flag if transfer length up to 8 bytes.
>> + */
>> if (xfer->tx_buf && xfer->rx_buf) {
>> peripheral.cmd = SPI_DUPLEX;
>> + if (xfer->len <= QCOM_GPI_IMMEDIATE_DMA_LEN)
>> + peripheral.flags |= QCOM_GPI_IMMEDIATE_DMA;
>> } else if (xfer->tx_buf) {
>> peripheral.cmd = SPI_TX;
>> peripheral.rx_len = 0;
>> + if (xfer->len <= QCOM_GPI_IMMEDIATE_DMA_LEN)
>> + peripheral.flags |= QCOM_GPI_IMMEDIATE_DMA;
>
> NAK. Please finish discussions in the previous iteration before posting
> new revision. Sending your responses together with sending next
> iteration is a bad practice and is frowned upon (unless one agrees to
> all the comments).
>
> There was an open question here and your answer doesn't sound convincing
> enough. Please continue discussion in v1.
Sure Dmitry, thanks for the guidance.
I will make sure that post the new revisions after all the comments are
sorted out.
>
>> } else if (xfer->rx_buf) {
>> peripheral.cmd = SPI_RX;
>> if (!(mas->cur_bits_per_word % MIN_WORD_LEN)) {
>> --
>> 2.17.1
>>
>
Powered by blists - more mailing lists