From patchwork Mon Jul 20 15:36:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 237414 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2107108ilg; Mon, 20 Jul 2020 09:01:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwzjRIA7+8/8yt1/kuc9sZemYDIlCCqP1G15blMjN59C8id9QvdGOzNk3bH0dPj6bsKas+ X-Received: by 2002:a50:ab5c:: with SMTP id t28mr22022982edc.209.1595260902256; Mon, 20 Jul 2020 09:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595260902; cv=none; d=google.com; s=arc-20160816; b=jast2R5mgRbyrQEQRIWIgI+ZCeh78bfGFx5rjushuQ1Riac8nEQmDQtd85WKODnfY4 DuldvLfYLHwyG1NCMdi/SAusZAyMynIHZGIWM0fQwzGow2vnLplYO8W3E1XGFmcGd7PW nuRZUKU1E6YFXcyWINtcGO7ubLUYmrndwtaQJ99wuGWyJnYdYhJgPmGpz9q4P7d75LLn tXWgB2jBL0wHJJUFxiCTNIgbpOSnflKib2RXfVnQySBlpKHQCs25zqdTk4ulQYxhtZLh +/K9v/TdS5K1CBa1DR8yZzq/0s9V2rS4zxHliyFV85a+ZODWzklal5vJx3EcHkSPev3L ap7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iaWi5sR2G1WhlUTAECIPelg/poxP8qZrAMD5SmbPKEQ=; b=ptMSl1iH2AxJ4blt+4I1zozZNvoZ3isBA7B+ofce+89ru4MnQRSyIELw49toIWEVWg bbPrr6MQ4rUvdyQHkmcnmyTysaPQtF/1KO3uPLSjKha2XhAgJnkXV3rGn67/njQ9UEMG Aqqp7DAyvFj1Cung9SzWtncvxVvaMVtKQw/kNYPXGwkvfHbbqTjMqPNSUIZSKmNCl1W6 VtyDm0+gn+5YDzd318BcDtKibdMsEFvijbm84uLgNJJN8PZHLCD7/iJDGuk6Ufpmu6R6 Q99rvKJkMyYxutFjdCB9Izw3jTNvfzZnw0XiiOr7yiPjJ4dPFmw4XxhQpvDJeP0AgeaL 7+jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uYbE5UeF; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si10703062ejw.386.2020.07.20.09.01.42; Mon, 20 Jul 2020 09:01:42 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uYbE5UeF; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732548AbgGTQBk (ORCPT + 15 others); Mon, 20 Jul 2020 12:01:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:35122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732023AbgGTQBh (ORCPT ); Mon, 20 Jul 2020 12:01:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F79320672; Mon, 20 Jul 2020 16:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595260897; bh=yOzak47EJ9Fo5F4o+e8MA+hzD4MsUtU/5HybLtvGEXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uYbE5UeFM9cJwD9kOFSqkV9ITDdOYhiEpsdPpyoMw7P6ZLLKB2Q+EFS/a6h0d+uBz AeZkGoTBCD+zg5hsISTO742qrznckt6oI78BUjs6462BXN3S9HRD2bMr10Ms2WmKdu l4QSeXCTkJPIogCWm/xPSgzukH3UThiV6JecVspY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grygorii Strashko , Peter Ujfalusi , Vinod Koul , Sasha Levin Subject: [PATCH 5.4 104/215] dmaengine: dmatest: stop completed threads when running without set channel Date: Mon, 20 Jul 2020 17:36:26 +0200 Message-Id: <20200720152825.156428904@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200720152820.122442056@linuxfoundation.org> References: <20200720152820.122442056@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Peter Ujfalusi [ Upstream commit fd17d1abce426b4224a916a242b57be94272771b ] The completed threads were not cleared and consequent run would result threads accumulating: echo 800000 > /sys/module/dmatest/parameters/test_buf_size echo 2000 > /sys/module/dmatest/parameters/timeout echo 50 > /sys/module/dmatest/parameters/iterations echo 1 > /sys/module/dmatest/parameters/max_channels echo "" > /sys/module/dmatest/parameters/channel [ 237.507265] dmatest: Added 1 threads using dma1chan2 echo 1 > /sys/module/dmatest/parameters/run [ 244.713360] dmatest: Started 1 threads using dma1chan2 [ 246.117680] dmatest: dma1chan2-copy0: summary 50 tests, 0 failures 2437.47 iops 977623 KB/s (0) echo 1 > /sys/module/dmatest/parameters/run [ 292.381471] dmatest: No channels configured, continue with any [ 292.389307] dmatest: Added 1 threads using dma1chan3 [ 292.394302] dmatest: Started 1 threads using dma1chan2 [ 292.399454] dmatest: Started 1 threads using dma1chan3 [ 293.800835] dmatest: dma1chan3-copy0: summary 50 tests, 0 failures 2624.53 iops 975014 KB/s (0) echo 1 > /sys/module/dmatest/parameters/run [ 307.301429] dmatest: No channels configured, continue with any [ 307.309212] dmatest: Added 1 threads using dma1chan4 [ 307.314197] dmatest: Started 1 threads using dma1chan2 [ 307.319343] dmatest: Started 1 threads using dma1chan3 [ 307.324492] dmatest: Started 1 threads using dma1chan4 [ 308.730773] dmatest: dma1chan4-copy0: summary 50 tests, 0 failures 2390.28 iops 965436 KB/s (0) Fixes: 6b41030fdc79 ("dmaengine: dmatest: Restore default for channel") Reported-by: Grygorii Strashko Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20200701101225.8607-1-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/dmatest.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 0425984db118a..62d9825a49e9d 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -1168,6 +1168,8 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp) } else if (dmatest_run) { if (!is_threaded_test_pending(info)) { pr_info("No channels configured, continue with any\n"); + if (!is_threaded_test_run(info)) + stop_threaded_test(info); add_threaded_test(info); } start_threaded_tests(info);