]> git.ipfire.org Git - thirdparty/linux.git/commit
net: fec: do not update PEROUT if it is enabled
authorWei Fang <wei.fang@nxp.com>
Tue, 25 Nov 2025 08:52:08 +0000 (16:52 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 27 Nov 2025 10:57:45 +0000 (11:57 +0100)
commite97faa0c20ea8840f45569ba434e30538fff8fc9
tree59fcc70cf84baf109cb15cda83c3aa73ce0660e1
parent50caa744689e505414673c20359b04aa918439e3
net: fec: do not update PEROUT if it is enabled

If the previously set PEROUT is already active, updating it will cause
the new PEROUT to start immediately instead of at the specified time.
This is because fep->reload_period is updated whithout check whether
the PEROUT is enabled, and the old PEROUT is not disabled. Therefore,
the pulse period will be updated immediately in the pulse interrupt
handler fec_pps_interrupt().

Currently, the driver does not support directly updating PEROUT and it
will make the logic be more complicated. To fix the current issue, add
a check before enabling the PEROUT, the driver will return an error if
PEROUT is enabled. If users wants to update a new PEROUT, they should
disable the old PEROUT first.

Fixes: 350749b909bf ("net: fec: Add support for periodic output signal of PPS")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20251125085210.1094306-3-wei.fang@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_ptp.c