Skip to contentSkip to conversation

pinctrl: amd: Fix an issue with shutdown when system set to s0ix

PATCH In review Mario Limonciello 4 participants 5 messages Aug 9, 2021 – Aug 12, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: amd: Fix an issue with shutdown when system set to s0ix

IRQs are getting armed on shutdown causing the system to immediately wake back up.

Reported-by [email protected]
CC Raul E Rangel <[email protected]>
Fixes d62bd5ce12d7 ("pinctrl: amd: Implement irq_set_wake")
---
 drivers/pinctrl/pinctrl-amd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/pinctrl-amd.c +1 -2
index a76be6cc26ee..5b764740b829 100644
@@ -444,8 +444,7 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
 	unsigned long flags;
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
-	u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3) |
-			BIT(WAKE_CNTRL_OFF_S4);
+	u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
 
 	raw_spin_lock_irqsave(&gpio_dev->lock, flags);
 	pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
Signature · 1 line
2.25.1
#1 lore raw

Am Mo., 9. Aug. 2021 um 22:15 Uhr schrieb Mario Limonciello <[email protected]>:

Quoted 18 lines

IRQs are getting armed on shutdown causing the system to immediately wake back up.

Reported-by [email protected]
CC Raul E Rangel <[email protected]>
Fixes d62bd5ce12d7 ("pinctrl: amd: Implement irq_set_wake")
---
 drivers/pinctrl/pinctrl-amd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/pinctrl-amd.c +0 -0
index a76be6cc26ee..5b764740b829 100644

drivers/pinctrl/pinctrl-amd.c static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)

Quoted 10 lines
drivers/pinctrl/pinctrl-amd.c +1 -3
@@ -444,8 +444,7 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
        unsigned long flags;
        struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
        struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
-       u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3) |
-                       BIT(WAKE_CNTRL_OFF_S4);
+       u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
 
        raw_spin_lock_irqsave(&gpio_dev->lock, flags);
        pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
--

Is working fine again with this fix.

Best Regards,

Gabriel C

Tested-by Gabriel Craciunescu
#2 lore raw

Am Mi., 11. Aug. 2021 um 10:26 Uhr schrieb Gabriel C <[email protected]>:

Quoted 28 lines

Am Mo., 9. Aug. 2021 um 22:15 Uhr schrieb Mario Limonciello <[email protected]>:

Quoted 25 lines

IRQs are getting armed on shutdown causing the system to immediately wake back up.

Reported-by [email protected]
CC Raul E Rangel <[email protected]>
Fixes d62bd5ce12d7 ("pinctrl: amd: Implement irq_set_wake")
---
 drivers/pinctrl/pinctrl-amd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/pinctrl-amd.c +1 -2
index a76be6cc26ee..5b764740b829 100644
@@ -444,8 +444,7 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
        unsigned long flags;
        struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
        struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
-       u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3) |
-                       BIT(WAKE_CNTRL_OFF_S4);
+       u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
 
Quoted 6 lines

drivers/pinctrl/pinctrl-amd.c static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)

Quoted 3 lines
drivers/pinctrl/pinctrl-amd.c +0 -1
        raw_spin_lock_irqsave(&gpio_dev->lock, flags);
        pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
--

Is working fine again with this fix.

Ofc feel free to add:

Best Regards

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Mario Limonciello
Quoted 18 lines · Mario Limonciello

IRQs are getting armed on shutdown causing the system to immediately wake back up.

Reported-by [email protected]
CC Raul E Rangel <[email protected]>
Fixes d62bd5ce12d7 ("pinctrl: amd: Implement irq_set_wake")
---
 drivers/pinctrl/pinctrl-amd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/pinctrl-amd.c +0 -0
index a76be6cc26ee..5b764740b829 100644

drivers/pinctrl/pinctrl-amd.c static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on) · line 450

Quoted 9 lines
drivers/pinctrl/pinctrl-amd.c +1 -2
@@ -444,8 +444,7 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
 	unsigned long flags;
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
-	u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3) |
-			BIT(WAKE_CNTRL_OFF_S4);
+	u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
 
 	raw_spin_lock_irqsave(&gpio_dev->lock, flags);
 	pin_reg = readl(gpio_dev->base + (d->hwirq)*4);

Looks good to me.