From: Nathan Lynch Date: Mon, 11 May 2026 14:16:22 -0500 Subject: [PATCH v2 10/23] dmaengine: sdxi: Complete administrative context jump start MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260511-sdxi-base-v2-10-889cfed17e3f@amd.com> References: <20260511-sdxi-base-v2-0-889cfed17e3f@amd.com> In-Reply-To: <20260511-sdxi-base-v2-0-889cfed17e3f@amd.com> To: Vinod Koul , Frank Li Cc: Bjorn Helgaas , David Rientjes , John.Kariuki@amd.com, Kinsey Ho , Mario Limonciello , PradeepVineshReddy.Kodamati@amd.com, Shivank Garg , Stephen Bates , Wei Huang , Wei Xu , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Jonathan Cameron , Nathan Lynch X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1778526994; l=2061; i=nathan.lynch@amd.com; s=20260410; h=from:subject:message-id; bh=qZNHCbrTwVMWVauKeGKxVay61YI1RSEUJLtl5aJfQj8=; b=7TVXYXsPfHvgr1ReZZ0PJAF7bkOEu4IJ/XJL0fLrlKosSSb1Sh3cZuQOwKN7Gzbx+6Ji1xcpl 7LNGttcAAm2B+bdM/45+xEMBsHosj48kzrz7K2YU7wsbax1KvLYuNx/ X-Developer-Key: i=nathan.lynch@amd.com; a=ed25519; pk=PK4ozhq+/z9/2Jl5rgDmvHa9raVomv79qM8p1RAFpEw= X-Endpoint-Received: by B4 Relay for nathan.lynch@amd.com/20260410 with auth_id=728 List-Id: B4 Relay Submissions Now that the SDXI function has been placed in active state, the admin context can finally be started by writing its doorbell. Introduce a sdxi_cxt_push_doorbell() helper to simplify this for callers; it will be used in all descriptor submission paths. Co-developed-by: Wei Huang Signed-off-by: Wei Huang Signed-off-by: Nathan Lynch --- drivers/dma/sdxi/context.h | 6 ++++++ drivers/dma/sdxi/device.c | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/dma/sdxi/context.h b/drivers/dma/sdxi/context.h index 65b773446ba3..8dd6beb7a642 100644 --- a/drivers/dma/sdxi/context.h +++ b/drivers/dma/sdxi/context.h @@ -7,6 +7,7 @@ #define DMA_SDXI_CONTEXT_H #include +#include #include #include "hw.h" @@ -58,4 +59,9 @@ struct sdxi_cxt { int sdxi_admin_cxt_init(struct sdxi_dev *sdxi); +static inline void sdxi_cxt_push_doorbell(struct sdxi_cxt *cxt, u64 index) +{ + iowrite64(index, cxt->db); +} + #endif /* DMA_SDXI_CONTEXT_H */ diff --git a/drivers/dma/sdxi/device.c b/drivers/dma/sdxi/device.c index 204841afa5b7..8e621875b10b 100644 --- a/drivers/dma/sdxi/device.c +++ b/drivers/dma/sdxi/device.c @@ -262,7 +262,20 @@ static int sdxi_fn_activate(struct sdxi_dev *sdxi) * SDXI 1.0 4.1.8.9: Set MMIO_CTL0.fn_gsr to GSRV_ACTIVE and * wait for MMIO_STS0.fn_gsv to reach GSV_ACTIVE or GSV_ERROR. */ - return sdxi_dev_start(sdxi); + err = sdxi_dev_start(sdxi); + if (err) + return err; + + /* + * SDXI 1.0 4.1.8.10.b: Start the admin context using method + * #3 ("Jump Start 1") from 4.3.4 Starting A Context and + * Context Signaling. We haven't queued any descriptors to the + * admin context at this point, so the appropriate value for + * the doorbell is 0. + */ + sdxi_cxt_push_doorbell(sdxi->admin_cxt, 0); + + return 0; } static int sdxi_device_init(struct sdxi_dev *sdxi) -- 2.54.0