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 5E5D7C43458 for ; Thu, 9 Jul 2026 14:14:17 +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:MIME-Version: Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To: Subject:Date:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=B0ih7vNULsYP19N+jqpufFpInVKLoHWbksrWxmLOeL4=; b=GKA4sGVGmYZR4FtKoSftjCblyT KLLX+bM76vIEcXLhwfOPq5TOOOHEn8vEgq9MASqSvZ6j01wcEYnnqjYfBnhtXAmEWlLtOcJ+nyj2w biVRA+H/IRhJcvTNPtWkRM28ti87ri6b/I12D8VYoaA0Asks+xlVLl+qfBnxxVnh3e1nmYvMcbbN8 TjsQy5TqbyEaSP1oTyAnecLUvqMLYmWChzlMZ55CNPX7sfUHF9JqHW9us/85etsV+dZhYv2UT3PRG to/Sf+iYBs1Gi3KroTJDbtQUaxt0DiMzEXkuEVayLGcqlBzS/LJj6zSu7xIe0796Hh4eyBupHVuJc j1BQXU9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1whpVw-00000002jBX-1Flo; Thu, 09 Jul 2026 14:14:08 +0000 Received: from mail-eastus2azlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c110::1] helo=BN1PR04CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1whpVt-00000002jAt-2NgE for linux-arm-kernel@lists.infradead.org; Thu, 09 Jul 2026 14:14:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hPH9Qg1LpZnFQo5Np2cmlMwEE/P4FsPw5EoK0C/MQW0Bm/TrOxye6HGiEsMw5EGGZlKbOJB6MvpHzWfDWjxHaC2jZN0nmccDRAwG+YnuwhGKcGtMCxNp5vml8t0uQrGU8sNUsVqVoGg4npZ8SYQiYAuv40H/nfRAYvxad2KOZitmMTUJT/C78aEAQJa9Hxy+67sNZNkQZ3PKAd7eOglrWMLhswlN+KjxP/j1rlyRwLcfDvj29K2A6tKg1vNAeLVr1+0yilJ9TnrTYILQTDrbHmwW4q1C4NgejA3CMBRnamE9jNEhZRv6fWXlNtWsFmpwy1FmIdjAgxFFwtCnQ2G73Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B0ih7vNULsYP19N+jqpufFpInVKLoHWbksrWxmLOeL4=; b=rNho6I0ksH/ULSSoCi1A3Y0ztk2YMr72ZlJO40xvAyDAsMyO7xMCQzRrMsW8Xfq+ZSLonJjpMHGdCcOLNdpb7Mnqfr8fOM6e66nHEz7JrE9ykxshjQ//K0qrq99QfL6OqD7OLNT4kPZaBpja0Kp6bxJOO0Zkob6y0o1ttB3EVgRVk9wS0Bc48kVAMLaosBx/rpWp9fghWvA4XFQNDUaxsbeDs4BoO436ump8pFP+jjiphRQw9f32MhvT6iV8gcHjOIaYBnaCaKZvL+byOz8/nR1zUzDtqT2HVQfbPuY8AbXOsyhEl48L8enrfp/NSpyaoKID1IX+/yeesIzQi8hKFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B0ih7vNULsYP19N+jqpufFpInVKLoHWbksrWxmLOeL4=; b=hDUXOKuSSB0DFVra7pHP4ZxTK+5ZYJqo+7w69UwrYcvr+8kHBzf5pSqFl+Q4rb7oXegm2fmLnxu8vbUDZumS35wU5SHTsdH3kQJdyWbPOqIXwRQGJhgRDn+Fq48NO0Q4rDPBBFV2HE3p52a2FWn2BQve26hYDAZ9Zz65cnFD5Dw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CY1PR12MB9697.namprd12.prod.outlook.com (2603:10b6:930:107::6) by IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.16; Thu, 9 Jul 2026 14:13:55 +0000 Received: from CY1PR12MB9697.namprd12.prod.outlook.com ([fe80::3a41:55a0:8203:596d]) by CY1PR12MB9697.namprd12.prod.outlook.com ([fe80::3a41:55a0:8203:596d%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026 14:13:53 +0000 Message-ID: Date: Thu, 9 Jul 2026 19:43:43 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V3 4/4] dmaengine: xilinx_dma: Extend metadata handling for AXI DMA and MCDMA To: Srinivas Neeli , Vinod Koul , Radhey Shyam Pandey Cc: Frank Li , Michal Simek , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Suraj Gupta , Marek Vasut , Tomi Valkeinen , Alex Bereza , Folker Schwesinger , dmaengine@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, git@amd.com References: <20260708100652.603074-1-srinivas.neeli@amd.com> <20260708100652.603074-5-srinivas.neeli@amd.com> Content-Language: en-US From: "Pandey, Radhey Shyam" In-Reply-To: <20260708100652.603074-5-srinivas.neeli@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN4PR01CA0010.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:272::8) To CY1PR12MB9697.namprd12.prod.outlook.com (2603:10b6:930:107::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR12MB9697:EE_|IA0PR12MB8374:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a621aa0-cf90-4702-b65f-08deddc44e8a X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|23010399003|7416014|376014|1800799024|22082099003|18002099003|4143699003|6133799003|56012099006|11063799006; X-Microsoft-Antispam-Message-Info: 3UN4Yt+vYOjXVT1/Ql+0vpO9DdCjLv3jwmwkQ96SA6WHP++DUR77h135Dfsz3SD32Zk3rd1Spxk4zYr3ledtiYPsX1DFFfnfspmEcIzH9RNAcicSrw+uVQhcfopYJYJ8oSJz7YXL0S1erp9HF0BjXSqz50Cp38fuC0sjc7JwWFatKCfaU+RClb0/AxC//ricnAW3H/K0fcJjpbdQFNI/feiCpPhKtmaG26QjsqGT34wwyWHLkuCUH78yWk/NBYmXp4+ikltMEvhtmBDMgah/ltUx2EkhmdyWFSe6bDCyJqeKhFHGZcUawr6ziV30mKwuvwor3IJ0Pk+APCiqe/mWcwQ/4dfuvrns6SmDNF1Q31GMAVdr6svQUNM601AWengvBjeaLYJnKZ/v4bEC6SyRblDjQPVEp5I4h+ogxm0FZkXMtbyOhRfkj9RqqNb2HUWeOW1PPLVUJpuJXY6RbRqEEfTfgZC0KaZZtkVm5VgZecQd6WVV1W9eloxgrj/iXuQxamHToL4lYfghLacihuuCi7NjecvOeqkD8eR3eeJrddXnpzc0vx5b2l9FmNeXshGImdfGQ9kyMg8NXB56fX9cNRHwWC4lKcp+2ZRSpq5jTUsCzbhiCfIm2WrOYquB4NdcaYcQ40cMw+ZV8LfS3GPZe8k9CMTyAa9PIxKEqGYgaLc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY1PR12MB9697.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(7416014)(376014)(1800799024)(22082099003)(18002099003)(4143699003)(6133799003)(56012099006)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aWRoSHpiQWpDQWEvbGJvN0Z5V01LdUR0Z2JhUWUxN01LYjNyY3BKVllvYW5Q?= =?utf-8?B?YnZUR2J6ME1HaEFodEF5elFTeTNZaTBPNnVVQjc5WXZwazJqMlM5NEk5ancx?= =?utf-8?B?UTJkV3RRYWN4K3pIUjMxeHA2WG5Ca25RKzRJK0xtNEczQUhRNW1nZGN6K0RY?= =?utf-8?B?TFNwaXM5cnM0UGJuNnFtVWNsRmFpNGxPczhieXFaZEJud1d6YUwyaXZRaWRy?= =?utf-8?B?SVFVZkQxY3VGYzM4NjlTMlR6bnJQc0ZYUmJVUHZnOUVKclc0bUUvcmN6YUh3?= =?utf-8?B?eExpcitzNUs3UTdmb3R4VFVTaHZ1U2JGcURtNlhFVFRWeXdvejdNbGx2VURF?= =?utf-8?B?VFZGMmloMFZpTWFwZnE3VGtISW43bHZEdmNFejhML0tKazBiMXV2YjBPVmVI?= =?utf-8?B?VGYzYWtBdVloMGp2OUZYdXZOWnF2NGdZN0Fvbm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lQNHhFZHhtVE9USStSYVBBNWFpSS9DeXhiQTVweEgySmpr?= =?utf-8?Q?+BGerUQySvWHzoyUu7?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a621aa0-cf90-4702-b65f-08deddc44e8a X-MS-Exchange-CrossTenant-AuthSource: CY1PR12MB9697.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 14:13:53.8390 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I6WZfETVtgp3uXxwV6vaPRhwTx2P7+ogR0cARZtNqn5zPcHVY3CIkWopPL1T67Iv X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8374 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260709_071405_712269_156AED38 X-CRM114-Status: GOOD ( 33.45 ) 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: Suraj Gupta > > xilinx_dma_get_metadata_ptr() exposed only the descriptor APP fields. Both > AXI DMA and AXI MCDMA descriptors carry a status word with the transfer > status, and AXI MCDMA additionally carries an AXI4-Stream sideband status > word holding TID, TDEST and TUSER that clients may need. Extend the > metadata handling to expose these. > > The returned pointer now starts at the descriptor status word for both AXI > DMA and AXI MCDMA. As the descriptor words are contiguous, the client sees > the status at index 0, followed for AXI MCDMA by the sideband status > (TID/TDEST/TUSER) at index 1 and the APP fields, or for AXI DMA by the APP > fields directly. The payload length is derived from the field sizes. > > This changes the get_metadata_ptr() contract for AXI DMA. The pointer now > starts at the status word of the last (EOF) descriptor instead of the APP > fields of the first, and the payload grows from 20 to 24 bytes. A client > reading app[0] now reads the status word. No in-tree consumer is affected, > as the axienet driver reads the RX frame length from result->residue > rather than the APP fields. Reading the EOF descriptor is also correct, as > the hardware writes the status and APP fields there. > > The index 0 and 1 layout described above is for the AXI MCDMA receive > (S2MM) direction, which is where metadata is consumed. On the transmit > (MM2S) direction the same descriptor words hold different fields. > > The probe logic is extended to read xlnx,axistream-connected for MCDMA, and > xilinx_mcdma_prep_slave_sg() attaches metadata_ops when an AXI Stream > interface is present, so MCDMA clients can use the metadata API in the same > way as AXI DMA clients. Nit - make the commit description precise.> > Signed-off-by: Suraj Gupta > Co-developed-by: Srinivas Neeli > Signed-off-by: Srinivas Neeli > --- > Changes in V3: > - Renamed subject to include "AXI DMA and MCDMA" (was "AXI MCDMA" only). > - Complete rewrite of commit message and implementation. > - Metadata pointer now returns status field at index 0 instead of APP > fields, exposing status and sideband information to clients. > - Changed from list_first_entry to list_last_entry to return the EOF > descriptor where hardware writes status and APP fields. > - Added explicit handling for both AXIDMA and MCDMA types with proper > payload length calculation. > - Added WARN_ON_ONCE for unsupported DMA types. > - Removed the 'chan' field from struct xilinx_dma_tx_descriptor (was > added in V2) as it's no longer needed; channel is obtained from > tx->chan instead. > - Dropped V2 patches 4/5 (dt-bindings xlnx,include-stscntrl-strm) and > 5/5 (xferred_bytes support) as the approach changed to use residue. > > Changes in V2: > - Added support for MCDMA metadata handling alongside AXIDMA. > - Added 'chan' field to struct xilinx_dma_tx_descriptor. > --- > drivers/dma/xilinx/xilinx_dma.c | 48 ++++++++++++++++++++++++++++----- > 1 file changed, 41 insertions(+), 7 deletions(-) > > diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c > index 1b5b00f08c5f..f5c4e0ca2cc4 100644 > --- a/drivers/dma/xilinx/xilinx_dma.c > +++ b/drivers/dma/xilinx/xilinx_dma.c > @@ -651,18 +651,48 @@ static inline void xilinx_aximcdma_buf(struct xilinx_dma_chan *chan, > * @tx: async transaction descriptor > * @payload_len: metadata payload length > * @max_len: metadata max length > - * Return: The app field pointer. > + * > + * The returned pointer starts at the descriptor status word for both AXI DMA > + * and AXI MCDMA. As the descriptor words are contiguous, the client sees the > + * status at index 0, followed for AXI MCDMA by the sideband status > + * (TID/TDEST/TUSER) at index 1 and the APP fields from index 2, or for AXI DMA > + * by the APP fields from index 1. These fields are populated by the hardware on > + * the End-Of-Frame descriptor, so the pointer is taken from there. > + * > + * Return: Pointer to the descriptor status field. > */ > static void *xilinx_dma_get_metadata_ptr(struct dma_async_tx_descriptor *tx, > size_t *payload_len, size_t *max_len) > { > struct xilinx_dma_tx_descriptor *desc = to_dma_tx_descriptor(tx); > - struct xilinx_axidma_tx_segment *seg; > + struct xilinx_dma_chan *chan = to_xilinx_chan(tx->chan); > + > + if (chan->xdev->dma_config->dmatype == XDMA_TYPE_AXIMCDMA) { > + struct xilinx_aximcdma_tx_segment *seg = > + list_last_entry(&desc->segments, > + struct xilinx_aximcdma_tx_segment, node); > + This func is common for MCDMA s2mm and mm2s channel. Please make it generic to address both. > + /* [0] = status, [1] = sideband (TID/TDEST/TUSER), [2..] = app */ > + *max_len = *payload_len = sizeof(seg->hw.s2mm_status) + > + sizeof(seg->hw.s2mm_sideband_status) + > + sizeof(seg->hw.app); > + return &seg->hw.s2mm_status; > + } > + > + if (chan->xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA) { > + struct xilinx_axidma_tx_segment *seg = > + list_last_entry(&desc->segments, > + struct xilinx_axidma_tx_segment, node); > + > + /* [0] = status, [1..] = app */ > + *max_len = *payload_len = sizeof(seg->hw.status) + > + sizeof(seg->hw.app); > + return &seg->hw.status; > + } > > - *max_len = *payload_len = sizeof(u32) * XILINX_DMA_NUM_APP_WORDS; > - seg = list_first_entry(&desc->segments, > - struct xilinx_axidma_tx_segment, node); > - return seg->hw.app; > + /* Only AXIDMA and MCDMA attach metadata_ops today. */ > + WARN_ON_ONCE(1); > + return ERR_PTR(-EINVAL); We are registering metadata ops for MCDMA and AXI DMA so when is this error condition going to happen? > } > > static struct dma_descriptor_metadata_ops xilinx_dma_metadata_ops = { > @@ -2639,6 +2669,9 @@ xilinx_mcdma_prep_slave_sg(struct dma_chan *dchan, struct scatterlist *sgl, > segment->hw.control |= XILINX_MCDMA_BD_EOP; > } > > + if (chan->xdev->has_axistream_connected) > + desc->async_tx.metadata_ops = &xilinx_dma_metadata_ops; > + > return &desc->async_tx; > > error: > @@ -3287,7 +3320,8 @@ static int xilinx_dma_probe(struct platform_device *pdev) > > dma_set_max_seg_size(xdev->dev, xdev->max_buffer_len); > > - if (xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA) { > + if (xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA || > + xdev->dma_config->dmatype == XDMA_TYPE_AXIMCDMA) { > xdev->has_axistream_connected = > of_property_read_bool(node, "xlnx,axistream-connected"); > }