gpio-dwapb: reason for storing & restoring registers on suspend/resume
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: gpio-dwapb: reason for storing & restoring registers on suspend/resume
- From: Magnus Olsson <magnus@xxxxxxxxxx>
- Date: Mon, 13 May 2019 10:04:37 +0200
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
Hi,
During PM suspend(), the gpio-dwapb.c driver store registers for each
port into a context. For Port A it also stores IRQ settings, since it
can act as a wake-up source. During resume(), the registers are restored
from the context.
What is the purpose of these store & restore? Because the GPIO
controller also is a wake-up source, it will never sleep and AFAIK the
registers remain untouched throughout a suspend/resume cycle.
When port A is used to wake up the system (e.g enable_irq_wake() has
enabled wake_en bits in the driver), I sometimes see calls to gpio-dwapb
irq_mask() before the driver is resumed(). When resume() later on
occurs, any changes made to the registers (in my case IRQ mask) while
the driver is suspended are therefore lost.
This race between resume() and irq_mask() (called by threaded wake-up
IRQ handler) sometime causes IRQ to remain masked indefinitely,
depending on when the wake-up IRQ arrives.
Is this intentional? Can anyone shed light on why the store & restore
mechanism exists in the first place?
BR,
Magnus Olsson.
[Index of Archives]
[Linux SPI]
[Linux Kernel]
[Linux ARM (vger)]
[Linux ARM MSM]
[Linux Omap]
[Linux Arm]
[Linux Tegra]
[Fedora ARM]
[Linux for Samsung SOC]
[eCos]
[Linux Fastboot]
[Gcc Help]
[Git]
[DCCP]
[IETF Announce]
[Security]
[Linux MIPS]
[Yosemite Campsites]
|