From patchwork Mon Oct 24 11: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: 10253 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp643709wru; Mon, 24 Oct 2022 13:42:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5c0VVEwPEaZDdRXUOWwasOk/TppKRasvKDL+as7XviYNueBThB97EDiprJrcTxaxX2UbhK X-Received: by 2002:a05:6a00:198d:b0:56b:fa7b:56ed with SMTP id d13-20020a056a00198d00b0056bfa7b56edmr3683032pfl.81.1666644153845; Mon, 24 Oct 2022 13:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666644153; cv=none; d=google.com; s=arc-20160816; b=PZY6ud/2Oomfxox0Mh8CXK/AjA5rYYOQ/9zI08uRx/pp7BtWBY6Qmvbb8A6faiN5Xz ISiY+MfDB2xjWMmx/tuhh0bxEjmJiW/39c4yE1QxxNl1Gbwr0ORz3m23oYgqy2SakgFr eYffHyJDHz/acMg26WzN/6R6C3YLu57owpD5GCpAggTX5SW2JjpJFdZMbme4fZtWs7N9 hf0GcffDNTrLFzupNzBsH98REGJiMd+J/aj6X67g3TA1oYprUnzZPbdtPEY40dzqwpUv sK1RyvnqpXk2shCP/Hkzwx8s2fx7HnymFpBg4rI6KAm8g2UQOBQ+Uy/ey1Zeq1LBfyGe I+7A== 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=2DaQzy31sq8wf+8sLMVqT9YoyNRbiEg10ZdmOVmJXsE=; b=TUOiB0JzpCFjWtNgRn/k+hQeXvnhBzuHjZBxqvI+FETUasgw9HKxp3gcvpBBh+d1sP UflmP5jymL+XBXKdIVACJ1R1tdyxRRgoE69pesaZdEw1yrHt8HMAM0aqRaL7NKWjtX+u kdCf/KO2ZCeAtaNKXPFt4Tp6zyl+uDMP73vbQoKwJuwRB1OA/tR/R1Q1tmvztbe7A0FC J3OoeRp2DoZW73kN1mi+NE90RGQAlxCGbn1X/zBc6bjZZrcin9Gwsd7M6FKX9gnovIk5 UFRkfZfJPfOJEllhlkPNpXHySrxco6tak+WFNluSOZXK0bU7hl930x69grol66s2qwJD WzjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=be54DHcj; 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 pj13-20020a17090b4f4d00b0020d9f17b911si11250647pjb.99.2022.10.24.13.42.21; Mon, 24 Oct 2022 13:42:33 -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=be54DHcj; 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 S234957AbiJXUmD (ORCPT + 99 others); Mon, 24 Oct 2022 16:42:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234674AbiJXUlO (ORCPT ); Mon, 24 Oct 2022 16:41:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F83A9249; Mon, 24 Oct 2022 11:50:28 -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 6EF29B815CB; Mon, 24 Oct 2022 12:11:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C64ADC433C1; Mon, 24 Oct 2022 12:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613508; bh=HD77Wa609X+9+wDYum1pHdfln9/gmMB9kVg4mwj/yPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=be54DHcjfedM4OLVXPWHKC7p5c2tEF82W+KXZcLOsKE5B7jmpIYGQSSoRC7eFODOJ FpjuGlZIYEvDPrCJCRLZJEIfXrG3R6d1tw93h9tlUOeSWtL+M0ffdV85+t/sROHXpO 5x+XnR8ZdUqlpWZnuOg533X2ye/WPw4eyBFQW21s= 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.4 164/255] dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup() Date: Mon, 24 Oct 2022 13:31:14 +0200 Message-Id: <20221024113008.150196237@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747603060024948721?= X-GMAIL-MSGID: =?utf-8?q?1747603060024948721?= 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 8e2a4d1f0be5..997839c2130e 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -653,7 +653,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 */ @@ -679,7 +679,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); } } @@ -876,7 +876,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(struct timer_list *t)