From patchwork Sat Oct 22 07:25:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7493 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1104861wrr; Sat, 22 Oct 2022 01:33:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gXJlEUvxQEBRzeePA50pdE/XAUcUbfbdaH3ZlNLe/yCQe2Pg9JiJtkGgOyJ94PqE6v1BO X-Received: by 2002:a17:902:b597:b0:182:8547:ae57 with SMTP id a23-20020a170902b59700b001828547ae57mr23591031pls.92.1666427612452; Sat, 22 Oct 2022 01:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427612; cv=none; d=google.com; s=arc-20160816; b=SOt5ehLwYDFEiDlBMIBks4aQPclEWAVS5ixb8mJNM/+hivG5kz88UdE1nSkkTLPouy Kgs94eLJp1fvPAzYNH/Fjuh0tRG9qRYDyQACVM3LuF+l8i7/stYURNYGK1U8bRAX+tHx Nnx+MxsODi2HOXCizcEuBe+e1O/VtDan5442bFU6pnCvwZQfwExKhVht/kYq5PAiZPJs 4H4xENpKQml1KKrnjV6LiG/fL2aGxYXeqKHImKnaqF9n/uyGcCM1EcBRkWT+JpTLDa9G EvQ4Rcv5XtJi/CiS/Yanjgny/QiCMypTXDlLHbfLfHaibpNJkua9H0XwLkQitdbfI+Ws HTaQ== 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=Y5CJR3evYtUr/BDsUIRHlBdCEq4vLlAuz/O2f8boXYDMqz5DiiQGoUs9nU4gLx7bin OjwCbFAvxbLxrcBUKaUTGZnvfRjSZNG7WuxH7VRU6WdAV0ogl8lHVfVIOxSZr+0o8JKR LxF+FY0i2GfYvfUvIHC7iLYswoBN1ekEZjrCCqeAtOo9VzAD65G2jL8QJZykUjScowc3 VeA3QBHyocbxPvpHI5qaI9Hn6WHit1O1hTv1/Ll+SuXWD5uyPvU2vwmiZ5i2ZOD6KFly psxSMPhubNvFvHGNrEMtMfB9r8BEdDbie9QT2hoOsMLDEjbJM9WevM+GhEAEZaFQ0C1O tlsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GBUKsZEt; 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 d17-20020a170903209100b00182c500d95bsi22924250plc.1.2022.10.22.01.33.19; Sat, 22 Oct 2022 01:33:32 -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=GBUKsZEt; 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 S233414AbiJVISS (ORCPT + 99 others); Sat, 22 Oct 2022 04:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234062AbiJVIQF (ORCPT ); Sat, 22 Oct 2022 04:16:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 871162DB96A; Sat, 22 Oct 2022 00:56:57 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A222B60BA0; Sat, 22 Oct 2022 07:56:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63085C433B5; Sat, 22 Oct 2022 07:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425366; bh=V1yLvhX9zdad2+j+Fwim9g75fpNwO3eUX/S2g7mfUCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GBUKsZEt8MSFugLh2Mwtm7vIpL0SQJaw4tgea4AeHNmHJcnLsBEhQMfxP8XpRSa6n XFdeRVc/gVXnDWxYbLHLsQtVDxRfr+U/Q9cziRYRudXBaS8LFbWV8hfKvrOTjBeBGK AOpFfQJhR6XNzJU9wQXRsTGIjM0r8cwlB1N3oh2g= 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 5.19 477/717] dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup() Date: Sat, 22 Oct 2022 09:25:56 +0200 Message-Id: <20221022072519.457117679@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376000148175264?= X-GMAIL-MSGID: =?utf-8?q?1747376000148175264?= 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)