drivers: gpio: nrfx: fix lost level interrupts
drivers: gpio: nrfx: fix lost level interrupts

Nordic devices detect edge interrupts through the PORT event which is
generated on a rising edge of DETECT, which itself is asserted when any
GPIO is configured for sense level detection and the GPIO's input signal
matches the configuration.

The previous code in Zephyr attempts to detect when at least one GPIO
SENSE signal is still asserted, and intentionally leaves the PORT event
uncleared to ensure the interrupt is re-entered.

This approach fails when no pin satisfies its SENSE condition during the
check but at least one input changes level between the completion of the
check and the clear of the PORT event.  Such a failure can be observed
on the pca20020 hardware when multiple sensors configured for level
triggers are active.  In this situation the corresponding sensor trigger
signals remain asserted but the PORT event required to drive their
processing has already been cleared.

The fix is to ensure that the SENSE configuration for all GPIOs across
all port instances is disabled prior to unconditionally clearing the
PORT event, then re-enabling the SENSE configuration for all GPIOs once
callbacks associated with detected SENSE triggers have been performed.
The act of re-enabling will ensure any relevant SENSE condition causes a
new rising edge on DETECT and so a new PORT event.

Closes issue #11806

See: https://devzone.nordicsemi.com/f/nordic-q-a/7246/missing-interrupts-on-gpioe-port-events

Signed-off-by: Peter A. Bigot <650538893330be855f76604594b4820eb226769e@pabigot.com>

zephyrproject-rtos/zephyr,galak/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,nashif/zephyr,nashif/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,punitvara/zephyr,galak/zephyr,ldts/zephyr,punitvara/zephyr,Vudentz/zephyr,explora26/zephyr,finikorg/zephyr,explora26/zephyr,ldts/zephyr,explora26/zephyr,finikorg/zephyr,nashif/zephyr,Vudentz/zephyr,nashif/zephyr,ldts/zephyr,punitvara/zephyr,Vudentz/zephyr,finikorg/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,ldts/zephyr,explora26/zephyr,Vudentz/zephyr