Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp853228rdg; Fri, 11 Aug 2023 01:43:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAAkgLbbDqFJzM25d9FKg5MVzfj/gQkbLxxBD+bohuuhZAJrbtMiloAP9/ZwKvFdQYI7Vp X-Received: by 2002:a05:6a20:4402:b0:13d:3b4d:e4b4 with SMTP id ce2-20020a056a20440200b0013d3b4de4b4mr2188695pzb.9.1691743411048; Fri, 11 Aug 2023 01:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691743411; cv=none; d=google.com; s=arc-20160816; b=x/aDqP6+V+2AA9NDTt3Hxn2jvP6Mr7QhpfcoMJeFkTp6onnV9JWscffXqeuDlF7D2t 1ObDv8X/YqfWZ8jXH8blXcdvbvRL7EizlaIIcZEkqFsFrc5nbpbVqDTjrgNYPd8jGQau 7QKtfghrc6pSiFXI50cvd8spIjG6r+SAWap2dbqBHVup10Q82GkEo3Wovd8aIat2lNlj gddyi5icizBsVFi476AOinbo8de/z0YWwS6PVJ8nYasZlxFXBBiH9ZYWRH2XCBamZL7a 8M2oVZe7PFJ8EZVLUdN3Kj6oDFV0jXG1v13sYI5ckcnT1/TG2oCfCYg/o0xlZAY3Ue0+ PmTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vVm1O0Syg4ejjYMdJVi4z6kpg+fEh4jWNr9Mz8DjEBU=; fh=SnawKCBo5eiYDl0u3fVPVQPKJjF7/j1naM/WXKvI3d4=; b=PO04Txt/dDkYc8jI0jPGwnGe6LWG/ZMgtzblthWo2Hv01TC6GmGTN9rzA5qrT0moyy 2pUWSFOqYS5D+N2T/MItCb/UDFTsSfEmUZ7WLJEEOca+i4bVfw4v8O9xSUKUy+AYRvFr +FJecpOcuEODLN5OnAKyZ8VZFxgy9ndzHpoFe6eAUisqjRnC23x0TySyeyuNr4Q79UsY 7SvYzQCNmHOG+/lbUtU2Rf5hQAcxGTsqtv5pCrzz6IU02jUg/aSOXBtXlYi2Zf+GhRMU PtfXL7G14LloLbH/357FzrtlqFx2x8UrInJI2JHbhD2CCfNUPjMXuR5GOiKUqBnJcCWr riXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=licdqO+s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a056a00141200b00686ef19c4d2si3030079pfu.325.2023.08.11.01.43.19; Fri, 11 Aug 2023 01:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=licdqO+s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234398AbjHKIRF (ORCPT + 99 others); Fri, 11 Aug 2023 04:17:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234473AbjHKIRD (ORCPT ); Fri, 11 Aug 2023 04:17:03 -0400 Received: from out-94.mta1.migadu.com (out-94.mta1.migadu.com [95.215.58.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93FC126B2 for ; Fri, 11 Aug 2023 01:17:01 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691741819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vVm1O0Syg4ejjYMdJVi4z6kpg+fEh4jWNr9Mz8DjEBU=; b=licdqO+sDYnJfKHnR0CE+bAjXPWEEG0jX68sg1wtWqG9HnP5fShB2CEZBloNS31eVOXP9E +kIno0g5qZCfGEgn+WQKsQHHQTa/fSCbLqGizfA8epUW0w6ze0fIkui5ffD8tgyWtmB3Z6 WPElMr+vxUMdHCYTaFR1DbnbGt8yCmk= From: Yajun Deng To: vkoul@kernel.org, bhelgaas@google.com, dave.jiang@intel.com Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH] dmaengine: ioat: fixing the wrong chancnt Date: Fri, 11 Aug 2023 16:16:45 +0800 Message-Id: <20230811081645.1768047-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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