linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Vladimir Murzin <vladimir.murzin@arm.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Vinod Koul <vkoul@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.8 58/85] dmaengine: dmatest: Prevent to run on misconfigured channel
Date: Mon,  5 Oct 2020 17:26:54 +0200	[thread overview]
Message-ID: <20201005142117.514377567@linuxfoundation.org> (raw)
In-Reply-To: <20201005142114.732094228@linuxfoundation.org>

From: Vladimir Murzin <vladimir.murzin@arm.com>

[ Upstream commit ce65d55f92a67e247f4d799e581cf9fed677871c ]

Andy reported that commit 6b41030fdc79 ("dmaengine: dmatest:
Restore default for channel") broke his scripts for the case
where "busy" channel is used for configuration with expectation
that run command would do nothing. Instead, behavior was
(unintentionally) changed to treat such case as under-configuration
and progress with defaults, i.e. run command would start a test
with default setting for channel (which would use all channels).

Restore original behavior with tracking status of channel setter
so we can distinguish between misconfigured and under-configured
cases in run command and act accordingly.

Fixes: 6b41030fdc79 ("dmaengine: dmatest: Restore default for channel")
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200922115847.30100-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/dma/dmatest.c | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 604f803579312..323822372b4ce 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -129,6 +129,7 @@ struct dmatest_params {
  * @nr_channels:	number of channels under test
  * @lock:		access protection to the fields of this structure
  * @did_init:		module has been initialized completely
+ * @last_error:		test has faced configuration issues
  */
 static struct dmatest_info {
 	/* Test parameters */
@@ -137,6 +138,7 @@ static struct dmatest_info {
 	/* Internal state */
 	struct list_head	channels;
 	unsigned int		nr_channels;
+	int			last_error;
 	struct mutex		lock;
 	bool			did_init;
 } test_info = {
@@ -1175,10 +1177,22 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp)
 		return ret;
 	} 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);
+			/*
+			 * We have nothing to run. This can be due to:
+			 */
+			ret = info->last_error;
+			if (ret) {
+				/* 1) Misconfiguration */
+				pr_err("Channel misconfigured, can't continue\n");
+				mutex_unlock(&info->lock);
+				return ret;
+			} else {
+				/* 2) We rely on defaults */
+				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);
 	} else {
@@ -1195,7 +1209,7 @@ static int dmatest_chan_set(const char *val, const struct kernel_param *kp)
 	struct dmatest_info *info = &test_info;
 	struct dmatest_chan *dtc;
 	char chan_reset_val[20];
-	int ret = 0;
+	int ret;
 
 	mutex_lock(&info->lock);
 	ret = param_set_copystring(val, kp);
@@ -1250,12 +1264,14 @@ static int dmatest_chan_set(const char *val, const struct kernel_param *kp)
 		goto add_chan_err;
 	}
 
+	info->last_error = ret;
 	mutex_unlock(&info->lock);
 
 	return ret;
 
 add_chan_err:
 	param_set_copystring(chan_reset_val, kp);
+	info->last_error = ret;
 	mutex_unlock(&info->lock);
 
 	return ret;
-- 
2.25.1




  parent reply	other threads:[~2020-10-05 15:33 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 15:25 [PATCH 5.8 00/85] 5.8.14-rc1 review Greg Kroah-Hartman
2020-10-05 15:25 ` [PATCH 5.8 01/85] io_uring: always delete double poll wait entry on match Greg Kroah-Hartman
2020-10-05 15:25 ` [PATCH 5.8 02/85] btrfs: fix filesystem corruption after a device replace Greg Kroah-Hartman
2020-10-05 15:25 ` [PATCH 5.8 03/85] mmc: sdhci: Workaround broken command queuing on Intel GLK based IRBIS models Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 04/85] USB: gadget: f_ncm: Fix NDP16 datagram validation Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 05/85] Revert "usbip: Implement a match function to fix usbip" Greg Kroah-Hartman
2020-10-06 13:26   ` M. Vefa Bicakci
2020-10-07  9:13     ` Greg Kroah-Hartman
2020-10-08  8:56       ` M. Vefa Bicakci
2020-10-08  9:25         ` Greg Kroah-Hartman
2020-10-08  9:37           ` M. Vefa Bicakci
2020-10-05 15:26 ` [PATCH 5.8 06/85] usbcore/driver: Fix specific driver selection Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 07/85] usbcore/driver: Fix incorrect downcast Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 08/85] usbcore/driver: Accommodate usbip Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 09/85] gpio: siox: explicitly support only threaded irqs Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 10/85] gpio: mockup: fix resource leak in error path Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 11/85] gpio: tc35894: fix up tc35894 interrupt configuration Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 12/85] gpio: amd-fch: correct logic of GPIO_LINE_DIRECTION Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 13/85] clk: samsung: Keep top BPLL mux on Exynos542x enabled Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 14/85] clk: socfpga: stratix10: fix the divider for the emac_ptp_free_clk Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 15/85] scsi: iscsi: iscsi_tcp: Avoid holding spinlock while calling getpeername() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 16/85] i2c: i801: Exclude device from suspend direct complete optimization Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 17/85] Input: i8042 - add nopnp quirk for Acer Aspire 5 A515 Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 18/85] iio: adc: qcom-spmi-adc5: fix driver name Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 19/85] ftrace: Move RCU is watching check after recursion check Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 20/85] tracing: Fix trace_find_next_entry() accounting of temp buffer size Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 21/85] memstick: Skip allocating card when removing host Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 22/85] drm/amdgpu: restore proper ref count in amdgpu_display_crtc_set_config Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 23/85] xen/events: dont use chip_data for legacy IRQs Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 24/85] clocksource/drivers/timer-gx6605s: Fixup counter reload Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 25/85] vboxsf: Fix the check for the old binary mount-arguments struct Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 26/85] mt76: mt7915: use ieee80211_free_txskb to free tx skbs Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 27/85] libbpf: Remove arch-specific include path in Makefile Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 28/85] drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 29/85] Revert "wlcore: Adding suppoprt for IGTK key in wlcore driver" Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 30/85] drm/sun4i: mixer: Extend regmap max_register Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 31/85] hv_netvsc: Cache the current data path to avoid duplicate call and message Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 32/85] net: dec: de2104x: Increase receive ring size for Tulip Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 33/85] rndis_host: increase sleep time in the query-response loop Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 34/85] nvme-pci: disable the write zeros command for Intel 600P/P3100 Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 35/85] nvme-core: get/put ctrl and transport module in nvme_dev_open/release() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 36/85] fuse: fix the ->direct_IO() treatment of iov_iter Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 37/85] drivers/net/wan/lapbether: Make skb->protocol consistent with the header Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 38/85] drivers/net/wan/hdlc: Set skb->protocol before transmitting Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 39/85] mac80211: Fix radiotap header channel flag for 6GHz band Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 40/85] mac80211: do not allow bigger VHT MPDUs than the hardware supports Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 41/85] tracing: Make the space reserved for the pid wider Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 42/85] tools/io_uring: fix compile breakage Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 43/85] io_uring: mark statx/files_update/epoll_ctl as non-SQPOLL Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 44/85] cpuidle: psci: Fix suspicious RCU usage Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 45/85] spi: fsl-espi: Only process interrupts for expected events Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 46/85] net: dsa: felix: fix some key offsets for IP4_TCP_UDP VCAP IS2 entries Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 47/85] nvme-pci: fix NULL req in completion handler Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 48/85] nvme-fc: fail new connections to a deleted host or remote port Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 49/85] scripts/kallsyms: skip ppc compiler stub *.long_branch.* / *.plt_branch.* Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 50/85] gpio: sprd: Clear interrupt when setting the type as edge Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 51/85] phy: ti: am654: Fix a leak in serdes_am654_probe() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 52/85] pinctrl: mvebu: Fix i2c sda definition for 98DX3236 Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 53/85] nfs: Fix security label length not being reset Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 54/85] NFSv4.2: fix clients attribute cache management for copy_file_range Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 55/85] pNFS/flexfiles: Ensure we initialise the mirror bsizes correctly on read Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 56/85] clk: tegra: Always program PLL_E when enabled Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 57/85] clk: tegra: Fix missing prototype for tegra210_clk_register_emc() Greg Kroah-Hartman
2020-10-05 15:26 ` Greg Kroah-Hartman [this message]
2020-10-05 15:26 ` [PATCH 5.8 59/85] clk: samsung: exynos4: mark chipid clock as CLK_IGNORE_UNUSED Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 60/85] scsi: target: Fix lun lookup for TARGET_SCF_LOOKUP_LUN_FROM_TAG case Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 61/85] iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate() Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 62/85] gpio: pca953x: Fix uninitialized pending variable Greg Kroah-Hartman
2020-10-05 15:26 ` [PATCH 5.8 63/85] gpio/aspeed-sgpio: enable access to all 80 input & output sgpios Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 64/85] gpio/aspeed-sgpio: dont enable all interrupts by default Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 65/85] gpio: aspeed: fix ast2600 bank properties Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 66/85] i2c: cpm: Fix i2c_ram structure Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 67/85] i2c: npcm7xx: Clear LAST bit after a failed transaction Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 68/85] Input: trackpoint - enable Synaptics trackpoints Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 69/85] blk-mq: call commit_rqs while list empty but error happen Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 70/85] scripts/dtc: only append to HOST_EXTRACFLAGS instead of overwriting Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 71/85] autofs: use __kernel_write() for the autofs pipe writing Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 72/85] pinctrl: qcom: sm8250: correct sdc2_clk Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 73/85] pinctrl: mediatek: check mtk_is_virt_gpio input parameter Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 74/85] gpio: pca953x: Correctly initialize registers 6 and 7 for PCA957x Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 75/85] iommu/amd: Fix the overwritten field in IVMD header Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 76/85] pipe: remove pipe_wait() and fix wakeup race with splice Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 77/85] random32: Restore __latent_entropy attribute on net_rand_state Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 78/85] gpiolib: Fix line event handling in syscall compatible mode Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 79/85] drm/i915/gvt: Fix port number for BDW on EDID region setup Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 80/85] scsi: sd: sd_zbc: Fix handling of host-aware ZBC disks Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 81/85] scsi: sd: sd_zbc: Fix ZBC disk initialization Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 82/85] epoll: do not insert into poll queues until all sanity checks are done Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 83/85] epoll: replace ->visited/visited_list with generation count Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 84/85] epoll: EPOLL_CTL_ADD: close the race in decision to take fast path Greg Kroah-Hartman
2020-10-05 15:27 ` [PATCH 5.8 85/85] ep_create_wakeup_source(): dentry name can change under you Greg Kroah-Hartman
2020-10-06  0:18 ` [PATCH 5.8 00/85] 5.8.14-rc1 review Shuah Khan
2020-10-07  9:12   ` Greg Kroah-Hartman
2020-10-06  5:27 ` Naresh Kamboju
2020-10-07  9:12   ` Greg Kroah-Hartman
2020-10-06  8:58 ` Jeffrin Jose T
2020-10-06  9:12 ` Jeffrin Jose T
2020-10-06 18:18 ` Guenter Roeck
2020-10-07  9:11   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201005142117.514377567@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vkoul@kernel.org \
    --cc=vladimir.murzin@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).