dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yajun Deng <yajun.deng@linux.dev>
To: vkoul@kernel.org, bhelgaas@google.com, dave.jiang@intel.com
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yajun Deng <yajun.deng@linux.dev>
Subject: [PATCH] dmaengine: ioat: fixing the wrong chancnt
Date: Fri, 11 Aug 2023 16:16:45 +0800	[thread overview]
Message-ID: <20230811081645.1768047-1-yajun.deng@linux.dev> (raw)

The chancnt would be updated in __dma_async_device_channel_register(),
but it was assigned in ioat_enumerate_channels(). Therefore chancnt has
the wrong value.

Clear chancnt before calling dma_async_device_register().

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 drivers/dma/ioat/init.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
index c4602bfc9c74..928fc8a83a36 100644
--- a/drivers/dma/ioat/init.c
+++ b/drivers/dma/ioat/init.c
@@ -536,8 +536,11 @@ static int ioat_probe(struct ioatdma_device *ioat_dma)
 
 static int ioat_register(struct ioatdma_device *ioat_dma)
 {
-	int err = dma_async_device_register(&ioat_dma->dma_dev);
+	int err;
+
+	ioat_dma->dma_dev.chancnt = 0;
 
+	err = dma_async_device_register(&ioat_dma->dma_dev);
 	if (err) {
 		ioat_disable_interrupts(ioat_dma);
 		dma_pool_destroy(ioat_dma->completion_pool);
-- 
2.25.1


             reply	other threads:[~2023-08-11  8:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11  8:16 Yajun Deng [this message]
2023-08-11 15:40 ` [PATCH] dmaengine: ioat: fixing the wrong chancnt Dave Jiang
2023-08-13  8:59   ` Yajun Deng
2023-08-14 15:06     ` Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230811081645.1768047-1-yajun.deng@linux.dev \
    --to=yajun.deng@linux.dev \
    --cc=bhelgaas@google.com \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).