]> git.baikalelectronics.ru Git - kernel.git/commit
net: systemport: Fix wake-up interrupt race during resume
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 2 Oct 2018 23:52:03 +0000 (16:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Oct 2018 00:34:47 +0000 (17:34 -0700)
commiteccef7df5ac756a884cafdc64f6b9a66b2c566c8
tree4888562d60c9b35ea9086a22d89158f41cbfdca8
parent5e6673bbc74c159526e286bac7dd3568da1028ed
net: systemport: Fix wake-up interrupt race during resume

The AON_PM_L2 is normally used to trigger and identify the source of a
wake-up event. Since the RX_SYS clock is no longer turned off, we also
have an interrupt being sent to the SYSTEMPORT INTRL_2_0 controller, and
that interrupt remains active up until the magic packet detector is
disabled which happens much later during the driver resumption.

The race happens if we have a CPU that is entering the SYSTEMPORT
INTRL2_0 handler during resume, and another CPU has managed to clear the
wake-up interrupt during bcm_sysport_resume_from_wol(). In that case, we
have the first CPU stuck in the interrupt handler with an interrupt
cause that has been cleared under its feet, and so we keep returning
IRQ_NONE and we never make any progress.

This was not a problem before because we would always turn off the
RX_SYS clock during WoL, so the SYSTEMPORT INTRL2_0 would also be turned
off as well, thus not latching the interrupt.

The fix is to make sure we do not enable either the MPD or
BRCM_TAG_MATCH interrupts since those are redundant with what the
AON_PM_L2 interrupt controller already processes and they would cause
such a race to occur.

Fixes: 18a5e73dbbca ("net: systemport: Add support for WAKE_FILTER")
Fixes: 5e5575881431 ("net: systemport: add Wake-on-LAN support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c