public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@gmail.com>
To: Sai Sree Kartheek Adivi <s-adivi@ti.com>,
	vkoul@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, nm@ti.com, ssantosh@kernel.org,
	dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, vigneshr@ti.com
Cc: r-sharma3@ti.com, gehariprasath@ti.com
Subject: Re: [PATCH v4 15/19] dmaengine: ti: k3-udma-v2: New driver for K3 BCDMA_V2
Date: Tue, 3 Feb 2026 20:14:12 +0200	[thread overview]
Message-ID: <66bedd88-8ac6-45bb-866d-edaf436ee359@gmail.com> (raw)
In-Reply-To: <7abbd45d-e688-41b5-bde4-5d97877f3267@ti.com>

Hi Kartheek,

On 03/02/2026 10:22, Sai Sree Kartheek Adivi wrote:
>>> @@ -632,7 +641,8 @@ int udma_configure_statictr(struct udma_chan *uc,
>>> struct udma_desc *d,
>>>               d->static_tr.bstcnt = d->residue / d->sglen / div;
>>>           else
>>>               d->static_tr.bstcnt = d->residue / div;
>>> -    } else if (uc->ud->match_data->type == DMA_TYPE_BCDMA &&
>>> +    } else if ((uc->ud->match_data->type == DMA_TYPE_BCDMA ||
>>> +           uc->ud->match_data->type == DMA_TYPE_BCDMA_V2) &&
>> Have you thought of adding a version member to struct udma_match_data
>> and use that instead of distinct different types for BCDMA/PKTDMA?
>>
>> Here for example you would not need any change as the code is common for
>> both v1 and v2.
>
> Hi Peter,
>
>
> I'm preparing a v5 and wanted to align with you on the handling of
> different dma
>
> variants (udma, bcdma, pktdma & v1, v2).
>
>
> Frank suggested moving toward feature flags (capabilities) in the
> match_data,
>
> rather than checking type. [1]
>
>
> I want to get your thoughts on Frank's suggestion before I proceed. Do
> you have
>
> any strong objections to using feature flags? I see merit in that
> approach for
>
> scaling to possible future DMA variants in K3 SoCs.
You have several differences here and there (small and big) between the
v1 and v2, if you want to feature flag these out you would need to have
a meaningful flag for each and every one of them.

I find this a daunting task to be honest, so I would go with the simpler
way to just use version to cover _all_ differences in one step.
How one should be handling things if
A) feature = FEATURE_1
B) feature = FEATURE_2
C) feature = FEATURE_1 | FEATURE_2
D) feature = FEATURE_1 | FEATURE_2 | FEATURE_3
E) feature = FEATURE_1 | FEATURE_3
...

I think this might get out of hand easily, but you know the hardware
better, which way fits better, which will scale better for the future.

Also, you set a FEATURE flag for V2, but it might be that in V3 revision
the same thing must be done in a third way, so you would need to
allocate a bit array to say that this feature have this three ways of
handling, etc.

Either way will help to make the code a bit cleaner, which is already in
good shape.

-- 
Péter


  reply	other threads:[~2026-02-03 18:13 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 11:01 [PATCH v4 00/19] dmaengine: ti: Add support for BCDMA v2 and PKTDMA v2 Sai Sree Kartheek Adivi
2026-01-30 11:01 ` [PATCH v4 01/19] dmaengine: ti: k3-udma: move macros to header file Sai Sree Kartheek Adivi
2026-01-30 15:36   ` Frank Li
2026-01-30 11:01 ` [PATCH v4 02/19] dmaengine: ti: k3-udma: move structs and enums " Sai Sree Kartheek Adivi
2026-01-30 15:37   ` Frank Li
2026-01-30 11:01 ` [PATCH v4 03/19] dmaengine: ti: k3-udma: move static inline helper functions " Sai Sree Kartheek Adivi
2026-01-30 15:38   ` Frank Li
2026-01-30 11:01 ` [PATCH v4 04/19] dmaengine: ti: k3-udma: move descriptor management to k3-udma-common.c Sai Sree Kartheek Adivi
2026-01-30 15:43   ` Frank Li
2026-01-30 11:01 ` [PATCH v4 05/19] dmaengine: ti: k3-udma: move ring management functions " Sai Sree Kartheek Adivi
2026-01-30 15:46   ` Frank Li
2026-01-30 11:01 ` [PATCH v4 06/19] dmaengine: ti: k3-udma: Add variant-specific function pointers to udma_dev Sai Sree Kartheek Adivi
2026-01-30 15:52   ` Frank Li
2026-01-30 11:01 ` [PATCH v4 07/19] dmaengine: ti: k3-udma: move udma utility functions to k3-udma-common.c Sai Sree Kartheek Adivi
2026-01-30 15:58   ` Frank Li
2026-01-30 11:01 ` [PATCH v4 08/19] dmaengine: ti: k3-udma: move resource management " Sai Sree Kartheek Adivi
2026-01-30 11:01 ` [PATCH v4 09/19] dmaengine: ti: k3-udma: refactor resource setup functions Sai Sree Kartheek Adivi
2026-01-30 11:01 ` [PATCH v4 10/19] dmaengine: ti: k3-udma: move inclusion of k3-udma-private.c to k3-udma-common.c Sai Sree Kartheek Adivi
2026-01-30 11:01 ` [PATCH v4 11/19] drivers: soc: ti: k3-ringacc: handle absence of tisci Sai Sree Kartheek Adivi
2026-01-30 18:40   ` kernel test robot
2026-01-30 18:40   ` kernel test robot
2026-02-03  6:05   ` Péter Ujfalusi
2026-01-30 11:01 ` [PATCH v4 12/19] dt-bindings: dma: ti: Add K3 BCDMA V2 Sai Sree Kartheek Adivi
2026-01-30 15:35   ` Frank Li
2026-02-05  9:04   ` Krzysztof Kozlowski
2026-01-30 11:01 ` [PATCH v4 13/19] dt-bindings: dma: ti: Add K3 PKTDMA V2 Sai Sree Kartheek Adivi
2026-01-30 12:44   ` Rob Herring (Arm)
2026-01-30 15:34   ` Frank Li
2026-02-05  9:06   ` Krzysztof Kozlowski
2026-01-30 11:01 ` [PATCH v4 14/19] dmaengine: ti: k3-psil-am62l: Add AM62Lx PSIL and PDMA data Sai Sree Kartheek Adivi
2026-01-30 11:01 ` [PATCH v4 15/19] dmaengine: ti: k3-udma-v2: New driver for K3 BCDMA_V2 Sai Sree Kartheek Adivi
2026-01-30 16:08   ` Frank Li
2026-02-03  6:37   ` Péter Ujfalusi
2026-02-03  8:22     ` Sai Sree Kartheek Adivi
2026-02-03 18:14       ` Péter Ujfalusi [this message]
2026-01-30 11:01 ` [PATCH v4 16/19] dmaengine: ti: k3-udma-v2: Add support for PKTDMA V2 Sai Sree Kartheek Adivi
2026-02-03  6:25   ` Péter Ujfalusi
2026-02-03  7:51     ` Sai Sree Kartheek Adivi
2026-01-30 11:01 ` [PATCH v4 17/19] dmaengine: ti: k3-udma-v2: Update glue layer to support " Sai Sree Kartheek Adivi
2026-01-30 11:01 ` [PATCH v4 18/19] dmaengine: ti: k3-udma: Validate resource ID and fix logging in reservation Sai Sree Kartheek Adivi
2026-01-30 11:01 ` [PATCH v4 19/19] dmaengine: ti: k3-udma: switch to synchronous descriptor freeing Sai Sree Kartheek Adivi
2026-01-30 20:37   ` kernel test robot
2026-02-05  9:07     ` Krzysztof Kozlowski
2026-02-11  7:42   ` Sai Sree Kartheek Adivi
2026-02-03  6:42 ` [PATCH v4 00/19] dmaengine: ti: Add support for BCDMA v2 and PKTDMA v2 Péter Ujfalusi

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=66bedd88-8ac6-45bb-866d-edaf436ee359@gmail.com \
    --to=peter.ujfalusi@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=gehariprasath@ti.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=r-sharma3@ti.com \
    --cc=robh@kernel.org \
    --cc=s-adivi@ti.com \
    --cc=ssantosh@kernel.org \
    --cc=vigneshr@ti.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