Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7391935rwi; Mon, 24 Oct 2022 14:03:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6D7mSNZgn+x6TmfL6o1GIX0GBZkVSC310hSFuv7YueUSaNnM/W6maamKbYN4Na5YnM/io5 X-Received: by 2002:a17:907:708:b0:77e:ff47:34b1 with SMTP id xb8-20020a170907070800b0077eff4734b1mr28028031ejb.493.1666645406740; Mon, 24 Oct 2022 14:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666645406; cv=none; d=google.com; s=arc-20160816; b=v77g77YAR5/TsPbf791bOJh5zwEIUWqox9sMbKAg+EDc6NEHT3HxwV8nBqcW62tpTu f//z0q9cvW3pIxrNQwTJsEBy7ScZ2lZNeSqcH5iIL4aX5waqfZe7af3C48LQ2pq/TQie xFSDmRDZxSyePCbBnJRcAbu9bFRE1930NReEp7dY2AsWumCDuWuXCxizrNpehuSCmZHp nJIv1+lRTU7dkrhSFDgdNTUiDJOnE+RXMCPNktxLqV8r8CpRSK/dK2vc99JwnjN2aJX4 iUniws2/DSELCfRI3B4TDtAJQF2yM/V3QPzTd7QnG20UyYcsZrhze81chQcSucHPJt8o CaXQ== 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=viCzafTUwtKdeEM4pzn0MjC7dTbVfnITXRdegZ/Fp6J763tl9ni31BkiVDuZ431XYK cgDiWCC5KbDNs9GTKOQvy4K5ryPpJwxTq83sbfPlSOUUStJC1VK9NJbQn4+tH/i6kd8P 4ddy0UFjYepztp+ixy7zn24/po9FOh0slpnr/6ko6pYHQoOXQEd7ynBrF8iKunSpT/m5 V+2+nIs7X+ZbliyyE5v25JWYR2mgbYB8FeAM1/CK/K3BUwVGpZeZUW9sSiyNApe/vLe9 UCfQrtIuiQXK0w/aiVoO2NS/DXmw3vGraI2iIQONNHuwVp6UmKxhmMdZYVERc/fVxxQ/ r7Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h0BNjPj4; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hy12-20020a1709068a6c00b0078de51e658esi737604ejc.208.2022.10.24.14.03.00; Mon, 24 Oct 2022 14:03: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=h0BNjPj4; 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 S232446AbiJXUZB (ORCPT + 99 others); Mon, 24 Oct 2022 16:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234180AbiJXUXH (ORCPT ); Mon, 24 Oct 2022 16:23:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58BA217A01D; Mon, 24 Oct 2022 11:38:49 -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 2D729B819B1; Mon, 24 Oct 2022 12:48:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D1EEC433D6; Mon, 24 Oct 2022 12:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615694; bh=V1yLvhX9zdad2+j+Fwim9g75fpNwO3eUX/S2g7mfUCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h0BNjPj4jyyF3QHpxVoF8SC/nsaekkioCmEZex45t74fnadFQ0JK08tD/uESC3II6 cdnrkLpUI7/UhsPxG2UCdQOOr482k+RXaGMniRKcdGUdHSu/5d66GsXONyEX1nLrcI Cx8ocdkZSacmoS1Shyz51AL8tL1WDEES1/6Z0Jxc= 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.15 348/530] dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup() Date: Mon, 24 Oct 2022 13:31:32 +0200 Message-Id: <20221024113100.760490658@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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) -- 2.35.1