linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume
@ 2023-06-01 23:29 Mario Limonciello
  2023-06-01 23:29 ` [PATCH v3 2/4] ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking Mario Limonciello
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Mario Limonciello @ 2023-06-01 23:29 UTC (permalink / raw)
  To: Rafael Wysocki, hdegoede, linus.walleij
  Cc: linux-acpi, linux-kernel, linux-gpio, platform-driver-x86,
	linux-pm, S-k Shyam-sundar, Natikar Basavaraj, Mario Limonciello

All uses in the kernel are currently already oriented around
suspend/resume. As some other parts of the kernel may also use these
messages in functions that could also be used outside of
suspend/resume, only enable in suspend/resume path.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v1->v2:
 * Remove pointless do/while
 * Add a function pm_debug_messages_should_print
 * Export pm_debug_messages_should_print so modules can use it too.
---
 include/linux/suspend.h | 20 +++++++++-----------
 kernel/power/main.c     |  6 ++++++
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 1a0426e6761c..9a3cc0b89208 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -555,6 +555,7 @@ static inline void unlock_system_sleep(unsigned int flags) {}
 #ifdef CONFIG_PM_SLEEP_DEBUG
 extern bool pm_print_times_enabled;
 extern bool pm_debug_messages_on;
+extern bool pm_debug_messages_should_print(void);
 static inline int pm_dyn_debug_messages_on(void)
 {
 #ifdef CONFIG_DYNAMIC_DEBUG
@@ -567,17 +568,13 @@ static inline int pm_dyn_debug_messages_on(void)
 #define pr_fmt(fmt) "PM: " fmt
 #endif
 #define __pm_pr_dbg(fmt, ...)					\
-	do {							\
-		if (pm_debug_messages_on)			\
-			printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__);	\
-		else if (pm_dyn_debug_messages_on())		\
-			pr_debug(fmt, ##__VA_ARGS__);	\
-	} while (0)
+	if (pm_debug_messages_should_print())			\
+		printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__);	\
+	else if (pm_dyn_debug_messages_on())			\
+		pr_debug(fmt, ##__VA_ARGS__);
 #define __pm_deferred_pr_dbg(fmt, ...)				\
-	do {							\
-		if (pm_debug_messages_on)			\
-			printk_deferred(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__);	\
-	} while (0)
+	if (pm_debug_messages_should_print())			\
+		printk_deferred(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__);
 #else
 #define pm_print_times_enabled	(false)
 #define pm_debug_messages_on	(false)
@@ -593,7 +590,8 @@ static inline int pm_dyn_debug_messages_on(void)
 /**
  * pm_pr_dbg - print pm sleep debug messages
  *
- * If pm_debug_messages_on is enabled, print message.
+ * If pm_debug_messages_on is enabled and the system is entering/leaving
+ *      suspend, print message.
  * If pm_debug_messages_on is disabled and CONFIG_DYNAMIC_DEBUG is enabled,
  *	print message only from instances explicitly enabled on dynamic debug's
  *	control.
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 3113ec2f1db4..daa535012e51 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -556,6 +556,12 @@ power_attr_ro(pm_wakeup_irq);
 
 bool pm_debug_messages_on __read_mostly;
 
+bool pm_debug_messages_should_print(void)
+{
+	return pm_debug_messages_on && pm_suspend_target_state != PM_SUSPEND_ON;
+}
+EXPORT_SYMBOL_GPL(pm_debug_messages_should_print);
+
 static ssize_t pm_debug_messages_show(struct kobject *kobj,
 				      struct kobj_attribute *attr, char *buf)
 {

base-commit: 7736c431466abb54a2679dc257f739fddfa84295
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 2/4] ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking
  2023-06-01 23:29 [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume Mario Limonciello
@ 2023-06-01 23:29 ` Mario Limonciello
  2023-06-01 23:29 ` [PATCH v3 3/4] pinctrl: amd: Use pm_pr_dbg to show debugging messages Mario Limonciello
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Mario Limonciello @ 2023-06-01 23:29 UTC (permalink / raw)
  To: Rafael Wysocki, hdegoede, linus.walleij
  Cc: linux-acpi, linux-kernel, linux-gpio, platform-driver-x86,
	linux-pm, S-k Shyam-sundar, Natikar Basavaraj, Mario Limonciello

Enabling debugging messages for the state requires turning on dynamic
debugging for the file. To make it more accessible, use
`pm_debug_messages` and clearer strings for what is happening.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/acpi/x86/s2idle.c | 52 ++++++++++++++++++++++++++++++++++-----
 1 file changed, 46 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index e499c60c4579..7681f6ecab67 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -59,6 +59,7 @@ static int lps0_dsm_func_mask;
 
 static guid_t lps0_dsm_guid_microsoft;
 static int lps0_dsm_func_mask_microsoft;
+static int lps0_dsm_state;
 
 /* Device constraint entry structure */
 struct lpi_device_info {
@@ -320,6 +321,44 @@ static void lpi_check_constraints(void)
 	}
 }
 
+static bool acpi_s2idle_vendor_amd(void)
+{
+	return boot_cpu_data.x86_vendor == X86_VENDOR_AMD;
+}
+
+static const char *acpi_sleep_dsm_state_to_str(unsigned int state)
+{
+	if (lps0_dsm_func_mask_microsoft || !acpi_s2idle_vendor_amd()) {
+		switch (state) {
+		case ACPI_LPS0_SCREEN_OFF:
+			return "screen off";
+		case ACPI_LPS0_SCREEN_ON:
+			return "screen on";
+		case ACPI_LPS0_ENTRY:
+			return "lps0 entry";
+		case ACPI_LPS0_EXIT:
+			return "lps0 exit";
+		case ACPI_LPS0_MS_ENTRY:
+			return "lps0 ms entry";
+		case ACPI_LPS0_MS_EXIT:
+			return "lps0 ms exit";
+		}
+	} else {
+		switch (state) {
+		case ACPI_LPS0_SCREEN_ON_AMD:
+			return "screen on";
+		case ACPI_LPS0_SCREEN_OFF_AMD:
+			return "screen off";
+		case ACPI_LPS0_ENTRY_AMD:
+			return "lps0 entry";
+		case ACPI_LPS0_EXIT_AMD:
+			return "lps0 exit";
+		}
+	}
+
+	return "unknown";
+}
+
 static void acpi_sleep_run_lps0_dsm(unsigned int func, unsigned int func_mask, guid_t dsm_guid)
 {
 	union acpi_object *out_obj;
@@ -331,14 +370,15 @@ static void acpi_sleep_run_lps0_dsm(unsigned int func, unsigned int func_mask, g
 					rev_id, func, NULL);
 	ACPI_FREE(out_obj);
 
-	acpi_handle_debug(lps0_device_handle, "_DSM function %u evaluation %s\n",
-			  func, out_obj ? "successful" : "failed");
+	lps0_dsm_state = func;
+	if (pm_debug_messages_on) {
+		acpi_handle_info(lps0_device_handle,
+				"%s transitioned to state %s\n",
+				 out_obj ? "Successfully" : "Failed to",
+				 acpi_sleep_dsm_state_to_str(lps0_dsm_state));
+	}
 }
 
-static bool acpi_s2idle_vendor_amd(void)
-{
-	return boot_cpu_data.x86_vendor == X86_VENDOR_AMD;
-}
 
 static int validate_dsm(acpi_handle handle, const char *uuid, int rev, guid_t *dsm_guid)
 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 3/4] pinctrl: amd: Use pm_pr_dbg to show debugging messages
  2023-06-01 23:29 [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume Mario Limonciello
  2023-06-01 23:29 ` [PATCH v3 2/4] ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking Mario Limonciello
@ 2023-06-01 23:29 ` Mario Limonciello
  2023-06-02  3:19   ` kernel test robot
  2023-06-01 23:29 ` [PATCH v3 4/4] platform/x86/amd: pmc: Use pm_pr_dbg() for suspend related messages Mario Limonciello
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Mario Limonciello @ 2023-06-01 23:29 UTC (permalink / raw)
  To: Rafael Wysocki, hdegoede, linus.walleij
  Cc: linux-acpi, linux-kernel, linux-gpio, platform-driver-x86,
	linux-pm, S-k Shyam-sundar, Natikar Basavaraj, Mario Limonciello

To make the GPIO tracking around suspend easier for end users to
use, link it with pm_debug_messages.  This will make discovering
sources of spurious GPIOs around suspend easier.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/pinctrl/pinctrl-amd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index f279b360c20d..43d3530bab48 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -30,6 +30,7 @@
 #include <linux/pinctrl/pinconf.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinmux.h>
+#include <linux/suspend.h>
 
 #include "core.h"
 #include "pinctrl-utils.h"
@@ -636,9 +637,8 @@ static bool do_amd_gpio_irq_handler(int irq, void *dev_id)
 			regval = readl(regs + i);
 
 			if (regval & PIN_IRQ_PENDING)
-				dev_dbg(&gpio_dev->pdev->dev,
-					"GPIO %d is active: 0x%x",
-					irqnr + i, regval);
+				pm_pr_dbg("GPIO %d is active: 0x%x",
+					  irqnr + i, regval);
 
 			/* caused wake on resume context for shared IRQ */
 			if (irq < 0 && (regval & BIT(WAKE_STS_OFF)))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 4/4] platform/x86/amd: pmc: Use pm_pr_dbg() for suspend related messages
  2023-06-01 23:29 [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume Mario Limonciello
  2023-06-01 23:29 ` [PATCH v3 2/4] ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking Mario Limonciello
  2023-06-01 23:29 ` [PATCH v3 3/4] pinctrl: amd: Use pm_pr_dbg to show debugging messages Mario Limonciello
@ 2023-06-01 23:29 ` Mario Limonciello
  2023-06-02  1:59 ` [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume andy.shevchenko
  2023-06-02  6:09 ` kernel test robot
  4 siblings, 0 replies; 7+ messages in thread
From: Mario Limonciello @ 2023-06-01 23:29 UTC (permalink / raw)
  To: Rafael Wysocki, hdegoede, linus.walleij
  Cc: linux-acpi, linux-kernel, linux-gpio, platform-driver-x86,
	linux-pm, S-k Shyam-sundar, Natikar Basavaraj, Mario Limonciello

Using pm_pr_dbg() allows users to toggle `/sys/power/pm_debug_messages`
as a single knob to turn on messages that amd-pmc can emit to aid in
any s2idle debugging.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/platform/x86/amd/pmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c
index 427905714f79..1304cd6f13f6 100644
--- a/drivers/platform/x86/amd/pmc.c
+++ b/drivers/platform/x86/amd/pmc.c
@@ -543,7 +543,7 @@ static int amd_pmc_idlemask_read(struct amd_pmc_dev *pdev, struct device *dev,
 	}
 
 	if (dev)
-		dev_dbg(pdev->dev, "SMU idlemask s0i3: 0x%x\n", val);
+		pm_pr_dbg("SMU idlemask s0i3: 0x%x\n", val);
 
 	if (s)
 		seq_printf(s, "SMU idlemask : 0x%x\n", val);
@@ -769,7 +769,7 @@ static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg)
 
 	*arg |= (duration << 16);
 	rc = rtc_alarm_irq_enable(rtc_device, 0);
-	dev_dbg(pdev->dev, "wakeup timer programmed for %lld seconds\n", duration);
+	pm_pr_dbg("wakeup timer programmed for %lld seconds\n", duration);
 
 	return rc;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume
  2023-06-01 23:29 [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume Mario Limonciello
                   ` (2 preceding siblings ...)
  2023-06-01 23:29 ` [PATCH v3 4/4] platform/x86/amd: pmc: Use pm_pr_dbg() for suspend related messages Mario Limonciello
@ 2023-06-02  1:59 ` andy.shevchenko
  2023-06-02  6:09 ` kernel test robot
  4 siblings, 0 replies; 7+ messages in thread
From: andy.shevchenko @ 2023-06-02  1:59 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Rafael Wysocki, hdegoede, linus.walleij, linux-acpi, linux-kernel,
	linux-gpio, platform-driver-x86, linux-pm, S-k Shyam-sundar,
	Natikar Basavaraj

Thu, Jun 01, 2023 at 06:29:20PM -0500, Mario Limonciello kirjoitti:
> All uses in the kernel are currently already oriented around
> suspend/resume. As some other parts of the kernel may also use these
> messages in functions that could also be used outside of
> suspend/resume, only enable in suspend/resume path.

...

>  * Remove pointless do/while

I believe this is a joke.

This guards against weirdness, like

	__pm_pr_dbg(foo)
	else
		bar;

NAK for this particular change.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 3/4] pinctrl: amd: Use pm_pr_dbg to show debugging messages
  2023-06-01 23:29 ` [PATCH v3 3/4] pinctrl: amd: Use pm_pr_dbg to show debugging messages Mario Limonciello
@ 2023-06-02  3:19   ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-06-02  3:19 UTC (permalink / raw)
  To: Mario Limonciello, Rafael Wysocki, hdegoede, linus.walleij
  Cc: oe-kbuild-all, linux-acpi, linux-kernel, linux-gpio,
	platform-driver-x86, linux-pm, S-k Shyam-sundar,
	Natikar Basavaraj, Mario Limonciello

Hi Mario,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 7736c431466abb54a2679dc257f739fddfa84295]

url:    https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello/ACPI-x86-Add-pm_debug_messages-for-LPS0-_DSM-state-tracking/20230602-073044
base:   7736c431466abb54a2679dc257f739fddfa84295
patch link:    https://lore.kernel.org/r/20230601232923.1248-3-mario.limonciello%40amd.com
patch subject: [PATCH v3 3/4] pinctrl: amd: Use pm_pr_dbg to show debugging messages
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20230602/202306021143.5D8Xmq0r-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/61f4d28eda8f5bf19179080626ec4f1276c1cbae
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Mario-Limonciello/ACPI-x86-Add-pm_debug_messages-for-LPS0-_DSM-state-tracking/20230602-073044
        git checkout 61f4d28eda8f5bf19179080626ec4f1276c1cbae
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=mips olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/pinctrl/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306021143.5D8Xmq0r-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/pinctrl/pinctrl-amd.c: In function 'do_amd_gpio_irq_handler':
>> drivers/pinctrl/pinctrl-amd.c:639:28: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
     639 |                         if (regval & PIN_IRQ_PENDING)
         |                            ^


vim +/else +639 drivers/pinctrl/pinctrl-amd.c

ba714a9c1dea85 Thomas Gleixner           2017-05-23  608  
2d54067fcd23aa Mario Limonciello         2021-10-31  609  static bool do_amd_gpio_irq_handler(int irq, void *dev_id)
dbad75dd1f25e0 Ken Xue                   2015-03-10  610  {
ba714a9c1dea85 Thomas Gleixner           2017-05-23  611  	struct amd_gpio *gpio_dev = dev_id;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  612  	struct gpio_chip *gc = &gpio_dev->gc;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  613  	unsigned int i, irqnr;
dbad75dd1f25e0 Ken Xue                   2015-03-10  614  	unsigned long flags;
10ff58aa3c2e2a Ben Dooks (Codethink      2019-10-22  615) 	u32 __iomem *regs;
2d54067fcd23aa Mario Limonciello         2021-10-31  616  	bool ret = false;
10ff58aa3c2e2a Ben Dooks (Codethink      2019-10-22  617) 	u32  regval;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  618  	u64 status, mask;
dbad75dd1f25e0 Ken Xue                   2015-03-10  619  
ba714a9c1dea85 Thomas Gleixner           2017-05-23  620  	/* Read the wake status */
229710fecdd805 Julia Cartwright          2017-03-09  621  	raw_spin_lock_irqsave(&gpio_dev->lock, flags);
ba714a9c1dea85 Thomas Gleixner           2017-05-23  622  	status = readl(gpio_dev->base + WAKE_INT_STATUS_REG1);
ba714a9c1dea85 Thomas Gleixner           2017-05-23  623  	status <<= 32;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  624  	status |= readl(gpio_dev->base + WAKE_INT_STATUS_REG0);
229710fecdd805 Julia Cartwright          2017-03-09  625  	raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
dbad75dd1f25e0 Ken Xue                   2015-03-10  626  
ba714a9c1dea85 Thomas Gleixner           2017-05-23  627  	/* Bit 0-45 contain the relevant status bits */
ba714a9c1dea85 Thomas Gleixner           2017-05-23  628  	status &= (1ULL << 46) - 1;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  629  	regs = gpio_dev->base;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  630  	for (mask = 1, irqnr = 0; status; mask <<= 1, regs += 4, irqnr += 4) {
ba714a9c1dea85 Thomas Gleixner           2017-05-23  631  		if (!(status & mask))
ba714a9c1dea85 Thomas Gleixner           2017-05-23  632  			continue;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  633  		status &= ~mask;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  634  
ba714a9c1dea85 Thomas Gleixner           2017-05-23  635  		/* Each status bit covers four pins */
dbad75dd1f25e0 Ken Xue                   2015-03-10  636  		for (i = 0; i < 4; i++) {
ba714a9c1dea85 Thomas Gleixner           2017-05-23  637  			regval = readl(regs + i);
1d66e379731f79 Mario Limonciello         2022-10-13  638  
1d66e379731f79 Mario Limonciello         2022-10-13 @639  			if (regval & PIN_IRQ_PENDING)
61f4d28eda8f5b Mario Limonciello         2023-06-01  640  				pm_pr_dbg("GPIO %d is active: 0x%x",
2d54067fcd23aa Mario Limonciello         2021-10-31  641  					  irqnr + i, regval);
1d66e379731f79 Mario Limonciello         2022-10-13  642  
1d66e379731f79 Mario Limonciello         2022-10-13  643  			/* caused wake on resume context for shared IRQ */
1d66e379731f79 Mario Limonciello         2022-10-13  644  			if (irq < 0 && (regval & BIT(WAKE_STS_OFF)))
2d54067fcd23aa Mario Limonciello         2021-10-31  645  				return true;
2d54067fcd23aa Mario Limonciello         2021-10-31  646  
8bbed1eef001fd Daniel Kurtz              2018-07-16  647  			if (!(regval & PIN_IRQ_PENDING) ||
8bbed1eef001fd Daniel Kurtz              2018-07-16  648  			    !(regval & BIT(INTERRUPT_MASK_OFF)))
ba714a9c1dea85 Thomas Gleixner           2017-05-23  649  				continue;
f460c70125bcb1 Sebastian Andrzej Siewior 2022-09-19  650  			generic_handle_domain_irq_safe(gc->irq.domain, irqnr + i);
6afb10267c1692 Daniel Drake              2017-10-02  651  
6afb10267c1692 Daniel Drake              2017-10-02  652  			/* Clear interrupt.
6afb10267c1692 Daniel Drake              2017-10-02  653  			 * We must read the pin register again, in case the
6afb10267c1692 Daniel Drake              2017-10-02  654  			 * value was changed while executing
a9cb09b7be84a7 Marc Zyngier              2021-05-04  655  			 * generic_handle_domain_irq() above.
d21b8adbd475db Daniel Drake              2019-08-14  656  			 * If we didn't find a mapping for the interrupt,
d21b8adbd475db Daniel Drake              2019-08-14  657  			 * disable it in order to avoid a system hang caused
d21b8adbd475db Daniel Drake              2019-08-14  658  			 * by an interrupt storm.
6afb10267c1692 Daniel Drake              2017-10-02  659  			 */
6afb10267c1692 Daniel Drake              2017-10-02  660  			raw_spin_lock_irqsave(&gpio_dev->lock, flags);
6afb10267c1692 Daniel Drake              2017-10-02  661  			regval = readl(regs + i);
d21b8adbd475db Daniel Drake              2019-08-14  662  			if (irq == 0) {
d21b8adbd475db Daniel Drake              2019-08-14  663  				regval &= ~BIT(INTERRUPT_ENABLE_OFF);
d21b8adbd475db Daniel Drake              2019-08-14  664  				dev_dbg(&gpio_dev->pdev->dev,
d21b8adbd475db Daniel Drake              2019-08-14  665  					"Disabling spurious GPIO IRQ %d\n",
d21b8adbd475db Daniel Drake              2019-08-14  666  					irqnr + i);
d21b8adbd475db Daniel Drake              2019-08-14  667  			}
ba714a9c1dea85 Thomas Gleixner           2017-05-23  668  			writel(regval, regs + i);
6afb10267c1692 Daniel Drake              2017-10-02  669  			raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
2d54067fcd23aa Mario Limonciello         2021-10-31  670  			ret = true;
dbad75dd1f25e0 Ken Xue                   2015-03-10  671  		}
dbad75dd1f25e0 Ken Xue                   2015-03-10  672  	}
2d54067fcd23aa Mario Limonciello         2021-10-31  673  	/* did not cause wake on resume context for shared IRQ */
2d54067fcd23aa Mario Limonciello         2021-10-31  674  	if (irq < 0)
2d54067fcd23aa Mario Limonciello         2021-10-31  675  		return false;
dbad75dd1f25e0 Ken Xue                   2015-03-10  676  
ba714a9c1dea85 Thomas Gleixner           2017-05-23  677  	/* Signal EOI to the GPIO unit */
229710fecdd805 Julia Cartwright          2017-03-09  678  	raw_spin_lock_irqsave(&gpio_dev->lock, flags);
ba714a9c1dea85 Thomas Gleixner           2017-05-23  679  	regval = readl(gpio_dev->base + WAKE_INT_MASTER_REG);
ba714a9c1dea85 Thomas Gleixner           2017-05-23  680  	regval |= EOI_MASK;
ba714a9c1dea85 Thomas Gleixner           2017-05-23  681  	writel(regval, gpio_dev->base + WAKE_INT_MASTER_REG);
229710fecdd805 Julia Cartwright          2017-03-09  682  	raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
dbad75dd1f25e0 Ken Xue                   2015-03-10  683  
ba714a9c1dea85 Thomas Gleixner           2017-05-23  684  	return ret;
dbad75dd1f25e0 Ken Xue                   2015-03-10  685  }
dbad75dd1f25e0 Ken Xue                   2015-03-10  686  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume
  2023-06-01 23:29 [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume Mario Limonciello
                   ` (3 preceding siblings ...)
  2023-06-02  1:59 ` [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume andy.shevchenko
@ 2023-06-02  6:09 ` kernel test robot
  4 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-06-02  6:09 UTC (permalink / raw)
  To: Mario Limonciello, Rafael Wysocki, hdegoede, linus.walleij
  Cc: oe-kbuild-all, linux-acpi, linux-kernel, linux-gpio,
	platform-driver-x86, linux-pm, S-k Shyam-sundar,
	Natikar Basavaraj, Mario Limonciello

Hi Mario,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 7736c431466abb54a2679dc257f739fddfa84295]

url:    https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello/ACPI-x86-Add-pm_debug_messages-for-LPS0-_DSM-state-tracking/20230602-073044
base:   7736c431466abb54a2679dc257f739fddfa84295
patch link:    https://lore.kernel.org/r/20230601232923.1248-1-mario.limonciello%40amd.com
patch subject: [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume
config: powerpc-randconfig-r035-20230531 (https://download.01.org/0day-ci/archive/20230602/202306021344.JymS3JYg-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/5828d770a5f17c4028520050068fd3cdd13b80a1
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Mario-Limonciello/ACPI-x86-Add-pm_debug_messages-for-LPS0-_DSM-state-tracking/20230602-073044
        git checkout 5828d770a5f17c4028520050068fd3cdd13b80a1
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/base/power/ kernel/power/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306021344.JymS3JYg-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/base/power/wakeup.c: In function 'pm_print_active_wakeup_sources':
>> drivers/base/power/wakeup.c:861:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
     861 |         if (!active && last_activity_ws)
         |            ^
--
   kernel/power/hibernate.c: In function 'disk_store':
>> kernel/power/hibernate.c:1158:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
    1158 |         if (!error)
         |            ^


vim +/else +861 drivers/base/power/wakeup.c

074037ec79bea7 Rafael J. Wysocki  2010-09-22  841  
bb177fedd348c9 Julius Werner      2013-06-12  842  void pm_print_active_wakeup_sources(void)
a938da0682c248 Todd Poynor        2012-08-12  843  {
a938da0682c248 Todd Poynor        2012-08-12  844  	struct wakeup_source *ws;
ea0212f40c6bc0 Thomas Gleixner    2017-06-25  845  	int srcuidx, active = 0;
a938da0682c248 Todd Poynor        2012-08-12  846  	struct wakeup_source *last_activity_ws = NULL;
a938da0682c248 Todd Poynor        2012-08-12  847  
ea0212f40c6bc0 Thomas Gleixner    2017-06-25  848  	srcuidx = srcu_read_lock(&wakeup_srcu);
2591e7b17c0d3f Madhuparna Bhowmik 2020-03-04  849  	list_for_each_entry_rcu_locked(ws, &wakeup_sources, entry) {
a938da0682c248 Todd Poynor        2012-08-12  850  		if (ws->active) {
74a1dd86d1739e Stephen Boyd       2019-03-25  851  			pm_pr_dbg("active wakeup source: %s\n", ws->name);
a938da0682c248 Todd Poynor        2012-08-12  852  			active = 1;
a938da0682c248 Todd Poynor        2012-08-12  853  		} else if (!active &&
a938da0682c248 Todd Poynor        2012-08-12  854  			   (!last_activity_ws ||
a938da0682c248 Todd Poynor        2012-08-12  855  			    ktime_to_ns(ws->last_time) >
a938da0682c248 Todd Poynor        2012-08-12  856  			    ktime_to_ns(last_activity_ws->last_time))) {
a938da0682c248 Todd Poynor        2012-08-12  857  			last_activity_ws = ws;
a938da0682c248 Todd Poynor        2012-08-12  858  		}
a938da0682c248 Todd Poynor        2012-08-12  859  	}
a938da0682c248 Todd Poynor        2012-08-12  860  
a938da0682c248 Todd Poynor        2012-08-12 @861  	if (!active && last_activity_ws)
74a1dd86d1739e Stephen Boyd       2019-03-25  862  		pm_pr_dbg("last active wakeup source: %s\n",
a938da0682c248 Todd Poynor        2012-08-12  863  			last_activity_ws->name);
ea0212f40c6bc0 Thomas Gleixner    2017-06-25  864  	srcu_read_unlock(&wakeup_srcu, srcuidx);
a938da0682c248 Todd Poynor        2012-08-12  865  }
bb177fedd348c9 Julius Werner      2013-06-12  866  EXPORT_SYMBOL_GPL(pm_print_active_wakeup_sources);
a938da0682c248 Todd Poynor        2012-08-12  867  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-02  6:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-01 23:29 [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume Mario Limonciello
2023-06-01 23:29 ` [PATCH v3 2/4] ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking Mario Limonciello
2023-06-01 23:29 ` [PATCH v3 3/4] pinctrl: amd: Use pm_pr_dbg to show debugging messages Mario Limonciello
2023-06-02  3:19   ` kernel test robot
2023-06-01 23:29 ` [PATCH v3 4/4] platform/x86/amd: pmc: Use pm_pr_dbg() for suspend related messages Mario Limonciello
2023-06-02  1:59 ` [PATCH v3 1/4] include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume andy.shevchenko
2023-06-02  6:09 ` kernel test robot

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).