From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB7E831B82A for ; Tue, 3 Feb 2026 18:13:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770142385; cv=none; b=ZJS6jVchXAj8I66DMFmbspwjHEFrbCugcDqds0rgfId0Jt3yH4yvzIHoDxUtTgHqS2+xKlQc7JW6C/PSSXBz2KBsNO3ONAugx0khcREjEfpNtG1qMCUTVexu4+rRAmxAKcx7WudyE2BBPydA1DD0fHab3oKq+bmYN1atvY96Mqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770142385; c=relaxed/simple; bh=12DizC0MRTUOsWMEXBP8KaJkARrW/TLZxDxEk8wmCso=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bvaMrYu4sVf2PUC79FWh17EscI/gtdyDA8NiilSDb4dtkZkgw4zZl6cv7b2wh7U8Z3cSMqEPdAGxDX/CeQgpkC/7ZVzn4HmxzaGkGolr0MVovn6nvvaSptAWQ8BwU4YxEKBmvG/j7zNmcgzCpe4c60V882NhCbkvuGM5zoEIbtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X9WKe7uU; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X9WKe7uU" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-383122fbc9bso51161521fa.1 for ; Tue, 03 Feb 2026 10:13:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770142382; x=1770747182; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=c0/ndP+Q6QYWzq22YHYUgQSQqkbwcgk08y+b5h1n8pQ=; b=X9WKe7uUJDQtnapoiqwwnU3N5rSb1rpHJNFAom8Y2WxfQ4mz6h/eKyZhr3Le/R1p0j vEMl28gyWb2rKHdqKPBLs+BBNydyADsTrM6XBaVOzboAxW4MePR5W9IWBmzlojMKQtZ2 9YRlROzkVCk6SoXfZO0Vl0zxyRq2IgunaiEwo2BzWFSvP6FRNvzzOZM75q34yyaHqXBL AQwKgOL34dm0utb/B9gIdTRjkxU9IRaCroGmoMoqTVnxuoa64IGrpHPq+h2WkovAF8RQ i1f2XvgOwOlvzeri53vkcoF2CjEmVxNzY/NrAfax8J2fbS6OZ0r38UthySvuDoYXbiTp vslA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770142382; x=1770747182; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=c0/ndP+Q6QYWzq22YHYUgQSQqkbwcgk08y+b5h1n8pQ=; b=uU+MznXWahqLgdCCPdT6gIZWrsWzK3iIcRpjpto5d2awm0Vkf5C/bmp7mdvRshtmEd 8UbceTtjVhGs6NtnhvHbEfIJVHWV5kXHTtO0rTn4QpSXpeOqfI1JpzW4kLaZph6YTV50 fb1jdQxpqeS6W+/ldOLFEZniuh9uCBA5PLOnkRt+cbQG+v6EIFlfPmpYFTMEIN14vOJp /lmDhCttDsl3bFmCicZNCNp/lW/m0CpOKKMvB/rK4R16Nq4TwHjMoAjDRzBKxWTY4xn2 igvaxEcFnKjZcVUoERyQhM0vKE+699b9TFsLqPv+UzHtLHLS58gFMg0h0GIp5+RkagI5 sBxw== X-Forwarded-Encrypted: i=1; AJvYcCW+Rh1T+RE0MQKCH+P+D7JeeoDx0U8lieMN+rqQ5+gPlG0GAwM6KnzBN9lkjGvmrYz/8mSc6eVC9GQg88o=@vger.kernel.org X-Gm-Message-State: AOJu0YzCFYNqIDMPZQuU2CyKAn4gPs+kgT8uAuTd3VXx8/sJBSzuPjDJ Wpfdir21aHBP7GlES1btmsmHsdXjs9i5NenmzV6yG53kmBEz3ykdY3ub X-Gm-Gg: AZuq6aLRT171d4xAHJ0Zd+4rcgGFaaPXU5Tq/90ANgxKYspgaLJzMUmKO1EsAhUCJFu pTQxsIvMRyIZYw6TDikcCiwhDlaU2SJqbxfnVL51D7MbIVZzO7uUFY/ELZDhrbyUNIIBSDwXJ4V OXQ/dtqKgJtsamP4CO+Mc1QPtgEW9nwEjtpUR8RoecnZLslaVlXzGYbNd2A4F92jIgPWC/eTkbA Mutk/lMk4dIWu7rGmpeBriPfmxYfaHsf4b25W3NXV7Fwv7bp2vf+vPjHURpb7JuyFWQqrxsY30Q FwDPpGN6r6NZegImvTHi2dIv/877nKEW3GZAz/Y29zznnzH5d5wuhrYlVKQR0DDtqTjQfsGy0fe c8g+zqZ7pjEYOc4qFtQYak/DCfS+gTqukCr6hvj7RrcKmE5co+Yg6JPuC6SBWV5WAAp98iuk5Jo 4a94ry3N0dJzt7n0O5PHbtINRk/vGLSgtKd9Nur3/s8vtikGXYuHbIZbATlBY= X-Received: by 2002:a05:651c:550:b0:383:f43:ed45 with SMTP id 38308e7fff4ca-38691db7f7cmr1903191fa.30.1770142381698; Tue, 03 Feb 2026 10:13:01 -0800 (PST) Received: from [10.0.0.100] (host-185-69-74-59.kaisa-laajakaista.fi. [185.69.74.59]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-38692040049sm477121fa.26.2026.02.03.10.13.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Feb 2026 10:13:01 -0800 (PST) Message-ID: <66bedd88-8ac6-45bb-866d-edaf436ee359@gmail.com> Date: Tue, 3 Feb 2026 20:14:12 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 15/19] dmaengine: ti: k3-udma-v2: New driver for K3 BCDMA_V2 To: Sai Sree Kartheek Adivi , 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 References: <20260130110159.359501-1-s-adivi@ti.com> <20260130110159.359501-16-s-adivi@ti.com> <98c254c5-94c1-49b0-b361-617639b781d8@gmail.com> <7abbd45d-e688-41b5-bde4-5d97877f3267@ti.com> From: =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= Content-Language: en-US In-Reply-To: <7abbd45d-e688-41b5-bde4-5d97877f3267@ti.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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