Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp212348ybh; Mon, 20 Jul 2020 14:44:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2y9GAcy5nm+PQNTGmnNGtO1Te2KuvWuBMrO9g+3cnLU6XEaPxy21eP6T+pbPhg4ag8XK7 X-Received: by 2002:a17:906:648f:: with SMTP id e15mr21407023ejm.99.1595281447059; Mon, 20 Jul 2020 14:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595281447; cv=none; d=google.com; s=arc-20160816; b=hMUTUFSBK4AlOnMtDS1/HmDeHUKGWTavsaqMgdQh3ki2e/7zJq/b4MLLQMue+W5z5h q94cdsZPFYUq1JyuHNTX6WPm4MXy7Jf1n0+Nsr0ium5TFf6TCS7pYZ4KOSPVXAkN/5h+ i/RAuH6nTqnmcrP0+EH1n8Xi13pTs86PNUoxkSi8LG9V5KN5IaIl3/wVBHXuw1Uf1Sbc ECNJnenUfJIvh3MAo9CDjl1M2x9Rzi34RSZyGcE89iIZeOAPPgqHWhmUnfLbUygTEkEE 1F73uU3fagnz/lv9tMZ/aPpddq3P/3/F+8O6kv5BHBVj7nlCc6Arv0WbJihP60XZta/+ RNpg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2AY3pvbIZ2bytV8Lnq9FmBAKsGbHiToAp1UWSF81R8g=; b=AjtemCE6LW6BopOtlZ0Iw5/Vhz5uy6DDXR4BA7zXo6gxBe3NqSOPf3RSqewXlrzHPV agTFfFrCOcQW24dqv4VMzeqO8xXazPWyg/i2nGfcbjCQWmS+42BbRGp7usfCTzL4+9Ta clBvMZaufpcnwuM6kcDZm69kNBBgs/W0xwWGduKqknPOrGVmc2e7+u2aoK1DqmCgUHGy htTomU6lPZrnUL7sbrQRASo5ByrkvOTusciVEj5xnNLDy0O/A66J0zhDlNuCiO89XCU6 OrujLR2llXZgnKdO7O/CTRvKvZz/dDWnyY//47sfQQ2DrZ25aBrhZrNWduRFAbsJInty q2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U1R7nSIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c27si12126739edj.262.2020.07.20.14.43.43; Mon, 20 Jul 2020 14:44:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=U1R7nSIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728824AbgGTVmQ (ORCPT + 99 others); Mon, 20 Jul 2020 17:42:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:58162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728333AbgGTVjE (ORCPT ); Mon, 20 Jul 2020 17:39:04 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 281A5207FC; Mon, 20 Jul 2020 21:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595281143; bh=LBn9Xwobhg/JDOcAvZgo6y0lgAMYmGyI+0wKy31ZQCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U1R7nSIlwr8tmLR+NRHQFAqygZPMFRR28AiIBUyLNVOqyTBqP6cbpIsUeMAoeLPdP Z+0jakSruLq2SI/bxwLQadr39WKQ0VKDfTYKiwrNV+GP5kxfvPVsS0TKiASlPb7DMX 3hbTIkPks6LYzmVk14Vh1+VxtIxDGvzCntUuv2pY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Leonid Ravich , Dave Jiang , Vinod Koul , Sasha Levin , dmaengine@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 10/19] dmaengine: ioat setting ioat timeout as module parameter Date: Mon, 20 Jul 2020 17:38:41 -0400 Message-Id: <20200720213851.407715-10-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200720213851.407715-1-sashal@kernel.org> References: <20200720213851.407715-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leonid Ravich [ Upstream commit 87730ccbddcb48478b1b88e88b14e73424130764 ] DMA transaction time to completion is a function of PCI bandwidth, transaction size and a queue depth. So hard coded value for timeouts might be wrong for some scenarios. Signed-off-by: Leonid Ravich Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20200701184816.29138-1-leonid.ravich@dell.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/ioat/dma.c | 12 ++++++++++++ drivers/dma/ioat/dma.h | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index b94cece58b984..890cadf3ec5d8 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -38,6 +38,18 @@ #include "../dmaengine.h" +int completion_timeout = 200; +module_param(completion_timeout, int, 0644); +MODULE_PARM_DESC(completion_timeout, + "set ioat completion timeout [msec] (default 200 [msec])"); +int idle_timeout = 2000; +module_param(idle_timeout, int, 0644); +MODULE_PARM_DESC(idle_timeout, + "set ioat idel timeout [msec] (default 2000 [msec])"); + +#define IDLE_TIMEOUT msecs_to_jiffies(idle_timeout) +#define COMPLETION_TIMEOUT msecs_to_jiffies(completion_timeout) + static char *chanerr_str[] = { "DMA Transfer Source Address Error", "DMA Transfer Destination Address Error", diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h index 1ab42ec2b7ff1..b061db2013324 100644 --- a/drivers/dma/ioat/dma.h +++ b/drivers/dma/ioat/dma.h @@ -111,8 +111,6 @@ struct ioatdma_chan { #define IOAT_RUN 5 #define IOAT_CHAN_ACTIVE 6 struct timer_list timer; - #define COMPLETION_TIMEOUT msecs_to_jiffies(100) - #define IDLE_TIMEOUT msecs_to_jiffies(2000) #define RESET_DELAY msecs_to_jiffies(100) struct ioatdma_device *ioat_dma; dma_addr_t completion_dma; -- 2.25.1