From 19910d905d2ca06d9d38ec97fb85de327403a2c4 Mon Sep 17 00:00:00 2001 From: Prakruthi Deepak Heragu Date: Thu, 6 Feb 2020 15:24:52 -0800 Subject: [PATCH 1/3] drivers: llcc: edac: Add a config flag for non GKI variants Add defer work feature in edac driver for non GKI variants. Change-Id: Ie05ada1efe94f9ecb3bc5518790aeb5e741cf1e1 Signed-off-by: Prakruthi Deepak Heragu --- drivers/edac/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index a47e6082d66d..37fcddbfb9a3 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -23,6 +23,15 @@ menuconfig EDAC if EDAC +config EDAC_QGKI + bool "Enable QGKI features for EDAC" + depends on QGKI + help + When QGKI variants are selected, use special EDAC features like + creating and using deferred work. This feature adds + a deferrable timer if the error checking is not worth waking up + the cpu from idle. + config EDAC_LEGACY_SYSFS bool "EDAC legacy sysfs" default y From b6541efc03204913cc4a853167add5b30c13b33f Mon Sep 17 00:00:00 2001 From: Rohit Vaswani Date: Fri, 3 Oct 2014 13:13:15 -0700 Subject: [PATCH 2/3] edac: Allow the option of creating a deferrable work for polling EDAC provides a mechanism to poll for errors using a callback function and uses a delayed timer to schedule it. Provide an option to create a deferrable timer if the error checking is not worth waking up the cpu from idle. Change-Id: Ia25216323eabf7fa4b894897c950414006921f3f Signed-off-by: Rohit Vaswani Signed-off-by: Venkata Narendra Kumar Gutta --- drivers/edac/edac_device.c | 10 ++++++++-- drivers/edac/edac_device.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 3e344719baa7..4b12502ea801 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -388,9 +388,15 @@ static void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, */ edac_dev->poll_msec = msec; edac_dev->delay = msecs_to_jiffies(msec); - +#ifdef CONFIG_EDAC_QGKI + if (edac_dev->defer_work) + INIT_DEFERRABLE_WORK(&edac_dev->work, + edac_device_workq_function); + else + INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function); +#else INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function); - +#endif /* optimize here for the 1 second case, which will be normal value, to * fire ON the 1 second time event. This helps reduce all sorts of * timers firing on sub-second basis, while they are happy diff --git a/drivers/edac/edac_device.h b/drivers/edac/edac_device.h index 67e55feef107..27669f3cad39 100644 --- a/drivers/edac/edac_device.h +++ b/drivers/edac/edac_device.h @@ -165,6 +165,9 @@ struct edac_device_ctl_info { int panic_on_ue; /* boolean for panic'ing on an UE */ unsigned poll_msec; /* number of milliseconds to poll interval */ unsigned long delay; /* number of jiffies for poll_msec */ +#ifdef CONFIG_EDAC_QGKI + bool defer_work; /* Create a deferrable work for polling */ +#endif /* Additional top controller level attributes, but specified * by the low level driver. From 06c03f1e6885da892fae188c0343bec1bb9fecaf Mon Sep 17 00:00:00 2001 From: Prakruthi Deepak Heragu Date: Thu, 30 Jan 2020 12:03:20 -0800 Subject: [PATCH 3/3] drivers: edac: Defer work for the polling EDAC driver Use the defer work mechanism to poll for errors using a callback function. Change-Id: Id599a9159098a8b13df386290b3e46939831a4ff Signed-off-by: Prakruthi Deepak Heragu --- drivers/edac/qcom_edac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c index e214f3713225..7af6b4c362a8 100644 --- a/drivers/edac/qcom_edac.c +++ b/drivers/edac/qcom_edac.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. */ #include @@ -383,6 +383,9 @@ static int qcom_llcc_edac_probe(struct platform_device *pdev) dev_info(dev, "No ECC IRQ; defaulting to polling mode\n"); edev_ctl->poll_msec = poll_msec; edev_ctl->edac_check = qcom_llcc_poll_cache_errors; +#ifdef CONFIG_EDAC_QGKI + edev_ctl->defer_work = 1; +#endif } rc = edac_device_add_device(edev_ctl);