From patchwork Mon Oct 24 11:31:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9839 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp556257wru; Mon, 24 Oct 2022 10:01:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4kXF7je2IQBmfkpmuqhPrJWDGgDTY7J6y4qDWAFl+iXeFPuiXil9y2qeanvaxhbjKFEUXb X-Received: by 2002:a17:902:e88b:b0:17f:93a4:e31b with SMTP id w11-20020a170902e88b00b0017f93a4e31bmr34856136plg.51.1666630882790; Mon, 24 Oct 2022 10:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666630882; cv=none; d=google.com; s=arc-20160816; b=T4jcIKb44+TEPpFgYMCXRH7T4BixqkMA9bj0W19afF3vV/IVDQL9XDDO6VvgSgrUAv XfYIHNJMQnbPye8/l+P7zckjvWEPnfgm57N9s63QJ9pEeFWtczksTPFqLcT2W5Mg7Z0V Ea3bbW3W6BI6j0dpiGCI61UyqPkoP16M3fCXDYkK/ia+zKz/QYByekZuPHl72KkiykC5 Jg9Cz6rLiEfKXRuyxO8acKt7eMP8UUHTe0LHu+rkcoYDqmTFCGqZKXskA/jN2lkdP6cR ft5Ac3KsWZaFD5D2c/P4BOaKz93rRu28e9Ur6T5vAigVZlYCwggHwUUv7WOFAxwO7jCz jKZQ== 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=UBb4QOyFAACNQoGPIirOgnL0m6BWFPRAXoQ+ahaPbuU=; b=08xunSN0IAeO5w7XMCeex/CewZmlCgD5jXI1b5Tj6K90wWruopPNRQS1KBSeUrURaD IRDZExeqIoiHYUakxsbNut9Xpz24pNP4ZtmdovQykj/EWBaDm6H8F9dTzUJLaCsu4iy9 q3CXvkcVgJIe2Q/9RgAIBnR0enQaLgmWqEJjp9VOKEbOihmZT3Dnu7Tr49hir+uXM+W9 qObZXY4qXaclR/oRlGyBHbr3YnryewlQo+NHZx3/IwddJzxP6D3rVaCC4gG/9lghVeQK vGu5MM4SHSrRHxRZFpSn1raEvVgwyjbh7HEPRsXw1C8iRwEINey9/VXpwE4eGPHtgjxo 9Nmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ChFSYWVF; 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 f36-20020a631f24000000b004644f068aafsi26654pgf.137.2022.10.24.10.01.03; Mon, 24 Oct 2022 10:01:22 -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=ChFSYWVF; 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 S235464AbiJXQyi (ORCPT + 99 others); Mon, 24 Oct 2022 12:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235493AbiJXQtq (ORCPT ); Mon, 24 Oct 2022 12:49:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CEE220359; Mon, 24 Oct 2022 08:33:09 -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 2ABCCB8115E; Mon, 24 Oct 2022 12:02:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DC4BC433C1; Mon, 24 Oct 2022 12:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612961; bh=Hl/cRYdYrCrKZdRnMFgBD3L9OYERVtzqcMFsuTkARQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ChFSYWVFen7ezBV21imbM1sKMUV2Kb0zVjMxRwXFAPbXr9dDafla8ff/C5+/ug7dH TOdK5rqVx6o8uhK/T/QzKX2WyQ+xR5FH47z8rAWu/byV8yL7Md5fRpA/7HItdYUcr8 u914KhtOsTPFMUuBYqzBuf8MpKd19QYVt9SsIED4= 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.19 154/229] dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup() Date: Mon, 24 Oct 2022 13:31:13 +0200 Message-Id: <20221024113003.995921970@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747589144511512807?= X-GMAIL-MSGID: =?utf-8?q?1747589144511512807?= 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 890cadf3ec5d..e86a3d19b718 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)