dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: <dmaengine@vger.kernel.org>, Vinod Koul <vkoul@kernel.org>,
	Michal Simek <michal.simek@xilinx.com>,
	Hyun Kwon <hyun.kwon@xilinx.com>,
	Tejas Upadhyay <tejasu@xilinx.com>,
	Satish Kumar Nagireddy <SATISHNA@xilinx.com>
Subject: Re: [PATCH v4 3/6] dmaengine: Add support for repeating transactions
Date: Mon, 1 Jun 2020 14:14:03 +0300	[thread overview]
Message-ID: <23b26252-eb7b-f918-759d-0ccda90586b0@ti.com> (raw)
In-Reply-To: <20200528021006.GG4670@pendragon.ideasonboard.com>

[-- Attachment #1: Type: text/plain, Size: 3673 bytes --]

Hi Laurent,

On 28/05/2020 5.10, Laurent Pinchart wrote:
>>> As mentioned in the commit message, I plan to extend that, I just didn't
>>> want to add the checks to all the prepare operation wrappers until an
>>> agreement on the approach would be reached. I also thought it would be
>>> good to not allow this API for other transaction types until use cases
>>> arise, in order to force upstream discussions instead of silently
>>> abusing the API :-)
>>
>> I would not object if slave_sg and memcpy got the same treatment. If the
>> DMA driver did not set the DMA_REPEAT then clients can not use this
>> feature anyways.
> 
> Would you not object, or would you prefer if it was done in v5 ? :-)

DMA_REPEAT is a generic flag, not limited to only interleaved, but you
are going to be the first user of it with interleaved.

> Overall I think that enabling APIs that have no user isn't necessarily
> the best idea, as it's prone to design issues, but I don't mind doing so
> if you think it needs to be done now.

We would get the support in one go with the same commit. I don't think
it makes much sense to add slave_sg later, then memcpy another time.
True, there might be no users for them for some time, but their presents
might invite users?

>>> I can extend the flag to all other transaction types
>>> (except for the cyclic transaction, as it doesn't make sense there).
>>
>> Yep, cyclic is a different type of transfer, it is for circular buffers.
>> It could be seen as a special case of slave_sg. Some drivers actually
>> create temporary sg_list in case of cyclic and use the same setup
>> function to set up the transfer for slave_sg/cyclic...
> 
> Cyclic is different for historical reasons, but if I had to redesign it
> today, I'd make it slave_sg + DMA_PREP_REPEAT. We obviously can't, and I
> have no issue with that.

Which should be accompanied with a flag to tell that the sg_list is
covering a circular buffer to save all drivers to check the sg_list that
it is circular buffer (current cyclic) or really sg.
Some DMA can only do repeat on circular buffers (omap-dma, tegra, etc).

>> But, DMA drivers might support neither of them, either of them or both.
>> It is up to the client to pick the preferred method for it's use.
>> It is not far fetched that the next DMA the client is going to be
>> serviced will have different capabilities and the client needs to handle
>> EOT or NOW or it might even need to have fallback to case when neither
>> is supported.
>>
>> I don't like excessive flags either, but based on my experience
>> under-flagging can bite back sooner than later.
>>
>> I'm aware that at the moment it feels like it is too explicit, but never
>> underestimate the creativity of the design - and in some cases the
>> constraint the design must fulfill.
> 
> I'm still very puzzled by why you think adding DMA_PREP_LOAD_EOT now is
> a good idea, given that there's no existing and no foreseen use case for
> not setting it. Creating an API element that is completely disconnected
> from any known use case doesn't seem like good API design to me,
> especially for an in-kernel API.

If we document that DMA_REPEAT covers REPEAT _and_ LOAD_EOT with one
flag then how would other drivers can implement REPEAT if they can not
support LOAD_EOT?
They should do DMA_REPEAT | NOT_LOAD_EOT | LOAD_ASAP?

LOAD_EOT is a feature the HW can or can not support and it is an
operation mode that you want to use or do not want to use.

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 1783 bytes --]

  reply	other threads:[~2020-06-01 11:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 16:59 [PATCH v4 0/6] dma: Add Xilinx ZynqMP DPDMA driver Laurent Pinchart
2020-05-13 16:59 ` [PATCH v4 1/6] dt: bindings: dma: xilinx: dpdma: DT bindings for Xilinx DPDMA Laurent Pinchart
2020-05-13 16:59 ` [PATCH v4 2/6] dmaengine: virt-dma: Use lockdep to check locking requirements Laurent Pinchart
2020-05-13 16:59 ` [PATCH v4 3/6] dmaengine: Add support for repeating transactions Laurent Pinchart
2020-05-14 18:23   ` Vinod Koul
2020-05-14 20:07     ` Laurent Pinchart
2020-05-15  8:38       ` Vinod Koul
2020-05-15 14:11         ` Laurent Pinchart
2020-05-18 13:57           ` Peter Ujfalusi
2020-05-18 14:32             ` Laurent Pinchart
2020-05-19 12:41               ` Peter Ujfalusi
2020-05-28  2:10                 ` Laurent Pinchart
2020-06-01 11:14                   ` Peter Ujfalusi [this message]
2020-06-01 11:49                     ` Laurent Pinchart
2020-06-03 10:51                       ` Peter Ujfalusi
2020-06-03 16:06                         ` Vinod Koul
2020-06-16 21:39                           ` Laurent Pinchart
2020-06-23  9:47                             ` Laurent Pinchart
2020-05-13 16:59 ` [PATCH v4 4/6] dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver Laurent Pinchart
2020-05-13 16:59 ` [PATCH v4 5/6] dmaengine: xilinx: dpdma: Add debugfs support Laurent Pinchart
2020-05-13 16:59 ` [PATCH v4 6/6] arm64: dts: zynqmp: Add DPDMA node Laurent Pinchart
2020-05-14  5:56   ` Michal Simek
2020-05-28  2:49     ` Laurent Pinchart

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=23b26252-eb7b-f918-759d-0ccda90586b0@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=SATISHNA@xilinx.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=hyun.kwon@xilinx.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=michal.simek@xilinx.com \
    --cc=tejasu@xilinx.com \
    --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).