{"id":2221950,"url":"http://patchwork.ozlabs.org/api/patches/2221950/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260410-sdxi-base-v1-14-1d184cb5c60a@amd.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260410-sdxi-base-v1-14-1d184cb5c60a@amd.com>","list_archive_url":null,"date":"2026-04-10T13:07:24","name":"[14/23] dmaengine: sdxi: Attach descriptor ring state to contexts","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c7d281f37160c842d8aee641c71763f8306bf23c","submitter":{"id":91626,"url":"http://patchwork.ozlabs.org/api/people/91626/?format=json","name":"Nathan Lynch via B4 Relay","email":"devnull+nathan.lynch.amd.com@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260410-sdxi-base-v1-14-1d184cb5c60a@amd.com/mbox/","series":[{"id":499458,"url":"http://patchwork.ozlabs.org/api/series/499458/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=499458","date":"2026-04-10T13:07:10","name":"dmaengine: Smart Data Accelerator Interface (SDXI) basic support","version":1,"mbox":"http://patchwork.ozlabs.org/series/499458/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2221950/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2221950/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-52327-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=LBJxIBFw;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-52327-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"LBJxIBFw\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fscdr0ZdLz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 23:12:00 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 543C03092E4B\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 13:08:04 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 175193BF688;\n\tFri, 10 Apr 2026 13:07:51 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 96F143A8734;\n\tFri, 10 Apr 2026 13:07:50 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPS id 6BDFCC2BCFF;\n\tFri, 10 Apr 2026 13:07:50 +0000 (UTC)","from aws-us-west-2-korg-lkml-1.web.codeaurora.org\n (localhost.localdomain [127.0.0.1])\n\tby smtp.lore.kernel.org (Postfix) with ESMTP id 6155CF4485E;\n\tFri, 10 Apr 2026 13:07:50 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775826470; cv=none;\n b=hcUPg2KWX0kbNnrow60qG6q8dEUigZbqCCpGGvSH9SKFON9eg7XcEE7XPJ6se7LCpCKasoXhwWX51vIbDfKIwaRdk+gQsxlEv7EO1ohSEWr60Jbb0qZ+XOFvPOIiSvMtL5bjFyQQnV0bmDOvsrtD68ra4YR0eoe5VZfa3FqJLuM=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775826470; c=relaxed/simple;\n\tbh=ix/egd9ifwo7e/St7dPwr06De/VvvRAKulv1v4opdYo=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=bzAjgjYADINmnb4o0cCY49I6b4sFKY+5NcEEA2kcqwuUG9S3+lxrhE5l8IPTZ/mZcSA5GEO0V9w1UEo/+gp/8OyZjJcA2jL7zrzMb+7OoFk3siYwZAXb+3FVInZIzk3PkHc8kkasXEtKMx3cSTIoYBzU2/YdenVbHea4rnyGTF4=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=LBJxIBFw; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775826470;\n\tbh=ix/egd9ifwo7e/St7dPwr06De/VvvRAKulv1v4opdYo=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;\n\tb=LBJxIBFwuVGlyPRAN5+DCgSkH+nVNWFopP9JCG/yihA9ahGSpvJDhZOmgJXH4D9jB\n\t b1qkxIzC/m7OLAsaLYMTPo/nRivIKV/tFM9UO9tWMexLDLo5q4XxsClAyb1mU8eQKW\n\t 8qJahjU9L+5vvNEDRCQvbIuVMs5L2bz97lpljjnKKZ6E7mry9OQMrIa+g2JlGlXWmJ\n\t Jw/4mKU6onWulzXFQ22HcZSZfQKYqUNi4I2lMww32vA4RFCV2qtWAytwimzrARWmmn\n\t m9EpCZPnFQ8HyoNT5zO+txTXKGOg9wGlWvcevEVPdj/Elu2BJXrpRRM3Yexx7wzmOt\n\t 69k4dTsL/CHBA==","From":"Nathan Lynch via B4 Relay <devnull+nathan.lynch.amd.com@kernel.org>","Date":"Fri, 10 Apr 2026 08:07:24 -0500","Subject":"[PATCH 14/23] dmaengine: sdxi: Attach descriptor ring state to\n contexts","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260410-sdxi-base-v1-14-1d184cb5c60a@amd.com>","References":"<20260410-sdxi-base-v1-0-1d184cb5c60a@amd.com>","In-Reply-To":"<20260410-sdxi-base-v1-0-1d184cb5c60a@amd.com>","To":"Vinod Koul <vkoul@kernel.org>","Cc":"Wei Huang <wei.huang2@amd.com>,\n Mario Limonciello <mario.limonciello@amd.com>,\n Bjorn Helgaas <bhelgaas@google.com>,\n Jonathan Cameron <jonathan.cameron@huawei.com>,\n Stephen Bates <Stephen.Bates@amd.com>, PradeepVineshReddy.Kodamati@amd.com,\n John.Kariuki@amd.com, linux-pci@vger.kernel.org,\n linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,\n Nathan Lynch <nathan.lynch@amd.com>","X-Mailer":"b4 0.15.2","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1775826467; l=2539;\n i=nathan.lynch@amd.com; s=20260410; h=from:subject:message-id;\n bh=osQr3BYuGP2fBkWl8ruQ505ci52JISit3XTQLri9FVw=;\n b=1EooEzzSz67Nn6PR20Q6rrCyRCAf3qi2P0cVNLda1cXwdfMEQU79c4wdjgA7Tz6eVMZAsqlR0\n 4p8Xayjz17YBZrdP0wIg80eMQbmbgoBm+njik+C99Q3ypwk52Oq350F","X-Developer-Key":"i=nathan.lynch@amd.com; a=ed25519;\n pk=PK4ozhq+/z9/2Jl5rgDmvHa9raVomv79qM8p1RAFpEw=","X-Endpoint-Received":"by B4 Relay for nathan.lynch@amd.com/20260410 with\n auth_id=728","X-Original-From":"Nathan Lynch <nathan.lynch@amd.com>","Reply-To":"nathan.lynch@amd.com"},"content":"From: Nathan Lynch <nathan.lynch@amd.com>\n\nAttach an instance of struct sdxi_ring_state to each context upon\nallocation. Each ring state has the same lifetime has its context and\nis freed upon context release.\n\nCo-developed-by: Wei Huang <wei.huang2@amd.com>\nSigned-off-by: Wei Huang <wei.huang2@amd.com>\nSigned-off-by: Nathan Lynch <nathan.lynch@amd.com>\n---\n drivers/dma/sdxi/context.c | 13 +++++++++++++\n drivers/dma/sdxi/context.h |  2 ++\n 2 files changed, 15 insertions(+)","diff":"diff --git a/drivers/dma/sdxi/context.c b/drivers/dma/sdxi/context.c\nindex 7cae140c0a20..792b5032203b 100644\n--- a/drivers/dma/sdxi/context.c\n+++ b/drivers/dma/sdxi/context.c\n@@ -24,6 +24,7 @@\n \n #include \"context.h\"\n #include \"hw.h\"\n+#include \"ring.h\"\n #include \"sdxi.h\"\n \n #define DEFAULT_DESC_RING_ENTRIES 1024\n@@ -60,6 +61,7 @@ static void sdxi_free_cxt(struct sdxi_cxt *cxt)\n \t\tdma_free_coherent(sdxi_to_dev(sdxi), sq->ring_size,\n \t\t\t\t  sq->desc_ring, sq->ring_dma);\n \tkfree(cxt->sq);\n+\tkfree(cxt->ring_state);\n \tkfree(cxt);\n }\n \n@@ -77,6 +79,10 @@ static struct sdxi_cxt *sdxi_alloc_cxt(struct sdxi_dev *sdxi)\n \n \tcxt->sdxi = sdxi;\n \n+\tcxt->ring_state = kzalloc_obj(*cxt->ring_state, GFP_KERNEL);\n+\tif (!cxt->ring_state)\n+\t\treturn NULL;\n+\n \tcxt->sq = kzalloc_obj(*cxt->sq, GFP_KERNEL);\n \tif (!cxt->sq)\n \t\treturn NULL;\n@@ -373,6 +379,8 @@ int sdxi_admin_cxt_init(struct sdxi_dev *sdxi)\n \tsq->cxt_sts->state = FIELD_PREP(SDXI_CXT_STS_STATE, CXTV_RUN);\n \tcxt->id = SDXI_ADMIN_CXT_ID;\n \tcxt->db = sdxi->dbs + cxt->id * sdxi->db_stride;\n+\tsdxi_ring_state_init(cxt->ring_state, &sq->cxt_sts->read_index,\n+\t\t\t     sq->write_index, sq->ring_entries, sq->desc_ring);\n \n \terr = sdxi_publish_cxt(cxt);\n \tif (err)\n@@ -389,10 +397,15 @@ int sdxi_admin_cxt_init(struct sdxi_dev *sdxi)\n  */\n struct sdxi_cxt *sdxi_cxt_new(struct sdxi_dev *sdxi)\n {\n+\tstruct sdxi_sq *sq;\n+\n \tstruct sdxi_cxt *cxt __free(sdxi_cxt) = sdxi_alloc_cxt(sdxi);\n \tif (!cxt)\n \t\treturn NULL;\n \n+\tsq = cxt->sq;\n+\tsdxi_ring_state_init(cxt->ring_state, &sq->cxt_sts->read_index,\n+\t\t\t     sq->write_index, sq->ring_entries, sq->desc_ring);\n \tif (register_cxt(sdxi, cxt))\n \t\treturn NULL;\n \ndiff --git a/drivers/dma/sdxi/context.h b/drivers/dma/sdxi/context.h\nindex 5cd78e883c8d..9779b9aa4f86 100644\n--- a/drivers/dma/sdxi/context.h\n+++ b/drivers/dma/sdxi/context.h\n@@ -54,6 +54,8 @@ struct sdxi_cxt {\n \tdma_addr_t akey_table_dma;\n \n \tstruct sdxi_sq *sq;\n+\n+\tstruct sdxi_ring_state *ring_state;\n };\n \n int sdxi_admin_cxt_init(struct sdxi_dev *sdxi);\n","prefixes":["14/23"]}