Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1082701lqd; Thu, 25 Apr 2024 05:46:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsLxyWr0WNknHDMeCSfWogoWk0JeADyID6yHmjJ8efJBPVSd/G6HgiLiiLZm534VimidJja8RRbpErT0O/6Cu6hoITWsZVhePKtEeHiw== X-Google-Smtp-Source: AGHT+IEEYWJHYym2Wcnp9Cu3u9zIfWsFtZoKhNWi6B55G4QlyH/R/xaIZg2SKNskffB1pGUlq0IV X-Received: by 2002:a05:6402:3594:b0:572:2fef:819e with SMTP id y20-20020a056402359400b005722fef819emr3999673edc.5.1714049195526; Thu, 25 Apr 2024 05:46:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714049195; cv=pass; d=google.com; s=arc-20160816; b=cnVMwTCYh/Ng4OXc5fDp8RYdYJQSi45cZURlUNUVem9H6LG9lHrT8OVUdjMlxcLJSL L0vKIAALQiFyLvUY8G77N5ogS12xFB2pcMVACfZ3oKfhWSDrtT+dZp6OErwZ5K8mBjRL byepIhkZqrzwFMWFg27iyLSwq/3bZdvBLCpOH7xaWYhSBdLf82QJBGLACrkYrTeTBN7b 15KWE7UKoH8x5Orgk8V/9q6Q6cVCDcJoL5SQsHRDIBMw0e/hFG1yV8bIxaDrT3TZm7nH rFHFYAgXWHXvBXdO/KjxPa0cvIHIlCbCpKQWlxtck2f53Ccu7Ce9yc3+8PnoVFOVcmFy QMsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=J/WPwC9cbZR2bQeNXkn2bjGbmbN/vqzDq+yXejklW5w=; fh=HeQNZ0zmF0wJ7TyVi1kSEPOH/yrdxwe8TYQbFJ+TaFk=; b=y3T6hcypujelBjff2u6MqpXmUwE9K4IDBO+AV0RWw3d0neRDJxhz2jS/5cIMEfbq1I RxGa3pPtO4wGgVU94KIJx7LKZjeF2M7fWbmh1rrBY5yv1GlF4lsPbZfS5U1nw9OAcJ+3 /ktKjuT6ye2hoE7yHaNYEJ21u5Ek0qdPMyieSjLK6BKYynjVcMgPAY+kks6+CTcpskJL 1AXOaeZGi2EMVUXHyaKApJj9svn+jC65EecvVy22nRVOPyl2A0J7LBpjuMQ9NwQ9Y6eX OkgNeLWhbGIuE7NjbBgZqL0MFmssFt2T+RqFo2GjW3N0ZdNNFAwwbeYjZfNow60Oobd0 ZHAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-158539-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f15-20020a056402354f00b005723f4543a2si992551edd.517.2024.04.25.05.46.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 05:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158539-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-158539-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 15B311F23F8F for ; Thu, 25 Apr 2024 12:46:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 765601494C7; Thu, 25 Apr 2024 12:46:28 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4363215AF6; Thu, 25 Apr 2024 12:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714049188; cv=none; b=VMzLbKPdg9Kxaxh0ecnvIUtjiRxTTgbv7MobT+EU6v89G9YbkpU+xk/HyXchT71Jb+S7ELWplq1cb6ciuoF6TpM34/qR9AuDOMIYv2MUf8VILyQ/ffmIX0HaJRX85Pta9fi+i7oKTin4zfd7D1p9VguXNwIp5CGaQfSpAGSg2XM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714049188; c=relaxed/simple; bh=r+Z9koNtsDY67WD++3sL7yViEG6jpEca9X4OmjWZ+u8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s7g3IkkFg5NMUaig9tJL6zey6M7JCgnqRUGEIHjnuU3HK1vgOi1S345hCEcIs7DCBoNbmC5AHs+I+Ya4Amve5ToLyzzE3q1+e6ggosPhOZfP2u4Si4QIEviSk2DhKiHRt34+elcfUvDIySRweusXL0jW7rfEMRoTgbFQvbu0ZhY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VQFrX2X7HzwRtQ; Thu, 25 Apr 2024 20:43:08 +0800 (CST) Received: from kwepemf500004.china.huawei.com (unknown [7.202.181.242]) by mail.maildlp.com (Postfix) with ESMTPS id 4B8DC18007F; Thu, 25 Apr 2024 20:46:20 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemf500004.china.huawei.com (7.202.181.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 25 Apr 2024 20:46:19 +0800 From: Jie Hai To: , "open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM" , open list CC: , Subject: [PATCH v2] dmaengine: dmatest: fix timeout caused by kthread_stop Date: Thu, 25 Apr 2024 20:40:38 +0800 Message-ID: <20240425124038.3096368-1-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230720114102.51053-1-haijie1@huawei.com> References: <20230720114102.51053-1-haijie1@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemf500004.china.huawei.com (7.202.181.242) The change introduced by commit a7c01fa93aeb ("signal: break out of wait loops on kthread_stop()") may cause dmatest aborts any ongoing tests and possible failure on the tests. The operations are as follows: modprobe hisi_dma modprobe dmatest echo 0 > /sys/module/dmatest/parameters/iterations echo "dma0chan0" > /sys/module/dmatest/parameters/channel echo "dma0chan1" > /sys/module/dmatest/parameters/channel echo "dma0chan2" > /sys/module/dmatest/parameters/channel echo 1 > /sys/module/dmatest/parameters/run echo 0 > /sys/module/dmatest/parameters/run And the failed dmesg logs are: [52575.636992] dmatest: Added 1 threads using dma0chan0 [52575.637555] dmatest: Added 1 threads using dma0chan1 [52575.638044] dmatest: Added 1 threads using dma0chan2 [52581.020355] dmatest: Started 1 threads using dma0chan0 [52581.020585] dmatest: Started 1 threads using dma0chan1 [52581.020814] dmatest: Started 1 threads using dma0chan2 [52587.705782] dmatest: dma0chan0-copy0: result #57691: 'test \ timed out' with src_off=0xfe6 dst_off=0x89 len=0x1d9a (0) [52587.706527] dmatest: dma0chan0-copy0: summary 57691 tests, \ 1 failures 51179.98 iops 411323 KB/s (0) [52587.707028] dmatest: dma0chan1-copy0: result #63178: 'test \ timed out' with src_off=0xdf dst_off=0x6ab len=0x389e (0) [52587.707767] dmatest: dma0chan1-copy0: summary 63178 tests, \ 1 failures 62851.60 iops 503835 KB/s (0) [52587.708376] dmatest: dma0chan2-copy0: result #60527: 'test \ timed out' with src_off=0x10e dst_off=0x58 len=0x3ea4 (0) [52587.708951] dmatest: dma0chan2-copy0: summary 60527 tests, \ 1 failures 52403.78 iops 420014 KB/s (0) The test 57691 of dma0chan0-copy0 does not time out, it is the signal brought by kthread_stop() interrupted the function wait_event_freezable_timeout() waiting for test completing. The timeout log is misleading and the ongoing test can be completed if wait_event_freezable_timeout() is replaced by wait_event_timeout(). Signed-off-by: Jie Hai --- v2: 1. Add more details in commit log. --- drivers/dma/dmatest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index a4f608837849..854165f55e7b 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -841,7 +841,7 @@ static int dmatest_func(void *data) } else { dma_async_issue_pending(chan); - wait_event_freezable_timeout(thread->done_wait, + ret = wait_event_timeout(thread->done_wait, done->done, msecs_to_jiffies(params->timeout)); -- 2.30.0