Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
soc/amd/common/gpio: Clear interrupt and wake status when configuring pads
This change clears interrupt and wake status for a pad when configuring it. This ensures that stale interrupts/wake notifications are flushed out and do not cause spurious wakes in future suspends.
BUG=b:159944426
Change-Id: Ia4ebd975312a4136f1d0690d7af7372615e31f0f Signed-off-by: Furquan Shaikh furquan@google.com --- M src/soc/amd/common/block/gpio_banks/gpio.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/42877/1
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index a8b11ba..396846d 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -201,6 +201,9 @@ iomux_read8(gpio); /* Flush posted write */
soc_gpio_hook(gpio, mux); + + /* Clear interrupt and wake status (write 1-to-clear bits) */ + control |= GPIO_INT_STATUS | GPIO_WAKE_STATUS; gpio_write32(gpio, control);
if (control_flags == 0)
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 3: Code-Review+1
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... PS4, Line 206: GPIO_WAKE_STATUS Don't we reconfigure pins on S3 resume? Don't we want the wake status so that wake source reporting works correctly?
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 4: Code-Review-2
(1 comment)
Waiting for a resolution on the event-logging situation before moving ahead with this.
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... PS4, Line 206: GPIO_WAKE_STATUS
Don't we reconfigure pins on S3 resume? Don't we want the wake status so that wake source reporting […]
Thanks for highlighting that Raul! I had that in mind, but didn't get a chance to sync up with Aaron on his work for eventlogging. I have added a comment here: b/159947207
Hello build bot (Jenkins), Raul Rangel, Kyösti Mälkki, Aaron Durbin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42877
to look at the new patch set (#5).
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
soc/amd/common/gpio: Clear interrupt and wake status when configuring pads
This change clears interrupt and wake status for a pad when configuring it. This ensures that stale interrupts/wake notifications are flushed out and do not cause spurious wakes in future suspends.
BUG=b:159944426
Change-Id: Ia4ebd975312a4136f1d0690d7af7372615e31f0f Signed-off-by: Furquan Shaikh furquan@google.com --- M src/soc/amd/common/block/gpio_banks/gpio.c 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/42877/5
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 5:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42877/5/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42877/5/src/soc/amd/common/block/gp... PS5, Line 213: __gpio_setbits32(gpio, PAD_CFG_MASK, control); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/42877/5/src/soc/amd/common/block/gp... PS5, Line 213: __gpio_setbits32(gpio, PAD_CFG_MASK, control); please, no space before tabs
https://review.coreboot.org/c/coreboot/+/42877/5/src/soc/amd/common/block/gp... PS5, Line 213: __gpio_setbits32(gpio, PAD_CFG_MASK, control); please, no spaces at the start of a line
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 6: Code-Review+2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 6:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42877/6/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42877/6/src/soc/amd/common/block/gp... PS6, Line 213: __gpio_setbits32(gpio, PAD_CFG_MASK, control); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/42877/6/src/soc/amd/common/block/gp... PS6, Line 213: __gpio_setbits32(gpio, PAD_CFG_MASK, control); please, no space before tabs
https://review.coreboot.org/c/coreboot/+/42877/6/src/soc/amd/common/block/gp... PS6, Line 213: __gpio_setbits32(gpio, PAD_CFG_MASK, control); please, no spaces at the start of a line
Hello build bot (Jenkins), Raul Rangel, Kyösti Mälkki, Aaron Durbin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42877
to look at the new patch set (#7).
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
soc/amd/common/gpio: Clear interrupt and wake status when configuring pads
This change clears interrupt and wake status for a pad when configuring it. This ensures that stale interrupts/wake notifications are flushed out and do not cause spurious wakes in future suspends.
BUG=b:159944426
Change-Id: Ia4ebd975312a4136f1d0690d7af7372615e31f0f Signed-off-by: Furquan Shaikh furquan@google.com --- M src/soc/amd/common/block/gpio_banks/gpio.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/42877/7
Furquan Shaikh has removed a vote from this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Removed Code-Review-2 by Furquan Shaikh furquan@google.com
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... PS4, Line 206: GPIO_WAKE_STATUS
Thanks for highlighting that Raul! I had that in mind, but didn't get a chance to sync up with Aaron […]
This will be taken care of in the event logging change to ensure that we snapshot the state before getting to the point of clearing the wake status.
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 7: Code-Review+2
Furquan Shaikh has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
soc/amd/common/gpio: Clear interrupt and wake status when configuring pads
This change clears interrupt and wake status for a pad when configuring it. This ensures that stale interrupts/wake notifications are flushed out and do not cause spurious wakes in future suspends.
BUG=b:159944426
Change-Id: Ia4ebd975312a4136f1d0690d7af7372615e31f0f Signed-off-by: Furquan Shaikh furquan@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/42877 Reviewed-by: Aaron Durbin adurbin@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/common/block/gpio_banks/gpio.c 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index 883dcfa..ebb2936 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -207,6 +207,9 @@ iomux_read8(gpio); /* Flush posted write */
soc_gpio_hook(gpio, mux); + + /* Clear interrupt and wake status (write 1-to-clear bits) */ + control |= GPIO_INT_STATUS | GPIO_WAKE_STATUS; __gpio_setbits32(gpio, PAD_CFG_MASK, control);
if (control_flags == 0)
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... PS4, Line 206: GPIO_WAKE_STATUS
This will be taken care of in the event logging change to ensure that we snapshot the state before g […]
I think we'd be able to log (eventlog) things w/ b/159947207 once that work is done, but it doesn't handle the case of the kernel expecting to capture the wake. If we want to note the device that woke from kernel we shouldn't clear these.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... PS4, Line 206: GPIO_WAKE_STATUS
I think we'd be able to log (eventlog) things w/ b/159947207 once that work is done, but it doesn't […]
I will have to dig into the kernel driver to see how it handles the WAKE_STATUS. But I agree that in general the kernel might want to send pm_wakeup notification depending upon the WAKE_STATUS bits.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42877 )
Change subject: soc/amd/common/gpio: Clear interrupt and wake status when configuring pads ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42877/4/src/soc/amd/common/block/gp... PS4, Line 206: GPIO_WAKE_STATUS
I will have to dig into the kernel driver to see how it handles the WAKE_STATUS. […]
We should run the dark resume test. I'm pretty sure that relies on these values.