From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA0CAC5B552 for ; Sun, 8 Jun 2025 13:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lkMrFuLvhnKEtj1OsXqMEZ+NniYE7eLzp58wZm0jZ5A=; b=N9dv9tJGEUw9l/AhJ779BI48nI jlJghW4NvqDY8f3fvhS0XbLFvdquqMq7u/xg9J02mcGGTaVCEEnt4dT3lvbrFlVY7fcv3qzhzFquS KNf80ZUI+6gxSqLIdvED4XsfSEkPwohF0dSwrdKY+fwjmTOtVAKDYC1b5zus4uu5v2gIgZkLjG1CS xPD/wCGWFTUrP8pxcVX/iVDOs6onQL9neirsmeKkZEYpOnrh7wUTW9M8bi3EJeNfdMFm/er6s7YUJ Z1DccxM24nLQTgJPwkO+nC+j0BowuLLuhhNng2Q9/dRLdbb7hiQxeETwI39cjWI/YBak1xbKy5XWv OTyfi8fQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uOFfW-00000002dAw-2hSM; Sun, 08 Jun 2025 13:02:34 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uOFYE-00000002cOC-2o81 for linux-arm-kernel@lists.infradead.org; Sun, 08 Jun 2025 12:55:03 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 646B75C0610; Sun, 8 Jun 2025 12:52:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F595C4CEEF; Sun, 8 Jun 2025 12:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749387301; bh=4tn9f9ULQbJNgNb6yeBPXInYhXzFExWbdF4INVKpQ4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NfgFXoTYy61YL9NBUUW6rkjHJxgqPy7JrWG0q/sY+zZG1bBgDbWNkr0KbR7Ignzvk 075zblfJghRw7gvqRG1tL4I8wE5w7/1YyfbylnYqXA1nDi31BgRXVJeD9SH1/fB1Fd 0YUs/pKq9fVmxUTdLTzVxb04syc1n2igEXrzhIceyHs1TamyRSxjaISps2ig0U0Rj3 nWrlyVQbuEgiR9YWlUzxlCcr0uqLcKpqSdwjZWyIzXP+BaJ4e1KyPFkOLDi7z/vGdd nCn46yRhBSRETAPRkautzuXN557l4RovbzDohapFPcFKGmUqqNYcuS966RCsBvmJs+ ies30/wKpyQBA== From: Sasha Levin To: patches@lists.linux.dev, stable@vger.kernel.org Cc: Thomas Gessler , Suraj Gupta , Folker Schwesinger , Vinod Koul , Sasha Levin , michal.simek@amd.com, jernej.skrabec@gmail.com, marex@denx.de, u.kleine-koenig@baylibre.com, krzysztof.kozlowski@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 6.14 07/10] dmaengine: xilinx_dma: Set dma_device directions Date: Sun, 8 Jun 2025 08:54:44 -0400 Message-Id: <20250608125447.933686-7-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250608125447.933686-1-sashal@kernel.org> References: <20250608125447.933686-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.14.10 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250608_055502_797565_AE79C171 X-CRM114-Status: GOOD ( 16.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thomas Gessler [ Upstream commit 7e01511443c30a55a5ae78d3debd46d4d872517e ] Coalesce the direction bits from the enabled TX and/or RX channels into the directions bit mask of dma_device. Without this mask set, dma_get_slave_caps() in the DMAEngine fails, which prevents the driver from being used with an IIO DMAEngine buffer. Signed-off-by: Thomas Gessler Reviewed-by: Suraj Gupta Tested-by: Folker Schwesinger Link: https://lore.kernel.org/r/20250507182101.909010-1-thomas.gessler@brueckmann-gmbh.de Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- **YES** ## Analysis This commit should be backported to stable kernel trees because it fixes a critical functionality bug that prevents the Xilinx DMA driver from working with important subsystems. ### The Problem The commit addresses a fundamental issue where `dma_get_slave_caps()` fails when called on Xilinx DMA channels. The code change shows that the driver was not setting the `directions` field in the `dma_device` structure: ```c + xdev->common.directions |= chan->direction; ``` This single line fix accumulates the direction capabilities from individual channels (either `DMA_MEM_TO_DEV` or `DMA_DEV_TO_MEM`) into the device-level `directions` bitmask. ### Why This Qualifies for Backporting 1. **Fixes Important User-Facing Bug**: The commit message explicitly states this prevents the driver from being used with IIO DMAEngine buffers, which is a significant functional regression affecting real users. 2. **Small and Contained Fix**: The change is minimal - just one line of code that sets a required field during channel probe. This has extremely low risk of introducing regressions. 3. **Critical Subsystem Integration**: Without this fix, `dma_get_slave_caps()` calls fail with `-ENXIO`, breaking integration with any subsystem that queries DMA capabilities (like IIO). 4. **Clear Root Cause**: The fix directly addresses the root cause - the missing `directions` field that the DMAEngine core requires to be set. 5. **No Architectural Changes**: This doesn't introduce new features or change driver architecture; it simply provides required capability information that was missing. ### Comparison to Reference Commits This closely matches **Similar Commit #1** (marked YES) which also fixed a missing capability flag (`DMA_CYCLIC cap_mask bit`) that prevented proper DMA channel allocation. Both commits: - Fix missing capability declarations - Are small, single-line changes - Address integration failures with other subsystems - Have minimal regression risk The commit also mirrors **Similar Commit #2** (marked YES) which fixed incorrect struct usage in the same driver - both address functional correctness issues in the Xilinx DMA driver. ### Risk Assessment The risk is minimal because: - The change only affects the capability reporting mechanism - It doesn't modify any data paths or transfer logic - The direction values being OR'd together are already correctly set per-channel - Failure mode is obvious (capability queries will work instead of failing) This is a textbook example of a stable tree candidate: it fixes an important bug affecting real users with a minimal, low-risk change that doesn't introduce new functionality. drivers/dma/xilinx/xilinx_dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 108a7287f4cd0..99619da7fc09e 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2908,6 +2908,8 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, return -EINVAL; } + xdev->common.directions |= chan->direction; + /* Request the interrupt */ chan->irq = of_irq_get(node, chan->tdest); if (chan->irq < 0) -- 2.39.5