]> git.itanic.dy.fi Git - linux-stable/commit
net: fman: dtsec: Always gracefully stop/start
authorSean Anderson <sean.anderson@seco.com>
Thu, 18 Aug 2022 16:16:29 +0000 (12:16 -0400)
committerJakub Kicinski <kuba@kernel.org>
Fri, 19 Aug 2022 23:35:54 +0000 (16:35 -0700)
commitaae73fde7eb33d407257dceffb7aed0bcdaf247a
tree76c884febef91e5582f32d064fcd7e4dd4d09c07
parente61406a1955eb968aed43ffb35301ff969d7522f
net: fman: dtsec: Always gracefully stop/start

There are two ways that GRS can be set: graceful_stop and dtsec_isr. It
is cleared by graceful_start. If it is already set before calling
graceful_stop, then that means that dtsec_isr set it. In that case, we
will not set GRS nor will we clear it (which seems like a bug?). For GTS
the logic is similar, except that there is no one else messing with this
bit (so we will always set and clear it). Simplify the logic by always
setting/clearing GRS/GTS. This is less racy that the previous behavior,
and ensures that we always end up clearing the bits. This can of course
clear GRS while dtsec_isr is waiting, but because we have already done
our own waiting it should be fine.

This is the last user of enum comm_mode, so remove it.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
Tested-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/fman/fman_dtsec.c
drivers/net/ethernet/freescale/fman/fman_mac.h