From patchwork Wed Oct 19 08:31:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5469 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp332273wrs; Wed, 19 Oct 2022 06:38:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7pIcLjHH5L75Mne0ylih+Y6AkTEXxtTSeXDNTNrccl+X6r5TXyY2cZ0Wl/o+P8ddM2I2ca X-Received: by 2002:a63:3348:0:b0:439:db24:8b02 with SMTP id z69-20020a633348000000b00439db248b02mr7157903pgz.425.1666186709315; Wed, 19 Oct 2022 06:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666186709; cv=none; d=google.com; s=arc-20160816; b=m3o1VhAYjgXs1ork9V5eN4vje0lPUfbvxcWCCsfvyXfY8biirXsdP+8GL93Dm0KwoZ 5JqwzGGGP7xL41HcyGx1S2YVBEYlR1PMOXXtHPrVH3guITxh8MiWQnZOyS2FsAg07VNj 5c+uAcbFvdUNThQaX7Mgjj5g45cbjtawKD9keMNkDosYfkSrOjOAcVPya+09/9UQ7jKa hKiJpt+t/OX2fOUhLCtZgzuasiMkhdmC4QMMb+XfM9Y/Oim4FI1eFe0kLGAf9UzoI4l+ n4GnCZDB2tqJHx9ni2zHIVzjtXJgAVhoXZDWt2jq0lC6pd6DqSZKz88oHLfqs7VeNfnA Wd1g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7asfMDE5/D7dKpT8/biKetb4XW91a489M0kGzgXzjQo=; b=k/Aah35R14gvfacggmtjE+qNoMeLEHWekzIy2oCTKGeqBNZLi6cKGQyd3LWXEauN/E VrKPTPYOy8JNqs8wbaouYJG+ViYW9zT0Ws+iC/Ft82hR3l8pyp2x0ePVCII++XjUt/yU OHH/xE1k1MirGbsMDKcvGRu5dx4VAJWkAL+CBl1vOanFl//PxSrCO9U8HTul2UhQGScJ 3hMG/K+TXRg1m0K9jXrC4gsZsURea7EjUY3GUKF/JzGagaAlYfbji0ZJXGggqWjX2bC3 gQCPxL20ozVCb6g78r7qNd/SzGcLkdzvycFVs9/vZNdMF7LV74dqviI5IrulfZigfoYU 0Vrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p3fXCtWw; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020a63464c000000b00434f41f6981si17889623pgk.360.2022.10.19.06.38.16; Wed, 19 Oct 2022 06:38:29 -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=@linuxfoundation.org header.s=korg header.b=p3fXCtWw; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231557AbiJSNet (ORCPT + 99 others); Wed, 19 Oct 2022 09:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232582AbiJSNeS (ORCPT ); Wed, 19 Oct 2022 09:34:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 545F11946CB; Wed, 19 Oct 2022 06:23:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 72C7EB8245D; Wed, 19 Oct 2022 09:04:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7186C433D6; Wed, 19 Oct 2022 09:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170259; bh=V1yLvhX9zdad2+j+Fwim9g75fpNwO3eUX/S2g7mfUCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p3fXCtWwyamrO9mZlC8zlC8zaIPUZOxnijn4/Tq9+XFcGNLnWprdsSMlq4+2xbriM a32KoalkgZ+CC5Fsy7f3C8+dFIAFGO1sschbpCKfVIzsLB2hlgoiDfxXr0ynDBS6EE +/WePULCoIY6UQ70A7H1ViCc5rk8SdFqJG11VcHk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Jiang , Vinod Koul , Sasha Levin Subject: [PATCH 6.0 587/862] dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup() Date: Wed, 19 Oct 2022 10:31:14 +0200 Message-Id: <20221019083315.908972896@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747123394602636054?= X-GMAIL-MSGID: =?utf-8?q?1747123394602636054?= From: Dave Jiang [ Upstream commit 898ec89dbb55b8294695ad71694a0684e62b2a73 ] User reports observing timer event report channel halted but no error observed in CHANERR register. The driver finished self-test and released channel resources. Debug shows that __cleanup() can call mod_timer() after the timer has been deleted and thus resurrect the timer. While harmless, it causes suprious error message to be emitted. Use mod_timer_pending() call to prevent deleted timer from being resurrected. Fixes: 3372de5813e4 ("dmaengine: ioatdma: removal of dma_v3.c and relevant ioat3 references") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/166360672197.3851724.17040290563764838369.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/ioat/dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index 37ff4ec7db76..e2070df6cad2 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -656,7 +656,7 @@ static void __cleanup(struct ioatdma_chan *ioat_chan, dma_addr_t phys_complete) if (active - i == 0) { dev_dbg(to_dev(ioat_chan), "%s: cancel completion timeout\n", __func__); - mod_timer(&ioat_chan->timer, jiffies + IDLE_TIMEOUT); + mod_timer_pending(&ioat_chan->timer, jiffies + IDLE_TIMEOUT); } /* microsecond delay by sysfs variable per pending descriptor */ @@ -682,7 +682,7 @@ static void ioat_cleanup(struct ioatdma_chan *ioat_chan) if (chanerr & (IOAT_CHANERR_HANDLE_MASK | IOAT_CHANERR_RECOVER_MASK)) { - mod_timer(&ioat_chan->timer, jiffies + IDLE_TIMEOUT); + mod_timer_pending(&ioat_chan->timer, jiffies + IDLE_TIMEOUT); ioat_eh(ioat_chan); } } @@ -879,7 +879,7 @@ static void check_active(struct ioatdma_chan *ioat_chan) } if (test_and_clear_bit(IOAT_CHAN_ACTIVE, &ioat_chan->state)) - mod_timer(&ioat_chan->timer, jiffies + IDLE_TIMEOUT); + mod_timer_pending(&ioat_chan->timer, jiffies + IDLE_TIMEOUT); } static void ioat_reboot_chan(struct ioatdma_chan *ioat_chan)