All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Alexey Minnekhanov <alexeymin@postmarketos.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Wolfram Sang <wsa@kernel.org>,
	linux-arm-msm@vger.kernel.org, Andy Gross <agross@kernel.org>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Douglas Anderson <dianders@chromium.org>,
	Matthias Kaehlcke <mka@chromium.org>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH v4] i2c: qcom-geni: Add support for GPI DMA
Date: Wed, 3 Nov 2021 10:51:47 +0530	[thread overview]
Message-ID: <YYIca8877aa6hNmd@matsya> (raw)
In-Reply-To: <eb297333-63bb-91c4-6340-801c3c9e3663@postmarketos.org>

Hello Alexey,

On 03-11-21, 05:13, Alexey Minnekhanov wrote:
> 19.10.2021 09:01, Vinod Koul wrote:
> > This adds capability to use GSI DMA for I2C transfers
> > 
> > Signed-off-by: Vinod Koul <vkoul@kernel.org>
> > ---
> > Changes since v3:
> >   - remove separate tx and rx function for gsi dma and make a common one
> >   - remove global structs and use local variables instead
> > 
> 
> Hi, I've tried this patch on sm8150 board and I'm seeing weird things:
> 
> [    0.428829] gpi c00000.dma-controller: Adding to iommu group 0
> [    0.480453] geni_se_qup cc0000.geniqup: Adding to iommu group 1
> [    0.484019] geni_i2c c80000.i2c: Bus frequency not specified, default to
> 100kHz.
> [    0.487172] geni_i2c c80000.i2c: error 0000000000000000: Failed to get tx
> DMA ch
> [    0.495499] geni_i2c c80000.i2c: error 0000000000000000: Failed to get rx
> DMA ch
> [    0.499842] geni_i2c c80000.i2c: Grabbed GPI dma channels
> [    0.504784] geni_i2c c80000.i2c: Using GPI DMA mode for I2C
> [    0.510812] geni_i2c c80000.i2c: Geni-I2C adaptor successfully added
> 
> It seems weird to me that it "failed to get DMA channels", but then says
> anyway "Grabbed GPI DMA channels" and "Using GPI DMA mode for I2C".
> 
> What I did in dts is basically include sm8150.dtsi and do
> 
> &gpi_dma2 {
> 	status = "okay";
> };
> 
> &i2c17 {
> 	status = "okay";
> 	dmas = <&gpi_dma2 0 0 QCOM_GPI_I2C>,
> 		<&gpi_dma2 1 0 QCOM_GPI_I2C>;
> 	dma-names = "tx", "rx";
> 	/* empty - no clients */
> }
> 
> Another observation, even if I comment out "dmas" and "dma-names" in i2c17
> node, I get
> 
> [    0.487037] geni_i2c c80000.i2c: error (____ptrval____): Failed to get tx
> DMA ch
> [    0.490077] geni_i2c c80000.i2c: error (____ptrval____): Failed to get rx
> DMA ch
> [    0.493077] geni_i2c c80000.i2c: Grabbed GPI dma channels
> [    0.496061] geni_i2c c80000.i2c: Using GPI DMA mode for I2C
> [    0.500155] geni_i2c c80000.i2c: Geni-I2C adaptor successfully added

This does not look correct. In absence of dmas property, the channel
allocation should not have gone ahead and you should not see " Grabbed
GPI dma channels" message!

Btw what is the output of below when dmas was commented out:
cat /sys/kernel/debug/dmaengine/summary

This would show the channels allocated to each controller

-- 
~Vinod

  reply	other threads:[~2021-11-03  5:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  6:01 [PATCH v4] i2c: qcom-geni: Add support for GPI DMA Vinod Koul
2021-11-01 16:23 ` Bjorn Andersson
2021-11-03  2:13 ` Alexey Minnekhanov
2021-11-03  5:21   ` Vinod Koul [this message]
2021-11-04  2:44     ` Alexey Minnekhanov
2021-10-29 15:31 kernel test robot
2021-10-31 14:05 ` kernel test robot
2021-10-31 14:05   ` kernel test robot

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=YYIca8877aa6hNmd@matsya \
    --to=vkoul@kernel.org \
    --cc=agross@kernel.org \
    --cc=alexeymin@postmarketos.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=sumit.semwal@linaro.org \
    --cc=wsa@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.