From patchwork Mon Oct 24 11:31:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp403503wru; Mon, 24 Oct 2022 04:52:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5T93n1IV0KiOcAnV/jFrQMe1I12BQZlTLBMDelzFTRO8mx8kuzAQqZeqhQ7UychytMfAOB X-Received: by 2002:a05:6a00:a96:b0:558:8915:2f0e with SMTP id b22-20020a056a000a9600b0055889152f0emr33088162pfl.38.1666612346576; Mon, 24 Oct 2022 04:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612346; cv=none; d=google.com; s=arc-20160816; b=OCBLZRC/pXVm3ifQhT9CR90QHx1spy/TET4Lpg9z8iVJ8LXg0TGA5nlOXOpk548a8H FbJg93jVxbKQL2WSi1POzWliu6ybkn8Evk/obwe71iZL1Ztho3ClH9ZP0FnDGKqtLiQS tdU1ur3PaotmtDNkwqr2OyM57/akKcDfNSLF2DebHrL+YAMmpGf2SYWjl1l6MzwNCOUq omjMTf0F7b2q1UL7uibWBZEXDRvAPhwMk6cy+vxQhI7BP7C0wMq08zXI2vS2Bdu9UVWU VNJ1n419hBqxQpZkGG4fP+GriZUClROru5vOifoQtR1CmVjChgQAKnNw5e+nHmEVtkhq mttg== 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=Ds4Q8tgJjQLjSGorEB1wtIaCs6yJcjGMTJK/AsJ5shg=; b=EfJee8RKQxF9R8Upgue63sl+K13OdgpPPtPKm0qoMHOtt50/99gSMe1VldayqoYNxT FS+fqy932Is0wyNY62NWkeRN3So5rxYmRiMnZhgq4JXKjmlxOfXxDlrIEK/7wyZbWZLp wnzN/yWATIYs91kS/jhq/5Dclbhxly+kF6uAn85wbHsxMVpK7iNrM7wb8au7ZYiHzZ3c iZqsSkI6kD5CKVsEN6kZIQGNQE+m2JG60E18cQ7+uVzSZIV9cgrDBwEOi4AKZBj8g4NI PeRlcvPdy9jGPNC11E2KPFOhZJxbLgQ1o3v1JTNyt2IhLQF3NPAtA0pxPCVQSBzXROgU 6bEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=scHvUF8p; 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 q85-20020a632a58000000b004394687b653si1961857pgq.253.2022.10.24.04.52.13; Mon, 24 Oct 2022 04:52:26 -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=scHvUF8p; 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 S231992AbiJXLvt (ORCPT + 99 others); Mon, 24 Oct 2022 07:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231633AbiJXLts (ORCPT ); Mon, 24 Oct 2022 07:49:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 336AF6F26C; Mon, 24 Oct 2022 04:44:06 -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 97488B8117E; Mon, 24 Oct 2022 11:44:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5723C433D6; Mon, 24 Oct 2022 11:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611844; bh=nKGmevzLQrtXkEM6g9KVEPyNFfuZdgp1sbhdc2Z129U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=scHvUF8plp3yE3SNN9RE4q9A6nEmmyyJikbU2RbGSGT1HXrb1jn4/3Nm3sU6h7TkW hhHLf/rVaO5SNXzDQbzbdgdYQLOzattgjbZsromtMw5cSRXOm+AmiUJ7duTevJofFG 4ciJrnL65R/h99cTuARMpmJdm2HpI6eOELbSmdBY= 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 4.9 115/159] dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup() Date: Mon, 24 Oct 2022 13:31:09 +0200 Message-Id: <20221024112953.683101678@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747569707860124394?= X-GMAIL-MSGID: =?utf-8?q?1747569707860124394?= 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 c5a45c57b8b8..36189a3337b1 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -663,7 +663,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); } /* 5 microsecond delay per pending descriptor */ @@ -685,7 +685,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); } } @@ -877,7 +877,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); } void ioat_timer_event(unsigned long data)