From patchwork Tue Dec 17 16:04:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 13912114 X-Patchwork-Delegate: kw@linux.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 408E71F7545 for ; Tue, 17 Dec 2024 16:05:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734451503; cv=none; b=LB/gRgy8zYhojeeUWzFbNtkQq2XtVGCVdGwmH0r/sUyYd9we0JT9CPTN51f0qVCAJXLqfS+9WIhsCcBYcH9Q50k+K/ekMQt37GYn0cycjvInjSyND1Wo7XDZNug5yYYaz9c0zdjpNzyMsVCHB5PXO7xViF4nX9zfGvv6pxS1+LU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734451503; c=relaxed/simple; bh=TU/raJvixvN4nOQHwwErByg4LJJt9dVgcIq0Gcog9v8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hCAWRFK+Emr43Txp4J9svOSoRvz/FX7iHC82XalLWuCfGqP9t9aKxU7hnMDoaWwBfOE0ilJOSHqqyqPXTJBH+aj5LvHAIhtellVa3ml4znKk5yvR50Zmbyov6UVSXaShnveX2N3qhYSQk19NisnK2mpWJb1hFIdMM5/7UthboGk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nLfhKfOZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nLfhKfOZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34013C4CED3; Tue, 17 Dec 2024 16:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734451503; bh=TU/raJvixvN4nOQHwwErByg4LJJt9dVgcIq0Gcog9v8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nLfhKfOZLiJXR4Jrh80kZasntvw2CzdkGVGxdhGFHnJkLBcvbOxj383Keav2FE0MV ZxE3Ds9FO6pRBnOJdR+ZbRWwaTUIaYV7gDLLWvxnZ7UMi5hCUPFmO7V21c+i5RC/ci riv9C/DUvf13gZzFbUzwIXRwENxJgbVA/BybQd9PrAewiT7wnKen7ZevgqfW1PJDAt 0ntTmCpvbrZZ4bTB57p/Zww8ojyWEskhGPgtVpmFMyg/lYsmTRBmFO8o4BFpx1v+Fm DcAC3yYlE7RqQoGAcH3FtfjYImCWPecrgL1O8tBYsyo6hociitXmUPRueliV0CreSu j/vZX3sR2vyvg== From: Niklas Cassel To: Manivannan Sadhasivam Cc: Damien Le Moal , Vinod Koul , linux-nvme@lists.infradead.org, Christoph Hellwig , Keith Busch , Sagi Grimberg , linux-pci@vger.kernel.org, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Lorenzo Pieralisi , Rick Wertenbroek , Niklas Cassel Subject: [PATCH 1/3] dmaengine: dw-edma: Add support for DMA_MEMCPY Date: Tue, 17 Dec 2024 17:04:49 +0100 Message-ID: <20241217160448.199310-4-cassel@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5606; i=cassel@kernel.org; h=from:subject; bh=TU/raJvixvN4nOQHwwErByg4LJJt9dVgcIq0Gcog9v8=; b=owGbwMvMwCV2MsVw8cxjvkWMp9WSGNITFypUPVfzczncLnnAYd6tnQZqE6f/jTy2b6VDVpftj izPHa39HaUsDGJcDLJiiiy+P1z2F3e7TzmueMcGZg4rE8gQBi5OAZhI9T+G/xlTam7+fVm+8vZT U54lSvpzAnPqp39KV1jJ1/LqmrfqZEdGhneTlBdXJTm8fCDRnZLB9PeoosTxoye4w9eu+3i9ga+ PhwUA X-Developer-Key: i=cassel@kernel.org; a=openpgp; fpr=5ADE635C0E631CBBD5BE065A352FE6582ED9B5DA Signed-off-by: Niklas Cassel --- drivers/dma/dw-edma/dw-edma-core.c | 52 ++++++++++++++++++++++++++++-- drivers/dma/dw-edma/dw-edma-core.h | 10 +++++- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c index 68236247059d..29cbd947df57 100644 --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -422,6 +422,9 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) return NULL; if (!xfer->xfer.il->src_inc || !xfer->xfer.il->dst_inc) return NULL; + } else if (xfer->type == EDMA_XFER_MEMCPY) { + if (!xfer->xfer.memcpy.len) + return NULL; } else { return NULL; } @@ -437,6 +440,9 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) if (xfer->type == EDMA_XFER_INTERLEAVED) { src_addr = xfer->xfer.il->src_start; dst_addr = xfer->xfer.il->dst_start; + } else if (xfer->type == EDMA_XFER_MEMCPY) { + src_addr = xfer->xfer.memcpy.src; + dst_addr = xfer->xfer.memcpy.dst; } else { src_addr = chan->config.src_addr; dst_addr = chan->config.dst_addr; @@ -455,6 +461,8 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) } else if (xfer->type == EDMA_XFER_INTERLEAVED) { cnt = xfer->xfer.il->numf * xfer->xfer.il->frame_size; fsz = xfer->xfer.il->frame_size; + } else if (xfer->type == EDMA_XFER_MEMCPY) { + cnt = 1; } for (i = 0; i < cnt; i++) { @@ -477,6 +485,8 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) burst->sz = sg_dma_len(sg); else if (xfer->type == EDMA_XFER_INTERLEAVED) burst->sz = xfer->xfer.il->sgl[i % fsz].size; + else if (xfer->type == EDMA_XFER_MEMCPY) + burst->sz = xfer->xfer.memcpy.len; chunk->ll_region.sz += burst->sz; desc->alloc_sz += burst->sz; @@ -495,7 +505,8 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) * and destination addresses are increased * by the same portion (data length) */ - } else if (xfer->type == EDMA_XFER_INTERLEAVED) { + } else if (xfer->type == EDMA_XFER_INTERLEAVED || + xfer->type == EDMA_XFER_MEMCPY) { burst->dar = dst_addr; } } else { @@ -512,7 +523,8 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) * and destination addresses are increased * by the same portion (data length) */ - } else if (xfer->type == EDMA_XFER_INTERLEAVED) { + } else if (xfer->type == EDMA_XFER_INTERLEAVED || + xfer->type == EDMA_XFER_MEMCPY) { burst->sar = src_addr; } } @@ -595,6 +607,40 @@ dw_edma_device_prep_interleaved_dma(struct dma_chan *dchan, return dw_edma_device_transfer(&xfer); } +static struct dma_async_tx_descriptor * +dw_edma_device_prep_dma_memcpy(struct dma_chan *dchan, dma_addr_t dst, + dma_addr_t src, size_t len, unsigned long flags) +{ + struct dw_edma_chan *chan = dchan2dw_edma_chan(dchan); + enum dma_transfer_direction direction; + struct dw_edma_transfer xfer; + + if (chan->dw->chip->flags & DW_EDMA_CHIP_LOCAL) { + if (chan->dir == EDMA_DIR_READ) + direction = DMA_DEV_TO_MEM; + else + direction = DMA_MEM_TO_DEV; + } else { + if (chan->dir == EDMA_DIR_WRITE) + direction = DMA_DEV_TO_MEM; + else + direction = DMA_MEM_TO_DEV; + } + + xfer.dchan = dchan; + xfer.direction = direction; + xfer.xfer.memcpy.dst = dst; + xfer.xfer.memcpy.src = src; + xfer.xfer.memcpy.len = len; + xfer.flags = flags; + xfer.type = EDMA_XFER_MEMCPY; + + /* DMA_MEMCPY does not need an initial dmaengine_slave_config() call */ + chan->configured = true; + + return dw_edma_device_transfer(&xfer); +} + static void dw_edma_done_interrupt(struct dw_edma_chan *chan) { struct dw_edma_desc *desc; @@ -787,6 +833,7 @@ static int dw_edma_channel_setup(struct dw_edma *dw, u32 wr_alloc, u32 rd_alloc) dma_cap_set(DMA_CYCLIC, dma->cap_mask); dma_cap_set(DMA_PRIVATE, dma->cap_mask); dma_cap_set(DMA_INTERLEAVE, dma->cap_mask); + dma_cap_set(DMA_MEMCPY, dma->cap_mask); dma->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); dma->src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); dma->dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); @@ -806,6 +853,7 @@ static int dw_edma_channel_setup(struct dw_edma *dw, u32 wr_alloc, u32 rd_alloc) dma->device_prep_slave_sg = dw_edma_device_prep_slave_sg; dma->device_prep_dma_cyclic = dw_edma_device_prep_dma_cyclic; dma->device_prep_interleaved_dma = dw_edma_device_prep_interleaved_dma; + dma->device_prep_dma_memcpy = dw_edma_device_prep_dma_memcpy; dma_set_max_seg_size(dma->dev, U32_MAX); diff --git a/drivers/dma/dw-edma/dw-edma-core.h b/drivers/dma/dw-edma/dw-edma-core.h index 71894b9e0b15..2b35dccbe8de 100644 --- a/drivers/dma/dw-edma/dw-edma-core.h +++ b/drivers/dma/dw-edma/dw-edma-core.h @@ -36,7 +36,8 @@ enum dw_edma_status { enum dw_edma_xfer_type { EDMA_XFER_SCATTER_GATHER = 0, EDMA_XFER_CYCLIC, - EDMA_XFER_INTERLEAVED + EDMA_XFER_INTERLEAVED, + EDMA_XFER_MEMCPY }; struct dw_edma_chan; @@ -139,12 +140,19 @@ struct dw_edma_cyclic { size_t cnt; }; +struct dw_edma_memcpy { + dma_addr_t dst; + dma_addr_t src; + size_t len; +}; + struct dw_edma_transfer { struct dma_chan *dchan; union dw_edma_xfer { struct dw_edma_sg sg; struct dw_edma_cyclic cyclic; struct dma_interleaved_template *il; + struct dw_edma_memcpy memcpy; } xfer; enum dma_transfer_direction direction; unsigned long flags; From patchwork Tue Dec 17 16:04:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 13912115 X-Patchwork-Delegate: kw@linux.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3B041F758C for ; Tue, 17 Dec 2024 16:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734451506; cv=none; b=WlFjhlkOs9clDzUcJH5pQBw94dkslxd0SG0tFk/Thh9VBXS4afUog4042yh4PGix5NM1T0ZtHs37u6iBZkL0VK/tyi5SR3iF3at0DT4LsgTVFaAMQVeM2+iQKrjRPNXPS9N5S1DcHhbKDJZifzvRW930JVoiPPT4UQ1hNOtiff0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734451506; c=relaxed/simple; bh=DB82UMamGsd29tTD7UzEWTxuioiXlTLHeqMQU4t60m0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FX9/UnBd4Rjua90g+xDRbfpPOYF5coYKgflsehUGTmi/7fboTXUNsDYhh+ZyCYKwBZNirBnz5i9q9mnd5jyitbqYrKdpoCeYBoKZQJLuFwKJTx75PwaXGbci2OI86ncerrbLGOh5pVXWG1OuMYguvUAU7TiFYfwX9MEIqVGE1x8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nEZywKqd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nEZywKqd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B802C4CED3; Tue, 17 Dec 2024 16:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734451506; bh=DB82UMamGsd29tTD7UzEWTxuioiXlTLHeqMQU4t60m0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nEZywKqdk9Fly9JEBUaBV2yzsGp9UkLourKYNdejmv+7jBrlRB8ivW9ayZD6dpb/q Tt5zNo+HhSzueKpRw9NqHbb5XynM0RLioVL+8cNUHPPAKVn0wsm/uL2acyPJOJCtnE XDjuoLypww1Mu8fJPhiYc2OfgtekLpzzCh3kuyAFyOsXaeVy5a5QlPn7pILKy1yKf4 8MgaJwQws486++DCNIZrCCJBp0WMvi0lvCG6zDlvC3vhbhitLOMfxN0QEWLqT1BvTl Shgs0q/bBHVV0C3zyrWs4Im90RfFny5v+3XEmk0ncmQbtNOtrWzlEtroRxtFXwOcKO b5x8tmwIsduXg== From: Niklas Cassel To: Manivannan Sadhasivam Cc: Damien Le Moal , Vinod Koul , linux-nvme@lists.infradead.org, Christoph Hellwig , Keith Busch , Sagi Grimberg , linux-pci@vger.kernel.org, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Lorenzo Pieralisi , Rick Wertenbroek , Niklas Cassel Subject: [PATCH 2/3] PCI: endpoint: pci-epf-test: Use private DMA_MEMCPY channel Date: Tue, 17 Dec 2024 17:04:50 +0100 Message-ID: <20241217160448.199310-5-cassel@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241217160448.199310-4-cassel@kernel.org> References: <20241217160448.199310-4-cassel@kernel.org> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2298; i=cassel@kernel.org; h=from:subject; bh=DB82UMamGsd29tTD7UzEWTxuioiXlTLHeqMQU4t60m0=; b=owGbwMvMwCV2MsVw8cxjvkWMp9WSGNITFyrE71W9Gyr9WzUvwuv7/oV3rEqubi46ULo7qibg1 zLjEKNFHaUsDGJcDLJiiiy+P1z2F3e7TzmueMcGZg4rE8gQBi5OAZjIU1FGhrlz2PeJbXrNNvUZ z8WannShqgeFHz5zrCkxkFcQK561qpyRYXKLmGWH3YLVrw6u1NE8EnJ4Va5f50JDNZMPn5kWr78 owA4A X-Developer-Key: i=cassel@kernel.org; a=openpgp; fpr=5ADE635C0E631CBBD5BE065A352FE6582ED9B5DA First try to use a DMA channel with DMA_PRIVATE and DMA_MEMCPY. If there is no such channel, fall back to a DMA_MEMCPY channel (without DMA_PRIVATE). Signed-off-by: Niklas Cassel --- drivers/pci/endpoint/functions/pci-epf-test.c | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index ef6677f34116..8315225d81bd 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -123,11 +123,9 @@ static int pci_epf_test_data_transfer(struct pci_epf_test *epf_test, { struct dma_chan *chan = (dir == DMA_MEM_TO_DEV) ? epf_test->dma_chan_tx : epf_test->dma_chan_rx; - dma_addr_t dma_local = (dir == DMA_MEM_TO_DEV) ? dma_src : dma_dst; enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT; struct pci_epf *epf = epf_test->epf; struct dma_async_tx_descriptor *tx; - struct dma_slave_config sconf = {}; struct device *dev = &epf->dev; int ret; @@ -136,24 +134,7 @@ static int pci_epf_test_data_transfer(struct pci_epf_test *epf_test, return -EINVAL; } - if (epf_test->dma_private) { - sconf.direction = dir; - if (dir == DMA_MEM_TO_DEV) - sconf.dst_addr = dma_remote; - else - sconf.src_addr = dma_remote; - - if (dmaengine_slave_config(chan, &sconf)) { - dev_err(dev, "DMA slave config fail\n"); - return -EIO; - } - tx = dmaengine_prep_slave_single(chan, dma_local, len, dir, - flags); - } else { - tx = dmaengine_prep_dma_memcpy(chan, dma_dst, dma_src, len, - flags); - } - + tx = dmaengine_prep_dma_memcpy(chan, dma_dst, dma_src, len, flags); if (!tx) { dev_err(dev, "Failed to prepare DMA memcpy\n"); return -EIO; @@ -225,7 +206,8 @@ static int pci_epf_test_init_dma_chan(struct pci_epf_test *epf_test) filter.dma_mask = BIT(DMA_DEV_TO_MEM); dma_cap_zero(mask); - dma_cap_set(DMA_SLAVE, mask); + dma_cap_set(DMA_PRIVATE, mask); + dma_cap_set(DMA_MEMCPY, mask); dma_chan = dma_request_channel(mask, epf_dma_filter_fn, &filter); if (!dma_chan) { dev_info(dev, "Failed to get private DMA rx channel. Falling back to generic one\n"); From patchwork Tue Dec 17 16:04:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 13912116 X-Patchwork-Delegate: kw@linux.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4383A1F759C for ; Tue, 17 Dec 2024 16:05:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734451510; cv=none; b=Ew24iVByp6WZmPcAR09EB4YZqwth2mDIEC42vzTeFavwTJnYHxb7sq/9odujaUTBwW+tzbkHXb+9799pN8FCrTdYVY9ZE1Ix7U9JlB7xzzCqX0yFOVccImFWg7gVoHHrRyrKk1zzI7Y0qRT9+DOEoxqzPNNYPDAZWIZtzGiNN0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734451510; c=relaxed/simple; bh=fyIlZNVelf5SMbRdM6Ux9PY3hbaZfU1cULKHILvSoBQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H3JBJiKfOeLtiT5o5inaBLMlMtJc6aVBMoatbnWm3Ow4mqMVTXOoBJfej2Y/a41IKc1cgHLzmSuNM+ZTPbH68KdKsroYTwWfWGZ5u7kv9FzXg+iH4FlJrDtWR+IruOa0sCNVmHwF5PUzHcWOsgpiFhUEav8pAOWuYYjuAVqL83s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F7ywJlHh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F7ywJlHh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5D4DC4CED6; Tue, 17 Dec 2024 16:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734451509; bh=fyIlZNVelf5SMbRdM6Ux9PY3hbaZfU1cULKHILvSoBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F7ywJlHhbGbwviHYvi7RJfsUdIiJW0Z20FQx9HFCIReWRiDBYegxbkfFNvVVhIr+G 0UmffETaTGh+3We1956dG8dOZwnUgYj7m4pnv3OYY3oPunw+UCLr0WwldSh8cxsd4h RUCj/NA3PJKO3JBhIFrrv/2r4zF9E8GAB6LQqm+CfHtJ8PxzAiFGfp3l7X3dY32uzI xnWhV1dbSaiRLx0mvzmmqtq0vsY7SeYT+E8msayPSU2ZncFNihIxepnd+sI2NDkmIn n8PryXTsGCDqmg/359y0Nb1KmrvFoVuvtFAZTKXh9b8rxfdIzjFnSc8IFG4FisjR6P xbPJY4vSbnHuA== From: Niklas Cassel To: Manivannan Sadhasivam Cc: Damien Le Moal , Vinod Koul , linux-nvme@lists.infradead.org, Christoph Hellwig , Keith Busch , Sagi Grimberg , linux-pci@vger.kernel.org, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Lorenzo Pieralisi , Rick Wertenbroek , Niklas Cassel Subject: [PATCH 3/3] debug prints - DO NOT MERGE Date: Tue, 17 Dec 2024 17:04:51 +0100 Message-ID: <20241217160448.199310-6-cassel@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241217160448.199310-4-cassel@kernel.org> References: <20241217160448.199310-4-cassel@kernel.org> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1516; i=cassel@kernel.org; h=from:subject; bh=fyIlZNVelf5SMbRdM6Ux9PY3hbaZfU1cULKHILvSoBQ=; b=owGbwMvMwCV2MsVw8cxjvkWMp9WSGNITFyoULRFMnNOzcVtH0f3U/9utrVcucprUeO7RArFHe X6VSsvedJSyMIhxMciKKbL4/nDZX9ztPuW44h0bmDmsTCBDGLg4BWAipj8Z/mdu4vaszuNsvPdn 9RPjVh+uZ7KaQn/8wqbevMe/LXD9UT6GP3yRvEUlFe+ZVgf12159fdj8aqUx31Tu2QUJTA+2PHS 04QIA X-Developer-Key: i=cassel@kernel.org; a=openpgp; fpr=5ADE635C0E631CBBD5BE065A352FE6582ED9B5DA Signed-off-by: Niklas Cassel --- drivers/dma/dw-edma/dw-edma-core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c index 29cbd947df57..eb69a608d087 100644 --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -197,6 +197,7 @@ static int dw_edma_start_transfer(struct dw_edma_chan *chan) if (!desc) return 0; + trace_printk("start transfer for desc: %px\n", desc); child = list_first_entry_or_null(&desc->chunk->list, struct dw_edma_chunk, list); if (!child) @@ -545,6 +546,9 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer) } } + if (xfer->type == EDMA_XFER_MEMCPY) + trace_printk("DMA_MEMCPY tx_prep desc: %px\n", desc); + return vchan_tx_prep(&chan->vc, &desc->vd, xfer->flags); err_alloc: @@ -653,6 +657,7 @@ static void dw_edma_done_interrupt(struct dw_edma_chan *chan) switch (chan->request) { case EDMA_REQ_NONE: desc = vd2dw_edma_desc(vd); + trace_printk("REQ_NONE desc: %px\n", desc); if (!desc->chunks_alloc) { list_del(&vd->node); vchan_cookie_complete(vd); @@ -664,6 +669,8 @@ static void dw_edma_done_interrupt(struct dw_edma_chan *chan) break; case EDMA_REQ_STOP: + desc = vd2dw_edma_desc(vd); + trace_printk("REQ_STOP desc: %px\n", desc); list_del(&vd->node); vchan_cookie_complete(vd); chan->request = EDMA_REQ_NONE;